var images=new Array();function preloadImages(){for(i=0;i<=4;i++){images[i]=new Image;images[i].src='/images/home/'+eval(i+1)+'.jpg';}}
function swapImage(obj,index){document.getElementById(obj).src=images[index].src;}
function setCurrency(Currency,ReturnPage)
{var URL;URL='/SetCurrency.aspx?Currency='+Currency+'&'+ReturnPage;alert('This will change the display currency to '+Currency+', to change your delivery country please select your country from the country selector in your shopping basket and to view ex VAT prices click the link at the bottom of product pages.  You can permenantly change these settings by logging into your account and setting them there.');Res=window.location=URL;}
function openisKube(URL)
{popupwin=window.open(URL,'','width=826,height=600,toolbar=1,directories=0,menubar=1,scrollbars=1,location=0,copyhistory=0')}
function Mod10(ccno){vlengthgood=0;ccsum=0;cclen=ccno.length;if(cclen<13)
{return false}
else
{for(i=1;i<cclen;i++)
{ccdig=parseInt(ccno.charAt(cclen-(i+1)));if(i%2==1)
{ccdig*=2;if(ccdig.toString().length==2)
{ccdig=(parseInt(ccdig.toString().charAt(0))+parseInt(ccdig.toString().charAt(1)));}}
ccsum+=ccdig;}
ccsum+=parseInt(ccno.charAt(cclen-1));if(ccsum%10==0)
{cc_type_id=0;if(ccno.match(/^4/))
{cc_type_id=1;if(cclen==13||cclen==16){vlengthgood=1;}else{vlengthgood=0;}}
if(ccno.match(/^50|^56|^57|^58|^6/))
{cc_type_id=0;vlengthgood=1;}
if(ccno.match(/^51|^52|^53|^54|^55/))
{cc_type_id=2;if(cclen==16){vlengthgood=1;}else{vlengthgood=0;}}
if(ccno.match(/^413733|^413734|^413735|^413736|^413737|^4462|^453978|^453979|^454313|^454313|^454432|^454433|^454434|^454435|^454742|^456725|^456726|^456727|^456728|^456729|^45673|^456740|^456741|^456742|^456743|^456744|^456745|^46583|^46584|^46585|^46586|^46587|^484409|^484410|^49096|^49097|^492181|^492182|^498824/))
{cc_type_id=4;if(cclen==16){vlengthgood=1;}else{vlengthgood=0;}}
if(ccno.match(/^450875|^484406|^484407|^484408|^484411|^484412|^484413|^484414|^484415|^484416|^484417|^484418|^484419|^48442|^48443|^48444|^484450|^484451|^484452|^484453|^484454|^484455|^49173|^49174|^49175|^491880/))
{cc_type_id=5;if(cclen==16){vlengthgood=1;}else{vlengthgood=0;}}
if(ccno.match(/^405501|^405502|^405503|^405504|^405550|^405551|^405552|^405553|^405554|^415928|^424604|^424604|^427533|^4288|^443085|^4484|^4485|^4486|^4715|^4716|^4804/))
{cc_type_id=1;if(cclen==16){vlengthgood=1;}else{vlengthgood=0;}}
if(ccno.match(/^490300|^490301|^49031|^49032|^490330|^490331|^490332|^490333|^490334|^49034|^49035|^49036|^49037|^49038|^49039|^49040|^490419|^490451|^490459|^490467|^490475|^490476|^490477|^490478|^4905|^491103|^491104|^491105|^491106|^491107|^491108|^491109|^49111|^49112|^49113|^49114|^49115|^49116|^491170|^491171|^491172|^491173|^491183|^491184|^491185|^491186|^491187|^491188|^491189|^49119|^4928|^4987/))
{cc_type_id=1;if(cclen==16){vlengthgood=1;}else{vlengthgood=0;}}
if(ccno.match(/^63345|^63346|^63347|^63348|^63349|^6767/))
{cc_type_id=5;if(cclen==16||cclen==18||cclen==19){vlengthgood=1;}else{vlengthgood=0;}}
if(ccno.match(/^490302|^490303|^490304|^490305|^490306|^490307|^490308|^490309|^490335|^490336|^490337|^490338|^490339|^491101|^491102|^491174|^491175|^491176|^491177|^491178|^491179|^491180|^491181|^491182|^4936|^564182|^63330|^63331|^63332|^63333|^63334|^6759/))
{cc_type_id=3;if(cclen==16||cclen==18||cclen==19){vlengthgood=1;}else{vlengthgood=0;}}
if(vlengthgood==1)
{return true;}
else
{return false}}
else
{return false}}}
function IsNumeric(sText){var ValidChars="0123456789";var IsNumber=true;var Char;for(i=0;i<sText.length&&IsNumber==true;i++)
{Char=sText.charAt(i);if(ValidChars.indexOf(Char)==-1)
{IsNumber=false;}}
return IsNumber;}
function emailCheck(emailStr)
{var checkTLD=1;var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;var emailPat=/^(.+)@(.+)$/;var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";var validChars="\[^\\s"+specialChars+"\]";var quotedUser="(\"[^\"]*\")";var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;var atom=validChars+'+';var word="("+atom+"|"+quotedUser+")";var userPat=new RegExp("^"+word+"(\\."+word+")*$");var domainPat=new RegExp("^"+atom+"(\\."+atom+")*$");var matchArray=emailStr.match(emailPat);if(matchArray==null){return false;}
var user=matchArray[1];var domain=matchArray[2];for(i=0;i<user.length;i++){if(user.charCodeAt(i)>127){return false;}}
for(i=0;i<domain.length;i++){if(domain.charCodeAt(i)>127){return false;}}
if(user.match(userPat)==null){return false;}
var IPArray=domain.match(ipDomainPat);if(IPArray!=null){for(var i=1;i<=4;i++){if(IPArray[i]>255){return false;}}
return true;}
var atomPat=new RegExp("^"+atom+"$");var domArr=domain.split(".");var len=domArr.length;for(i=0;i<len;i++){if(domArr[i].search(atomPat)==-1){return false;}}
if(checkTLD&&domArr[domArr.length-1].length!=2&&domArr[domArr.length-1].search(knownDomsPat)==-1){return false;}
if(len<2){return false;}
return true;}
function showlink(url)
{opener.location.href=url;opener.focus();window.close();}
function showPanel(panel)
{if(document.getElementById(panel).style.display!='block'){document.getElementById(panel).style.display='block'};}
function hidePanel(panel)
{if(document.getElementById(panel).style.display!='none'){document.getElementById(panel).style.display='none'};}
function showStatus(Msg)
{window.status=Msg;return true;}
function showHelp(Page)
{popupwin=window.open('/Help.aspx?Page='+Page,'','width=600,height=600,toolbar=0,directories=0,menubar=0,scrollbars=1,location=0,copyhistory=0')}
function openPopup(URL,width,height){if(height==undefined){height=600};if(width==undefined){width=600};popupwin=window.open(URL,'','width='+width+',height='+height+',toolbar=0,directories=0,menubar=0,scrollbars=1,location=0,copyhistory=0')}
function InStr(strSearch,charSearchFor)
{for(i=0;i<strSearch.length;i++)
{if(charSearchFor==Mid(strSearch,i,1))
{return i;}}
return-1;}
function Mid(str,start,len)
{if(start<0||len<0)return"";var iEnd,iLen=String(str).length;if(start+len>iLen)
iEnd=iLen;else
iEnd=start+len;return String(str).substring(start,iEnd);}
var BROWSER_IE4="IE4"
var BROWSER_NN4="NN4"
var BROWSER_IE="IE"
var BROWSER_VER;BROWSER_VER=checkBrowser()
function checkBrowser(){var BROWSER_VER;if(document.all&&!document.getElementById)
BROWSER_VER=BROWSER_IE4
else if(document.layers)
BROWSER_VER=BROWSER_NN4
else if(document.getElementById)
BROWSER_VER=BROWSER_IE
else
BROWSER_VER=BROWSER_IE
return(BROWSER_VER)}
var previousMenuItem=""
function showPopupDiv(DivToShow,position,leftAdj,topAdj){if(DivToShow!=previousMenuItem&&previousMenuItem!=""){hideDisplayDiv(previousMenuItem)}
var lyr=getMyHTMLElement(DivToShow);lyr.style.left=(getLeft(position)+leftAdj)+"px";lyr.style.top=(getTop(position)+topAdj)+"px";showDisplayDiv(DivToShow)
previousMenuItem=DivToShow}
function thinkAboutHidingDiv(DivToHide){try
{if(DivToHide!="")thinkAboutTimeOut=setTimeout("hideDisplayDiv('"+DivToHide+"')",2000);}
catch(e)
{}}
function forgetAboutHidingDiv(){try
{if(typeof thinkAboutTimeOut!='undefined'){clearTimeout(thinkAboutTimeOut)}}
catch(e)
{}}
function showDisplayDiv(DivToShow){var lyr=getMyHTMLElement(DivToShow);lyr.style.display="";}
function hideDisplayDiv(DivToHide){var lyr=getMyHTMLElement(DivToHide);lyr.style.display="none";}
function getTop(item){var top=0;var mywhere;mywhere=getMyHTMLElement(item);while(mywhere.tagName.toLowerCase()!='body')
{top+=mywhere.offsetTop;mywhere=mywhere.offsetParent;}
return top;}
function getLeft(item){var left=0;var mywhere;mywhere=getMyHTMLElement(item);while(mywhere.tagName.toLowerCase()!='body')
{left+=mywhere.offsetLeft;mywhere=mywhere.offsetParent;}
return left;}
function getMyHTMLElement(sid)
{var oelement;if(BROWSER_VER==BROWSER_IE4)
oelement=document.all[sid]
else if(BROWSER_VER==BROWSER_NN4)
oelement=document.layers[sid]
else if(BROWSER_VER==BROWSER_IE)
oelement=document.getElementById(sid)
else
oelement=document.getElementById(sid)
return(oelement);}
function LTrim(str)
{var whitespace=new String(" \t\n\r");var s=new String(str);if(whitespace.indexOf(s.charAt(0))!=-1){var j=0,i=s.length;while(j<i&&whitespace.indexOf(s.charAt(j))!=-1)
j++;s=s.substring(j,i);}
return s;}
function RTrim(str)
{var whitespace=new String(" \t\n\r");var s=new String(str);if(whitespace.indexOf(s.charAt(s.length-1))!=-1){var i=s.length-1;while(i>=0&&whitespace.indexOf(s.charAt(i))!=-1)
i--;s=s.substring(0,i+1);}
return s;}
function Trim(str)
{return RTrim(LTrim(str));}
function replaceString(aSearch,aFind,aReplace)
{result=aSearch;if(result!=null&&result.length>0)
{a=0;b=0;while(true)
{a=result.indexOf(aFind,b);if(a!=-1)
{result=result.substring(0,a)+aReplace+result.substring(a+aFind.length);b=a+aReplace.length;}
else
break;}}
return result;}
function stripNonUKChars(control)
{var s=control.value;var rExps=[/[\xC0-\xC3]/g,/[\xE0-\xE3]/g,/[\xC8-\xCA]/g,/[\xE8-\xEB]/g,/[\xCC-\xCE]/g,/[\xEC-\xEE]/g,/[\xD2-\xD5]/g,/[\xF2-\xF5]/g,/[\xD9-\xDB]/g,/[\xF9-\xFB]/g,/[\xC4]/g,/[\xE4]/g,/[\xEb]/g,/[\xEb]/g,/[\xCf]/g,/[\xEf]/g,/[\xD6]/g,/[\xF6]/g,/[\xD8]/g,/[\xF8]/g,/[\xDC]/g,/[\xFC]/g,/[\xC7]/g,/[\xF7]/g,/[\xD1]/g,/[\xF1]/g,/[\xDF]/g,/[\xC5]/g,/[\xE5]/g];var repChar=['A','a','E','e','I','i','O','o','U','u','Ae','ae','Ee','ee','Ie','ie','Oe','oe','Oe','oe','Ue','ue','C','c','N','n','ss','Aa','aa'];for(var i=0;i<rExps.length;i++)
s=s.replace(rExps[i],repChar[i]);control.value=s;return false}
function grayOut(vis,options){var options=options||{};var zindex=options.zindex||50;var opacity=options.opacity||70;var opaque=(opacity/100);var bgcolor=options.bgcolor||'#000000';var dark=document.getElementById('darkenScreenObject');if(!dark){var tbody=document.getElementsByTagName("body")[0];var tnode=document.createElement('div');tnode.style.position='absolute';tnode.style.top='0px';tnode.style.left='0px';tnode.style.overflow='hidden';tnode.style.display='none';tnode.id='darkenScreenObject';tbody.appendChild(tnode);dark=document.getElementById('darkenScreenObject');}
if(vis){if(document.body&&(document.body.scrollWidth||document.body.scrollHeight)){var pageWidth=document.body.scrollWidth+'px';var pageHeight=document.body.scrollHeight+'px';}else if(document.body.offsetWidth){var pageWidth=document.body.offsetWidth+'px';var pageHeight=document.body.offsetHeight+'px';}else{var pageWidth='100%';var pageHeight='100%';}
dark.style.opacity=opaque;dark.style.MozOpacity=opaque;dark.style.filter='alpha(opacity='+opacity+')';dark.style.zIndex=zindex;dark.style.backgroundColor=bgcolor;dark.style.width=pageWidth;dark.style.height=pageHeight;dark.style.display='block';}else{dark.style.display='none';}}
function addPopup(whichone){var tbody=document.getElementsByTagName("body")[0];var tnode=document.createElement('div');tnode.style.position='absolute';tnode.style.width='580px';tnode.style.height='200px';tnode.style.display='none';tnode.style.zIndex=51;tnode.id='divPopup';tbody.appendChild(tnode);if(typeof(window.innerWidth)=='number'){var myWidth=window.innerWidth;var myHeight=window.innerHeight;}else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){var myWidth=document.documentElement.clientWidth;var myHeight=document.documentElement.clientHeight;}else if(document.body&&(document.body.clientWidth||document.body.clientHeight)){var myWidth=document.body.clientWidth;var myHeight=document.body.clientHeight;}
tnode.style.top=(myHeight-200)/2+'px';tnode.style.left=(myWidth-580)/2+'px';var myPopup=document.getElementById('divPopup');switch(whichone)
{case'Basket':myPopup.innerHTML='<img src="/images/product/shoppingPopup.jpg" alt="" style="position: relative" /><input type="Button" class="Button" style="position: absolute; left: 160px; top: 115px" value="CONTINUE SHOPPING" onclick="closePopup(\'divPopup\')" /><input type="Button" class="Button" style="position: absolute; left: 360px; top: 115px" value="VIEW MY BAG" onclick="window.location.href=\'/ShoppingBag.aspx\'" />';break;case'Wishlist':myPopup.innerHTML='<img src="/images/product/wishlistPopup.jpg" alt="" style="position: relative" /><input type="Button" class="Button" style="position: absolute; left: 160px; top: 115px" value="CONTINUE SHOPPING" onclick="closePopup(\'divPopup\')" /><input type="Button" class="Button" style="position: absolute; left: 360px; top: 115px" value="VIEW MY WISH LIST" onclick="window.location.href=\'/Wishlist.aspx\'" />';break;case'Maillist':myPopup.innerHTML='<img src="/images/maillistPopup.jpg" alt="" style="position: relative" /><input type="Button" class="Button" style="position: absolute; left: 245px; top: 115px" value="CLOSE" onclick="closePopup(\'divPopup\')" />';break;}
myPopup.style.display='block';}
function closePopup(div){grayOut(false);document.getElementById(div).style.display='none';}
function urlencode(str){return escape(str).replace(/\+/g,'%2B').replace(/%20/g,'+').replace(/\*/g,'%2A').replace(/\//g,'%2F').replace(/@/g,'%40');}
function addFeedback(){var tbody=document.getElementsByTagName("body")[0];var tnode=document.createElement('div');tnode.id='divFeedback';tbody.appendChild(tnode);var myFeedback=document.getElementById('divFeedback');myFeedback.innerHTML='<img onclick="openFeedback(\'/Feedback.aspx?URL='+urlencode(document.location)+'\')" src="/images/Feedback.gif" alt="Have your say" title="Have your say" />';}
function openFeedback(URL){var Left=(screen.width-470)/2;var Top=(screen.height-550)/2;popupwin=window.open(URL,'','width=470,height=600,toolbar=0,directories=0,menubar=0,scrollbars=1,location=0,copyhistory=0,top='+Top+',left='+Left)}