function toggleControl(divId,divAction,nRec) {
  var div = document.getElementById(divId);

  if(divAction == "hide"){
	  div.style.display = "none";// (div.style.display=="block" ? "none" : "block");
  }
  else if(divAction == "hideAll"){
	 
	  for(i=1;i<=nRec;i++){
	//  for(i=1;i<=8;i++){
		//document.getElementById(i).style.display= "none";
		document.getElementById("service"+i).style.display= "none";
		document.getElementById("arrowDown"+i).style.display= "block";
		document.getElementById("arrowDown"+i).style.display = "inline";
		document.getElementById("arrowUp"+i).style.display = "none";
	  }
  }
  else{
	div.style.display = "block";
	div.style.display = "inline";
  }
  
}

function contactmap(pName){		
		obj = "#showmap"
		document.getElementById("roomImage").src="showImages.php?img="+pName;
		window.scrollTo(0,0);
		 document.body.scroll = 'no';
//		document.body.overflow='hidden';
//		document.body.style="overflow-x:hidden;overflow-y:hidden"
//		document.body.style="overflow:-moz-scrollbars-horizontal;overflow-x:hidden;overflow-y:scroll;";
		

		$('#calinfo').show();
		$('#calinfo').fadeTo("slow", 1);
		
		$('#roomImage').css({opacity:1.0});
		$('#roomImage').css('display', 'block');
		
		var a = $('#roomImage').offset();
		$('#infoclose').css('left', (a.left + 665));
		$('#infoclose').css('top', (a.top - 20));
		

	}

function chkContactMandatory(){
	frm = document.contactForm;

	if( trim(frm.name.value) == '' )	{
		alert('Your Name is required.');
		frm.name.focus();
		return false;
	}	

	if( trim(frm.email.value) == '' )	{
		alert('Your EMail is required.');
		frm.email.focus();
		return false;
	}
	else if(verifyEmail(frm.email)==false){
		frm.email.focus();
		return false;
	}	

	if( trim(frm.contactNo.value) == '' )	{
		alert('Your Contact No. is required.');
		frm.contactNo.focus();
		return false;
	}	

	if( trim(frm.question.value) == '' )	{
		alert('Your Question / Comment is required.');
		frm.question.focus();
		return false;
	}	


	var radioLength = frm.knowus.length;
	var radioChk = false;
	for(var i = 0; i < radioLength; i++) {
		if(frm.knowus[i].checked) {
			radioChk = true;
		}
	}

	if(trim(frm.other.value) == ''){

		if(radioChk == false){
		alert('How can you know us? is required.');
		return false;
		}
		
	}

return true;
}

function verifyEmail(email) {
	checkEmail = email.value

	if ((checkEmail.indexOf('@') < 0) || ((checkEmail.charAt(checkEmail.length-4) != '.') && (checkEmail.charAt(checkEmail.length-3) != '.')))
	{
		alert("You have entered an invalid email address. Please try again.");
		email.focus()
		return false;
	} 
	else {
		return true;
	}

}

 function trim(stringToTrim) {
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}

