function SetupMiniListImages(size){var images=document.getElementsByTagName('img');for(i=0;i<images.length;i++){if(images[i].complete){centerMiniListImage(images[i],size);}else{images[i].onload=function(){centerMiniListImage(this,size);}}}}
function centerMiniListImage(img,size){if(img.width>img.height){img.width=img.width/(img.height/size);img.height=size;img.style.marginLeft=-((img.width-size)/2)+"px";}else{img.height=img.height/(img.width/size);img.width=size;img.style.marginTop=-((img.height-size)/2)+"px";}}
function returncustomlink(SelectId,CustomId)
{var custom='custom_'+CustomId;var selection=document.getElementById(custom);if(selection==null)return(false);for(i=0;i<selection.options.length;i++){Cat_Id=selection.options[i].value;if(Cat_Id==SelectId){selection.selectedIndex=i;break}}
tb_remove();return(false);}
function Checkout_Setup()
{try{var alinks=document.getElementsByTagName("A");for(var i=0;i<alinks.length;i++){if(alinks[i].target!='_blank')alinks[i].onclick=Checkout_Leave;}
var alinks=document.getElementsByTagName("AREA");for(var i=0;i<alinks.length;i++){if(alinks[i].target!='_blank')alinks[i].onclick=Checkout_Leave;}}
catch(e){}}
function Checkout_Leave()
{Ask="You are in the middle of checking out, if you continue you will cancel the checkout process; (Even if you open it in another window!).\r\nAre you sure you want to abandon the checkout process?";Ret=confirm(Ask);return(Ret);}
function QL_IsLoggedIn(xml)
{try{if(xml=='T'){$("#TB_window").hide();$("#TB_load").show();sURL=unescape(window.location);window.location=sURL;}else{QL_SetStatus(false);e=document.getElementById("QLogin_Name");BG_Color(e,'#FF9999');BG_Color(document.getElementById("QLogin_Password"),'#FF9999');$("#QLogin_Status").html("<font color=red>Username or password is wrong!</font>");e.focus();}}
catch(e)
{sURL=unescape(window.location.pathname);window.location.href=sURL;}}
function BG_Color(Link,Color)
{Link.style.background=Color;}
function QL_SetStatus(Status)
{document.getElementById("QLost_Password").disabled=Status;document.getElementById("QCreate_Account").disabled=Status;document.getElementById("Quick_Login").disabled=Status;}
function QL_QL(Link)
{isValid=true;try{if(Link.form.QLogin_Name.value==''){BG_Color(Link.form.QLogin_Name,'#FF9999');Link.form.QLogin_Name.focus();isValid=false;}else{BG_Color(Link.form.QLogin_Name,'#99FF99');}
if(Link.form.QLogin_Password.value==''){BG_Color(Link.form.QLogin_Password,'#FF9999');if(isValid)Link.form.QLogin_Password.focus();isValid=false;}else{BG_Color(Link.form.QLogin_Password,'#99FF99');}
if(!isValid){$("#QLogin_Status").html("<font color=red>Username or password cannot be blank!</font>");return(false);}
QL_SetStatus(true);iSubmit="Ajax=1&Quick_Login=1&Login_Name="+Link.form.QLogin_Name.value+"&Login_Password="+Link.form.QLogin_Password.value;if(Link.form.QRemember_Me.checked){iSubmit=iSubmit+"&Auto_Login=1";}
$.post("/login.php",iSubmit,function(xml){QL_IsLoggedIn(xml);});}
catch(e){alert("Please try and login again!");window.location.href="/login.php";}
return(false);}
function QL_Password_Reset(xml)
{if(xml=='T'){$("#TB_window").html("<br><br><center><b>Your password has been reset and<br>sent to your email address!</b><br><br><input type=button class='TB_closeWindowButton2' value='Close Window' onclick='TB_remove();'> </center>");}else{$("#QLogin_Status").html("<font color=red>Unknown account, are you sure<br>you registered with this email address?</font>");e=document.getElementById("QLogin_Name");BG_Color(e,'#FF9999');BG_Color(document.getElementById("QLogin_Password"),'');e.focus();}
return(false);}
function QL_LP(Link)
{try{if(Link.form.QLogin_Name.value==''){BG_Color(Link.form.QLogin_Name,'#FF9999');BG_Color(document.getElementById("QLogin_Password"),'');$("#QLogin_Status").html("<font color=red>Username cannot be blank!</font>");Link.form.QLogin_Name.focus();return(false);}
iSubmit="Ajax=1&Reset_Password=1&Login_Name="+Link.form.QLogin_Name.value;$.post("/login.php",iSubmit,function(xml){QL_Password_Reset(xml);});}
catch(e){alert("Please try and reset your password again!");window.location.href="/login.php";}
return(false);}
function QL_CA(Link)
{$("#TB_window").hide();$("#TB_load").show();if(self.parent!=null){self.parent.window.location.href="/login.php?T=create_account";}else{window.location.href="/login.php?T=create_account";}}
function activate_payment_type(SelectList)
{if(SelectList.selectedIndex<0)return;if(SelectList.selectedIndex>=SelectList.options.length)return;for(i=0;i<SelectList.options.length;i++){Cat_Id=SelectList.options[i].value;panel=document.getElementById(Cat_Id);if(panel!=null)panel.style.display="none";}
Cat_Id=SelectList.options[SelectList.selectedIndex].value;panel=document.getElementById(Cat_Id);if(panel!=null){panel.style.display="";}}
function Custom_Select(Link,ChangeControl,DataValue)
{return;}
function Custom_Radio(Link,ChangeControl,DataValue)
{return;}
function Custom_Checkbox(Link,ChangeControl,DataValue)
{return;}
function ChangeRating(Rating,Product,Type)
{$.post("/pages.php","Ajax=1&ChangeRating="+Rating+"&"+Type+"="+Product);Cookie=window.RatingAlreadySet;if(Cookie==null){Cookie=0;}
if(Cookie==1){return;}
if(Rating==1){var domItem=document.getElementById("rating_pro");if(domItem!=null){value=domItem.title.substring(1);value=parseInt(value);value+=1;domItem.alt='+'+value;}
spanItem=document.getElementById("srp");if(spanItem!=null){spanItem.innerHTML=value;}}else{var domItem=document.getElementById("rating_neg");if(domItem!=null){value=domItem.title.substring(1);value=parseInt(value);value+=1;domItem.alt='+'+value;}
spanItem=document.getElementById("srn");if(spanItem!=null){spanItem.innerHTML=value;}}
if(domItem!=null){domItem.title=domItem.alt;}
window.RatingAlreadySet=1;}
function AjaxKeyCapture(e){if(typeof window.event!="undefined"){e=window.event;}
if(e.keyCode==27){self.parent.tb_remove();return(false);}}
function CCS(DomainName)
{Cookie=getCookie('users_SID');if(null===Cookie){if(window.location!=DomainName+"pages.php?T=cookiesupport"&&window.location!=DomainName+"contactus.php"&&window.location!=DomainName+"error404.php"){window.location="pages.php?T=cookiesupport";}}}
function Roll_Over(Link_Name,Roll_Image)
{var Temp_Image,Check_Image,Object_Src;if(document.images){Object_Src=Get_Image_ID(Roll_Image);if(Object_Src==-1)return;document.images[Link_Name].src=document.Page_Images[Object_Src].src;}}
function Roll_Over_This(Link,Roll_Image)
{var Temp_Image,Check_Image,Object_Src;if(document.images){Object_Src=Get_Image_ID(Roll_Image);if(Object_Src==-1)return;Link.src=document.Page_Images[Object_Src].src;}}
function Preload_Images()
{var i,j;if(document.images){if(document.Page_Images==null){document.Page_Images=new Array();i=0;}else i=document.Page_Images.length;for(j=0;j<Preload_Images.arguments.length;j++){document.Page_Images[i]=new Image();document.Page_Images[i].src=Preload_Images.arguments[j];i++;}}}
function Get_Image_ID(Image_Lookup)
{var Check_Image,Object_ID=-1,i;var Image_Name,Temp_Image;Image_Name=new String(Image_Lookup);if(document.Page_Images==null)Preload_Images(Image_Name);if(Image_Name.charAt(0)=='.'){Temp_Image=Image_Name.substr(2);}else{Temp_Image=Image_Name;}
for(i=0;i<document.Page_Images.length;i++){Check_Image=document.Page_Images[i].src.substr(document.Page_Images[i].src.length-Temp_Image.length);if(Check_Image==Temp_Image){Object_ID=i;i=document.Page_Images.length;}}
if(Object_ID==-1){Preload_Images(Image_Name);Object_ID=document.Page_Images.length-1;}
return(Object_ID);}
function JumpToPicture(){window.open('/picture.php?Show_Picture='+Picture_Id+'&Store='+Store+Session,'zoom_image_s','dependant=1,directories=0,height=600,width=700,hotkeys=0,resizable=1,status=0,menubar=0,screenx=30,screeny=30,toolbar=0,scrollbars=yes');}
function JumpToStore(){if(Store>0){url='/store.php?Show_Store='+Store+Session;window.location=url;}}
function JumpToProduct(Id)
{if(Id==0)return(false);if(CurBox[Id]==0)return(false);url='/product.php?VP='+CurBox[Id];window.location=url;return(true);}
function Start_Multi_Rotation()
{Start=Start+1;if(Start>Count)Start=1;CurBox[0]=CurBox[0]+1;if(CurBox[0]>PicBoxes)CurBox[0]=1;Roll_Over('rotate_'+CurBox[0],Picture_Array[Start]);CurBox[CurBox[0]]=JumpTo_Array[Start];Store=JumpTo_Array[Start];Next=Start+1;if(Next<=Count)Preload_Images(Picture_Array[Next]);if(Timer>0)self.setTimeout('Start_Multi_Rotation()',Timer);}
function Start_Multi_Preload()
{var OldTimer=Timer;Timer=0;Start_Multi_Rotation();Start_Multi_Rotation();Start_Multi_Rotation();Timer=OldTimer;if(Count>3)self.setTimeout('Start_Multi_Rotation()',Timer);}
function Start_Rotation()
{Start=Start+1;if(Start>Count)Start=1;Roll_Over('themepict',Picture_Array[Start]);Store=JumpTo_Array[Start];Next=Start+1;if(Next>Count)Next=1;Preload_Images(Picture_Array[Next]);self.setTimeout('Start_Rotation()',Timer);}
function ChangeGallery(Store_Id,SelectList,Session)
{if(SelectList.selectedIndex<0)return;if(SelectList.selectedIndex>=SelectList.options.length)return;var Cat_Id=SelectList.options[SelectList.selectedIndex].value;location.href="/gallery/"+Cat_Id+"?VS="+Store_Id;}
function ReturnToItem()
{Cookie=getCookie("RI");if(Cookie){window.location.hash=Cookie;deleteCookie("RI");}}
function SI(Item)
{setCookie("RI",Item);return(true);}
function setCookie(name,value,expires,path,domain,secure)
{document.cookie=name+"="+escape(value)+((expires)?"; expires="+expires.toGMTString():"")+((path)?"; path="+path:"")+((domain)?"; domain="+domain:"")+((secure)?"; secure":"");}
function getCookie(name)
{var dc=document.cookie;var prefix=name+"=";var begin=dc.indexOf("; "+prefix);if(begin==-1)
{begin=dc.indexOf(prefix);if(begin!=0)return null;}
else
{begin+=2;}
var end=document.cookie.indexOf(";",begin);if(end==-1)
{end=dc.length;}
return unescape(dc.substring(begin+prefix.length,end));}
function deleteCookie(name,path,domain)
{if(getCookie(name))
{document.cookie=name+"="+((path)?"; path="+path:"")+((domain)?"; domain="+domain:"")+"; expires=Thu, 01-Jan-70 00:00:01 GMT";}}
var ie4=(document.all)?1:0;var gecko=(navigator.userAgent.indexOf('Gecko')>-1)?1:0;var op6=(navigator.userAgent.indexOf('Opera/6')>-1)?1:0;var op7=(navigator.userAgent.indexOf('Opera/7')>-1)?1:(navigator.userAgent.indexOf('Opera 7')>-1)?1:0;var ns4=(navigator.userAgent.indexOf('Mozilla/4.7')>-1)?1:0;var sf=(navigator.userAgent.indexOf('Safari')>-1)?1:0;if(op7)ie4=0;if(sf){ie4=0;gecko=1;}
var LinkToField="";function openspell(openmelink)
{height=391;width=555;if(ie4)LinkToField=openmelink;if(gecko){LinkToField=openmelink;height=height+6;}
if(op6){LinkToField=openmelink;height=height+10;width=width+10;}
if(op7)LinkToField=openmelink;if(!(op6||gecko||ie4||op7)){alert("phpSpell only supports one of the following browsers:\nOpera 6+, Netscape 6+, Mozilla 1+, Internet Explorer 4+, Safari");}else{directory="/spelling/";win1=window.open(directory+"phpSpell.html","spellcheckwin",'resizable=no,width='+width+',height='+height);if(win1.opener==null)win1.opener=self;}
return(false);}
function Opera_Get_Link(){return(LinkToField);}