var xmlHttp;
window.acInit=false;

createDropShadows = function(){
 //get the elements with the classname highContrast
 var highContrast = getElementsByClass('highContrast');
  
 //loop through the highContrast elements
 for(i = 0; i <= highContrast.length; i++){
	
  //current element
  var currentElement = highContrast[i];
		
  //current element's text
  var hcContent = currentElement.firstChild.data;
		
  //create a span to replace the content text
  var contentSpan = document.createElement('span');
  var contentSpanText = document.createTextNode(hcContent);
  contentSpan.appendChild(contentSpanText);
		
  //create a span for the shadow and give it the class "shadow"
  var shadowSpan = document.createElement('span');
  var shadowSpanText = document.createTextNode(hcContent);
  shadowSpan.appendChild(shadowSpanText);
  shadowSpan.className = "shadow";
		
  //kill the original text and toss the spans in there
  currentElement.firstChild.data = '';
  currentElement.appendChild(shadowSpan);
  currentElement.appendChild(contentSpan);
 }
}

function showHint(str,fldname)
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
{
  alert ("Your browser does not support AJAX!");
  return;
} 
var url="gethint.php";
url=url+"?q="+str+"&fld="+fldname;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged55 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 

function confpass(str,fldname,oldstr)
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
{
  alert ("Your browser does not support AJAX!");
  return;
} 
var url="gethint.php";
url=url+"?q="+str+"&fld="+fldname+"&orpass="+oldstr;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged55 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 


function validation(f)
{
LoadingScreen.show();
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
{
  alert ("Your browser does not support AJAX!");
  return;
} 
var str = create_xml(f);
var url="check.php";
url=url+"?"+str
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged22 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}


function revalidation(f)
{
LoadingScreen.show();
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
{
  alert ("Your browser does not support AJAX!");
  return;
} 
var str = create_xml(f);
var url="recheck.php";
url=url+"?"+str
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged22 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function validationgetback(f)
{
LoadingScreen.show();
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
{
  alert ("Your browser does not support AJAX!");
  return;
} 
var str = create_xml(f);
var url="resub.php";
url=url+"?"+str
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged33 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}


function updateform(f)
{
LoadingScreen.show();
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
{
  alert ("Your browser does not support AJAX!");
  return;
} 
var str = create_xml(f);
var url="update.php";
url=url+"?"+str
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged44
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function showcomplete()
{
LoadingScreen.show();
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
{
  alert ("Your browser does not support AJAX!");
  return;
} 
var url="complete.php";
url=url+"?sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged44
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}


function propind(j,k)
{
window.scrollTo(0,0);
document.getElementById("loadimage").style.display='';
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
{
  alert ("Your browser does not support AJAX!");
  return;
} 
var url="propind.php";
url=url+"?page1="+j;
url=url+"&town="+k;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChangedprop
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function ppropind(j,k)
{
window.scrollTo(0,0);
document.getElementById("loadimage").style.display='';
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
{
  alert ("Your browser does not support AJAX!");
  return;
} 
var url="propind.php";
url=url+"?page1="+j;
url=url+"&intdid="+k;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChangedprop
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function propdetail(x,propertyid)
{
if (x=="")
{
document.xx.ggm.value='map';
document.xx.ggn.value="'"+namear[propertyid]+"'";
document.xx.ggt.value="'"+townar[propertyid]+"'";
document.xx.ggc.value="'"+countyar[propertyid]+"'";
}
else
{
document.xx.ggm.value='';
document.xx.ggn.value='';
document.xx.ggt.value='';
document.xx.ggc.value='';
}
window.scrollTo(0,0);
document.getElementById("loadimage").style.display='';
document.getElementById("propcontent").style.display='none';
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
{
  alert ("Your browser does not support AJAX!");
  return;
} 
var url="propdet.php";
url=url+"?sid="+Math.random();
url=url+"&disp="+x;
url = url+"&propertyid="+propertyid;
xmlHttp.onreadystatechange=stateChangedprop2
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}


function ppropdetail(x,propertyid,k)
{
if (x=="")
{
document.xx.ggm.value='map';
document.xx.ggn.value="'"+namear[propertyid]+"'";
document.xx.ggt.value="'"+townar[propertyid]+"'";
document.xx.ggc.value="'"+countyar[propertyid]+"'";
}
else
{
document.xx.ggm.value='';
document.xx.ggn.value='';
document.xx.ggt.value='';
document.xx.ggc.value='';
}
window.scrollTo(0,0);
document.getElementById("loadimage").style.display='';
document.getElementById("propcontent").style.display='none';
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
{
  alert ("Your browser does not support AJAX!");
  return;
} 
var url="propdet.php";
url=url+"?sid="+Math.random();
url=url+"&disp="+x;
url = url+"&propertyid="+propertyid;
url=url+"&intdid="+k;
xmlHttp.onreadystatechange=stateChangedprop2
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}


function create_xml(f)
{
	var xml = '';
	for (i=0; i<f.elements.length; i++)
	{
		if (f.elements[i].name)
		{
			if (f.elements[i].name=="trad")
			{
				if (f.trad.checked)
				{
				xml += f.elements[i].name+"="+f.elements[i].value+"&";
				}
				else
				{
				xml += f.elements[i].name+"=&";
				}
			}
			else
			{
			xml += f.elements[i].name+"="+f.elements[i].value+"&";
			}
		}
	}
	return xml;
}




function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}


function pickShowOrHide() {
with (document.getElementById("traddiv").style) {
	if (display == "none" && document.form1.trad.checked==true)
	{
	display = ""
	document.getElementById("tradsep").value='1';
	}
	else
	{
	display = "none";
	document.getElementById("tradsep").value='0';
	}
}
}

function stateChanged55() 
{ 
	
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
	LoadingScreen.hide();
	responseXml = xmlHttp.responseXML;
    xmlDoc = responseXml.documentElement;
	var commands = xmlDoc.getElementsByTagName('errormsg');
		for (i=0;i<commands.length;i++) 
		{
	    result = xmlDoc.getElementsByTagName("errormsg")[i].firstChild.data;
    	fieldID = xmlDoc.getElementsByTagName("fieldname")[i].firstChild.data;
    	message = document.getElementById(fieldID + "failed");
		stylel =  document.getElementById(fieldID + "stylel");
		styler =  document.getElementById(fieldID + "styler");
		//alert(fieldID);
			if (result=="0")
			{
			message.innerHTML="";
			stylel.style.background='';
			styler.style.background='';
			}
			else
			{
			message.innerHTML= result;
			stylel.style.background='#FFFFCC';
			styler.style.background='#FFFFCC';
			}		
		}
	
	}
	
}


function stateChanged22() 
{ 
	
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
	setTimeout("LoadingScreen.hide()",3000);
	responseXml = xmlHttp.responseXML;
	// get the document element
    xmlDoc = responseXml.documentElement;
	var commands = xmlDoc.getElementsByTagName('errormsg');
	for (i=0;i<commands.length;i++) {
    result = xmlDoc.getElementsByTagName("errormsg")[i].firstChild.data;
    fieldID = xmlDoc.getElementsByTagName("fieldname")[i].firstChild.data;
	fieldretval = xmlDoc.getElementsByTagName("fieldval")[i].firstChild.data;
	// find the HTML element that displays the error
	 
	//alert(fieldID);
	//alert(result);
	//alert(fieldretval);


		if (fieldID=="regid")
		{
		var reg = document.getElementById("regid");
		reg.value=result;
		}
		else if (fieldID=="Confirm")
		{
		var conf = document.getElementById("Confirm");
		conf.style.visibility='visible';
		var subb = document.getElementById("Submit");
		subb.style.visibility='hidden';

			document.getElementById("fname").style.display= 'none';
			document.getElementById("fnameval").style.display= 'block';
			document.getElementById("lname").style.display= 'none';
			document.getElementById("lnameval").style.display= 'block';
			document.getElementById("salut").style.display= 'none';
			document.getElementById("salutval").style.display= 'block';
			document.getElementById("caddress1").style.display= 'none';
			document.getElementById("caddress1val").style.display= 'block';
			document.getElementById("caddress2").style.display= 'none';
			document.getElementById("caddress2val").style.display= 'block';
			document.getElementById("ccity").style.display= 'none';
			document.getElementById("ccityval").style.display= 'block';
			document.getElementById("ccounty").style.display= 'none';
			document.getElementById("ccountyval").style.display= 'block';
			document.getElementById("ccountryid").style.display= 'none';
			document.getElementById("ccountryidval").style.display= 'block';
			document.getElementById("cpostcode").style.display= 'none';
			document.getElementById("cpostcodeval").style.display= 'block';
			document.getElementById("taddress1").style.display= 'none';
			document.getElementById("taddress1val").style.display= 'block';
			document.getElementById("taddress2").style.display= 'none';
			document.getElementById("taddress2val").style.display= 'block';
			document.getElementById("tcity").style.display= 'none';
			document.getElementById("tcityval").style.display= 'block';
			document.getElementById("tcounty").style.display= 'none';
			document.getElementById("tcountyval").style.display= 'block';
			document.getElementById("tcountryid").style.display= 'none';
			document.getElementById("tcountryidval").style.display= 'block';
			
			document.getElementById("phone1a").style.display= 'none';
			document.getElementById("phone1aval").style.display= 'block';
			document.getElementById("phone1b").style.display= 'none';
			document.getElementById("phone1bval").style.display= 'block';
			document.getElementById("phone1c").style.display= 'none';
			document.getElementById("phone1cval").style.display= 'block';
									
			document.getElementById("phone2a").style.display= 'none';
			document.getElementById("phone2aval").style.display= 'block';
			document.getElementById("phone2b").style.display= 'none';
			document.getElementById("phone2bval").style.display= 'block';
			document.getElementById("phone2c").style.display= 'none';
			document.getElementById("phone2cval").style.display= 'block';
									
			document.getElementById("mobile1a").style.display= 'none';
			document.getElementById("mobile1aval").style.display= 'block';
			document.getElementById("mobile1b").style.display= 'none';
			document.getElementById("mobile1bval").style.display= 'block';
						
			document.getElementById("mobile2a").style.display= 'none';
			document.getElementById("mobile2aval").style.display= 'block';
			document.getElementById("mobile2b").style.display= 'none';
			document.getElementById("mobile2bval").style.display= 'block';
						
			document.getElementById("email1").style.display= 'none';
			document.getElementById("email1val").style.display= 'block';
			document.getElementById("email2").style.display= 'none';
			document.getElementById("email2val").style.display= 'block';
			document.getElementById("username").style.display= 'none';
			document.getElementById("usernameval").style.display= 'block';
			document.getElementById("password").style.display= 'none';
			document.getElementById("passwordval").style.display= 'block';
			document.getElementById("cpassword").style.display= 'none';
			document.getElementById("cpasswordval").style.display= 'block';
			document.getElementById("passa").style.display= 'none';
			document.getElementById("passaval").style.display= 'block';
			document.getElementById("passq").style.display= 'none';
			document.getElementById("passqval").style.display= 'block';

			document.getElementById("company").style.display= 'none';
			document.getElementById("companyval").style.display= 'block';
			document.getElementById("trading").style.display= 'none';
			document.getElementById("tradingval").style.display= 'block';
			document.getElementById("caddress3").style.display= 'none';
			document.getElementById("caddress3val").style.display= 'block';
			document.getElementById("taddress3").style.display= 'none';
			document.getElementById("taddress3val").style.display= 'block';
			document.getElementById("tpostcode").style.display= 'none';
			document.getElementById("tpostcodeval").style.display= 'block';
			document.getElementById("vatnumber").style.display= 'none';
			document.getElementById("vatnumberval").style.display= 'block';
			document.getElementById("passq").style.display= 'none';
			document.getElementById("passqval").style.display= 'block';
			document.getElementById("Reset").style.visibility= 'hidden';
			document.getElementById("Change").style.visibility= 'visible';
			document.getElementById("Update").style.visibility= 'hidden';

		
		}
		else
		{
		    message = document.getElementById(fieldID + "failed");
			mesval = document.getElementById(fieldID + "val");
			stylel =  document.getElementById(fieldID + "stylel");
			styler =  document.getElementById(fieldID + "styler");
			mesval.innerHTML = fieldretval;
			if (result=="0")
			{
			message.innerHTML="";
			}
			else
			{
			message.innerHTML= result;
			stylel.style.background='#FFFFCC';
			styler.style.background='#FFFFCC';
			}		
		}
	}
	
	}
}


function stateChanged33() 
{ 
	 if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
	LoadingScreen.hide();
	responseXml = xmlHttp.responseXML;
	// get the document element
    xmlDoc = responseXml.documentElement;
	var commands = xmlDoc.getElementsByTagName('errormsg');
	for (i=0;i<commands.length;i++) {
    result = xmlDoc.getElementsByTagName("errormsg")[i].firstChild.data;
    fieldID = xmlDoc.getElementsByTagName("fieldname")[i].firstChild.data;
	fieldretval = xmlDoc.getElementsByTagName("fieldval")[i].firstChild.data;
	// find the HTML element that displays the error
	 
	//alert(fieldID);
	//alert(result);
	//alert(fieldretval);


		if (fieldID=="regid")
		{
		var reg = document.getElementById("regid");
		reg.value=result;
		}
		else if (fieldID=="Confirm")
		{
		var conf = document.getElementById("Confirm");
		conf.style.visibility='visible';
		var subb = document.getElementById("Submit");
		subb.style.visibility='hidden';

document.getElementById("fname").style.display= 'block';
document.getElementById("fnameval").style.display= 'none';
document.getElementById("lname").style.display= 'block';
document.getElementById("lnameval").style.display= 'none';
document.getElementById("salut").style.display= 'block';
document.getElementById("salutval").style.display= 'none';
document.getElementById("caddress1").style.display= 'block';
document.getElementById("caddress1val").style.display= 'none';
document.getElementById("caddress2").style.display= 'block';
document.getElementById("caddress2val").style.display= 'none';
document.getElementById("ccity").style.display= 'block';
document.getElementById("ccityval").style.display= 'none';
document.getElementById("ccounty").style.display= 'block';
document.getElementById("ccountyval").style.display= 'none';
document.getElementById("ccountryid").style.display= 'block';
document.getElementById("ccountryidval").style.display= 'none';
document.getElementById("cpostcode").style.display= 'block';
document.getElementById("cpostcodeval").style.display= 'none';
document.getElementById("taddress1").style.display= 'block';
document.getElementById("taddress1val").style.display= 'none';
document.getElementById("taddress2").style.display= 'block';
document.getElementById("taddress2val").style.display= 'none';
document.getElementById("tcity").style.display= 'block';
document.getElementById("tcityval").style.display= 'none';
document.getElementById("tcounty").style.display= 'block';
document.getElementById("tcountyval").style.display= 'none';
document.getElementById("tcountryid").style.display= 'block';
document.getElementById("tcountryidval").style.display= 'none';

document.getElementById("phone1a").style.display= 'block';
document.getElementById("phone1aval").style.display= 'none';
document.getElementById("phone1b").style.display= 'block';
document.getElementById("phone1bval").style.display= 'none';
document.getElementById("phone1c").style.display= 'block';
document.getElementById("phone1cval").style.display= 'none';

document.getElementById("phone2a").style.display= 'block';
document.getElementById("phone2aval").style.display= 'none';
document.getElementById("phone2b").style.display= 'block';
document.getElementById("phone2bval").style.display= 'none';
document.getElementById("phone2c").style.display= 'block';
document.getElementById("phone2cval").style.display= 'none';

document.getElementById("mobile1a").style.display= 'block';
document.getElementById("mobile1aval").style.display= 'none';
document.getElementById("mobile1b").style.display= 'block';
document.getElementById("mobile1bval").style.display= 'none';

document.getElementById("mobile2a").style.display= 'block';
document.getElementById("mobile2aval").style.display= 'none';
document.getElementById("mobile2b").style.display= 'block';
document.getElementById("mobile2bval").style.display= 'none';

document.getElementById("email1").style.display= 'block';
document.getElementById("email1val").style.display= 'none';
document.getElementById("email2").style.display= 'block';
document.getElementById("email2val").style.display= 'none';
document.getElementById("username").style.display= 'block';
document.getElementById("usernameval").style.display= 'none';
document.getElementById("password").style.display= 'block';
document.getElementById("passwordval").style.display= 'none';
document.getElementById("cpassword").style.display= 'block';
document.getElementById("cpasswordval").style.display= 'none';
document.getElementById("passa").style.display= 'block';
document.getElementById("passaval").style.display= 'none';
document.getElementById("passq").style.display= 'block';
document.getElementById("passqval").style.display= 'none';

document.getElementById("company").style.display= 'block';
document.getElementById("companyval").style.display= 'none';
document.getElementById("trading").style.display= 'block';
document.getElementById("tradingval").style.display= 'none';
document.getElementById("caddress3").style.display= 'block';
document.getElementById("caddress3val").style.display= 'none';
document.getElementById("taddress3").style.display= 'block';
document.getElementById("taddress3val").style.display= 'none';
document.getElementById("tpostcode").style.display= 'block';
document.getElementById("tpostcodeval").style.display= 'none';
document.getElementById("vatnumber").style.display= 'block';
document.getElementById("vatnumberval").style.display= 'none';
document.getElementById("passq").style.display= 'block';
document.getElementById("passqval").style.display= 'none';
document.getElementById("Reset").style.visibility= 'hidden';
document.getElementById("Change").style.visibility= 'hidden';
document.getElementById("Update").style.visibility= 'visible';
document.getElementById("Confirm").style.visibility= 'hidden';
		
		}
		else
		{
		    message = document.getElementById(fieldID + "failed");
			mesval = document.getElementById(fieldID + "val");
			mesval.innerHTML = fieldretval;
			if (result=="0")
			{
			message.innerHTML="";
			}
			else
			{
			message.innerHTML= result;
			}		
		}
	}
	}
}



function showLoad (xx) {
     
}

function hideload (xx) {
	
}

function stateChanged44() 
{ 
 	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
	LoadingScreen.hide();	
	var newData = xmlHttp.responseText;
	//$('load').style.display = 'none';
	document.getElementById("content").innerHTML = newData;
	}
}

function stateChangedprop() 
{ 

 	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
	
	document.getElementById("loadimage").style.display='none';
	var newData = xmlHttp.responseText;
	document.getElementById("propcontent").innerHTML = newData;
	myLytebox.updateLyteboxItems();
	}
}


function stateChangedprop2() 
{ 
	
 	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
	
	var ggmmval = document.xx.ggm.value;
	document.getElementById("loadimage").style.display='none';
	var newData = xmlHttp.responseText;
	document.getElementById("propcontent").style.display='';
	document.getElementById("propcontent").innerHTML = newData;
	myLytebox.updateLyteboxItems();
	if (ggmmval=="map") LoadMapSearch();
	}
}



function contform()
{
	if (document.form1.connt.checked)
	{
	document.form1.Submit.disabled=false;
	}
	else
	{
	document.form1.Submit.disabled=true;
	}
}


function LoadMapSearch() {
  var a = document.xx.ggn.value;
  var b = document.xx.ggt.value;
  var c = document.xx.ggc.value;
  var options = { title : "+a+"};
  var goptions = b+","+c+",UK";
  new GSmapSearchControl( document.getElementById("mapsearch"),goptions,options);
}


function initStatLyr() {
	// args: id, left, top, w, h, duration of glide to location onscroll, acceleration factor
  // acceleration factor should be -1 to 1. -1 is full deceleration
	var statLyr = new Glider("glideDiv",lett,5,null,null,1000,-1);
  statLyr.show();
}


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.01
  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 && d.getElementById) x=d.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 MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function checkCallback() {
    var wm = "Please enter the following\n\n";
    var noerror = 1;

    var t1 = document.forms["formCallback"].contactname;
    if (t1.value == "" || t1.value == " ")
    {
        wm += "Name\n";
        noerror = 0;
    }
    var t1 = document.forms["formCallback"].telephone;
    if (t1.value == "" || t1.value == " ")
    {
        wm += "Telephone Number\n";
        noerror = 0;
    }
    
    if (noerror == 0)
    {
        alert(wm);
        return false;
    }
    else return true;
}


function opacity(id, opacStart, opacEnd, millisec) {
    //speed for each frame
    var speed = Math.round(millisec / 100);
    var timer = 0;

    //determine the direction for the blending, if start and end are the same nothing happens
    if(opacStart > opacEnd) {
        for(i = opacStart; i >= opacEnd; i--) {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    } else if(opacStart < opacEnd) {
        for(i = opacStart; i <= opacEnd; i++)
            {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    }
}

//change the opacity for different browsers
function changeOpac(opacity, id) {
    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
} 

function initbox()
{
	//document.getElementById("dropin").style.visibility="visible";
	opacity("dropin", 0, 100, 3000);
}

function dismissbox()
{
opacity("dropin", 100, 0, 3000);
}

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

function newWindow(a_str_windowURL, a_str_windowName, a_int_windowWidth, a_int_windowHeight, a_bool_scrollbars, a_bool_resizable, a_bool_menubar, a_bool_toolbar, a_bool_addressbar, a_bool_statusbar, a_bool_fullscreen) {
  var int_windowLeft = (screen.width - a_int_windowWidth) / 2;
  var int_windowTop = (screen.height - a_int_windowHeight) / 2;
  var str_windowProperties = 'height=' + a_int_windowHeight + ',width=' + a_int_windowWidth + ',top=' + int_windowTop + ',left=' + int_windowLeft + ',scrollbars=' + a_bool_scrollbars + ',resizable=' + a_bool_resizable + ',menubar=' + a_bool_menubar + ',toolbar=' + a_bool_toolbar + ',location=' + a_bool_addressbar + ',statusbar=' + a_bool_statusbar + ',fullscreen=' + a_bool_fullscreen + '';
  var obj_window = window.open(a_str_windowURL, a_str_windowName, str_windowProperties)
    if (parseInt(navigator.appVersion) >= 4) {
      obj_window.window.focus();
    }
}
