function popup(w,h,url)
{
        x = screen.availWidth/2-w/2;
        y = screen.availHeight/2-h/2;
        var popupWindow = window.open(
            url,'','width='+w+',height='+h+',left='+x+',top='+y+',screenX='+x+',screenY='+y+',scrollbars=no');
}
function CheckForm(FormID){
	Elements = document.getElementById(FormID).elements;
	Throw = false;

	for(M=0; M<Elements.length; M++){

		Element = Elements[M];
		if(Element.id.indexOf('-Req') != -1){

			Element.parentNode.nextSibling.className = "NoError";
			if(Element.parentNode.parentNode.style.display == "none") continue;
			
			Value = new String(Element.value);

			if(Value.length == 0){
				Element.parentNode.nextSibling.className = "Error";
				Throw = true;
				continue;
			}
			
			if(Element.type.toLowerCase() == "checkbox" && Element.checked != true){
				Element.parentNode.nextSibling.className = "Error";
				Throw = true;
				continue;
			}

			if(Element.id.indexOf('-Email') != -1 && (Value.indexOf('@') == -1 || Value.indexOf('.') == -1 || Value.indexOf('@') >= Value.lastIndexOf('.'))){
				Element.parentNode.nextSibling.className = "Error";
				Throw = true;
				continue;
			}
		}
	}

	if(Throw == false) return true;
	else return false;

}