//MENU ROLLOVER
if (document.images) {
nav1on   = new Image(); nav1on.src   = "_images/menu_homeon.gif";
nav1off  = new Image(); nav1off.src  = "_images/menu_home.gif";
nav2on   = new Image(); nav2on.src   = "_images/menu_portfolioon.gif";
nav2off  = new Image(); nav2off.src  = "_images/menu_portfolio.gif";
nav4on   = new Image(); nav4on.src   = "_images/menu_serviceson.gif";
nav4off  = new Image(); nav4off.src  = "_images/menu_services.gif";
nav5on   = new Image(); nav5on.src   = "_images/menu_contacton.gif";
nav5off  = new Image(); nav5off.src  = "_images/menu_contact.gif";
}

function rollOn(img){
    if (document.images) {
        document[img].src=eval(img + "on.src");
    }
}

function rollOff(img){
    if (document.images) {
		document[img].src=eval(img + "off.src");
	}
}


//CLEAR FIELDfunction clearIt(field) {field.value="";}


// OPEN WINDOW
function openWin(url,name,popW,popH) {w = screen.availWidth;
h = screen.availHeight;leftPos = 5;
topPos = 5;window.open(url,name,'width='+popW+',height='+popH+',scrollbars=yes,toolbar=no,status=no,resizable=yes,top='+ topPos+',left='+leftPos);}

//AJAX
function Inint_AJAX() {try { return new ActiveXObject("Msxml2.XMLHTTP");  } catch(e) {} //IEtry { return new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) {} //IEtry { return new XMLHttpRequest();          } catch(e) {} //Native Javascriptalert("Your browser does not support HTTP Request");return null;};

function SignUp_Validate(form) {var req = Inint_AJAX();
var thename = form.name.value;
var theemail = form.email.value;
var thebmonth = form.bmonth.value;
var thebday = form.bday.value;
var thebyear = form.byear.value;
req.onreadystatechange = function () { if (req.readyState==4) {      if (req.status==200) {
	var response = req.responseText;
	if (response == 'Underage') {
window.location.href=window.location.href;

	} else if (response == 'No Errors') {
	SignUp_Process(form);
	} else {
	document.getElementById('errormsg').innerHTML=response; //return value;
	}      } }};

var fields = "name="+thename+"&email="+theemail+"&bday="+thebmonth+"-"+thebday+"-"+thebyear;req.open("POST", "process_signupvalidate.php", true);req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=iso-8859-1");req.send(fields);};


function SignUp_Process(form) {var req = Inint_AJAX();
var thename = form.name.value;
var theemail = form.email.value;
var thebmonth = form.bmonth.value;
var thebday = form.bday.value;
var thebyear = form.byear.value;
req.onreadystatechange = function () { if (req.readyState==4) {      if (req.status==200) {
	var response = req.responseText;
	document.getElementById('signup').innerHTML=response; //return value;      } }};

var fields = "name="+thename+"&email="+theemail+"&bday="+thebmonth+"-"+thebday+"-"+thebyear;req.open("POST", "process_signup.php", true);req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=iso-8859-1");req.send(fields);};



function Comment_Validate(form) {var req = Inint_AJAX();
var thename = form.name.value;
var theemail = form.email.value;
var thebmonth = form.bmonth.value;
var thebday = form.bday.value;
var thebyear = form.byear.value;
var thecomment = form.comment.value;
var thecommentid = form.commentid.value;
req.onreadystatechange = function () { if (req.readyState==4) {      if (req.status==200) {
	var response = req.responseText;
	if (response == 'Underage') {
	document.getElementById('errormsg').innerHTML= "<span class='error'>Thank you for your interest in registering. <br />As we are committed to protecting your privacy, we are unable to accept your registration.</span>";
window.location.reload();
	} else if (response == 'No Errors') {
	Comment_Process(form);
	} else {
	document.getElementById('errormsg').innerHTML=response; //return value;
	}      } }};

var fields = "name="+thename+"&email="+theemail+"&bday="+thebmonth+"-"+thebday+"-"+thebyear+"&comment="+thecomment+"&commentid="+thecommentid;req.open("POST", "process_commentvalidate.php", true);req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=iso-8859-1");req.send(fields);};


function Comment_Process(form) {var req = Inint_AJAX();
var thename = form.name.value;
var theemail = form.email.value;
var thebmonth = form.bmonth.value;
var thebday = form.bday.value;
var thebyear = form.byear.value;
var thecomment = form.comment.value;
var thecommentid = form.commentid.value;
req.onreadystatechange = function () { if (req.readyState==4) {      if (req.status==200) {
	var response = req.responseText;
	document.getElementById('thecomment').innerHTML=response; //return value;      } }};

var fields = "name="+thename+"&email="+theemail+"&bday="+thebmonth+"-"+thebday+"-"+thebyear+"&comment="+thecomment+"&commentid="+thecommentid;req.open("POST", "process_comment.php", true);req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=iso-8859-1");req.send(fields);};

function show_hide(id){
	var curState = document.getElementById(id).style.display
	if(curState == 'none'){
		document.getElementById(id).style.display = 'block'
	}else{
		document.getElementById(id).style.display = 'none'
	}
}

