
function closepopup() {
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById('popupcenter').style.visibility = 'hidden';
		document.getElementById('popupcenterbg').style.visibility = 'hidden';
	}
	else {
		if (document.layers) { // Netscape 4
			document.hidepage.visibility = 'hidden';
		}else { // IE 4
			document.all.hidepage.style.visibility = 'hidden';
		}
	}
}

function showid(show) {
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(show).style.display = 'block';
	}else {
		if (document.layers) { // Netscape 4
		document.hidepage.display = 'block';
		}
		else { // IE 4
			document.all.hidepage.style.display = 'block';
		}
	}
}

function hideid(show) {
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(show).style.display = 'none';
	}
	else {
		if (document.layers) { // Netscape 4
		document.hidepage.display = 'none';
		}
		else { // IE 4
			document.all.hidepage.style.display = 'none';
		}
	}
}

/**
* Ajax input Check 
*
* Recive request i number
* Currently available request numbers:
* - 1: E-mail controle
* - 2: Required controle ( NotEmpty )
* @param string  | inputString | input value
* @param int |  checkType  |  check type
*
* @author Andreas Warnaar <andreas.warnaar@webparking.nl>
* @copyright Copyright (c) 2009, Webparking
* @project Wpl_mVC
* @version 0.3
* 
* @note URLS are Hardcoded inputcheck.php
**/
var divId
var xmlHttp
function inputCheck(inputString,checkType,targetScript,Id){
	divId = Id 
	if (inputString.length==0){ 
	  document.getElementById(divId).innerHTML=""
	  return
	}
	 
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null){
	  alert ("Browser does not support HTTP Request")
	  return
	} 
	var url=targetScript
	
	switch(checkType){
		default:
			url=url+"?string="+inputString
	}
	url=url+"&sid="+Math.random()
	url=url+"&type="+checkType
	xmlHttp.onreadystatechange=stateChanged 
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
} 

function stateChanged(){ 

	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
		document.getElementById(divId).innerHTML=xmlHttp.responseText 
		document.getElementById(divId).className="validation_respon"
	}	 
}

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;
}


