function showhideObj(obj){
	if(obj.className=="visible"){
		obj.className = "hidden";
	}else if(obj.className=="hidden"){
		obj.className = "visible";
	}
}

function showhideObj1(obj){
		obj.className = "hidden";
}

var url;
var req;

function pressBtn1(obj1, obj2){

obj3 = document.getElementById("arrmonth");
obj5 = document.getElementById("arryear");

	var dataa = new Date();
	//mes = dataa.getMonth();

	mes="9"; // месяц сентябрь (октябрь - mes="10")

	god = dataa.getFullYear();

	if($('type').value==""){
		alert("Select 'Room Type'");
		return false;
	}else if($('arrival').value=="" || $('arrmonth').value=="" || $('arryear').value=="" || $('departure').value=="" || $('depmonth').value=="" || $('depyear').value==""){
		alert("Check field 'Check-in Date' and 'Check-out Date'");	
		return false;	
	}else if(obj1.value > 3){
		showhideObj(showMenu);
		setTimeout("showhideObj1(showMenu); window.location='../contacts_us.php'", 5000);
		return false;
	}else if(obj2.value > 0){
		showhideObj(showMenu);
		setTimeout("showhideObj1(showMenu); window.location='../contacts_us.php'", 5000);
		return false;
	}else if((obj3.value == mes) && (obj5.value == god)){
		showhideObj(showMenu);
		setTimeout("showhideObj1(showMenu); window.location='../contacts_us.php'", 5000);
		return false;
	/*}else if(obj4.value == && obj6.value ==){
		showhideObj(showMenu);
		setTimeout("showhideObj1(showMenu); window.location='../contacts_us.php'", 5000);
		return false;*/
	}else{
			showhideObj(showMenu);
	infa=$('kalku').serialize();
	url = "prices/checkYear.php?"+infa;
    if (window.XMLHttpRequest) {
        req = new XMLHttpRequest();
        req.onreadystatechange = processReqChange;
        req.open("GET", url, true);
        req.send(null);
    } else if (window.ActiveXObject) {
        req = new ActiveXObject("Microsoft.XMLHTTP");
        if (req) {
            req.onreadystatechange = processReqChange;
            req.open("GET", url, true);
            req.send();
        }
    }
			return false;	
	}
}





function checkYear(){

}

function processReqChange() {
    if (req.readyState == 4) {
        if (req.status == 200) {
           viewMa();
        } else {
            alert("Не удалось получить данные:\n" + req.statusText);
        }
    }  
}

function viewMa(){
 var resTxt = req.responseText;
 if(resTxt.indexOf("ERRNO")>=0 || resTxt.indexOf("error")>=0 || resTxt.length == 0)
  throw(resTxt.length == 0 ? "Server error. " : resTxt);
	if(resTxt == "Error"){
		window.location="../contacts_us.php";
	}
	else{
		infa=$('kalku').serialize();
		infa1="book1.php?"+infa;
		window.location=infa1;

		//window.location=infa1;
	}
}
