var host = location.hostname;
var url = "";

if(host == 'localhost')
{
    url = 'http://localhost:8080/newid/newidflooring/wp-content/themes/wp-framework/library/media/';
}
else
{
    //url = 'http://www.newidflooring.co.uk/';
    url = 'http://www.newidflooring.co.uk.php5-19.dfw1-2.websitetestlink.com/wp-content/themes/wp-framework/library/media/';
}

var theIms=new Array();
	theIms["home"] = new Image();theIms["home"].src= url +"Images/common/home.gif";
	theIms["homeR"] = new Image();theIms["homeR"].src= url +"Images/common/homeR.gif";
	theIms["about"] = new Image();theIms["about"].src= url +"Images/common/about.gif";
	theIms["aboutR"] = new Image();theIms["aboutR"].src= url +"Images/common/aboutR.gif";
	theIms["carpets"] = new Image();theIms["carpets"].src= url +"Images/common/carpets.gif";
	theIms["carpetsR"] = new Image();theIms["carpetsR"].src= url +"Images/common/carpetsR.gif";
	theIms["commercial"] = new Image();theIms["commercial"].src= url +"Images/common/commercial.gif";
	theIms["commercialR"] = new Image();theIms["commercialR"].src= url +"Images/common/commercialR.gif";
	theIms["contact"] = new Image();theIms["contact"].src= url +"Images/common/contact.gif";
	theIms["contactR"] = new Image();theIms["contactR"].src= url +"Images/common/contactR.gif";
	theIms["hardwood"] = new Image();theIms["hardwood"].src= url +"Images/common/hardwood.gif";
	theIms["hardwoodR"] = new Image();theIms["hardwoodR"].src= url +"Images/common/hardwoodR.gif";
	theIms["karndean"] = new Image();theIms["karndean"].src= url +"Images/common/karndean.gif";
	theIms["karndeanR"] = new Image();theIms["karndeanR"].src= url +"Images/common/karndeanR.gif";
	theIms["send"] = new Image();theIms["send"].src= url +"Images/contact/send.gif";
	theIms["sendR"] = new Image();theIms["sendR"].src= url +"Images/contact/sendR.gif";
var theMenu ="home,about,carpets,commercial,contact,hardwood,karndean";
function _document_onclick(e)
{var event = e ? e : window.event;
 var target = e ? event.target : event.srcElement;
 if(target.id=="send")
 	{var elem = document.forms.theData;var errMess = "";
	 if(elem.theTitle.selectedIndex==0){document.getElementById("sTitle").style.color="#fb3a26";errMess="Please complete all items in red";}
	 if(elem.fName.value==""){document.getElementById("theFName").style.color="#fb3a26";errMess="Please complete all items in red";}
	 if(elem.lName.value==""){document.getElementById("theLName").style.color="#fb3a26";errMess="Please complete all items in red";}
	 if(elem.email.value==""){document.getElementById("theEMail").style.color="#fb3a26";errMess="Please complete all items in red";}
	 if(elem.tPhone.value==""){document.getElementById("theTel").style.color="#fb3a26";errMess="Please complete all items in red";}
	 if(elem.howDidYouHear.selectedIndex==0){document.getElementById("theHear").style.color="#fb3a26";errMess="Please complete all items in red";}
	 if(elem.enquiry.value==""){document.getElementById("theEnquiry").style.color="#fb3a26";errMess="Please complete all items in red";}
	 if(errMess!=""){alert(errMess);return;}
	 elem.action="contact.php";elem.submit();
	}
}
function _document_onmouseover(e)
{var event = e ? e : window.event;
 var target = e ? event.target : event.srcElement;
 try{if(theMenu.indexOf(target.id) != -1 && target.id != thePage){document.getElementById(target.id).src=theIms[target.id+"R"].src;}} catch(e){}
 try{if(target.id == "send"){document.getElementById(target.id).src=theIms[target.id+"R"].src;}} catch(e){}
 }
function _document_onmouseout(e)
{var event = e ? e : window.event;
 var target = e ? event.target : event.srcElement;
 try {if(theMenu.indexOf(target.id) != -1 && target.id != thePage){document.getElementById(target.id).src=theIms[target.id].src;}} catch(e){}
 try{if(target.id == "send"){document.getElementById(target.id).src=theIms[target.id].src;}} catch(e){}
}
/* SET up document handlers here	*/
if (document.layers) document.captureEvents(Event.ONCLICK);
document.onclick = _document_onclick;
if (document.layers) document.captureEvents(Event.ONMOUSEOVER);
document.onmouseover = _document_onmouseover;
if (document.layers) document.captureEvents(Event.ONMOUSEOUT);
document.onmouseout = _document_onmouseout;
