<!--

/* **************************************************************

iLead Common methods. Note: you can persist qString values by 

(a) defining the value to be persisted using persistQstr(), 

and (b) using the navigate method to go to another page. 



01. navigate(sectArg,optArg,pageArg,QstrArg)

02. link(sLocArg)

03. popUp(sLocArg,iHeight,iWidth)

04. scrollingPopUp(sLocArg,iHeightArg,iWidthArg,bToolBarArg)

05. statusMsg(myMsg)



NOTE: goToServer() and gotoBuilder() are temporary solutions to 

keep all the  servers straight beween iLead1, and iLead2.0 

during phases1,2 of development.



Modified 6/29/01 - added logic facilitate production servers mappings



neal.cabage@homestore.com 5/10/01

************************************************************* */



//Constant values.

var sPersistQstr; 		sPersistQstr="";

var sBuilderDevLoc; 	sBuilderDevLoc 		= "sto02web008d"; 			

var sBuilderQALoc; 		sBuilderQALoc 		= "sto02web008q"; 			

var sBuilderProdLoc; 	sBuilderProdLoc 	= "homepage.realtor.com";	

var sControlBarDevLoc; 	sControlBarDevLoc 	= "sto02web005d";			

var sControlBarQALoc; 	sControlBarQALoc 	= "sto02ilead2q";			

var sControlBarProdLoc; sControlBarProdLoc 	= "ilead.realtor.com";		



//Feed in all vlaues to be persisted in QString.

persistQstr("id");



function navigate(sectArg,optArg,pageArg,QstrArg) {

//Refresh page with passed in parameters.



	sSect	 = new String(sectArg);

	sOpt 	 = new String(optArg);

	sPage	 = new String(pageArg);

	sQstr	 = new String(QstrArg);



	myString = new String(document.location.href);

	mySplit	 = myString.split("?");

	myURL	 = buildAbsPath("default.asp") + "?sect=" + sSect;

	

	if (sOpt!="undefined" && sOpt!=0)   {myURL = myURL + "&opt=" + sOpt}

	if (sPage!="undefined" && sPage!=0) {myURL = myURL + "&page=" + sPage}

	if (sPersistQstr.length>0) {myURL = myURL + "&" + sPersistQstr}

	if (sQstr!="undefined" && sQstr!=0) {myURL = myURL + "&" + sQstr}

	myURL = myURL + "&rt="+getTimeStamp(); //Request time overrides browser cache.

	

	window.location.href = myURL;

}



function link(sLocArg) {

//Navigation outside of framework

	sLoc = buildAbsPath(sLocArg);

	document.location.href = sLoc;

}



function getQueryStrValue(sVarArg) {

//Pass in a queryString keyName and recieve back it's value.



	qs = new String(location.search);

	qs=qs.substr(1,qs.length).split("&");

	qsKeys = new Array();

	qsVals = new Array();

	myValue = "";



	//Parse values into 2 arrays for search

	for (i=0;i<qs.length;i++){

	   qsElem=qs[i].split("=");

	   key=qsElem[0]; value=qsElem[1];

	   qsKeys=qsKeys.concat(key);

	   qsVals=qsVals.concat(value);

 	}



	//Search for key that matches request

	for (i=0;i<qsKeys.length;i++){

	   if (qsKeys[i].valueOf() == sVarArg) {

		myValue=qsVals[i].valueOf(); break;	   		

	   } 

	} 

	return(myValue);

}

	

function popUp(sLocArg,iHeight,iWidth) {

//Open a child window.

	sLoc = buildAbsPath(sLocArg);

	eval("window.open('"+sLoc+"','me','height="+iHeight+",width="+iWidth+"scrollbars=no,resizable=no');");

}	



function scrollingPopUp(sLocArg,iHeightArg,iWidthArg,bToolBarArg) {

//Open a child window.

	iWidth		= new String(iWidthArg);		

	iHeight		= new String(iHeightArg);	

	bToolBar	= new String(bToolBarArg);

	sLoc 		= buildAbsPath(sLocArg);

		

	if (iWidth.length="undefined") {iWidth=590}

	if (iHeight.length="undefined") {iHeight=500}

	

	if (bToolBar.length="undefined") {

		bToolBar="yes"

	}else{

		if(bMenuBarArg=="false" || bMenuBarArg=="0") {bToolBar="no"}

		else{bToolBar="yes"}

	}

	eval("window.parent.open('"+sLoc+"','child_','height="+iHeight+",width="+iWidth+",scrollbars=yes,toolbar=" + bToolBar + ",resizable=yes');");

}

			

function statusMsg(myMsg) {

//Place message into status bar.

	window.status = myMsg;

	return(true);

}



function chat(agentID,agentScreenName,emailURL,promoURL,ftmlsid,ftmlsalias,fthsid,ftspg,ftsid,ftaid,ftlid,ftctype){

//Launch the "chat with me" window.



	var url = "http://homestoreimlink.facetime.net/messengerLaunch.html" + "?agentID=" + agentID + "&agentScreenName=" + escape(agentScreenName) + "&emailURL=\"" + escape(emailURL) + "\"" + "&promoURL=\"" + promoURL + "\"" + "&mlsid=" + escape(ftmlsid) + "&mlsalias=" + escape(ftmlsalias) + "&aid=" + escape(ftaid) + "&lid="  + escape(ftlid) + "&ctype=" + escape(ftctype) + "&spg="  + escape(ftspg) + "&HSID=" + escape(fthsid) + "&sid=" + escape(ftsid);

	var urlRD = "http://www.realtor.com/Redir/Redir.asp?target=" + escape(url) ;	

	window.open(urlRD,'_blank','width=3,height=3');

}

		

function help(whichSect) {

//Launch help wizard.



	myURL = buildAbsPath("help/default.asp");

	window.open(myURL,"Help","height=400,width=600,scrollBars=yes,resizable=no");

}



function comingSoon() {

	alert("Not Yet Implemented");

}



function persistQstr(keyArg) {

//Adds values to persisted qString.



   sKey = new String(keyArg);

   sVal = new String(getQueryStrValue(keyArg));



   if (sKey.length>0 && sVal>0) { 

     if (sPersistQstr.length>0) {sPersistQstr+="&"}

       	sPersistQstr+=sKey + "=" + sVal 

   }

}



function logOut() {

//Push the user to a logOut area.



	myURL = buildAbsPath("logOut.asp?"+getTimeStamp());

	myMsg = "Are you sure that you wish to Log Out of iLead?";

	x = confirm(myMsg);

	if (x) {window.location.href = myURL}

}



function buildAbsPath(sRelPathArg) {

//Uses currentServer() and goToServer() to determine the 

// base by which to form an absolute path.  Path presumes

// relative path is relavent to controlBar dir.



	myPath = new String(sRelPathArg); myIndex = myPath.indexOf("http://");

	if ((myIndex>=0) && (myIndex<=2)) {

		myURL = myPath;

	}else{

		if (DisplayORControlBar()=="Display" || DisplayORControlBar()=="display") {

			myURL = "http://" + goToServer() + virtualDir() +  "display/" + myPath;

		}else{

			myURL = "http://" + goToServer() + virtualDir() + "controlBar/" + myPath;

		}

	}

	//Strip spaces out.

	return(normalize(myURL));

}



function virtualDir() {

//Function adds Virtual Directory reference as needed.



	sCurrServer = currentServer();

	

	if (sCurrServer==sControlBarQALoc) 		 {myVal = "/iLead/"}

	else if (sCurrServer==sControlBarDevLoc) {myVal = "/iLead/"}

	else {myVal = "/";}

	

	return(myVal);

}



function goToServer(){

//Temporary function intended to take care of the bouncing between servers

//that is necissary while iLead2.0 uses the iLead1.0 builder. This function

//should be retired for a more generic method once the builder resides on 

//the same system. 



	currServer = currentServer();



	if (currServer == sBuilderQALoc){

		myURL = sControlBarQALoc;

	}else if (currServer == sBuilderDevLoc){

		myURL = sControlBarDevLoc;

	}else if (currServer == sBuilderProdLoc){

		myURL = sControlBarProdLoc;

	}else{

		myURL = currServer;

	}

	return(myURL);

}



function goToBuilder(){

//Temporary ... same story as goToServer()



	currServer = currentServer();



	if (currServer == sControlBarQALoc){

		myURL = sBuilderQALoc;

	}else if (currServer == sControlBarDevLoc){

		myURL = sBuilderDevLoc;

	}else if (currServer == sControlBarProdLoc){

		myURL = sBuilderProdLoc;

	}else{

		myURL = currServer;

	}

	return(myURL);

}



function DisplayORControlBar(){

	myString = new String(document.location.href);

	mySplit	 = myString.split("/");

	myTestVal = mySplit[3].toLowerCase()

	

	if (myTestVal=="ilead") {myDir = mySplit[4]}

	else{myDir = mySplit[3]}

	

	return(myDir);

}



function currentServer(){

//Returns name of machine



	myString = new String(document.location.href).toLowerCase();

	mySplit	 = myString.split("/");

	myURL	 = mySplit[2];

	

	return(myURL);

}


function updateClock() {

	var month = new Array(12);

	month[0] = "Jan";

	month[1] = "Feb";

	month[2] = "March";

	month[3] = "Apr";

	month[4] = "May";

	month[5] = "June";

	month[6] = "July";

	month[7] = "Aug";

	month[8] = "Sep";

	month[9] = "Oct";

	month[10] = "Nov";

	month[11] = "Dec";

	var day = new Array(7);

	day[0] = "Sunday";

	day[1] = "Monday";

	day[2] = "Tuesday";

	day[3] = "Wednesday";

	day[4] = "Thursday";

	day[5] = "Friday";

	day[6] = "Saturday";

    var time = new Date();

	//var ndate = new Date("Dec 25, 1995");

    var hours = time.getHours();

    var minutes = time.getMinutes();

    var seconds = time.getSeconds();

	document.frmdt.txtdate.value = day[time.getDay()]+" "+time.getDate()+" "+month[time.getMonth()]+", "+time.getYear();

	//txtdate.value = time.toGMTString();

	document.frmdt.txttime.disabled = true;

	document.frmdt.txtdate.disabled = true;

    document.frmdt.txttime.value = ((hours < 10) ? '0' + hours : hours) + 

                          ':' + ((minutes < 10) ? '0' + minutes : minutes) +

                          ':' + ((seconds < 10) ? '0' + seconds : seconds);

	//document.txttime.value = hours + ":" + minutes + ":" + seconds;

    setTimeout("updateClock()",1000);

}



//-->		
<!--
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_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_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];}
}
//-->
/////////////////////////////advance search rent////////////////////////////
function PriceRange()
{
	
	if(document.frm.price.value!="any" && document.frm.pricemax1.value!="any")
	{
		var minp=parseInt(document.frm.price.value);
		var maxp = parseInt(document.frm.pricemax1.value)
		if(minp>maxp)
		{
			alert ("The mininum Price should be less than the maximum price");
			document.frm.price.focus();
			return false;
		}
	}
}
function cityref()
{
	var a=document.frm.province.options[document.frm.province.selectedIndex].value;
		var length=0;
		var opt = new Array();
		for(var i=0; i<mes.length; i++)
		{
			var str=mes[i];
			var ind=str.indexOf('?');
			var province=str.substring(ind+1,str.length);
			var city=str.substring(0,ind);
			var pos=1;
			if(province==a){
			opt[length]=city;
				length++;
			}
			
			
		}
			document.frm.city.length = length+1;
			//alert(length);
			document.frm.city.options[0].value = "any";
			document.frm.city.options[0].text = "geen voorkeur";
			for(var k=1; k<length+1; k++)	
			{
				document.frm.city.options[k].value = opt[k-1];
				document.frm.city.options[k].text = opt[k-1];
			}

}
function clearcom()
{
		cityref();
}
////////////////////////////////////////////////////////
/////////////////////advence search rent result///////////////////////////
function checknum(){
var key=event.keyCode;
	if((key>47 && key<58) || (key>95 && key<106) ) 
	{
		
	}
	else
	{
		if( key!=8 && key!=9 && key!=37 && key!=39 && key!=144 && key!=40 && key!=13){
				alert("only numeric values are allowed");
				return false;
			}
	}
	
}
function checkker()
{
	if(document.frm.email.value=="")
	{
		alert("A.u.b. email invullen");
		document.frm.email.focus();
		return false;
	}
	else
	if(document.frm.name.value=="")
	{
		alert("A.u.b. naam invullen");
		document.frm.namefocus();
		return false;
	}
	else
	if(document.frm.email.value!=""){
		var val=document.frm.email.value;
		if(val.indexOf('@')<1){
			alert("A.u.b. een geldig email invullen");
			document.frm.email.focus();
			return false;
		}
		else
		if(val.indexOf('.')<1 || val.indexOf('@')>val.indexOf('.')){
			alert("A.u.b. een geldig email invullen");
			document.frm.email.focus();
			return false;
		}
	}

	
}
//////////////////////////////////////////////////////////////////////////
////////////////////////////////Detail of rent property/////////////////////
function getback()
{
	history.go(-1);
	history.go(0);
}

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

///////////////////////////////////////////////////////////////////////////
//////////////////Paging of rent /////////////////////////////////////////
function openpicture(i)
{
	 var win=open("picture_rent.php?pid="+i,"Mywin","height=350,width=450");
}
//////////////////////////////////////////////////////////////////////////
///////////////////////////Post Code validate function///////////////////
function validpostcode()
{
	var flag = 0;
	 var length =  document.frm.postcode.value.length;
	 var value = document.frm.postcode.value;
	 //alert("length = "+length);
	 if(length < 6 || length > 7 || value=="")
	 {
	 	return false;
	 
	 }
	 else
	{
		for(var i=0; i<4; i++)
		{
			if(value.charAt(i)<'0' || value.charAt(i)>'9')
			{
				flag = 1;
			
			}
		
		}
		if(length==6)
		{
			if((value.charAt(4)<65 || value.charAt(4)>122) || (value.charAt(5)<65 || value.charAt(5)>122))
			{
				flag = 1;	
			}	
		
		}
		else
		if(length==7)
		{
			if(value.charAt(4)!=' ' || (value.charAt(5)<65 || value.charAt(5)>122) || (value.charAt(6)<65 || value.charAt(6)>122))
			{
				flag = 1;
			}
		}
		if(flag==1)
			return false;
		else 
			return true;	
	
	
	}
	 
}
////////////////////////////////////////////////////////////////////////
////////////////////////Validity for landlord add property//////////////
function checkvalid(){
if(document.frm.description.value==""){
	alert("A.u.b. omschrijving invullen");
	document.frm.description.focus();
	return false;
}
else
	if(document.frm.filename.value==""){
		document.frm.empty.value="empty";
	}
	else
		document.frm.empty.value="notempty";
	if(document.frm.filename1.value==""){
		document.frm.empty1.value="empty";
	}
	else
		document.frm.empty1.value="notempty";
	if(document.frm.filename2.value==""){
		document.frm.empty2.value="empty";
	}
	else
		document.frm.empty2.value="notempty";
	if(document.frm.filename3.value==""){
		document.frm.empty3.value="empty";
	}
	else
		document.frm.empty3.value="notempty";
	if(document.frm.filename4.value==""){
		document.frm.empty4.value="empty";
	}
	else
		document.frm.empty4.value="notempty";
}
////////////////////////////////////////////////////////////////////////
///////////////////////////////////Login Authentication/////////////////
function validlogin(){
	if(document.frm.txtname.value==""){
		alert("Uw loginnaam!");
		document.frm.txtname.focus();
		return false;
	}
	else
	if(document.frm.txtpass.value==""){
		alert("Uw wachtwoord!");
		document.frm.txtpass.focus();
		return false;
	}
	
	
}
///////////////////////////////////////////////////////////////////////
////////////////////////Change password validity///////////////////////
function CP_validity(){
if(document.frm.oldpassword.value==""){
	alert("Oude wachtwoord invullen a.u.b.");
	document.frm.oldpassword.focus();
	return false;
}
else
if(document.frm.newpassword.value==""){
	alert("A.u.b. wachtwoord nogmaals invullen");
	document.frm.newpassword.focus();
	return false;
}
if(document.frm.newpassword.value!=document.frm.confirmpass.value){
	alert("Wachtwoord en wachtwoordbevestiging moeten overeenkomen");
	document.frm.newpassword.focus();
	return false;
}
else
if(document.frm.confirmpass.value==""){
	alert("A.u.b. wachtwoord bevestiging invullen");
	document.frm.confirmpass.focus();
	return false;
}
else
		if(document.frm.newpassword.value!=""){
			var k = 0;
			var pass = document.frm.newpassword.value;
			for(k = 0; k<pass.length; k++)
			{
				if(pass.charAt(k)=="'" || pass.charAt(k)=="\"")
				{
					alert("A.u.b. geen tekens in wachtwoord als ' invullen");
					document.frm.newpassword.focus();
					return false;

				}	
			}
		}

}

///////////////////////////////////////////////////////////////////////
///////////////////Profile validate////////////////////////////////////
function profilevalid(){
var pc = 0;
var em = 0;
	if(document.frm.firstname.value==""){
		alert("Naam invullen a.u.b.");
		document.frm.firstname.focus();
		return false;
	} 
	else 
	if(document.frm.secondname.value==""){
		alert("Achternaam invullen a.u.b.");
		document.frm.secondname.focus();
		return false;
	} 
	else 
	if(document.frm.address.value==""){
		alert("Adres invullen a.u.b.");
		document.frm.address.focus();
		return false;
	} 
	else 
	if(document.frm.postcode.value==""){
		alert("Postcode invullen a.u.b.");
		document.frm.postcode.focus();
		return false;
	} 
	else
	if(document.frm.phoneday.value=="" || document.frm.phoneday.value.length<10) 
	{
		alert("A.u.b. een geldig telefoonnummer invullen a.u.b.");
		document.frm.phoneday.focus();
		return false;
	}
	
	else 
	if(document.frm.email.value==""){
		alert("Email invullen a.u.b.");
		document.frm.email.focus();
		return false;
	} 
	else 
	if(document.frm.info.value==""){
		alert("Opmerkingen invullen a.u.b.");
		document.frm.info.focus();
		return false;
	}
	else 
	if(document.frm.email.value!=""){
		var val=document.frm.email.value;
		if(val.indexOf('@')<1){
			alert("A.u.b. een gelding email invullen");
			document.frm.email.focus();
			return false;
		} else if(val.indexOf('.')<1 || val.indexOf('@')>val.indexOf('.')){
			alert("A.u.b. een geldig email invullen");
			document.frm.email.focus();
			return false;
		}
		em =1;
		if(document.frm.postcode.value!="")
		{
			if(validpostcode())
				pc = 1;
			else
			{
				alert("A.u.b. een geldig postcode invullen als 1234PA of 1234 PA");
				document.frm.postcode.focus();
			}				
							
				
		} 
		 if(em==1 && pc==1)
				return true;
			else 
				return false;	
		
	}
}

///////////////////////////////////////////////////////////////////////
//////////////////////////Landlord mail Validity///////////////////////
function mail_validate()
{
	if(document.frm.name.value=="")
	{
		alert("Naam invullen a.u.b.");
		document.frm.name.focus();
		return false;
	
	}
	else
	if(document.frm.initial.value=="")
	{
		alert("Voorletters invullen a.u.b.");
		document.frm.initial.focus();
		return false;
	
	}
	else
	if(document.frm.email.value=="")
	{
		alert("Email invullen a.u.b.");
		document.frm.email.focus();
		return false;
	
	}
	else
	if(document.frm.address.value=="")
	{
		alert("Adres invullen a.u.b.");
		document.frm.address.focus();
		return false;
	
	}
	else
	if(document.frm.postcode.value=="")
	{
		alert("Postcode invullen a.u.b.");
		document.frm.postcode.focus();
		return false;
	
	}
	if(document.frm.city.value=="")
	{
		alert("A.u.b. plaats invullen");
		document.frm.city.focus();
		return false;
	
	}
	else
	if(document.frm.email.value!=""){
		var val=document.frm.email.value;
		if(val.indexOf('@')<1){
			alert("A.u.b. een geldig email invullen");
			document.frm.email.focus();
			return false;
		}
		else
		if(val.indexOf('.')<1 || val.indexOf('@')>val.indexOf('.')){
			alert("A.u.b. een geldig email invullen");
			document.frm.email.focus();
			return false;
		}
	}

}
///////////////////////////////////////////////////////////////////////
/////////////////////////Registration Validity/////////////////////////
function reg_valid(){
var pc = 0;
var em = 0;
var pw = 0;
	if(document.frm.id.value==""){
		alert("Loginnaam a.u.b. invullen.");
		document.frm.id.focus();
		return false;
	} 
	else 
	if(document.frm.password1.value==""){
		alert("Wachtwoord invullen a.u.b.");
		document.frm.password1.focus();
		return false;
	}
	else 
	if(document.frm.retypepassword.value==""){
		alert("A.u.b. wachtwoord nogmaals invullen");
		document.frm.retypepassword.focus();
		return false;
	}
	else
	if(document.frm.choose.value=="any"){
		alert("A.u.b. een selectie maken bij dropdown Ik ben");
		document.frm.choose.focus();
		return false;
	}
	
	else
	if(document.frm.retypepassword.value!=document.frm.password1.value){
		alert("Wachtwoorden komen niet overeen. A.u.b. wachtwoord nogmaals invullen");
		document.frm.retypepassword.focus();
		return false;
	}
	else
	if(document.frm.firstname.value==""){
		alert("Naam invullen a.u.b.");
		document.frm.firstname.focus();
		return false;
	} 
	else 
	if(document.frm.secondname.value==""){
		alert("Achternaam invullen a.u.b.");
		document.frm.secondname.focus();
		return false;
	} 
	else 
	if(document.frm.address.value==""){
		alert("Adres invullen a.u.b.");
		document.frm.address.focus();
		return false;
	} 
	else 
	if(document.frm.postcode.value==""){
		alert("Postcode invullen a.u.b.");
		document.frm.postcode.focus();
		return false;
	} 
	else
	if(document.frm.phoneday.value=="" || document.frm.phoneday.value.length<10) 
	{
		alert("A.u.b. geldig telefoonnummer invullen");
		document.frm.phoneday.focus();
		return false;
	}
	
	else 
	if(document.frm.email.value==""){
		alert("Email invullen a.u.b.");
		document.frm.email.focus();
		return false;
	} 
	else 
	if(document.frm.info.value==""){
		alert("Opmerkingen invullen a.u.b.");
		document.frm.info.focus();
		return false;
	}
	else 
	if(document.frm.password1.value==""){
		alert("Wachtwoord invullen a.u.b.");
		document.frm.password1.focus();
		return false;
	} 
	else 
	if(document.frm.retypepassword.value==""){
		alert("Opnieuw wachtwoord invullen a.u.b.");
		document.frm.retypepassword.focus();
		return false;
	} 
	else 
	if(document.frm.password1.value!=document.frm.retypepassword.value){
		alert("Wachtwoord en wachtwoordbevestiging komen niet overeen.");
		document.frm.password1.focus();
		return false;
	} 
	else 
	if(document.frm.email.value!=""){
		var val=document.frm.email.value;
		if(val.indexOf('@')<1){
			alert("A.u.b. een geldig email invullen");
			document.frm.email.focus();
			return false;
		} else if(val.indexOf('.')<1 || val.indexOf('@')>val.indexOf('.')){
			alert("A.u.b. een geldig email invullen");
			document.frm.email.focus();
			return false;
		}
		em =1;
		if(document.frm.postcode.value!="")
		{
			if(validpostcode())
				pc = 1;
			else
			{
				alert("A.u.b. een geldig postcode invullen als 1234PA or 1234 PA");
				document.frm.postcode.focus();
			
			}				
				
		}
		//
		if(document.frm.password1.value!=""){
			var k = 0;
			var pass = document.frm.password1.value;
			for(k = 0; k<pass.length; k++)
			{
				if(pass.charAt(k)=="'" || pass.charAt(k)=="\"")
				{
					pw = 1;
					alert("Teken niet toegestaan zoals ' in wachtwoord");
					document.frm.password1.focus();

				}	
			}
		}
	
		/// 
		 if(em==1 && pc==1 && pw==0)
				return true;
			else 
				return false;	
		
	}
}
//////////////////////////////////////////////////////////////////////
/////////////////////////Bid Validation///////////////////////////////
function validate_bid()
{
	if(document.frm.name.value=="")
	{
		alert("Naam invullen a.u.b.");
		document.frm.name.focus();
		return false;
	}
	else
	if(document.frm.email.value=="")
	{
		alert("Email invullen a.u.b.");
		document.frm.email.focus();
		return false;
	}
	else
	if(document.frm.bid.value=="")
	{
		alert("Lege bod is niet toegestaan");
		document.frm.bid.focus();
		return false;
	}
	else
	if(document.frm.email.value!=""){
		var val=document.frm.email.value;
		if(val.indexOf('@')<1){
			alert("A.u.b. een geldig email invullen");
			document.frm.email.focus();
			return false;
		}
		else
		if(val.indexOf('.')<1 || val.indexOf('@')>val.indexOf('.')){
			alert("A.u.b. een geldig email invullen");
			document.frm.email.focus();
			return false;
		}
	}
}
/////////////////////////////////////////////////////////////////////
