﻿var CLOZ={MastID:[],SizeClassID:[],SizeID:[],ColorID:[],LogoID:[],LineID:[],CanPsnLogoID:null,IsCompTee:false,CTQty:0,IsSpecSize:[],IsDualSize:[],AutoCloseCart:null,ViType:[],SelectedElems:new Array(10),Sizes:[],SizeIDs:[],Qtys:[],PsnSurcharge:[],DoName:[],DoNumber:[],PsnNameFee:[],PsnNumberFee:[],PsnMaxNameChars:[],MonoSurcharge:[],MonoNameFee:[],MonoInitialsFee:[],MonoMaxNameChars:[],MonoThreadID:[],MonoThreadText:[],MonoStyleID:[],MonoStyleText:[],AlterSurcharge:[],AlterID:[],AlterFee:[],AlterInputCount:[],FontColorID:[],FontColorText:[],IconID:[],IconText:[],TrayID:[],TrayText:[],WheelID:[],WheelText:[],LockID:[],LockText:[],NameplateID:[],NameplateText:[],NameColorID:[],NameColorText:[],NumberColorID:[],NumberColorText:[],OHQty:[],IsSafari:(/webkit|khtml/).test(navigator.userAgent.toLowerCase()),ServerPath:(("https:"==document.location.protocol)?"https://www.rhedhouse.com":"http://www.rhedhouse.com")};function showselsw(B){var A=$$(".deptSwatch2Sel")[B];$("ProdColor"+B).innerHTML="<div class='ChoiceTitle'>Color: <span id='ItemColor' class='ColorDesc'>"+A.alt+"</span></div>"}function showsw(B,A){var D=CLOZ.ServerPath+"/requesthandler.aspx";var C=uncache("SEID="+B+"&CID="+A);new Ajax.Request(D,{method:"get",asynchronous:false,parameters:C,onComplete:showswSuccess})}function showswSuccess(E){var D=E.responseText.evalJSON();var C=D.ElemId;var A=D.ColorDesc;var B=$(C);B.innerHTML=A}function changeProdImage(B,C,A,E){var F=CLOZ.ServerPath+"/requesthandler.aspx";var D="PEID="+B+"&MID="+C+"&CID="+A;if(E==1){D+="&Sale=1"}D=uncache(D);new Ajax.Request(F,{method:"get",parameters:D,onComplete:changeProdImageSuccess})}function changeProdImageSuccess(C){var B=C.responseText.evalJSON();var A=B.ElemId;var D=$(A);D.innerHTML=B.ProductHtml;var E=$("S"+B.MastID);if(E!=null){E.innerHTML=B.SaleHtml}}function uncache(B){var A=new Date();var C=A.getTime();return B+"&time="+C}function changeProdImage2(B,D,F,G,A,C){var H=CLOZ.ServerPath+"/requesthandler.aspx";var E=uncache("ICC=1&CID="+D+"."+F+"."+G+"."+A+"."+C);new Ajax.Request(H,{method:"get",parameters:E,onComplete:ItemColorChangedSuccess})}function ItemColorChangedSuccess(originalRequest){var JSONobj=originalRequest.responseText.evalJSON();var itemIndex=JSONobj.ItemIndex;var mastDesc=JSONobj.MastDesc;var colorDesc=JSONobj.ColorDesc;var logod=JSONobj.Logod;var price=JSONobj.Price;var listprice=JSONobj.ListPrice;$$(".ProductHTML"+itemIndex)[0].innerHTML=JSONobj.ProductHtml;$$(".ColorHTML"+itemIndex)[0].innerHTML=JSONobj.ColorHtml;$("LargeImage"+itemIndex).innerHTML=JSONobj.LargeImageHtml;$("EnlargeImgLink"+itemIndex).href=JSONobj.LargeImageUrl;$("ProdImgLink"+itemIndex).href=$("EnlargeImgLink"+itemIndex).href;if(CLOZ.MastID==787){$("NameColorInput"+itemIndex).replace(JSONobj.PersonalizeHtml)}else{$$(".PersonalizeLinkContent"+itemIndex)[0].innerHTML=JSONobj.PersonalizeHtml}if(JSONobj.SelectedNameColorElemId!=""){SelectNameColor(JSONobj.SelectedNameColorElemId,itemIndex)}if(JSONobj.SelectedNumberColorElemId!=""){SelectNumberColor(JSONobj.SelectedNumberColorElemId,itemIndex)}$$(".MonogramLinkContent"+itemIndex)[0].innerHTML=JSONobj.MonogramHtml;eval(JSONobj.PersonalizeLoadScript);eval(JSONobj.MonogramLoadScript);if($$(".LogoOptions"+itemIndex)[0]!=null){$$(".LogoOptions"+itemIndex)[0].replace(JSONobj.LogoOptionsHtml);if(JSONobj.LogoOptionsHtml.length>100){$$(".LogoChoice")[0].show()}else{$$(".LogoChoice")[0].hide()}}$("LogoBoxError").hide();SetProductTitle(itemIndex,mastDesc,colorDesc,logod,price,listprice);CLOZ.MastID[itemIndex]=JSONobj.MastID;CLOZ.ColorID[itemIndex]=JSONobj.ColorID;CLOZ.LogoID[itemIndex]=JSONobj.LogoID;CLOZ.OHQty[itemIndex]=JSONobj.OH;CLOZ.IsCompTee=(price=="$0.00");FinishPsnConfig(JSONobj.LogoID,itemIndex);Shadowbox.setup();if($("FontColorChooser")!=null){SetFontColorChoice(JSONobj.ColorID)}}function ItemColorChangedSuccess2(B){var A=B.responseText.evalJSON();$("MainImgXXX").src=A.ImageSrc;$("ImageViews").innerHTML=A.ImageViewsHtml;$("ColorSwatches").innerHTML=A.ColorSwatchHtml}function ItemSizeClassChanged(A,B){var A=$(A);var D=CLOZ.ServerPath+"/requesthandler.aspx";var C=uncache("ISCC=1&SCID="+A.value+"."+CLOZ.SizeID[B]+"."+CLOZ.ColorID[B]);new Ajax.Request(D,{method:"get",parameters:C,onComplete:ItemSizeClassChangedSuccess})}function ItemSizeClassChangedSuccess(originalRequest){var JSONobj=originalRequest.responseText.evalJSON();var mastDesc=JSONobj.MastDesc;var colorDesc=JSONobj.ColorDesc;var logod=JSONobj.Logod;var price=JSONobj.Price;var listprice=JSONobj.ListPrice;var sizeClassID=JSONobj.SizeClassID;var sizeID=JSONobj.SizeID;var colorID=JSONobj.ColorID;var sizeScript=JSONobj.SizesHtml2Script;var itemIndex=JSONobj.ItemIndex;if($$(".Sizes"+itemIndex)[0]!=null){$$(".Sizes"+itemIndex)[0].innerHTML=JSONobj.SizesHtml2}CLOZ.SelectedElems[itemIndex]=new Array(2);if(sizeScript!=""){eval(sizeScript)}$$(".ProductHTML"+itemIndex)[0].innerHTML=JSONobj.ProductHtml;$("EnlargeImgLink"+itemIndex).href=$("ProdImgLink"+itemIndex).href;SetProductTitle(itemIndex,mastDesc,colorDesc,logod,price,listprice);CLOZ.SizeClassID[itemIndex]=sizeClassID;CLOZ.SizeID[itemIndex]=sizeID;CLOZ.ColorID[itemIndex]=colorID;CLOZ.IsDualSize[itemIndex]=(JSONobj.IsDualSize.toLowerCase()=="false"?false:true);CLOZ.IsCompTee=(price=="$0.00");Shadowbox.setup()}function ItemSizeChanged(A,B){var E;if(!CLOZ.IsDualSize[B]){E=CLOZ.Sizes[B].get(A.id)}else{if(CLOZ.SelectedElems[B][0]==null||CLOZ.SelectedElems[B][1]==null){CLOZ.SizeID[B]=0;return}else{var C=CLOZ.SelectedElems[B][0].innerHTML+":"+CLOZ.SelectedElems[B][1].innerHTML;E=CLOZ.SizeIDs[B].get(C);if(E==null){CLOZ.SizeID[B]=0;return}}}var A=$(A);var F=CLOZ.ServerPath+"/requesthandler.aspx";var D=uncache("ISC=1&SZID="+E+"."+CLOZ.ColorID[B]+"."+CLOZ.LogoID[B]+"."+CLOZ.LineID[B]);new Ajax.Request(F,{method:"get",parameters:D,onComplete:ItemSizeChangedSuccess})}function ItemSizeChangedSuccess(originalRequest){var JSONobj=originalRequest.responseText.evalJSON();var mastDesc=JSONobj.MastDesc;var colorDesc=JSONobj.ColorDesc;var logod=JSONobj.Logod;var price=JSONobj.Price;var listprice=JSONobj.ListPrice;var sizeID=JSONobj.SizeID;var colorID=JSONobj.ColorID;var logoID=JSONobj.LogoID;var itemIndex=JSONobj.ItemIndex;$$(".ProductHTML"+itemIndex)[0].innerHTML=JSONobj.ProductHtml;if($$(".ColorHTML"+itemIndex)[0]!=null){$$(".ColorHTML"+itemIndex)[0].innerHTML=JSONobj.ColorHtml}$("EnlargeImgLink"+itemIndex).href=$("ProdImgLink"+itemIndex).href;$$(".PersonalizeLinkContent"+itemIndex)[0].innerHTML=JSONobj.PersonalizeHtml;$$(".MonogramLinkContent"+itemIndex)[0].innerHTML=JSONobj.MonogramHtml;eval(JSONobj.PersonalizeLoadScript);eval(JSONobj.MonogramLoadScript);if($$(".LogoOptions"+itemIndex)[0]!=null){$$(".LogoOptions"+itemIndex)[0].replace(JSONobj.LogoOptionsHtml);if(JSONobj.LogoOptionsHtml.length>100){$$(".LogoChoice")[0].show()}else{$$(".LogoChoice")[0].hide()}}$("QtyError").hide();$("LogoBoxError").hide();SetProductTitle(itemIndex,mastDesc,colorDesc,logod,price,listprice);FinishAlterConfig(sizeID,itemIndex);CLOZ.SizeID[itemIndex]=sizeID;CLOZ.ColorID[itemIndex]=colorID;CLOZ.LogoID[itemIndex]=logoID;CLOZ.OHQty[itemIndex]=JSONobj.OH;CLOZ.IsCompTee=(price=="$0.00");RefreshTray();FinishPsnConfig(logoID,itemIndex);Shadowbox.setup();return(ValidateSize(itemIndex))}function ShowAlt(B,C){var A=$(B).src;$(C).innerHTML="<img src='"+A+"' width='270' height='270' style='padding: 0px; margin: 0px;' border='0' />";if($(B).className=="Selected"){return}$(B).className="Hover"}function RevertAlt(B,C){var A=$(B).src;$(C).innerHTML="<img src='"+A+"' width='270' height='270' style='padding: 0px; margin: 0px;' border='0' />";$$("#AltViews img").each(function(D){if(D.className!="Selected"){D.className="Normal"}})}function SetAlt(A,B){$(B).src=$(A).src;$$("#AltViews img").each(function(C){C.className="Normal"});$(A).className="Selected"}function FinishAlterConfig(C,B){if(C==474){CLOZ.IsSpecSize[B]=true;CLOZ.AlterFee[B]=0;CLOZ.AlterID[B]=7;$("AlterError2"+B).hide();$("AlterWaistError2"+B).hide();$("AlterHipError2"+B).hide();$("AlterLengthError2"+B).hide();$("AlterBustError2"+B).hide();$("AlterInch4Input2"+B).show();$("AlterationLink"+B).hide()}else{CLOZ.IsSpecSize[B]=false;try{$("AlterInch4Input2"+B).hide();$("AlterationLink"+B).show()}catch(A){}}}function FinishPsnConfig(B,A){if(CLOZ.CanPsnLogoID!=null){$$(".PersonalizeLinkContent"+A)[0].style.display=(B==CLOZ.CanPsnLogoID?"block":"none")}}function LogoOptionChanged(A,B){var A=$(A);var D=CLOZ.ServerPath+"/requesthandler.aspx";var C=uncache("ILOC=1&LID="+CLOZ.MastID[B]+"."+CLOZ.SizeClassID[B]+"."+CLOZ.SizeID[B]+"."+CLOZ.ColorID[B]+"."+A.value);new Ajax.Request(D,{method:"get",parameters:C,onComplete:LogoOptionChangedSuccess})}function LogoOptionChangedSuccess(G){var C=G.responseText.evalJSON();var B=C.ItemIndex;$$(".ProductHTML"+B)[0].innerHTML=C.ProductHtml;$("EnlargeImgLink"+B).href=C.LargeImageUrl;$("LargeImage"+B).innerHTML=C.LargeImageHtml;$$(".ColorHTML"+B)[0].innerHTML=C.ColorHtml;var B=C.ItemIndex;var F=C.MastDesc;var A=C.ColorDesc;var E=C.Logod;var H=C.Price;var D=C.ListPrice;SetProductTitle(B,F,A,E,H,D);CLOZ.LogoID[B]=C.LogoID;CLOZ.IsCompTee=(H=="$0.00");CLOZ.OHQty[B]=C.OH;FinishPsnConfig(C.LogoID,B);Shadowbox.setup()}function SelectThread(A,B){if(CLOZ.MonoThreadID[B]!=null){$(CLOZ.MonoThreadID[B]).className="CImg"}CLOZ.MonoThreadID[B]=A.id;CLOZ.MonoThreadText[B]=A.alt;$(CLOZ.MonoThreadID[B]).className="CImgSel"}function ShowThread(A,B){$("SelectedThread"+B).innerHTML=A.alt;if($(A.id).className!="CImgSel"){$(A.id).className="CImgOver"}}function ShowSelectedThread(A,B){$(A.id).className="CImg";if(CLOZ.MonoThreadText[B]==null){CLOZ.MonoThreadText[B]=""}$("SelectedThread"+B).innerHTML=CLOZ.MonoThreadText[B];if(CLOZ.MonoThreadID[B]!=null){$(CLOZ.MonoThreadID[B]).className="CImgSel"}}function SelectStyle(A,B){if(CLOZ.MonoStyleID[B]!=null){$(CLOZ.MonoStyleID[B]).className="SImg"}CLOZ.MonoStyleID[B]=A.id;CLOZ.MonoStyleText[B]=A.alt;$(CLOZ.MonoStyleID[B]).className="SImgSel"}function ShowStyle(A,B){$("SelectedStyle"+B).innerHTML=A.alt;if($(A.id).className!="SImgSel"){$(A.id).className="SImgOver"}}function ShowSelectedStyle(A,B){$(A.id).className="SImg";if(CLOZ.MonoStyleText[B]==null){CLOZ.MonoStyleText[B]=""}$("SelectedStyle"+B).innerHTML=CLOZ.MonoStyleText[B];if(CLOZ.MonoStyleID[B]!=null){$(CLOZ.MonoStyleID[B]).className="SImgSel"}}function SelectNameColor(A,B){if($(CLOZ.NameColorID[B])!=null){$(CLOZ.NameColorID[B]).className="deptSwatch2"}CLOZ.NameColorID[B]=$(A).id;CLOZ.NameColorText[B]=$(A).alt;$("SelectedNameColor"+B).innerHTML=$(A).alt;$(A).className="deptSwatch2Sel"}function ShowNameColor(A,B){$("SelectedNameColor"+B).innerHTML=A.alt}function ShowSelectedNameColor(A,B){$(A.id).className="deptSwatch2";if(CLOZ.NameColorText[B]==null){CLOZ.NameColorText[B]=""}$("SelectedNameColor"+B).innerHTML=CLOZ.NameColorText[B];if($(CLOZ.NameColorID[B])!=null){$(CLOZ.NameColorID[B]).className="deptSwatch2Sel"}}function SelectNumberColor(A,B){if($(CLOZ.NumberColorID[B])!=null){$(CLOZ.NumberColorID[B]).className="deptSwatch2"}if($(A)!=null){CLOZ.NumberColorID[B]=$(A).id;CLOZ.NumberColorText[B]=$(A).alt;$("SelectedNumberColor"+B).innerHTML=$(A).alt;$(A).className="deptSwatch2Sel"}}function ShowNumberColor(A,B){$("SelectedNumberColor"+B).innerHTML=A.alt}function ShowSelectedNumberColor(A,B){$(A.id).className="deptSwatch2";if(CLOZ.NumberColorText[B]==null){CLOZ.NumberColorText[B]=""}$("SelectedNumberColor"+B).innerHTML=CLOZ.NumberColorText[B];if($(CLOZ.NumberColorID[B])!=null){$(CLOZ.NumberColorID[B]).className="deptSwatch2Sel"}}function SetProductTitle(C,B,A,E,F,D){$("ProdTitle"+C).innerHTML="<div class='ItemDesc'>"+B+"</div>";if(A!=""){$("ProdColor"+C).innerHTML="<div class='ChoiceTitle'>Color: <span id='ItemColor' class='ColorDesc'>"+A+"</span></div>"}if(F==D){$("ItemPrice"+C).innerHTML="<div class='PriceDesc'>"+F+"</div>"}else{$("ItemPrice"+C).innerHTML="<span class='PriceDescStrike'>"+D+"</span>&nbsp;&nbsp;<span class='SalePriceDesc'>"+F+"</span>"}}function ShowPanel(A,B){if(A.startsWith("Personalize")){if($("PsnNameInput"+B)!=null){$("PsnNameInput"+B).style.display=(CLOZ.DoName[B]?"":"none");$("PsnNameError"+B).hide()}if($("PsnNumberInput"+B)!=null){$("PsnNumberInput"+B).style.display=(CLOZ.DoNumber[B]?"":"none");$("PsnNumberError"+B).hide()}if($("PsnNameColorError"+B)!=null){$("PsnNameColorError"+B).hide()}if($("PsnNumberColorError"+B)!=null){$("PsnNumberColorError"+B).hide()}$("PsnSurcharge"+B).hide();$("MonogramLink"+B).style.visibility="hidden";$("AlterationLink"+B).style.visibility="hidden";$("CartButton").style.visibility="hidden";$("CartReview").className="hidden"}else{if(A.startsWith("Monogram")){$("MonoNameError"+B).hide();$("MonoThreadError"+B).hide();$("MonoStyleError"+B).hide();$("MonoSurcharge"+B).hide();$("PersonalizeLink"+B).style.visibility="hidden";$("AlterationLink"+B).style.visibility="hidden";$("CartButton").style.visibility="hidden";$("CartReview").className="hidden"}else{if(A.startsWith("Alteration")){$("AlterShortenError"+B).hide();$("AlterWaistError"+B).hide();$("AlterHipError"+B).hide();$("AlterLengthError"+B).hide();$("AlterBustError"+B).hide();$("AlterSleevesError"+B).hide();$("AlterBackError"+B).hide();$("AlterSurcharge"+B).hide();$("PersonalizeLink"+B).style.visibility="hidden";$("MonogramLink"+B).style.visibility="hidden";$("CartButton").style.visibility="hidden";$("CartReview").className="hidden"}else{if(A.startsWith("CartReview")){if(!cookiesEnabled()){$("QtyError").show().innerHTML="It appears that your browser does not support cookies,<br/>or cookies have been disabled. Cookies must be<br/>enabled to purchase online from our store.<p/>For customer service or to place an order via phone,<br/> please call 773-247-8879.<p/>";return}var D=CLOZ.ServerPath+"/requesthandler.aspx";var C=GetItemConfig(B);if(C!=false){new Ajax.Request(D,{method:"get",parameters:C,onComplete:AddToCartSuccess})}return}}}}$(A).className="";new Effect.BlindDown(A,{duration:0.3})}function HidePanel(A,B){var C=true;if(A=="Personalize"+B){C=ValidatePsn(B)}else{if(A=="Monogram"+B){C=ValidateMono(B)}else{if(A=="Alteration"+B){C=ValidateAlter(B)}else{if(A=="CartReview"){clearTimeout(CLOZ.AutoCloseCart);Event.stopObserving(document,"click",CloseCart)}else{if(A=="IconChoice"+B){C=ValidateIcon(B)}}}}}if(C){new Effect.BlindUp($(A),{duration:0.3});$("PersonalizeLink"+B).style.visibility="";$("MonogramLink"+B).style.visibility="";$("AlterationLink"+B).style.visibility="";$("CartReview").style.visibility="";$("CartButton").style.visibility=""}}function GetItemConfig(L){var Q=new Hash();var a=CLOZ.ViType[L];if(a=="tape"){if(!ValidateTape()){return false}}else{if(a=="sportstix"){if(!ValidateSportStix()){return false}}else{if(a=="campstix"){if(!ValidateCampStix()){return false}}else{if(a=="tag"){if(!ValidateTag()){return false}}else{if(a=="idset"){if(!ValidateIDSet()){return false}}else{if(a=="ezstamp"){if(!ValidateEZ()){return false}}else{if(a=="cubename"){if(!ValidateCubename()){return false}}else{if(a=="chair"){if(!ValidateChair()){return false}}else{if(a=="nameplate"){if(!ValidateNameplate(L)){return false}}else{if(a=="trunk"){if(!ValidateTrunk(L)){return false}}else{if(a=="ldcamppack"){if(!ValidateCampPack(L)){return false}}else{if(CLOZ.IsSpecSize[L]){if(!ValidateSpecSize(L)){return false}}else{if(!ValidateSize(L)){return false}else{if(!ValidateQty(L)){return false}else{if(!ValidateLogo(L)){return false}else{if(!ValidateMono(L)){return false}else{if(!ValidatePsn(L)){return false}else{if(!ValidateAlter(L)){return false}}}}}}}}}}}}}}}}}}Q.set("ATC",1);var L;var K=CLOZ.MastID.length;for(L=0;L<K;L++){var S=$("NameColors"+L);var U=$("NumberColors"+L);var A=$("AlterTypes"+L);var a=CLOZ.ViType[L];Q.set("mastID"+L,CLOZ.MastID[L]);Q.set("sizeClassID"+L,CLOZ.SizeClassID[L]);Q.set("sizeID"+L,CLOZ.SizeID[L]);Q.set("colorID"+L,CLOZ.ColorID[L]);Q.set("logoID"+L,CLOZ.LogoID[L]);Q.set("lineID"+L,CLOZ.LineID[L]);Q.set("qty"+L,CLOZ.Qtys[L]);var V="";var W="";var R=0;var T=0;if($("PsnName"+L)!=null){V=$F("PsnName"+L)}if($("PsnNumber"+L)!=null){W=$F("PsnNumber"+L)}if(S!=null){R=CLOZ.NameColorID[L].substring(CLOZ.NameColorID[L].lastIndexOf("_")+1)}if(U!=null){T=CLOZ.NumberColorID[L].substring(CLOZ.NumberColorID[L].lastIndexOf("_")+1)}if(V!=""){Q.set("psnName"+L,V)}if(W!=""){Q.set("psnNumber"+L,W)}if(V!=""||W!=""){Q.set("psnNameFee"+L,CLOZ.PsnNameFee[L]);Q.set("psnNumberFee"+L,CLOZ.PsnNumberFee[L]);Q.set("nameColorID"+L,R);Q.set("numberColorID"+L,T)}var P="";var O=0;var Z=0;if($("MonoName"+L)!=null){P=$F("MonoName"+L);if(P!=""){O=CLOZ.MonoStyleID[L].substring(CLOZ.MonoStyleID[L].lastIndexOf("_")+1);Z=CLOZ.MonoThreadID[L].substring(CLOZ.MonoThreadID[L].lastIndexOf("_")+1)}}if(P!=""){Q.set("monoName"+L,P);Q.set("monoID"+L,O);Q.set("threadID"+L,Z);Q.set("monoNameFee"+L,CLOZ.MonoNameFee[L]);Q.set("monoInitialsFee"+L,CLOZ.MonoInitialsFee[L])}if(A!=null){var X=$F("AlterShorten"+L);var b=$F("AlterWaist"+L);var I=$F("AlterHip"+L);var N=$F("AlterLength"+L);var C=$F("AlterBust"+L);if(CLOZ.IsSpecSize[L]){b=$F("AlterWaist2"+L);I=$F("AlterHip2"+L);N=$F("AlterLength2"+L);C=$F("AlterBust2"+L)}else{b=$F("AlterWaist"+L);I=$F("AlterHip"+L);N=$F("AlterLength"+L);C=$F("AlterBust"+L)}var Y=$F("AlterSleeves"+L);var B=$F("AlterBack"+L);if(CLOZ.AlterID[L]!=""){Q.set("alterID"+L,CLOZ.AlterID[L])}if(X!=""){Q.set("shortenInches"+L,X)}if(b!=""){Q.set("waistInches"+L,b)}if(I!=""){Q.set("hipInches"+L,I)}if(N!=""){Q.set("lengthInches"+L,N)}if(C!=""){Q.set("bustInches"+L,C)}if(Y!=""){Q.set("sleevesInches"+L,Y)}if(B!=""){Q.set("backInches"+L,B)}}if(a=="tape"){Q.set("psnName"+L,$F("TapeName"))}else{if(a=="sportstix"){Q.set("line1",$F("SportStixName"));Q.set("line2",$F("SportStixPhone"))}else{if(a=="campstix"){Q.set("line1",$F("CampStixName"))}else{if(a=="tag"){Q.set("line1",$F("TagName"));Q.set("line2",$F("TagAddress1"));Q.set("line3",$F("TagAddress2"));Q.set("line4",$F("TagCity"));Q.set("line5",$F("TagState"));Q.set("line6",$F("TagZip"));Q.set("line7",$F("TagPhone"))}else{if(a=="idset"){Q.set("tapename1",$F("IdssTapeName1"));Q.set("tapename2",$F("IdssTapeName2"));Q.set("PsnName"+L,$F("IdssIdentifier"));Q.set("tagitname",$F("IdssTagitName"));Q.set("tagitphone",$F("IdssTagitPhone"));Q.set("tagitid",$F("IdssColorList"));Q.set("stixname",$F("IdssStixName"));Q.set("line1",$F("IdssLine1"));Q.set("line2",$F("IdssLine2"));Q.set("line3",$F("IdssLine3"));Q.set("line4",$F("IdssLine4"));Q.set("line5",$F("IdssLine5"));Q.set("line6",$F("IdssLine6"));Q.set("line7",$F("IdssLine7"))}else{if(a=="ezstamp"){Q.set("psnName"+L,$F("EZName"))}else{if(a=="cubename"){Q.set("psnName"+L,$F("CubeName"))}else{if(a=="chair"){Q.set("psnName"+L,$F("ChairName"));Q.set("psnNameFee"+L,CLOZ.PsnNameFee[L]);Q.set("nameColorID"+L,R)}else{if(a=="cnnameplate"){Q.set("line1",$F("Line1"));if($F("Line2").length>0){Q.set("line2",$F("Line2"))}Q.set("fontColorID"+L,CLOZ.FontColorID[L].substring(CLOZ.FontColorID[L].lastIndexOf("_")+1));Q.set("fontStyleID"+L,$F("FontStyle"+L));if(CLOZ.IconID[L]!=null){Q.set("iconID"+L,CLOZ.IconID[L].substring(CLOZ.IconID[L].lastIndexOf("_")+1))}else{Q.set("iconID"+L,0)}}else{if(a=="nameplate"){Q.set("line1",$F("Line1"));if($F("Line2").length>0){Q.set("line2",$F("Line2"))}}else{if(a=="trunk"){Q.set("trayID"+L,CLOZ.TrayID);Q.set("wheelID"+L,CLOZ.WheelID);Q.set("lockID"+L,CLOZ.LockID);if(CLOZ.NameplateID!=0){Q.set("line1",$F("Line1"));if($F("Line2").length>0){Q.set("line2",$F("Line2"))}}}else{if(a=="ldcamppack"){var F=$F("labelname");var M=$F("labellastName");var E=$F("labelname_1");var J=$("Icon").innerHTML;var H=$("FontStyle").innerHTML;var G=$("FontColor").innerHTML;Q.set("ldcp_firstName"+L,F);Q.set("ldcp_lastName"+L,M);Q.set("ldcp_contactInfo"+L,E);Q.set("ldcp_icon"+L,J);Q.set("ldcp_fontstyle"+L,H);Q.set("ldcp_fontcolor"+L,G)}}}}}}}}}}}}}var D=$$(".ItemConfig0")[0];if(D!=null){D.value=Q.toQueryString()}return Q}function AddToCartSuccess(B){var A=B.responseText.evalJSON();elem=$("CartReview");if(A.CartReviewHTML!=""){elem.innerHTML=A.CartReviewHTML;document.documentElement.scrollTop=0;clearTimeout(CLOZ.AutoCloseCart);Event.stopObserving(document,"click",CloseCart);Event.observe(document,"click",CloseCart);Event.observe($("CartReview"),"mouseover",MouseOverCart);Event.observe($("CartReview"),"mouseout",MouseOutCart);CLOZ.AutoCloseCart=setTimeout("HidePanel('CartReview',0)",6000);elem.className="ACPanel";new Effect.BlindDown(elem,{duration:0.3})}else{if(A.DuplicateSewTapeError!=""){if($("TapeInputError")!=null){$("TapeInputError").show().innerHTML=A.DuplicateSewTapeError;return false}}}}CloseCart=function(B){var A=Event.element(B);if(A.id!="AddToCart"){HidePanel("CartReview",0)}};MouseOverCart=function(){clearTimeout(CLOZ.AutoCloseCart)};MouseOutCart=function(){CLOZ.AutoCloseCart=setTimeout("HidePanel('CartReview',0)",3000)};function ValidatePsn(B){if($("PsnName"+B)==null){return true}var C="";var F=0;var D=$(CLOZ.NameColorID[B]);var G=$(CLOZ.NumberColorID[B]);var E="";var H="";var A=/[\[\<\>\]\+]/;CLOZ.PsnSurcharge[B]=0;if($("PsnName"+B)!=null){C=$F("PsnName"+B)}if($("PsnNumber"+B)!=null){F=$F("PsnNumber"+B)}$("PsnError"+B).hide();if(C.length>CLOZ.PsnMaxNameChars[B]){$("PsnError"+B).show().innerHTML="Please limit name to "+CLOZ.PsnMaxNameChars[B]+" characters!";$("PsnNameError"+B).show();return false}else{if(C.match(A)){$("PsnError"+B).show().innerHTML="Name contains one or more invalid characters!";$("PsnNameError"+B).show();return false}}if(CLOZ.DoName[B]){if(C.length==0){}}if(C.length>0&&D!=null){E="<span style='padding-left:20px'>Color: "+CLOZ.NameColorText[B]+"</span>"}if(F.length>0){if(!IsPositiveNumber(F)||F>99){$("PsnError"+B).show().innerHTML="Please enter a number between 0 and 99!";$("PsnNumberError"+B).show();return false}if(G!=null){H="<span style='padding-left:20px'>Color: "+CLOZ.NumberColorText[B]+"</span>"}}CLOZ.PsnSurcharge[B]=(C.length>0?CLOZ.PsnNameFee[B]:0)+(F.length>0?CLOZ.PsnNumberFee[B]:0);return true}function ValidateMono(B){if($("MonoName"+B)==null){return true}var D=$F("MonoName"+B);var A=/[\[\<\>\]\+]/;CLOZ.MonoSurcharge[B]=0;$("MonoError"+B).hide();var C=CLOZ.MonoMaxNameChars[B];if(C==0){C=30}$("MonoNameText"+B).innerHTML="";if(D.length==0){if(CLOZ.MonoThreadID[B]!=null){$(CLOZ.MonoThreadID[B]).className="CImg";CLOZ.MonoThreadID[B]=null;CLOZ.MonoThreadText[B]="";$("SelectedThread"+B).innerHTML=""}if(CLOZ.MonoStyleID[B]!=null){$(CLOZ.MonoStyleID[B]).className="SImg";CLOZ.MonoStyleID[B]=null;CLOZ.MonoStyleText[B]="";$("SelectedStyle"+B).innerHTML=""}}else{if(D.length>C){$("MonoError"+B).show().innerHTML="Please limit input to "+C+" characters!";$("MonoNameError"+B).show();return false}else{if(D.match(A)){$("MonoError"+B).show().innerHTML="Input contains one or more invalid characters!";$("MonoNameError"+B).show();return false}else{if(CLOZ.MonoThreadID[B]==null){$("MonoError"+B).show().innerHTML="Please select a thread color!";$("MonoThreadError"+B).show();return false}else{if(CLOZ.MonoStyleID[B]==null){$("MonoError"+B).show().innerHTML="Please select a monogram style!";$("MonoStyleError"+B).show();return false}}}}}CLOZ.MonoSurcharge[B]=(D.length>3?CLOZ.MonoNameFee[B]:(D.length>0?CLOZ.MonoInitialsFee[B]:0));return true}function ValidateAlter(F){var H=$F("AlterShorten"+F);var J=$F("AlterWaist"+F);var E=$F("AlterHip"+F);var G=$F("AlterLength"+F);var D=$F("AlterBust"+F);var I=$F("AlterSleeves"+F);var C=$F("AlterBack"+F);var A=0;var B=CLOZ.AlterInputCount[F];CLOZ.AlterSurcharge[F]=0;$("AlterError"+F).hide();if(B==1){A++;if(H.length==0||!IsPositiveNumber(H)){$("AlterError"+F).show().innerHTML="Please specify a numeric value 0 or greater!";$("AlterShortenError"+F).show();return false}}else{if(B==2){A++;if(I.length==0||!IsPositiveNumber(I)){$("AlterError"+F).show().innerHTML="Please specify a numeric value 0 or greater!";$("AlterSleevesError"+F).show();return false}if(C.length==0||!IsPositiveNumber(C)){$("AlterError"+F).show().innerHTML="Please specify a numeric value 0 or greater!";$("AlterBackError"+F).show();return false}}else{if(B==4){A++;if(J.length==0||!IsPositiveNumber(J)){$("AlterError"+F).show().innerHTML="Please specify a numeric value 0 or greater!";$("AlterWaistError"+F).show();return false}if(E.length==0||!IsPositiveNumber(E)){$("AlterError"+F).show().innerHTML="Please specify a numeric value 0 or greater!";$("AlterHipError"+F).show();return false}if(G.length==0||!IsPositiveNumber(G)){$("AlterError"+F).show().innerHTML="Please specify a numeric value 0 or greater!";$("AlterLengthError"+F).show();return false}if(D.length==0||!IsPositiveNumber(D)){$("AlterError"+F).show().innerHTML="Please specify a numeric value 0 or greater!";$("AlterBustError"+F).show();return false}}}}return true}function AlterTypeChanged(F){var D=$("AlterTypes"+F);var A=$("AlterInch1Input"+F);var B=$("AlterInch2Input"+F);var C=$("AlterInch4Input"+F);var G=D.options[D.selectedIndex].value;var H=G.split(".");CLOZ.AlterID[F]=H[0];CLOZ.AlterFee[F]=H[2];var E=H[1];if(E=="0"){A.hide();B.hide();C.hide();CLOZ.AlterInputCount[F]=0}if(E=="1"){A.show();B.hide();C.hide();CLOZ.AlterInputCount[F]=1}else{if(E=="2"){A.hide();B.show();C.hide();CLOZ.AlterInputCount[F]=2}else{if(E=="4"){A.hide();B.hide();C.show();CLOZ.AlterInputCount[F]=4}}}}function AlterTypeChanged2(D,F){$("AlterShorten"+F).value="";$("AlterWaist"+F).value="";$("AlterHip"+F).value="";$("AlterLength"+F).value="";$("AlterBust"+F).value="";$("AlterSleeves"+F).value="";$("AlterBack"+F).value="";var A=$("AlterInch1Input"+F);var B=$("AlterInch2Input"+F);var C=$("AlterInch4Input"+F);var G=$(D).value;var H=G.split(".");CLOZ.AlterID[F]=H[0];CLOZ.AlterFee[F]=H[2];var E=H[1];if(E=="0"){A.hide();B.hide();C.hide();CLOZ.AlterInputCount[F]=0}if(E=="1"){A.show();B.hide();C.hide();CLOZ.AlterInputCount[F]=1}else{if(E=="2"){A.hide();B.show();C.hide();CLOZ.AlterInputCount[F]=2}else{if(E=="4"){A.hide();B.hide();C.show();CLOZ.AlterInputCount[F]=4}}}}function ValidateSpecSize(C){var E=$F("AlterWaist2"+C);var B=$F("AlterHip2"+C);var D=$F("AlterLength2"+C);var A=$F("AlterBust2"+C);CLOZ.AlterSurcharge[C]=0;if(E.length==0||!IsPositiveNumber(E)){$("AlterError2").show().innerHTML="Please specify a numeric value 0 or greater!";$("AlterWaistError2").show();return false}if(B.length==0||!IsPositiveNumber(B)){$("AlterError2").show().innerHTML="Please specify a numeric value 0 or greater!";$("AlterHipError2").show();return false}if(D.length==0||!IsPositiveNumber(D)){$("AlterError2").show().innerHTML="Please specify a numeric value 0 or greater!";$("AlterLengthError2").show();return false}if(A.length==0||!IsPositiveNumber(A)){$("AlterError2").show().innerHTML="Please specify a numeric value 0 or greater!";$("AlterBustError2").show();return false}return true}function ValidateSize(A){var B=$("SizeError"+A);if(B!=null){B.hide();if(CLOZ.SizeID[A]==0){B.show().innerHTML="Item not available in current size selection!";return false}}return true}function ValidateQty(B){var D=CLOZ.Qtys[B];if(parseInt(D)>parseInt(CLOZ.OHQty[B])){$("QtyError").show().innerHTML="This item has limited inventory.<BR/>No more than "+CLOZ.OHQty[B]+" may be ordered!";return false}else{if(CLOZ.IsCompTee){if(D>3){$("QtyError").show().innerHTML="You can only order a maximum of 3 Complimentary Tees<BR/> per order!";return false}else{var E=CLOZ.ServerPath+"/requesthandler.aspx";var C="CTC=1";new Ajax.Request(E,{method:"get",parameters:C,asynchronous:false,onComplete:function A(G){var F=G.responseText.evalJSON();CLOZ.CTQty=F.CTQty}});if(CLOZ.CTQty>=3){$("QtyError").show().innerHTML="You can only order a maximum of 3 Complimentary Tees<BR/> per order!";return false}}}else{$("QtyError").hide().innerHTML=""}}return true}function ValidateLogo(A){if($$(".LogoOptions"+A)[0]!=null){$("LogoBoxError").hide();if($$(".LogoChoice")[0].style.display!="none"){var B=CLOZ.LogoID[A];if(B==-1){$("LogoBoxError").show();return false}}}return true}function SubmitNavPos(A){$$(".HideNavPos")[0].value=A;document.forms[0].submit()}function AddOnload(A){if(window.addEventListener){window.addEventListener("load",A,false)}else{if(window.attachEvent){window.attachEvent("onload",A)}}}function Switch(A,B){A.style.backgroundImage="url("+B+")"}function SetListIndex(A,E){var B=false;var D=A.options;for(var C=0;C<D.length;C++){if(E==D[C].value){A.selectedIndex=C;B=true;break}}if(!B){A.selectedIndex=0}}function IsPositiveNumber(A){A=parseFloat(A);if(typeof A=="number"){return(!isNaN(A)&&A>=0)}return false}function CurrencyFormatted(A){var B=parseFloat(A);if(isNaN(B)){B=0}var C="";if(B<0){C="-"}B=Math.abs(B);B=parseInt((B+0.005)*100);B=B/100;var D=new String(B);if(D.indexOf(".")<0){D+=".00"}if(D.indexOf(".")==(D.length-2)){D+="0"}D=C+D;return D}function IsValidUSAPhone(A){A=A.replace(/\D/g,"");return(A.length==7||A.length==10)}function checkEnter(C){var B=(window.event)?window.event:C;var A=B.keyCode;if(A==13){document.forms[0].submit()}}function centerPop(K,D,E,C,I,F){var E;var C;var J;var H=window.screen.width;var G=window.screen.height;var A=(H/2)-((E)/2);var B=(G/2)-((C+50)/2);if(I==null){J="yes"}else{J=(I==1?"yes":"no")}if(F==null){F=0}theWin=window.open(K,"popupname","width="+E+",height="+C+",toolbar=0,location=0,status=0,scrollbars="+J+",menubar=0,resizable="+F+",left="+A+",top="+B+",screenX="+A+",screenY="+B+",");theWin.focus()}function getSelectedRadio(A){if(A[0]){for(var B=0;B<A.length;B++){if(A[B].checked){return B}}}else{if(A.checked){return 0}}return -1}function getSelectedRadioValue(A){var B=getSelectedRadio(A);if(B==-1){return""}else{if(A[B]){return A[B].value}else{return A.value}}}function getSelectedCheckbox(A){var D=[];var C=0;if(A[0]){for(var B=0;B<A.length;B++){if(A[B].checked){D.length=C;D[C]=B;C++}}}else{if(A.checked){D.length=C;D[C]=0}}return D}function getSelectedCheckboxValue(A){var C=[];var D=getSelectedCheckbox(A);if(D.length!=0){C.length=D.length;for(var B=0;B<D.length;B++){if(A[D[B]]){C[B]=A[D[B]].value}else{C[B]=A.value}}}return C}function limitText(A,B,C){if(B.value.length>=C){B.value=B.value.substring(0,C-1)}}var delay=5000;var start_frame=0;var slideShowAppear,slideShowFade;function initshow(){if($("slide-images")!=null){var B=$("slide-images").getElementsByTagName("li");for(var A=0;A<B.length;A++){B[A].style.visibility="visible";if(A!=0){B[A].style.display="none"}else{B[A].style.display=""}}end_frame=B.length-1;start_slideshow(start_frame,end_frame,delay,B)}}function start_slideshow(D,B,A,C){setTimeout(fadeInOut(D,D,B,A,C),A)}function fadeInOut(C,E,B,A,D){return(function(){D=$("slide-images").getElementsByTagName("li");if(D.length>1){Effect.Fade(D[C],{duration:2});if(C==B){C=E}else{C++}lisAppear=D[C];slideShowAppear=setTimeout("Effect.Appear(lisAppear, {duration:2});",0);slideShowFade=setTimeout(fadeInOut(C,E,B,A),A+1850)}})}function stop_slideshow(){clearTimeout(slideShowAppear);clearTimeout(slideShowFade);if($("slide-images")!=null){var A=$("slide-images").getElementsByTagName("li");for(i=0;i<A.length;i++){if(i!=0){A[i].style.visibility="hidden";A[i].style.display=""}else{A[i].style.visibility="";A[i].style.display="block"}}}}var wait=4000;var fader;function swapFade(){var A=$$(".fade-box");if($$(".fade-box").length==2){Effect.Fade(A[0],{duration:3,from:1,to:0});Effect.Appear(A[1],{duration:1,from:0,to:1})}clearTimeout(fader)}function initswap(){var A=$$(".fade-box");if($$(".fade-box").length>0){for(i=0;i<A.length;i++){A[i].style.visibility="visible";if(i!=0){A[i].style.display="none"}else{A[i].style.display=""}}fader=setInterval("swapFade()",wait)}}function SetChoice(B,C,A,D){var F=CLOZ.SelectedElems[D];if(F==null){CLOZ.SelectedElems[D]=new Array(2)}var E=CLOZ.SelectedElems[D][C-1];if(E!=null){if(E.className.startsWith("NA")){$(E).className="NA"}else{$(E).className="Normal"}}if(!B.className.startsWith("NA")){$(B).className="Selected"}else{$(B).className="NASelected"}CLOZ.SelectedElems[D][C-1]=B;$("SizeDesc"+D+"-"+C).innerHTML=B.innerHTML;ItemSizeChanged(B,D)}function SetBorder(B,C,A,D){if(!B.className.startsWith("NA")&&!B.className.startsWith("Selected")){$(B).className="Hover"}$("SizeDesc"+D+"-"+C).innerHTML=B.innerHTML;if(A==1){UpdateSizeChoices(B,C,1,D)}}function ClearBorder(B,C,A,D){selectedElem=CLOZ.SelectedElems[D][C-1];if(selectedElem!=B){if(!B.className.startsWith("NA")){$(B).className="Normal"}}$("SizeDesc"+D+"-"+C).innerHTML=(selectedElem!=null?selectedElem.innerHTML:"");if(A==1){UpdateSizeChoices(B,C,0,D)}}function UpdateSizeChoices(A,D,C,E){var H=CLOZ.SelectedElems[E][D-1];var F=D==1?CLOZ.SelectedElems[E][1]:CLOZ.SelectedElems[E][0];var G=F==null?null:F.id;var J,B;var I=CLOZ.Sizes[E];if(C==0){if(H==null&&F==null){J=I.get(A.id);UpdateSizeDisplay(A,D,J,null,true)}else{if(H!=null&&F==null){J=I.get(H.id);UpdateSizeDisplay(A,D,J,null,false)}else{if(H==null&&F!=null){J=I.get(A.id);UpdateSizeDisplay(A,D,J,G,true);J=I.get(G);UpdateSizeDisplay(A,D==1?2:1,J,null,false)}else{J=I.get(H.id);B=H.id;UpdateSizeDisplay(A,D,J,G,false)}}}}else{J=I.get(A.id);UpdateSizeDisplay(A,D,J,G,false)}}function UpdateSizeDisplay(A,B,H,D,E){var F=H.split(",");var G=B==1?"b":"a";var C=0;F.each(function(J){var I="S"+C+G;if(E){if(I==D){$(I).className="Selected"}else{$(I).className="Normal"}}else{if(J==2){$(I).className="Selected"}else{if(J==1){if(I==D){$(I).className="Selected"}else{$(I).className="Normal"}}else{if(J==0){if(I==D){$(I).className="NASelected"}else{$(I).className="NA"}}}}}C++})}function SetQty(A,B){Qty=$F(A);CLOZ.Qtys[B]=Qty}function loadPhotoControlPanel(A){var C=CLOZ.ServerPath+"/requesthandler.aspx";var B=uncache("LPCP="+A);new Ajax.Request(C,{method:"get",parameters:B,onComplete:loadPhotoControlPanelSuccess})}function loadPhotoControlPanelSuccess(C){var B=C.responseText.evalJSON();if($(gSelectedEdit)!=null){$(gSelectedEdit).replace(B.ControlPanelHtml);var A=B.EditPhotoModalDialogHtml;A=A.gsub("<br/>","\n");$("EditPhotoPanel").innerHTML=A;$("DeletePhotoPanel").innerHTML=B.DeletePhotoModalDialogHtml;$("MovePhotoPanel").innerHTML=B.MovePhotoModalDialogHtml}}function Rotate(B,A){var D=CLOZ.ServerPath+"/requesthandler.aspx";var C=uncache("RI="+B+"."+A);new Ajax.Request(D,{method:"get",parameters:C,onComplete:RotateImageSuccess});$(B).src=CLOZ.ServerPath+"/includes/indicator2.gif"}function RotateImageSuccess(C){var B=C.responseText.evalJSON();var A=B.SourceElemId;$(A).src=B.ImageUrl}function addCategory(A){if(A==null||A.length==0){alert("Please specify a Category Name!");return}var C=CLOZ.ServerPath+"/requesthandler.aspx";var B=uncache("AC="+A);new Ajax.Request(C,{method:"get",parameters:B,onComplete:addCategorySuccess})}function addCategorySuccess(A){window.open("iManager.aspx","_self")}function deleteCategory(A){var C=CLOZ.ServerPath+"/requesthandler.aspx";var B=uncache("DC="+A);new Ajax.Request(C,{method:"get",parameters:B,onComplete:deleteCategorySuccess})}function deleteCategorySuccess(A){window.open("iManager.aspx","_self")}function editCategory(A){var B=$F("EditCategoryName");if(B==null||B.length==0){alert("Please specify a Category Name!");return}var D=CLOZ.ServerPath+"/requesthandler.aspx";var C=uncache("EC="+A+"&CN="+B);new Ajax.Request(D,{method:"get",parameters:C,onComplete:editCategorySuccess})}function editCategorySuccess(A){window.open("iManager.aspx","_self")}function editPhoto(C){var E=escape($$(".PhotoTitle")[1].value);var A=escape($$(".PhotoDesc")[1].value);var D=escape($$(".PhotoTags")[1].value);var F=CLOZ.ServerPath+"/requesthandler.aspx";var B=uncache("EP="+C+"&TLE="+E+"&DSC="+A+"&TAG="+D);new Ajax.Request(F,{method:"get",parameters:B,onComplete:editPhotoSuccess})}function editPhotoSuccess(A){window.open("iManager.aspx","_self")}function deletePhoto(B){var C=CLOZ.ServerPath+"/requesthandler.aspx";var A=uncache("DP="+B);new Ajax.Request(C,{method:"get",parameters:A,onComplete:deletePhotoSuccess})}function deletePhotoSuccess(A){window.open("iManager.aspx","_self")}function movePhoto(C){var A=$F($$(".Categories")[1]);var D=CLOZ.ServerPath+"/requesthandler.aspx";var B=uncache("MP="+C+"&CID="+A);new Ajax.Request(D,{method:"get",parameters:B,onComplete:movePhotoSuccess})}function movePhotoSuccess(A){window.open("iManager.aspx","_self")}var gEditSelection;var gSelectedImages=new Array();function CreateCategory(){var A=false;var C=$F("NewCategoryName");if(C.length==0){alert("Please specify a name!");return false}var F=$("CategoryList");var D=F.options.length;var E=F.options;for(var B=0;B<E.length;B++){if(C.toLowerCase()==E[B].text.toLowerCase()){F.selectedIndex=B;A=true;break}}if(!A){F.options[D]=new Option(C,-2,true,true)}ToggleCategoryPanel(F)}function ToggleCategoryPanel(A){var B=-1;var C;if(A!=null){B=A.selectedIndex;C=A.options[B].value}else{$("CategoryList").selectedIndex=0}if(B==1){$("CategoryList").style.display="none";$("CreateCategoryPanel").style.display=""}else{$("CategoryList").style.display="";$("CreateCategoryPanel").style.display="none";$("NewCategoryName").value=""}}function MovePhotos(){if(gSelectedImages.length==0){alert("Please select one or more photos you want to move!");return}if($("CategoryList").selectedIndex<2){alert("Please select a category!")}else{var B=$("CategoryList");var F=B.selectedIndex;var A=B.options[F].text;var E="";for(var C=0;C<gSelectedImages.length;C++){var D=gSelectedImages[C];ImgId=D.substring(6);E+=ImgId+","}var H=CLOZ.ServerPath+"/requesthandler.aspx";var G=uncache("PM="+E+"&CN="+A);new Ajax.Request(H,{method:"get",parameters:G,onComplete:MovePhotosSuccess})}}function MovePhotosSuccess(){window.open("iEditor.aspx?MPS=1","_self")}function ApplyTags(){if(gSelectedImages.length==0){alert("Please select one or more photos to apply these tags to!");return}var A=$F("Tags");A=A.gsub(/,{1,}/," ");A=A.gsub(/ {2,}/," ");A=A.strip();if(A.length==0){alert("You did not enter any tags!");return}gSelectedImages.each(function(B){var C="Tag"+B.substring(6);$(C).value=$(C).value+" "+A;$(C).value=$(C).value.strip()})}function SaveDetails(){if(gSelectedImages.length==0){alert("Please select one or more photos to update!");return}var E;var B=new Hash();for(var C=0;C<gSelectedImages.length;C++){var D=gSelectedImages[C];E=D.substring(6);var G=$F("Tit"+E);var A=$F("Dsc"+E);var F=$F("Tag"+E);B.set(D,"qzd"+G+"qzd"+A+"qzd"+F)}var H=CLOZ.ServerPath+"/requesthandler.aspx";new Ajax.Request(H,{method:"post",parameters:B.toQueryString(),onComplete:showSaveDetailsSuccess})}function showSaveDetailsSuccess(){window.open("iEditor.aspx?SDS=1","_self")}function DeletePhotos(){if(gSelectedImages.length==0){alert("Please select one or more photos to delete!");return}var A=confirm("This action will permanently delete these photos from your account and cannot be undone. Do you want to continue?");if(A){var D="";for(var B=0;B<gSelectedImages.length;B++){var C=gSelectedImages[B];ImgId=C.substring(6);D+=ImgId+","}var F=CLOZ.ServerPath+"/requesthandler.aspx";var E=uncache("PD="+D);new Ajax.Request(F,{method:"get",parameters:E,onComplete:DeletePhotosSuccess})}}function DeletePhotosSuccess(){window.open("iEditor.aspx?DPS=1","_self")}var gArrowDeg=0;function RotateImages(A){if(A>0){gArrowDeg+=90}else{gArrowDeg-=90}if(gArrowDeg<0){gArrowDeg=270}if(gArrowDeg>270){gArrowDeg=0}$("batch_rotate_img").src=CLOZ.ServerPath+"/ClozImages/Site/Cloz/Buttons/Arrow"+gArrowDeg+".gif"}function RotatePhotos(){if(gSelectedImages.length==0){alert("Please select one or more photos to rotate!");return}var C="";for(var A=0;A<gSelectedImages.length;A++){var B=gSelectedImages[A];ImgId=B.substring(6);C+=ImgId+","}var E=CLOZ.ServerPath+"/requesthandler.aspx";var D=uncache("PR="+C+"&AGL="+gArrowDeg);new Ajax.Request(E,{method:"get",parameters:D,onComplete:RotatePhotosSuccess});iBox.show("<img src=includes/indicator.gif width=40 height=40 style=vertical-align:bottom />&nbsp;&nbsp;Processing your request...Please wait...","",{width:300})}function RotatePhotosSuccess(){window.open("iEditor.aspx?RPS=1","_self")}function SaveDates(){if(gSelectedImages.length==0){alert("Please select one or more photos to apply your date settings to!");return}var D=$F("DateUploaded");var E=$F("TimeUploaded");if(!isDate(D)){alert("You must specify a real date, not in the future, in the format m/d/y (like 6/4/2006)")}else{if(!isTime(E)){alert("You must specify a real time in the format h/m/s (like 15:23:22)")}else{var C="";for(var A=0;A<gSelectedImages.length;A++){var B=gSelectedImages[A];ImgId=B.substring(6);C+=ImgId+","}var G=CLOZ.ServerPath+"/requesthandler.aspx";var F=uncache("PT="+C+"&DAT="+D+"&TIM="+E);new Ajax.Request(G,{method:"get",parameters:F,onComplete:SaveDatesSuccess})}}}function SaveDatesSuccess(){window.open("iEditor.aspx?STS=1","_self")}function isDate(B){var A=/^(\d{1,2})(\/|-)(\d{1,2})(\/|-)(\d{4})$/;var E=B.match(A);if(E==null){return false}month=E[1];day=E[3];year=E[5];if(month<1||month>12){return false}if(day<1||day>31){return false}if((month==4||month==6||month==9||month==11)&&day==31){return false}if(month==2){var D=(year%4==0&&(year%100!=0||year%400==0));if(day>29||(day==29&&!D)){return false}}var F=new Date();var C=new Date(B);if(C>F){return false}return true}function isTime(B){var A=/^(2[0-3])|[01]{0,1}[0-9]:[0-5]{0,1}[0-9]:[0-5]{0,1}[0-9]$/;return A.test(B)}Event.observe(document,"click",checkTooltips);var gLastTipId;var gIframeId="EditPhotosFrame";function checkTooltips(A){var C=(A&&A.target)||(event&&event.srcElement);var B=$$(".tooltip");B.each(function(D){if(!isTooltipArea(C)){D.style.visibility="hidden";$(gIframeId).style.width=0;$(gIframeId).style.height=0}})}function isTooltipArea(A){return(A.className.substring(0,7)=="tooltip")}function showTooltip(D,E,A){if(gLastTipId!=null){$(gLastTipId).style.visibility="hidden"}$(E).style.visibility="visible";gLastTipId=E;if(!A){var B=findPosX($(D));var C=findPosY($(D));$(E).style.top=(C+20)+"px";$(E).style.left=(B-10)+"px"}positionIFrame($(E),$(gIframeId))}function positionIFrame(A,B){var C=findPosX(A);var D=findPosY(A);B.style.left=C;B.style.top=D;B.style.height=A.offsetHeight;B.style.width=A.offsetWidth;B.style.display="block"}function SelectAll(B){gSelectedImages=new Array();var A=$$(".PhotoImage");if(B){A.each(function(C){gSelectedImages.push(C.id);$(C).style.border="solid 3px red"})}else{A.each(function(C){$(C).style.border="solid 3px #EFEFEF"})}$("SelectedQty").innerHTML=gSelectedImages.length}function ShowDetail(E){var B=$$(".PhotoDetail");var F=$$(".HeadTitle");var A=$$(".HeadDesc");var C=E?"":"none";var D=E?"none":"";B.each(function(G){$(G).style.display=C});F.each(function(G){$(G).style.display=D});A.each(function(G){$(G).style.display=D})}function EnableDetail(A){var B=$$(".PhotoTitle");B.each(function(C){C.disabled=!A});B=$$(".PhotoDesc");B.each(function(C){C.disabled=!A});B=$$(".PhotoTags");B.each(function(C){C.disabled=!A})}function findPosX(B){var A=0;if(B.offsetParent){while(1){A+=B.offsetLeft;if(!B.offsetParent){break}B=B.offsetParent}}else{if(B.x){A+=B.x}}return A}function findPosY(B){var A=0;if(B.offsetParent){while(1){A+=B.offsetTop;if(!B.offsetParent){break}B=B.offsetParent}}else{if(B.y){A+=B.y}}return A}function SelectPhoto(A){var B=false;gSelectedImages.each(function(C){if(A.id==C){gSelectedImages=gSelectedImages.without(A.id);A.style.border="solid 3px #EFEFEF";B=true;throw $break}});if(!B){gSelectedImages.push(A.id);A.style.border="solid 3px red"}$("SelectedQty").innerHTML=gSelectedImages.length}function DoEdit(A){gEditSelection=A;$("BatchTags").style.display="none";$("BatchRotate").style.display="none";$("BatchDelete").style.display="none";$("BatchDate").style.display="none";$("BatchMove").style.display="none";$("SavePanel").style.display="block";$("SavePanel2").style.display="block";switch(A){case 0:$("BatchTags").style.display="block";ShowDetail(true);break;case 1:$("BatchRotate").style.display="block";ShowDetail(false);break;case 2:$("BatchDelete").style.display="block";ShowDetail(false);break;case 3:$("BatchDate").style.display="block";ShowDetail(false);break;case 4:$("BatchMove").style.display="block";ShowDetail(false);break}}function SaveChanges(){switch(gEditSelection){case 0:SaveDetails();break;case 1:RotatePhotos();break;case 2:DeletePhotos();break;case 3:SaveDates();break;case 4:MovePhotos();break}}function SaveSS(D){var B="ctl00_ClozHeader_";if(D==0){$(B+"SearchFull").className="SearchEnabled";$(B+"SearchTags").className="SearchDisabled"}else{$(B+"SearchFull").className="SearchDisabled";$(B+"SearchTags").className="SearchEnabled"}var C=CLOZ.ServerPath+"/requesthandler.aspx";var A=uncache("FSS="+D);new Ajax.Request(C,{method:"get",parameters:A})}function over(A){A.src=A.src.replace(/\.gif/gi,"_over.gif");A.src=A.src.replace(/\.png/gi,"_over.png");A.src=A.src.replace(/\.jpg/gi,"_over.jpg")}function out(A){A.src=A.src.replace(/_over/gi,"")}function SavePackListMode(A){var C=CLOZ.ServerPath+"/requesthandler.aspx";var B=uncache("plmode="+A);new Ajax.Request(C,{method:"get",parameters:B})}function ChangePL(A){var D=CLOZ.ServerPath+"/requesthandler.aspx";var C=$F(A);var B=uncache("cpl="+C);new Ajax.Request(D,{method:"get",parameters:B,onComplete:processPackListUpdate})}function processPackListUpdate(B){var A=B.responseText.evalJSON();var C=A.PackListId;if(A.Href==""){$("ctl00_MainContent_ClozPackList_PackListPdf").removeAttribute("href")}else{$("ctl00_MainContent_ClozPackList_PackListPdf").href=A.Href}$$(".plp").each(function(D){D.hide()});$("PackListPanel"+C).show()}var gLetterElem=null;function FilterOrg(A){var C=$(A).innerHTML;if(gLetterElem!=null){$(gLetterElem).className=""}gLetterElem=A;$(gLetterElem).className="LetterSel";var B=$$(".OrgVal");if(C=="All"){B.each(function(D){$(D).show()})}else{B.each(function(D){$(D).hide()});$(C+"List").show()}}function createCookie(D,E,B){if(B){var A=new Date();A.setTime(A.getTime()+(B*24*60*60*1000));var C="; expires="+A.toGMTString()}else{var C=""}document.cookie=D+"="+E+C+"; path=/"}function readCookie(D){var E=D+"=";var B=document.cookie.split(";");for(var C=0;C<B.length;C++){var A=B[C];while(A.charAt(0)==" "){A=A.substring(1,A.length)}if(A.indexOf(E)==0){return A.substring(E.length,A.length)}}return null}function eraseCookie(A){createCookie(A,"",-1)}function cookiesEnabled(){createCookie("tc","1",1);if(readCookie("tc")==null){return false}else{eraseCookie("tc");return true}}function hide(A){if(A!=null){A.style.display="none"}}function show(A){if(A!=null){A.style.display="block"}}function flipOverview(A){hide($("itemMoreInfo"+A));show($("itemOverview"+A));$("overviewTab"+A).className="tabDown";$("overviewTabChild"+A).className="tabChildDown";if($("moreinfoTab"+A)!=null){$("moreinfoTab"+A).className="tabUp";$("moreinfoTabChild"+A).className="tabChildUp"}}function flipMoreInfo(A){hide($("itemOverview"+A));show($("itemMoreInfo"+A));$("overviewTab"+A).className="tabDown";$("overviewTabChild"+A).className="tabChildDown";if($("moreinfoTab"+A)!=null){$("moreinfoTab"+A).className="tabUp";$("moreinfoTabChild"+A).className="tabChildUp"}if($("moreinfoTab"+A)!=null){$("moreinfoTab"+A).className="tabDown";$("moreinfoTabChild"+A).className="tabChildDown"}$("overviewTab"+A).className="tabUp";$("overviewTabChild"+A).className="tabChildUp"}function IndexProduct(A){this.productNum=A;this.currentColorCode="";this.currentColorName="";this.imageSet=new ImageSet();this.productViews=new ProductViews();this.switchColor=function(B,D){var F=this.productViews.getProductView(B);var C=this.imageSet.getColorImage(B);if(F!==null){this.linkToProductPage(F.productPageURL)}var E=$("productImg"+A);if(E===null){return}this.currentColorCode=B;this.currentColorName=D;if(C===null){return}else{E.src=C}};this.showFront=function(B){var C=this.imageSet.getColorImage(this.getCurrentColorCode());if(C===null){return}var D=$("prdtImg_"+A);if(D===null){return}D.src=C};this.getCurrentColorCode=function(){if(this.currentColorCode===""){this.currentColorCode=this.imageSet.colorImages[0].colorCode}return this.currentColorCode};this.getCurrentColorName=function(){if(this.currentColorName===""){this.currentColorName=this.imageSet.colorImages[0].colorName}return this.currentColorName};this.linkToProductPage=function(D){var C=$("productLink"+A);var B=$("productImg"+A);C.href=D;B.href=C.href}}function ProductList(){this.productArray=new Array();this.addProduct=function(A){this.productArray.push(A)};this.getProduct=function(B){for(var A=0;A<this.productArray.length;A++){if(this.productArray[A].productNum==B){return this.productArray[A]}}return null};this.swatchClicked=function(D,A,B){var C=this.getProduct(D);if(C===null){return}C.switchColor(A,B)};this.mouseOverSw=function(C,A){var B=this.getProduct(C);if(B===null){return}$("SW"+C).innerHTML=A};this.mouseOutSw=function(B){var A=this.getProduct(B);if(A===null){return}$("SW"+B).innerHTML=""};this.linkToProductPage=function(B){var A=this.getProduct(B);if(A===null){return}A.linkToProductPage()};this.preload=function(){for(var A=0;A<this.productArray.length;A++){this.productArray[A].preload()}}}function ProductViews(){this.productViewArray=new Array();this.getProductView=function(A){var B;for(B=0;B<this.productViewArray.length;B++){if(this.productViewArray[B].colorCode==A){return this.productViewArray[B]}}return null}}function ProductView(A,B){this.colorCode=A;this.productPageURL=B}function ColorImage(A,B){this.colorCode=A;this.imageName=B}function ImageSet(A){this.imageSetId=A;this.colorImages=new Array();this.getColorImage=function(B){var C;for(C=0;C<this.colorImages.length;C++){if(this.colorImages[C].colorCode==B){return this.colorImages[C].imageName}}return null}};
