//this.window.defaultStatus = "Welcome!  Click on underlined blue text to navigate.";


function show(name){
	showwin=window.open('dbimgs/?'+name,name.replace('.','_'),'width=601,height=447');
}

function showall(filename,name){
	showwin=window.open(filename,name,'width=590,height=280');
}

function showall2(filename,name){
	showwin=window.open(filename,name,'width=610,height=580,scrollbars');
}

function profile(id) {
	showwin=window.open('profile/?'+id,'profile'+id,'width=412,height=450,scrollbars=1,status=false');
}

function sendMsg(){
	showwin=window.open('sendMsg.php','msgWin','width=520,height=385,status=false');
}

function setSeries(chooser) {
    var serieChooser = chooser.form.elements["serieList"];
    serieChooser.options.length = 0;
    var choice = chooser.options[chooser.selectedIndex].value;
    var db = serieDB[choice];
    //serieChooser.options[0] = new Option("", "", true, false);
    if (choice != "") {
        // loop through array of the hash table entry, and populate options
        for (var i = 0; i < db.length; i++) {
            serieChooser.options[i] = new Option(db[i].text, db[i].value);
        }
    }
}

function calculate(){
	var summ=0;
//var test='';
	for (var i in sales) {
//test=document.getElementsByName('num.'+sales[i].name)[0].value;
//alert (test);
		sales[i].num=parseInt(document.getElementsByName('num.'+sales[i].name)[0].value);
		document.getElementsByName('sum.'+sales[i].name)[0].value=(sales[i].num*sales[i].price).toFixed(2)+' грн';
		summ+=sales[i].num*sales[i].price;
	}
	document.getElementsByName('summ')[0].value=summ.toFixed(2)+' грн';
	//alert (result);
}

/**
 *
 * @access public
 * @return void
 **/
function testresult(number){
	if (number==1) {
		location.href="main.html";
	}
}
