// Mouseovers
function switchImg(imgName, imgSrc, no) 
{
  if (document.images)
  {
    if (imgSrc != "none")
    {
      document.images[imgName].src=imgSrc;
      if(a && !no) document.images[a].src='img/btn-'+a+'_over.gif';
    }
  }
}
// Preloader
function simplePreload()
{ 
  var args=simplePreload.arguments;
  document.imageArray=new Array(args.length);
  for(var i=0; i<args.length; i++)
  {
    document.imageArray[i]=new Image;
    document.imageArray[i].src=args[i];
  }
}
// Deeplinking
var a=document.location.hash;
var a=a.replace('#','');

function showIT(b){
    if(a){
		document.getElementById(a+'_area').style.display='none';
		switchImg(a,'img/btn-'+a+'.gif',1);
		//document.getElementById(a+'_t').style.display='none';
	}else{
		//document.getElementById('title_t').style.display='none';
	}
	document.location.hash=b;
    document.getElementById(b+'_area').style.display='';
    //document.getElementById(b+'_t').style.display='';
	a=b;
	bottom();
}
// Properties page numbers
function page(id){
	img=id+2;
	document.getElementById('properties_img').style.background='url(img/img-rtf_satx_0'+img+'.jpg) no-repeat';
	document.getElementById('page_'+id).className='on';
	if(id==1) document.getElementById('page_'+2).className='off'; else document.getElementById('page_'+1).className='off';
}
function imgswpl(id){
	img=id+4;
	window.status=img;
	document.getElementById('properties_img').style.background='url(img/img-rtf_leg_0'+img+'.jpg) no-repeat';
}
function imgswp(id){
	img=id+4;
	window.status=img;
	document.getElementById('properties_img').style.background='url(img/img-rtf_satx_0'+img+'.jpg) no-repeat';
}
function page_i(id){
	img=id+4;
	document.getElementById('properties_img').style.background='url(img/img-rtf_satx_0'+img+'.jpg) no-repeat';
	//document.getElementById('page_'+id).className='on';
	document.getElementById('sub_text').innerHTML=document.getElementById('sub_text_'+id).innerHTML;
	document.getElementById('property_text').innerHTML=document.getElementById('property_text_'+id).innerHTML;
	if(id==1){
//		document.getElementById('page_'+2).className='off';
//		document.getElementById('page_'+3).className='off';
	}
	if(id==2){
		//document.getElementById('page_'+1).className='off';
		//document.getElementById('page_'+3).className='off';
		document.getElementById('property_logos').style.display='';
	}else{
		document.getElementById('property_logos').style.display='none';
	}
	if(id==3){
//		document.getElementById('page_'+2).className='off';
//		document.getElementById('page_'+1).className='off';
	}
}
function page_o(id){
	img=id+10;
	document.getElementById('properties_img').style.background='url(img/img-rtf_satx_'+img+'.jpg) no-repeat';
	//document.getElementById('page_'+id).className='on';
	document.getElementById('sub_text').innerHTML=document.getElementById('sub_text_'+id).innerHTML;
}
function page_r(id){
	img=id+19;
	document.getElementById('properties_img').style.background='url(img/img-rtf_satx_'+img+'.jpg) no-repeat';
	//document.getElementById('page_'+id).className='on';
	document.getElementById('sub_text').innerHTML=document.getElementById('sub_text_'+id).innerHTML;
}
// Scroll page to bottom
function bottom(){
	//ch=document.body.clientHeight
	window.scrollTo(0,560)
}
// Contact Form
function contact() {
  http.open("POST", "inc/process_contact.asp", true);
  http.onreadystatechange=getHttpRes;
  
  var params="do=form";
	for(i=0; i<document.form_form.elements.length; i++){
			//if((document.form_form.elements[i].type!='checkbox' && document.form_form.elements[i].type!='radio') || document.form_form.elements[i].checked)
				params+="&"+encodeURI(document.form_form.elements[i].name)+"="+encodeURI(document.form_form.elements[i].value);
	}
		
  //alert(params);
//  document.getElementById('status').innerHTML="wait...";
	document.getElementById('submit').style.display="none"; 
//  document.getElementById('submitted').style.display=""; 
  
  http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  http.setRequestHeader("Content-length", params.length);
  http.setRequestHeader("Connection", "close");

  http.send(params);
}
function getHttpRes( ) {
  if (http.readyState== 4 && http.status== 200) {
  	var res=http.responseText;
  	var next=res.split(':::');
    if (next[1]=='done'){
		document.getElementById('form_area').innerHTML=next[0];
		document.images['contact_us'].src='img/img-thank_you.png';
	}else{
		alert(next[0]);
		document.form_form.elements[next[1]].focus();
		document.getElementById('submit').style.display='';
	}
    //if (next[1]==2) document.getElementById('add_area').style.display=''; 
    //if (next[1]==2) document.getElementById('items').innerHTML='Drag areas here!'; 
    //if (next[1]==3) document.getElementById('add_area').style.display='none'; 
    //if (next[1]==3) document.getElementById('rename').style.display=''; 
    //if (next[1]==3) document.getElementById('rename').innerHTML=next[2]; 
    //if (next[1]==4) setTimeout('window.location="index.php"', 2000); 
  }
}
function getXHTTP( ) {
  var xhttp;
   try {
      xhttp=new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        xhttp=new ActiveXObject("Microsoft.XMLHTTP");
      } catch (e2) {
	    try {
	      xhttp=new XMLHttpRequest();
	    } catch (e3) {
	      xhttp=false;
	    }
      }
    }
  return xhttp;
}
var http=getXHTTP();
//------------------------------------------
