
function change(id, newClass) {identity=document.getElementById(id); identity.className=newClass;};

function show(idLayer) { document.getElementById(idLayer).style.display='block'; };
function showInline(idLayer) { document.getElementById(idLayer).style.display='inline'; };
function hide(idLayer) { document.getElementById(idLayer).style.display='none'; };
function rs_clear(idLayer){ document.getElementById(idLayer).innerHTML='';};


function tog_box(type){
	if (document.getElementById(type).style.display=='none'){show(type);}else{hide(type);}
}


function GetXmlHttpObject(){
	var xmlHttp=null;
	try{xmlHttp=new XMLHttpRequest();}
	catch (e){
		try{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
		catch (e){xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}
	}
	return xmlHttp;
};


var xmlHttp;
function rs_Cal(type, val, chkd, rule, aux, cust){
	if(rule=="first"){
		document.getElementById("rs_cal_"+type).innerHTML='<iframe frameborder="0" scrolling="no" src="/hbc_lib/inc/blank.php" id="rs_cal_iframe" ></iframe><div id="rs_cal"><p style="padding:5px 0 0 0; margin:0; height:182px; text-align:center;">&nbsp;</p></div>';
	}
	xmlHttp=GetXmlHttpObject();
var arr_type = new Array();
arr_type = type.split('_');
var type_aux = "";
	if (arr_type[0]=="in"){ if (arr_type[1]==null) type_aux="out"; else type_aux="out_"+arr_type[1];}
	if (arr_type[0]=="out"){ if (arr_type[1]==null) type_aux="in"; else type_aux="in_"+arr_type[1];}
	document.getElementById('rs_cal_'+type_aux).innerHTML='';
	var url="/hbc_lib/rscal/rscal.php";
	url=url+"?type="+type+"&val="+val+"&chkd="+chkd+"&aux="+aux+"&cust="+cust;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=stateChanged_cal;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
	function stateChanged_cal() {if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){document.getElementById("rs_cal_"+type).innerHTML=xmlHttp.responseText; }};
};





function rs_Chk_srch(page, rs_action, mod)
{
	var blnPass = true;
	if (mod) mod=mod; else mod="";
	
	if (document.rs_sbh_form.rs_city && document.rs_sbh_form.rs_city.value==""){
		alert('Please enter a city.');
		document.rs_sbh_form.rs_city.focus();
		blnPass = false;
	}
	
	
	if (blnPass){
		if(document.getElementById("rs_chk_in"+mod+"_txt").value=="" || document.getElementById("rs_chk_in"+mod+"_txt").value=="mm/dd/yyyy"){
			alert('Please enter a check-in date.');
			document.getElementById("rs_chk_in"+mod+"_txt").focus();
			blnPass = false;
		}else if(document.getElementById("rs_chk_out"+mod+"_txt").value=="" || document.getElementById("rs_chk_out"+mod+"_txt").value=="mm/dd/yyyy"){
			alert('Please enter a check-out date.');
			document.getElementById("rs_chk_out"+mod+"_txt").focus();
			blnPass = false;
		}
	}
	
	if (page=="city"){
		if (document.getElementById('rs_city_backup').value!=document.getElementById('rs_city').value){
				document.getElementById('rs_cid_span').innerHTML="";
				document.getElementById('rs_sbh_form').action=rs_action;
		}
	}
	return blnPass;
}