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)
{document.getElementById(panel).style.display='block';}
function hidePanel(panel)
{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){var Left=(screen.width-600)/2;var Top=(screen.height-600)/2;var popupwin=window.open(URL,'','width=600,height=600,toolbar=0,directories=0,menubar=0,scrollbars=1,location=0,copyhistory=0,top='+Top+',left='+Left)}
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+"')",1000);}
catch(e)
{}}
function forgetAboutHidingDiv(){try
{if(typeof thinkAboutTimeOut!='undefined'){clearTimeout(thinkAboutTimeOut)}}
catch(e)
{}}
function showDisplayDiv(DivToShow){try
{if(typeof thinkAboutTimeOut!='undefined'){clearTimeout(thinkAboutTimeOut)}}
catch(e)
{}
var lyr=getMyHTMLElement(DivToShow);lyr.style.display="block";}
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}
var isIE=(navigator.appVersion.indexOf("MSIE")!=-1)?true:false;var isWin=(navigator.appVersion.toLowerCase().indexOf("win")!=-1)?true:false;var isOpera=(navigator.userAgent.indexOf("Opera")!=-1)?true:false;function ControlVersion()
{var version;var axo;var e;try
{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");version=axo.GetVariable("$version");}
catch(e)
{}
if(!version)
{try
{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");version="WIN 6,0,21,0";axo.AllowScriptAccess="always";version=axo.GetVariable("$version");}
catch(e)
{}}
if(!version)
{try
{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");version=axo.GetVariable("$version");}
catch(e)
{}}
if(!version)
{try
{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");version="WIN 3,0,18,0";}
catch(e)
{}}
if(!version)
{try
{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");version="WIN 2,0,0,11";}
catch(e)
{version=-1;}}
return version;}
function GetSwfVer()
{var flashVer=-1;if(navigator.plugins!=null&&navigator.plugins.length>0)
{if(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"])
{var swVer2=navigator.plugins["Shockwave Flash 2.0"]?" 2.0":"";var flashDescription=navigator.plugins["Shockwave Flash"+swVer2].description;var descArray=flashDescription.split(" ");var tempArrayMajor=descArray[2].split(".");var versionMajor=tempArrayMajor[0];var versionMinor=tempArrayMajor[1];if(descArray[3]!="")
{tempArrayMinor=descArray[3].split("r");}
else
{tempArrayMinor=descArray[4].split("r");}
var versionRevision=tempArrayMinor[1]>0?tempArrayMinor[1]:0;var flashVer=versionMajor+"."+versionMinor+"."+versionRevision;}}
else if(navigator.userAgent.toLowerCase().indexOf("webtv/2.6")!=-1)flashVer=4;else if(navigator.userAgent.toLowerCase().indexOf("webtv/2.5")!=-1)flashVer=3;else if(navigator.userAgent.toLowerCase().indexOf("webtv")!=-1)flashVer=2;else if(isIE&&isWin&&!isOpera)
{flashVer=ControlVersion();}
return flashVer;}
function DetectFlashVer(reqMajorVer,reqMinorVer,reqRevision)
{versionStr=GetSwfVer();if(versionStr==-1)
{return false;}
else if(versionStr!=0)
{if(isIE&&isWin&&!isOpera)
{tempArray=versionStr.split(" ");tempString=tempArray[1];versionArray=tempString.split(",");}
else
{versionArray=versionStr.split(".");}
var versionMajor=versionArray[0];var versionMinor=versionArray[1];var versionRevision=versionArray[2];if(versionMajor>parseFloat(reqMajorVer))
{return true;}
else if(versionMajor==parseFloat(reqMajorVer))
{if(versionMinor>parseFloat(reqMinorVer))
{return true;}
else if(versionMinor==parseFloat(reqMinorVer))
{if(versionRevision>=parseFloat(reqRevision))
{return true;}}}
return false;}}
function sleep(milliseconds){var start=new Date().getTime();for(var i=0;i<1e7;i++){if((new Date().getTime()-start)>milliseconds){break;}}}
function urlencode(str){return escape(str).replace(/\+/g,'%2B').replace(/%20/g,'+').replace(/\*/g,'%2A').replace(/\//g,'%2F').replace(/@/g,'%40');}
var canScroll=0;function BrandScroller(ulId,speed,pause,pauseafter){if(canScroll==1){return};canScroll=1;this.container=document.getElementById(ulId);this.container.Scroller=this;this.speed=speed;this.count=0;this.pause=pause;this.pauseafter=pauseafter;this.scroll=function(){var c=this.container.firstChild;var first=null;var blnPause=false;while(c){if(c.tagName=='LI'){first=c;break;}
c=c.nextSibling;}
var px=0;var nodeSize=0;nodeSize=first.clientWidth;if(first.style.marginLeft!=''){px=parseInt(first.style.marginLeft);}
first.style.marginLeft=(px-2)+'px';if(parseInt(first.style.marginLeft)<=-(nodeSize)){first.style.marginLeft='0px';this.container.removeChild(first);this.container.appendChild(first);this.count++;if(this.count==this.pauseafter)
{var blnPause=true;this.count=0;}}
if(!blnPause)
{if(canScroll==1){setTimeout('document.getElementById(\''+this.container.id+'\').Scroller.scroll()',this.speed);}}
else
{if(canScroll==1){setTimeout('document.getElementById(\''+this.container.id+'\').Scroller.scroll()',(this.speed+this.pause));}}}
if(canScroll==1){setTimeout('document.getElementById(\''+ulId+'\').Scroller.scroll()',this.speed);}}
function stopScroll(){canScroll=0;clearTimeout;}
function startScroll(ulId){if(canScroll==0){BrandScroller(ulId,20,0,0);}}
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';if(document.body.scrollHeight<200){pageHeight=self.innerHeight+window.pageYOffset+'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="ButtonLong" style="position: absolute; left: 160px; top: 115px;background-image: url(/images/buttonlong.jpg);backgroudn" value="Continue Shopping" onclick="closePopup(\'divPopup\')" /><input type="Button" class="ButtonLong" style="position: absolute; left: 360px; top: 115px;background-image: url(/images/buttonlong.jpg);" 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="ButtonLong" style="position: absolute; left: 160px; top: 115px;background-image: url(/images/buttonlong.jpg);" value="Continue Shopping" onclick="closePopup(\'divPopup\')" /><input type="Button" class="ButtonLong" style="position: absolute; left: 360px; top: 115px;background-image: url(/images/buttonlong.jpg);" value="View My Wishlist" onclick="window.location.href=\'/Wishlist.aspx\'" />';break;case'Maillist':myPopup.innerHTML='<img src="/images/maillistPopup.jpg" alt="" style="position: relative" /><input type="Button" class="ButtonLong" style="position: absolute; left: 245px; top: 115px;background-image: url(/images/buttonlong.jpg);" value="Close" onclick="closePopup(\'divPopup\')" />';break;case'BasketNotValid':myPopup.innerHTML='<img src="/images/basketPopup.jpg" alt="" style="position: relative" /><input type="Button" class="ButtonLong" style="position: absolute; left: 160px; top: 115px;background-image: url(/images/buttonlong.jpg);" value="Continue Checkout" onclick="closePopup(\'divPopup\')" /><input type="Button" class="Button" style="position: absolute; left: 360px; top: 115px;background-image: url(/images/buttonlong.jpg);" value="View My Bag" onclick="window.location.href=\'/ShoppingBag.aspx\'" />';break;}
myPopup.style.display='block';}
function closePopup(div){grayOut(false);document.getElementById(div).style.display='none';}
function addFeedback(){var tbody=document.getElementsByTagName("body")[0];var tnode=document.createElement('div');tnode.id='divCS';tbody.appendChild(tnode);var myFeedback=document.getElementById('divCS');myFeedback.innerHTML='<img onclick="openFeedback(\'/CS.aspx?URL='+urlencode(document.location)+'\')" src="/images/Feedback.gif" width="35" height="102" alt="Have your say" title="Have your say" />';}
function addFacebook(){var tbody=document.getElementsByTagName("body")[0];var tnode=document.createElement('div');tnode.id='divFB';tbody.appendChild(tnode);var myFeedback=document.getElementById('divFB');myFeedback.innerHTML='<img onclick="window.open(\'http://www.facebook.com/group.php?gid=29826587649\')" src="/images/Facebook.gif" width="35" height="36" alt="Follow us on Facebook" title="Follow us on Facebook" />';}
function addTwitter(){var tbody=document.getElementsByTagName("body")[0];var tnode=document.createElement('div');tnode.id='divTwitter';tbody.appendChild(tnode);var myFeedback=document.getElementById('divTwitter');myFeedback.innerHTML='<img onclick="window.open(\'http://twitter.com/simplybeach\')"src="/images/Twitter.gif" width="35" height="36" alt="Follow us on Twitter" title="Follow us on Twitter" />';}
function addBlog(){var tbody=document.getElementsByTagName("body")[0];var tnode=document.createElement('div');tnode.id='divBlog';tbody.appendChild(tnode);var myFeedback=document.getElementById('divBlog');myFeedback.innerHTML='<img onclick="window.open(\'http://blog.simplybeach.com/\')"src="/images/Blog.gif" width="35" height="36" alt="Read our blog" title="Read our blog" />';}
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)}
function gID(obj){return document.getElementById(obj)}

