

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}



function fnclose() {
	window.close();
}
function fnSubmitFull()
{
	if (fnValidate()==true)
	{
		document.searchs.submit();
	}
return true;
}

function fnSubmitQuick()
{
	if (fnValidate()==true)
	{
		document.QuickSearch.submit();
	}
return true;
}

function fnValidate()
{
	
	//if searchs.Price_night_Our.value 
return true;
}

//******************** for right menu order validation *************************************************
function FnSend()
{
	if (OrderValidate2()==true) 
	{
	document.Order.submit();
	}
}


function Trim(s) 
{
  // Remove leading spaces and carriage returns
  
  while ((s.substring(0,1) == ' ') || (s.substring(0,1) == '\n') || (s.substring(0,1) == '\r'))
  {
    s = s.substring(1,s.length);
  }

  // Remove trailing spaces and carriage returns

  while ((s.substring(s.length-1,s.length) == ' ') || (s.substring(s.length-1,s.length) == '\n') || (s.substring(s.length-1,s.length) == '\r'))
  {
    s = s.substring(0,s.length-1);
  }
  return s;
}

function OrderValidate2()
{

var name=Trim(document.Order.name.value);
var organization=Trim(document.Order.organization.value);
var   phone=Trim(document.Order.phone.value);
var   address=Trim(document.Order.address.value);
			
	if ((name.length)==0)
	{
		alert("Please input your name");
		document.Order.name.focus();
		return false;
	}
	if ((organization.length)==0)
	{
		alert("Please input your Organization");
		document.Order.organization.focus();
		return false;
	}
	
	
	if ((phone.length)==0)
	{
		alert("Please input phone");
		document.Order.phone.focus();
		return false;
	}

	
	if ((address.length)==0)
	{
		alert("Please input address");
		document.Order.address.focus();
		return false;
	}
	
	
 var mailstr=document.Order.email.value;
	if
(!(mailstr.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]{2,4}$/)!= -1) & (!Trim(mailstr)) ) {
   window.alert('Please enter a valid email address.');
   document.Order.email.focus();
   return false;  
  }

	
return true;
}

 function isInteger(s){
          var i;
          for (i = 0; i < s.length; i++){
                // Check that current character is number.
                var c = s.charAt(i);
                if (((c < "0") || (c > "9"))) return false;
            }
            // All characters are numbers.
            return true;
        }

//******************** for right menu order validation *************************************************
var xmlHttp;
function getServerName()
{
    var str = window.location.protocol + '//' + window.location.hostname;
    return str;
}
function callServer(sURL)
{

try {
  xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
  try {
    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (e2) {
    xmlHttp = false;
  }
}
if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
  xmlHttp = new XMLHttpRequest();
}
//var sURL = "curs.php";
xmlHttp.open("GET",sURL,true);
xmlHttp.onreadystatechange = writeResponse;
xmlHttp.send(null);
}

function writeResponse()
{
if(xmlHttp.readyState == 4)
{
document.getElementById("number").innerHTML=xmlHttp.responseText;

}
}