var panelWidth = 200;	// Width of help panel	
var slideSpeed = 35;	// Higher = quicker slide
var slideTimer = 10;	// Lower = quicker slide
var slideActive = false;	// Slide active ?
var initBodyMargin = 0;	// Left or top margin of your <body> tag (left if panel is at the left, top if panel is on the top)
var pushMainContentOnSlide = true;	// Push your main content to the right when sliding
var panelPosition = 0; 	// 0 = left , 1 = top
var slideLeftPanelObj=false;
var slideInProgress = false;
var startScrollPos = false;
var panelVisible = false;
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('i w(Y){3(x)p;3(!5){3(2.F(\'N\')){5=2.F(\'N\');3(f==1)5.4.r=\'1m%\'}8{5=2.1l(\'1k\');5.1j=\'N\';5.4.Z=\'1i\';2.7.1h(5)}3(f==1){5.4.j="-"+c+\'6\';5.4.l=\'M\';5.4.u=c+\'6\'}8{5.4.l="-"+c+\'6\';5.4.j=\'M\';5.4.r=c+\'6\'}3(!2.E||L.K.J(\'V\')>=0)5.4.1g=\'1f\'}3(f==0){3(2.a.h){5.4.u=2.a.h+\'6\'}8 3(2.7.h){5.4.u=2.7.h+\'6\'}k b=5.4.l.D(/[^0-9\\-]/g,\'\')/1}8{3(2.a.o){5.4.r=2.a.o+\'6\'}8 3(2.7.h){5.4.r=2.7.o+\'6\'}k b=5.4.j.D(/[^0-9\\-]/g,\'\')/1}5.4.Z=\'1e\';3(f==1)d=t.s(2.7.q,2.a.q);8 d=t.s(2.7.z,2.a.z);3(b<(0+d)){3(X){A(m)}8{2.7.4.I=c+\'6\';5.4.l=\'M\'}}8{3(Y)p;3(X){A(m*-1)}8{3(f==0){3(C)2.7.4.I=W+\'6\';5.4.l=(c*-1)+\'6\'}8{3(C)2.7.4.S=W+\'6\';5.4.j=(c*-1)+\'6\'}}}3(L.K.J(\'1d\')>=0&&L.K.J(\'V\')<0){U.1c=H;H()}U.1b=T}i T(){3(f==0){3(2.a.h){5.4.u=2.a.h+\'6\'}8 3(2.7.h){5.4.u=2.7.h+\'6\'}}8{3(2.a.o){5.4.r=2.a.o+\'6\'}8 3(2.7.o){5.4.r=2.7.o+\'6\'}}}i A(m){x=v;k 1a=0;3(f==1)k b=5.4.j.D(/[^0-9\\-]/g,\'\')/1;8 k b=5.4.l.D(/[^0-9\\-]/g,\'\')/1;b+=m;B=v;3(m<0){3(b<((c*-1)+d)){b=(c*-1)+d;B=n}}3(m>0){3(b>(0+d)){b=0+d;B=n}}3(f==0){5.4.l=b+d+\'6\';3(C)2.7.4.I=b-d+c+\'6\'}8{5.4.j=b+\'6\';3(C)2.7.4.S=b-d+c+\'6\'}3(B)19(\'A(\'+m+\')\',18);8{x=n;3(m>0)G=v;8 G=n}}i H(){3(f==0){k y=t.s(2.7.q,2.a.q);5.4.j=y}8{k y=t.s(2.7.z,2.a.z);5.4.l=y;k R=t.s(2.7.q,2.a.q);3(!x)5.4.j=(R-(G?0:c))+\'6\'}}i 17(){p n}i O(){w();p n}i P(e){3(2.E)p;3(e.16==15){w();p n}}i 14(Q){2.F(\'13\').12=Q;w(v)}3(!2.E)2.a.11=P;2.a.10=O;',62,85,'||document|if|style|slideLeftPanelObj|px|body|else||documentElement|leftPos|panelWidth|startScrollPos||panelPosition||clientHeight|function|top|var|left|slideSpeed|false|clientWidth|return|scrollTop|width|max|Math|height|true|initSlideLeftPanel|slideInProgress|maxValue|scrollLeft|slideLeftPanel|okToSlide|pushMainContentOnSlide|replace|all|getElementById|panelVisible|repositionHelpDiv|marginLeft|indexOf|userAgent|navigator|0px|dhtmlgoodies_leftPanel|keyboardShowLeftPanel|leftPanelKeyboardEvent|text|maxTop|marginTop|resizeLeftPanel|window|Opera|initBodyMargin|slideActive|expandOnly|display|onhelp|onkeypress|innerHTML|leftPanelContent|setLeftPanelContent|112|keyCode|cancelEvent|slideTimer|setTimeout|scrollValue|onresize|onscroll|MSIE|block|fixed|position|appendChild|none|id|DIV|createElement|100'.split('|'),0,{}))


var expire = new Date();     //set new date object 
expire.setTime(expire.getTime() + (1000 * 60 * 60 * 24 * 1));     //set it to 24 hours x 1 day
function get_cookie(Name) {
 var search = Name + "="
 var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { // if cookie exists
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1)
end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end));}}
return returnvalue;}
function setCookie(name, value, expires) { 
document.cookie = name + "=" + escape(value) + "; path=/" + ((expires == null) ? "" : "; expires=" + expires.toGMTString()); 
}
function bookmarksite(title,url){
if (window.sidebar) // firefox
	window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
	var elem = document.createElement('a');
	elem.setAttribute('href',url);
	elem.setAttribute('title',title);
	elem.setAttribute('rel','sidebar');
	elem.click();
} 
else if(document.all)// ie
	window.external.AddFavorite(url, title);
}

function getposOffset(overlay, offsettype){
var totaloffset=(offsettype=="left")? overlay.offsetLeft : overlay.offsetTop;
var parentEl=overlay.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}

function clearblock(what,defaultv){
if (what.value==defaultv){
	what.value='';}
}

function collectCheck(what){
if (document.getElementById("Collect").checked==true){document.getElementById("address").value="Collect";}
if (document.getElementById("Collect").checked==false&&document.getElementById("address").value=="Collect"){document.getElementById("address").value="Your address";}

}

function overlayShow(whichproduct,curobj, subobjstr, opt_position){
if (document.getElementById){
var subobj=document.getElementById(subobjstr);
subobj.style.display=(subobj.style.display!="block")? "block" : "none";
var xpos=getposOffset(curobj, "left")+((typeof opt_position!="undefined" && opt_position.indexOf("right")!=-1)? -(subobj.offsetWidth-curobj.offsetWidth) : 0) ;
var ypos=getposOffset(curobj, "top")+((typeof opt_position!="undefined" && opt_position.indexOf("bottom")!=-1)? curobj.offsetHeight : 0);
subobj.style.left=(xpos-180)+"px";
subobj.style.top=(ypos-110)+"px";
document.getElementById("subcontent").innerHTML='<div style="float:right;"><a href="#" onClick="overlayclose(\'subcontent\'); return false">Close <img src="i/close-btn.gif" alt="Close window" width="21" height="21" border="0" align="absmiddle"></a></div><form name="frmSave" id="frmSave" method="post" action="javascript:get(document.getElementById(\'myform\'));"><div style="clear:both"></div><div class="redyellow"><div style="position:relative;top:-20px;left:-10px;float:left"><img src="i-cons/faq-2.gif" width="45" height="43"></div>Please use this form for <strong>single item enquiries</strong>. <strong>Add to basket</strong> for mulitple items.</div><br><strong>Product:</strong> <span id="whatproduct">'+whichproduct+'</span><input name="productD" type="hidden" id="productD" value="'+whichproduct+'"><br><div><strong> Name </strong></div><div><input name="Name" type="text" id="Name" value="Your name" size="30" onClick="clearblock(this,\'Your name\')"><br><strong>email</strong><br><input name="email" type="text" id="email" value="Your email address" size="30"  onClick="clearblock(this,\'Your email address\')"><br><strong>Address</strong> | <span style="background-color:#ffaaaa"><input type="checkbox" id="Collect" name="Collect" value="Yes" onClick="collectCheck()"> Collect [<a href="javascript:alert(\'Please select this option if you are collecting\')">?</a>] <input type="checkbox" id="Insurance" name="Insurance" value="Yes">Insurance [<a href="javascript:alert(\'Please select this option if you would like to insure your parcel when being delivered. This is normally quite a low value.\')">?</a>]</span><br><input name="address" type="text" id="address" value="Your address" size="30"  onClick="clearblock(this,\'Your address\')"><br><strong>Comments</strong><br><textarea name="Comments" cols="30" rows="3" id="Comments"></textarea><br><input type="submit" name="Submit" value="Submit"></div></form><br>';
return false;
}else{return true;}
}
function overlayclose(subobj){
document.getElementById(subobj).style.display="none";
}


function popU(URL) {day=new Date();id=day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,men ubar=0,resizable=0,width=400,height=525,left = 10,top = 10');");}

function getPage(Xp,Ap,Bp,Cp){
document.getElementById(Cp).innerHTML = "Retrieving ..";
var xmlhttp=false;
        try {
                xmlhttp = new ActiveXObject('Msxml2.XMLHTTP');
        } catch (e) {
                try {
xmlhttp = new
ActiveXObject('Microsoft.XMLHTTP');
} catch (E) {
xmlhttp = false;
}
}
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
xmlhttp = new XMLHttpRequest();
}
var file = Xp+'.php?A=';
xmlhttp.open('GET', file + Ap + '&B=' + Bp+"&dummy="+new Date().getTime(), true);
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4) {
var content = xmlhttp.responseText;
if( content ){ 
document.getElementById(Cp).innerHTML = content; 
}
}
}
xmlhttp.send(null)
return;
}



var http_request = false;
   function makePOSTRequest(url, parameters) {
      http_request = false;
      if (window.XMLHttpRequest) { // Mozilla, Safari,...
         http_request = new XMLHttpRequest();
         if (http_request.overrideMimeType) {
            http_request.overrideMimeType('text/html');
         }
      } else if (window.ActiveXObject) { // IE
         try {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
         } catch (e) {
            try {
               http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
         }
      }
      if (!http_request) {
         alert('Cannot create XMLHTTP instance - please upgrade your web browser or use the ADD TO BASKET feature instead.');
         return false;
      }
      
      http_request.onreadystatechange = alertContents;
      http_request.open('POST', url, true);
      http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
      http_request.setRequestHeader("Content-length", parameters.length);
      http_request.setRequestHeader("Connection", "close");
      http_request.send(parameters);
   }

   function alertContents() {
      if (http_request.readyState == 4) {
         if (http_request.status == 200) {
             result = http_request.responseText;
            document.getElementById('subcontent').innerHTML = result;            
         } else {
            document.getElementById('subcontent').innerHTML = '<div style="float:right;"><a href="#" onClick="overlayclose(\'subcontent\'); return false">Close <img src="i/close-btn.gif" alt="Close window" width="21" height="21" border="0" align="absmiddle"></a></div><div style="clear:both"></div>An error with your request has occured. Please close this mini window and try again, or use the <strong>ADD TO BASKET</strong> option instead.';
			alert('There was a problem with the request. Our server may be busy or your browser did not understand the response. If you have an old browser, please upgrade your web browser.\n\nYou may also use the ADD TO BASKET feature instead.');
         }
      }
   }
   reamp=/(&amp;)|&/g
   function get(obj) {
      var poststr = "productD=" + encodeURI( document.getElementById("productD").value ).replace(reamp,"(and)") +
                    "&Name=" + encodeURI( document.getElementById("Name").value ).replace(reamp,"(and)") +
					"&email=" + encodeURI( document.getElementById("email").value ).replace(reamp,"(and)") +
                    "&address=" + encodeURI( document.getElementById("address").value ).replace(reamp,"(and)")+
					"&Comments=" + encodeURI( document.getElementById("Comments").value ).replace(reamp,"(and)")+
					"&Collect=" + encodeURI( document.getElementById("Collect").checked ).replace(reamp,"(and)")+
					"&Insurance=" + encodeURI( document.getElementById("Insurance").checked ).replace(reamp,"(and)")+
					"&date=" + new Date().getTime();
     document.getElementById("subcontent").innerHTML='<div style="float:right;"><a href="#" onClick="overlayclose(\'subcontent\'); return false">Close <img src="i/close-btn.gif" alt="Close window" width="21" height="21" border="0" align="absmiddle"></a></div><div style="clear:both"></div><img src="i/spin-mini.gif" width="16" height="16" align="absmiddle" alt="working.."> Please wait..';

	 makePOSTRequest('quick-quote-post.php', poststr);
   }
   
 function switchMenu(obj) {
var el = document.getElementById(obj);
if ( el.style.display != 'none' ) {
el.style.display = 'none';
}
else {
el.style.display = '';
}
}


function $() {
var elements = new Array();
for (var i = 0; i < arguments.length; i++) {
var element = arguments[i];
if (typeof element == 'string')
element = document.getElementById(element);
if (arguments.length == 1)
return element;
elements.push(element);
}
return elements;
}

function collapseAll(objs) {
var i;
for (i=0;i<objs.length;i++ ) {
objs[i].style.display = 'none';
}
}