function basketAlert(){if(strBasketAlert!=''){alert(strBasketAlert);}}
function DisplayBasketSummary(){document.getElementById("TblHeadAccountSummary").style.display="none";document.getElementById("TblHeadBasketSummary").style.display="block";}
function DisplayAccountSummary(){document.getElementById("TblHeadAccountSummary").style.display="block";document.getElementById("TblHeadBasketSummary").style.display="none";}
function onLoadInit(){try{basketAlert();}catch(err){}try{feedbackAlert();}catch(err){}iceCookie('userpref','|');}
function popwin(strURL,intWidth,intHeight,intType)
{window.open("/"+strURL+".htm",strURL,"left=0,top=0,width="+intWidth+",height="+intHeight+", resizable=0");}
function openNewWindow(strURL,strName,intWidth,intHeight,intType)
{var titleBarHeight,windowBorderWidth,screenWidth,screenHeight,windowWidth,windowHeight,left,top,blnScrollbars,blnResizable,blnOpenWithParms;titleBarHeight=24;windowBorderWidth=4;screenWidth=800;screenHeight=600;if(window.screen){if(window.screen.availWidth){screenWidth=window.screen.availWidth;screenHeight=window.screen.availHeight;}}
windowWidth=windowBorderWidth+intWidth+windowBorderWidth;windowHeight=titleBarHeight+intHeight+windowBorderWidth;left=(screenWidth-windowWidth)/2;top=(screenHeight-windowHeight)/2;if(intType==1){blnScrollbars=0;blnResizable=0;blnOpenWithParms=1;}else if(intType==2){blnScrollbars=1;blnResizable=0;blnOpenWithParms=1;}else if(intType==3){blnScrollbars=0;blnResizable=1;blnOpenWithParms=1;}else if(intType==4){blnOpenWithParms=0;strName=window.open(strURL,strName,'left = '+left+', top = '+top+', screenX = '+left+', screenY = '+top+', width = '+windowWidth+', height = '+windowHeight);}else{blnOpenWithParms=0;strName=window.open(strURL,strName);}
if(blnOpenWithParms==1){strName=window.open(strURL,strName,'left='+left+', top='+top+', screenX='+left+', screenY='+top+', width='+windowWidth+', height='+windowHeight+', scrollbars='+blnScrollbars+', resizable='+blnResizable+', toolbar=0, location=0, directories = 0, status = 0, menubar = 0, copyhistory = 0');}
strName.focus();}
var ImageProductCode="";var OriginalWidth=540;function LargeImage()
{if(arguments.length<2)
{ImageProductCode=arguments[0].replace("&","%26");var html="<img id=\"ProductImage\" src=\"ProductImage.aspx?pc="+ImageProductCode+"&w="+OriginalWidth+"\">";document.getElementById("DivLargeImagePlaceHolder").innerHTML=html;document.getElementById("DivLargeImage").style.visibility="visible";document.onclick=HideImage;}
else
{var strName=arguments[0];var intWidth=arguments[1];var intHeight=arguments[2];var strURL=arguments[3];objRefWindow=window.open(strURL,strName,'resizable=yes,menubar=no,status=no,location=no,scrollbars=yes,width='+intWidth+',height='+intHeight);}}
function HideImage()
{document.getElementById("DivLargeImage").style.visibility="hidden";}
function ImageZoomIn()
{var img=document.getElementById(arguments[0]);if(img.width>1000)
{alert("Image zoom level reached its maximum limit");return;}
w=img.width+270;var html="<img id=\"ProductImage\" src=\"ProductImage.aspx?pc="+ImageProductCode+"&w="+w+"\">";document.getElementById("DivLargeImage").style.visibility="visible";document.getElementById("DivLargeImagePlaceHolder").innerHTML=html;}
function ImageZoomOut()
{var img=document.getElementById(arguments[0]);if(img.width<271)
return;w=img.width-270;var html="<img id=\"ProductImage\" src=\"ProductImage.aspx?pc="+ImageProductCode+"&w="+w+"\">";document.getElementById("DivLargeImage").style.visibility="visible";document.getElementById("DivLargeImagePlaceHolder").innerHTML=html;}
function DisplayAgeAndVintagePage()
{var cmb=document.getElementById(arguments[0]);var Page=arguments[1];if(cmb.selectedIndex>0)
{window.location.href=Page+"-"+cmb[cmb.selectedIndex].value+".aspx";}}
function GenerateDefaultPageBanners()
{var siteURL="http://www.thewhiskyexchange.com/";siteURL="";var displayarr=new Array
("<a href=\""+siteURL+"F-40-Port_Askaig.aspx\" title=\"Port Askaig - Single Islay Malt Scotch Whisky Range\"><img src=\"site_data/thewhiskyexchange_com/images/gfxPa-imgr.gif\" width=\"189\" style=\"border-right:0px;border-top: solid 0px #666666;border-bottom: solid 0px #666666; border-left: solid 0px #666666;\" /></a>","<a href=\""+siteURL+"LostDistilleries.aspx\" title=\"The Lost Distilleries of Scotland\"><img src=\"site_data/thewhiskyexchange_com/images/gfxLost.gif\" width=\"189\" style=\"border-right:0px;border-top: solid 0px #666666;border-bottom: solid 0px #666666; border-left: solid 0px #666666;\" /></a>","<a href=\""+siteURL+"D-429.aspx\" title=\"Bin Ends\"><img src=\"site_data/thewhiskyexchange_com/images/gfxBinEnds.gif\" width=\"189\" style=\"border-right:0px;border-top: solid 0px #666666;border-bottom: solid 0px #666666; border-left: solid 0px #666666;\" /></a>","<a href=\""+siteURL+"G-460.aspx\" title=\"Elements of Islay\"><img src=\"site_data/thewhiskyexchange_com/images/gfxElements.gif\" width=\"189\" style=\"border-right:0px;border-top: solid 0px #666666;border-bottom: solid 0px #666666; border-left: solid 0px #666666;\" /></a>","<a href=\""+siteURL+"Luxury.aspx\" title=\"Our Luxury Collection has the world\'s rarest and most expensive single malt whiskies, from Black Bowmore to a Macallan 1928\"><img src=\"site_data/thewhiskyexchange_com/images/gfxLuxury.gif\" width=\"189\" style=\"border-right:0px;border-top: solid 0px #666666;border-bottom: solid 0px #666666; border-left: solid 0px #666666;\" /></a>","<a href=\""+siteURL+"D-404.aspx\" title=\"Exclusive Single Malts\"><img src=\"site_data/thewhiskyexchange_com/images/gfxExclusiveToUs.gif\" width=\"189\" style=\"border-right:0px;border-top: solid 0px #666666;border-bottom: solid 0px #666666; border-left: solid 0px #666666;\" /></a>","<a href=\""+siteURL+"D-480.aspx\" title=\"World Whisky Awards 2010\"><img src=\"site_data/thewhiskyexchange_com/images/gfxWWA2010.jpg\" width=\"189\" style=\"border-right:0px;border-top: solid 0px #666666;border-bottom: solid 0px #666666; border-left: solid 0px #666666;\" /></a>")
displayarr=RandomizeArray(displayarr);var j=6;if(displayarr.length<6)
j=displayarr.length
for(i=0;i<j;i++)
{document.write(displayarr[i]+"<div style=\"height:10px\"></div>");}}
function RandomizeArray(myArray)
{var i=myArray.length;if(i==0)return false;while(--i)
{var j=Math.floor(Math.random()*(i+1));var tempi=myArray[i];var tempj=myArray[j];myArray[i]=tempj;myArray[j]=tempi;}
return myArray;}
function LimitInputChars()
{var ObjTextBox=arguments[0];var ObjLimitBox=arguments[1];var MaxChars=parseInt(arguments[2]);if(ObjTextBox.value.length>MaxChars)
ObjTextBox.value=ObjTextBox.value.substr(0,MaxChars);var RemainChars=MaxChars-ObjTextBox.value.length;ObjLimitBox.value=RemainChars+" chars remaining";}
function sbuy()
{location.href="AddBasketSilent.aspx?rdl=default.aspx&productid="+arguments[0];}
function buy()
{var qty=document.getElementById("TxtQty"+arguments[0]).value;location.href="AddBasketSilent.aspx?rdl="+escape(location.href)+"&qty="+qty+"&productid="+arguments[0];}
function mailinglist(){document.write("<iframe style='width:100%;height:175px;' frameborder='0' src='MailingListSubscribe.aspx'></iframe>");}
function writevintage()
{var opt=arguments[0].split(',');document.write("<select id=\"CmbVintageList\" style=\"width: 75px; font-size: 12px;\" onchange=\"DisplayAgeAndVintagePage('CmbVintageList','Vintage')\"><option value=\"\">Vintage</option>");for(i=0;i<opt.length;i++)
{document.write("<option value=\""+opt[i]+"\">"+opt[i]+"</option>");}
document.write("</select>");}
function writeage()
{var opt=arguments[0].split(',');document.write("<select id=\"CmbAgeList\" style=\"width: 75px; font-size: 12px;\" onchange=\"DisplayAgeAndVintagePage('CmbAgeList','Age')\"><option value=\"\">Age</option>");for(i=0;i<opt.length;i++)
{document.write("<option value=\""+opt[i]+"\">"+opt[i]+" yrs</option>");}
document.write("</select>");}
function sortby(){location.href="?order="+arguments[0];}
