
function loadup(){window.focus();externalLinks();preloadgfx();}
function preloadgfx(){web='http://www.quotemeremovals.co.uk/images/';images=new Array();images.push(web+'OrangeButton.png');var thisPage=getPageName();if(thisPage=='removal-quote.php'||thisPage=='myquotes.php'||thisPage=='removal-quote-business.php'){images.push(web+'infoboxtop.png');images.push(web+'infoboxbg.png');images.push(web+'infoboxfooter.png');images.push(web+'infoClose.png');images.push(web+'quotemeBlue.png');}
var x=images.length;if(document.images){for(i=0;i<x;i++){eval('imageObj'+i+' = new Image()');eval('imageObj'+i+'.src = images[i]');}}}
function getPageName(){var currentURL=' '+window.location;var urlstrip=currentURL.split('/');var thispage=urlstrip[urlstrip.length-1];return thispage;}
function openW3C(){var ref=window.location;W3C=window.open('http://validator.w3.org/check?uri='+ref,'W3C','');W3C.focus();}
function openWiki(url){wiki=window.open(url,'wiki','');wiki.focus();}
function openLink(url){links=window.open(url,'links','');links.focus();}
function MM_validateForm(){var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;for(i=0;i<(args.length-2);i+=3){test=args[i+2];val=MM_findObj(args[i]);if(val){nm=val.name;if((val=val.value)!=""){if(test.indexOf('isEmail')!=-1){p=val.indexOf('@');if(p<1||p==(val.length-1))errors+='- '+nm+' must contain an e-mail address.\n';}else if(test!='R'){num=parseFloat(val);if(isNaN(val))errors+='- '+nm+' must contain a number.\n';if(test.indexOf('inRange')!=-1){p=test.indexOf(':');min=test.substring(8,p);max=test.substring(p+1);if(num<min||max<num)errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';}}}else if(test.charAt(0)=='R')errors+='- '+nm+' is required.\n';}}if(errors)alert('The following error(s) occurred:\n'+errors);document.MM_returnValue=(errors=='');}
function externalLinks(){if(!document.getElementsByTagName)return;var anchors=document.getElementsByTagName("a");for(var i=0;i<anchors.length;i++){var anchor=anchors[i];if(anchor.getAttribute("href")&&anchor.getAttribute("rel")=="external")
anchor.target="_blank";}}
function MM_swapImgRestore(){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){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(){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];}}
function MM_openBrWindow(theURL,winName,features){window.open(theURL,winName,features);}
function getCity(){var p1=document.getElementById('PostCode').value;if(p1!='Select'){var formurl="join.php?pc="+p1;document.getElementById('JoinForm').action=formurl;document.getElementById('JoinForm').submit();}}
function getQuoteCity(){var p1=document.getElementById('pcFrom').value;var p2=document.getElementById('pcTo').value;document.getElementById('pc1').value=p1;document.getElementById('pc2').value=p2;saveCookie();document.getElementById('setpostcodes').submit();}
function getQuoteCityB(){var p1=document.getElementById('pcFrom').value;var p2=document.getElementById('pcTo').value;document.getElementById('pc1').value=p1;document.getElementById('pc2').value=p2;document.getElementById('setpostcodes').submit();}
function getCookie(c_name){if(document.cookie.length>0){c_start=document.cookie.indexOf(c_name+"=");if(c_start!=-1){c_start=c_start+c_name.length+1;c_end=document.cookie.indexOf(";",c_start);if(c_end==-1)c_end=document.cookie.length;return unescape(document.cookie.substring(c_start,c_end));}}
return"";}
function saveCookie(){var di=document.getElementById('distance').value;if(di==''){di=0;}
saveDistance(di);var md=document.getElementById('mdate').value;document.cookie="mdate="+md;var st=document.getElementById('storage').value;if(st==''){st=0;}
document.cookie="stor="+st;var vo=document.getElementById('volume').value;if(vo>0){saveVolume(vo);}
var cn=document.getElementById('contact_name').value;document.cookie="nam="+escape(cn);var em=document.getElementById('contact_email').value;document.cookie="em="+em;var ph=document.getElementById('contact_phone').value;document.cookie="ph="+ph;var ex=document.getElementById('extras').value;document.cookie="ex="+escape(ex);}
function restoreCookie(){var md=getCookie('mdate');if(md.length>0){document.getElementById('mdate').value=md;}
var n=getCookie('nam');if(n.length>0){document.getElementById('contact_name').value=unescape(n);}
var e=getCookie('em');if(e.length>0){document.getElementById('contact_email').value=e;}
var p=getCookie('ph');if(p.length>0){document.getElementById('contact_phone').value=p;}
var e=getCookie('ex');if(e.length>0){document.getElementById('extras').value=unescape(e);}
if(getPageName()=='removal-quote.php'){var dis=getCookie('dis');if(dis>0){document.getElementById('distance').value=dis;}
var st=getCookie('stor');if(st>0){document.getElementById('storage').value=st;}
var v=getCookie('vo');if(v>0){document.getElementById('volume').value=v;}}}
function saveDistance(d){document.cookie="dis="+d;}
function saveVolume(v){document.cookie="vo="+v;}
function delCookie(){var new_date=new Date();new_date=new_date.toGMTString();var thecookie=document.cookie.split(";");for(var i=0;i<thecookie.length;i++){document.cookie=thecookie[i]+"; expires ="+new_date;}}
function clearQuoteCookie(){delCookie();document.getElementById('reset-quote-form').submit();}
var help1='<strong>Postcodes:</strong><br />To find your postcode faster, open the list and quickly type in your postcode.<br /><br /><strong>Town/City:</strong><br />These are set automatically using your postcodes.<br /><br /><strong>Distance:</strong><br />An estimate of the distance is calculated automatically using the postcodes.<br />To get an accurate distance, use our distance calculator, this uses Google Maps to get an accurate road distance to your destination.';var help2='<strong>Moving Date:<br /></strong>Click on the date to open up the date picker, then select your anticipated moving date from the calendar.<br /><br /><strong>Storage:</strong><br />Enter 0 if you do not require storage.<br /><br /><strong>Volume:</strong><br />Please use our volume calculator to get a rough estimate of the volume.';var help3='<strong>Contact Details:<br /></strong>Please enter all the contact details.<br />You must use a valid email address to receive quotes.<br /><br /><strong>Other Info:</strong> (optional)<br />Please supply any information that you think may be useful to the removals companies.';var help4='<strong>Postcodes:</strong><br />To find your postcode faster, open the list and quickly type in your postcode.<br /><br /><strong>Town/City:</strong><br />These are set automatically using your postcodes.<br /><br /><strong>Addresses:</strong><br />Please enter both addresses and include floor numbers if applicable.';var help5='<strong>Moving Date:<br /></strong>Click on the date to open up the date picker, then select your anticipated moving date from the calendar.<br /><br /><strong>Personnel &amp; floorspace area:</strong><br />If you are unsure of these values please leave these boxes blank.';window.document.OpenInfoBox=null;function infoBox(divID,itext,ititle){var lastOpened=window.document.OpenInfoBox;if(window.document.OpenInfoBox!=null){closeInfo(window.document.OpenInfoBox);}
if(lastOpened!=divID){if(divID=='help1'){itext=help1;}
if(divID=='help2'){itext=help2;}
if(divID=='help3'){itext=help3;}
if(divID=='help4'){itext=help4;}
if(divID=='help5'){itext=help5;}
obj=document.getElementById(divID);obj.style.visibility="visible";txt='<div id="infowrapper"><div class="header"><a href="javascript:;" onmouseover="closeInfo(\''+divID+'\')"><img src="images/infoClose.png" /></a><span style="margin-left:2px">'+ititle+'</span></div><div id="infobox"><p>'+itext+'</p></div><div class="infofooter"></div></div>';obj.innerHTML=txt;window.document.OpenInfoBox=divID;}}
function closeInfo(idiv){window.document.OpenInfoBox=null;document.getElementById(idiv).style.visibility="hidden";}
function swapimg(imgid,newimage){document.getElementById(imgid).src='images/'+newimage;}
function volumePress(vol,hsize,fsize,garage,garden){if(vol>0){window.opener.document.getElementById('volume').value=vol;window.opener.document.getElementById('moveSize').value=hsize;window.opener.document.getElementById('furnished').value=fsize;window.opener.document.getElementById('garageItems').value=garage;window.opener.document.getElementById('gardenItems').value=garden;saveVolume(vol);window.close()}}
function checkHomeQuotesForm(){var errors='';var dist=document.getElementById('distance').value;var stor=document.getElementById('storage').value;var vol=document.getElementById('volume').value;var c_name=document.getElementById('contact_name').value;var c_email=document.getElementById('contact_email').value;var c_phone=document.getElementById('contact_phone').value;if(stor==''){stor=0;document.getElementById('storage').value=0;}
if(dist==''){errors+='- Distance\n';}
if(vol==''){errors+='- Volume\n';}
if(c_name==''){errors+='- Contact Name\n';}
if(c_email==''){errors+='- Contact Email Address\n';}
if(c_phone==''){errors+='- Contact Phone Number\n';}
if(errors==''){document.getElementById('quote').action='quoteme.php';document.getElementById('quote').submit();}else{window.alert('The following fields are required:\n'+errors);}}
function checkBusinessForm(){var errors='';var c_name=document.getElementById('contact_name').value;var comp_name=document.getElementById('company_name').value;var c_email=document.getElementById('contact_email').value;var c_phone=document.getElementById('contact_phone').value;var personnel=document.getElementById('personnel').value;var floor_space=document.getElementById('floor_space').value;var address1=document.getElementById('address1').value;var address2=document.getElementById('address2').value;if(address1.length<5){errors+='- Current address\n';}
if(address2.length<5){errors+='- Destination address\n';}
if(c_name==''){errors+='- Contact Name\n';}
if(comp_name==''){errors+='- Company Name\n';}
if(c_email==''){errors+='- Contact Email Address\n';}
if(c_phone==''){errors+='- Contact Phone Number\n';}
if(errors==''){document.getElementById('quote').action='quoteme-business.php';document.getElementById('quote').submit();}else{window.alert('The following fields are required:\n'+errors);}}
function checkAreaForm(){var errors='';var area1=document.getElementById('area1').value;var area2=document.getElementById('area2').value;var movetype1=parseInt(document.getElementById('movetype1').value);var movetype2=parseInt(document.getElementById('movetype2').value);if(movetype1+movetype2!=1){errors='- Please select if you require quotes for a domestic or business move.\n';}
if(area1!='--'&&area2!='--'&&errors==''){if(movetype1==1){document.getElementById('qmarea').action='removal-quote.php';}
if(movetype2==1){document.getElementById('qmarea').action='removal-quote-business.php';}
document.getElementById('qmarea').submit();}else{if(area1=='--'||area2=='--'){errors+='- Please enter both postcode regions.';}
window.alert(errors);}}
function areacheckbox(obj){document.getElementById('movetype1').checked=false;document.getElementById('movetype2').checked=false;document.getElementById('movetype1').value="0";document.getElementById('movetype2').value="0";obj.checked=true;obj.value="1";areaFormbg();}
function areaFormbg(){formbg=new Image();var c=document.getElementById('movetype2').value;if(c=="1"){document.getElementById('gatewayForm').style.background="white url(http://www.quotemeremovals.co.uk/images/areaform/Gateway_business.jpg) no-repeat";formbg.src="http://www.quotemeremovals.co.uk/images/areaform/Gateway_home.jpg";document.getElementById('quoteTitle').innerHTML="Business Removal Quotes";}else{document.getElementById('gatewayForm').style.background="white url(http://www.quotemeremovals.co.uk/images/areaform/Gateway_home.jpg) no-repeat";formbg.src="http://www.quotemeremovals.co.uk/images/areaform/Gateway_business.jpg";document.getElementById('quoteTitle').innerHTML="Home Removal Quotes";}}
function pcToUpper(id){var st=id.value;var result=st.toUpperCase();id.value=result;}
function pcToLower(id){var st=id.value;var result=st.toLowerCase();id.value=result;}
function fixNumber(n){var num=n.value;var str=num.replace(',','');var val=parseInt(str);if(!isNaN(val)){n.value=val;}}
function writeAreaOptions(id){document.write('<select name="'+id+'" id="'+id+'"><option value="--">--</option><option value="AB">AB</option><option value="AL">AL</option><option value="B">B</option><option value="BA">BA</option><option value="BB">BB</option><option value="BD">BD</option><option value="BH">BH</option><option value="BL">BL</option><option value="BN">BN</option><option value="BR">BR</option><option value="BS">BS</option><option value="BT">BT</option><option value="CA">CA</option><option value="CB">CB</option><option value="CF">CF</option><option value="CH">CH</option><option value="CM">CM</option><option value="CO">CO</option><option value="CR">CR</option><option value="CT">CT</option><option value="CV">CV</option><option value="CW">CW</option><option value="DA">DA</option><option value="DD">DD</option><option value="DE">DE</option><option value="DG">DG</option><option value="DH">DH</option><option value="DL">DL</option><option value="DN">DN</option><option value="DT">DT</option><option value="DY">DY</option><option value="E">E</option><option value="EC">EC</option><option value="EH">EH</option><option value="EN">EN</option><option value="EX">EX</option><option value="FK">FK</option><option value="FY">FY</option><option value="G">G</option><option value="GL">GL</option><option value="GU">GU</option><option value="HA">HA</option><option value="HD">HD</option><option value="HG">HG</option><option value="HP">HP</option><option value="HR">HR</option><option value="HS">HS</option><option value="HU">HU</option><option value="HX">HX</option><option value="IG">IG</option><option value="IP">IP</option><option value="IV">IV</option><option value="KA">KA</option><option value="KT">KT</option><option value="KW">KW</option><option value="KY">KY</option><option value="L">L</option><option value="LA">LA</option><option value="LD">LD</option><option value="LE">LE</option><option value="LL">LL</option><option value="LN">LN</option><option value="LS">LS</option><option value="LU">LU</option><option value="M">M</option><option value="ME">ME</option><option value="MK">MK</option><option value="ML">ML</option><option value="N">N</option><option value="NE">NE</option><option value="NG">NG</option><option value="NN">NN</option><option value="NP">NP</option><option value="NR">NR</option><option value="NW">NW</option><option value="OL">OL</option><option value="OX">OX</option><option value="PA">PA</option><option value="PE">PE</option><option value="PH">PH</option><option value="PL">PL</option><option value="PO">PO</option><option value="PR">PR</option><option value="RG">RG</option><option value="RH">RH</option><option value="RM">RM</option><option value="S">S</option><option value="SA">SA</option><option value="SE">SE</option><option value="SG">SG</option><option value="SK">SK</option><option value="SL">SL</option><option value="SM">SM</option><option value="SN">SN</option><option value="SO">SO</option><option value="SP">SP</option><option value="SR">SR</option><option value="SS">SS</option><option value="ST">ST</option><option value="SW">SW</option><option value="SY">SY</option><option value="TA">TA</option><option value="TD">TD</option><option value="TF">TF</option><option value="TN">TN</option><option value="TQ">TQ</option><option value="TR">TR</option><option value="TS">TS</option><option value="TW">TW</option><option value="UB">UB</option><option value="W">W</option><option value="WA">WA</option><option value="WC">WC</option><option value="WD">WD</option><option value="WF">WF</option><option value="WN">WN</option><option value="WR">WR</option><option value="WS">WS</option><option value="WV">WV</option><option value="YO">YO</option><option value="ZE">ZE</option></select>');}
function getQuote(type,pcarea){var act;if(type=='business'){act='removal-quote-business.php';}else{act='removal-quote.php';}
document.getElementById('getQuote').action=act;document.getElementById('setpc').value=pcarea;document.getElementById('getQuote').submit();}
function convertCheck(id){document.getElementById('clicked').value=id;document.getElementById('convert').action='conversion-tools.php';document.getElementById('convert').submit();}
function statusAlert(status){var alertstring='Your account is currently '+status.toUpperCase()+'.\n';if(status=='Inactive'){alertstring+='Please check your settings.';}
if(status=='Suspended'){alertstring+='Please contact us or check your billing page.';}
if(status=='Closed'){alertstring+='Please contact us.';}
window.alert(alertstring);}
function saveIinvitesForm(id){var value=document.getElementById('status'+id).value;document.getElementById('formvalue').value=value;document.getElementById('formid').value=id;document.getElementById('invited').submit();}

