function buy(){
	winpopup=window.open('', 'bye', 'Tollbar=0,  location=0, Directories=0, Status=0, Menubar=0, Scrollbars=1, Resizable=0, Copyhistory=0, top=300, left=400, Width=250, height=150');
	document.form1.submit();
}
function send(){
	document.form2.action="mail.php";
	winpopup=window.open('', 'mail', 'Tollbar=0, Location=0, Directories=0, Status=0, Menubar=0, Scrollbar=0, Resizable=0, Copyhistory=0, top=300, left=400, Width=230, height=130');
	document.form2.submit();
}
function download(){
	document.form2.action="download.php";
	winpopup=window.open('', 'mail', 'Tollbar=0, Location=0, Directories=0, Status=0, Menubar=0, Scrollbar=0, Resizable=0, Copyhistory=0, top=300, left=400, Width=230, height=130');
	document.form2.submit();
}
function set_year1(){

	if(document.form1.month1.options[document.form1.month1.selectedIndex].value==0){ 
		//alert("Выберите месяц!"); 
		return;}
	if(document.form1.year1.options[document.form1.year1.selectedIndex].value==0){ 
		//alert("Выберите год!"); 
		return;}
	document.location.href='index.php?year1='+document.form1.year1.options[document.form1.year1.selectedIndex].value+"&year2="+document.form2.year2.options[document.form2.year2.selectedIndex].value+'&month1='+document.form1.month1.options[document.form1.month1.selectedIndex].value+'&month2='+document.form2.month2.options[document.form2.month2.selectedIndex].value+'&doc_type='+document.form3.doc_type.value+'&sort_mode='+document.form2.sort_mode.options[document.form2.sort_mode.selectedIndex].value;
}
function set_year2(){
	if(document.form2.month2.options[document.form2.month2.selectedIndex].value==0){ 
		//alert("Выберите месяц!"); 
		return;}
	if(document.form2.year2.options[document.form2.year2.selectedIndex].value==0){ 
		//alert("Выберите год!"); 
		return;}
	document.location.href='index.php?year2='+document.form2.year2.options[document.form2.year2.selectedIndex].value+"&year1="+document.form1.year1.options[document.form1.year1.selectedIndex].value+'&month2='+document.form2.month2.options[document.form2.month2.selectedIndex].value+'&month1='+document.form1.month1.options[document.form1.month1.selectedIndex].value+'&doc_type='+document.form3.doc_type.value+'&sort_mode='+document.form2.sort_mode.options[document.form2.sort_mode.selectedIndex].value;
}
function set_month1(){
	if(document.form1.month1.options[document.form1.month1.selectedIndex].value==0){ 
		//alert("Выберите месяц!"); 
		return;}
	if(document.form1.year1.options[document.form1.year1.selectedIndex].value==0){ 
		//alert("Выберите год!"); 
		return;}
	document.location.href='index.php?year1='+document.form1.year1.options[document.form1.year1.selectedIndex].value+"&year2="+document.form2.year2.options[document.form2.year2.selectedIndex].value+'&month1='+document.form1.month1.options[document.form1.month1.selectedIndex].value+'&month2='+document.form2.month2.options[document.form2.month2.selectedIndex].value+'&doc_type='+document.form3.doc_type.value+'&sort_mode='+document.form2.sort_mode.options[document.form2.sort_mode.selectedIndex].value;
}
function set_month2(){
	if(document.form2.month2.options[document.form2.month2.selectedIndex].value==0){ 
		//alert("Выберите месяц!"); 
		return;}
	if(document.form2.year2.options[document.form2.year2.selectedIndex].value==0){ 
		//alert("Выберите год!"); 
		return;}
	document.location.href='index.php?year1='+document.form1.year1.options[document.form1.year1.selectedIndex].value+"&year2="+document.form2.year2.options[document.form2.year2.selectedIndex].value+'&month1='+document.form1.month1.options[document.form1.month1.selectedIndex].value+'&month2='+document.form2.month2.options[document.form2.month2.selectedIndex].value+'&doc_type='+document.form3.doc_type.value+'&sort_mode='+document.form2.sort_mode.options[document.form2.sort_mode.selectedIndex].value;
}
function set_doc_type(){
	document.location.href='index.php?doc_type='+document.form3.doc_type.options[document.form3.doc_type.selectedIndex].value;
}
function set_date_mode(){
	document.location.href='index.php?year1='+document.form1.year1.options[document.form1.year1.selectedIndex].value+"&year2="+document.form2.year2.options[document.form2.year2.selectedIndex].value+'&month1='+document.form1.month1.options[document.form1.month1.selectedIndex].value+'&month2='+document.form2.month2.options[document.form2.month2.selectedIndex].value+'&doc_type='+document.form3.doc_type.value+'&sort_mode='+document.form2.sort_mode.options[document.form2.sort_mode.selectedIndex].value;
}
function show_calendar(){
	w = window.open("calendar.html", "Calendar", "width=200,height=200,status=no,resizable=no,top=200,left=200");
	w.opener = self;
}
