function SetTempCookie(aa,ba){document.cookie=aa+"="+escape(ba);}
function GetTempCookie(ga){var ha=document.cookie.indexOf(ga+"=");var ia=ha+ga.length+1;if(!ha&&(ga!=document.cookie.substring(0,ga.length))){return null;}
if(ha==-1){return null;}
var ja=document.cookie.indexOf(";",ia);if(ja==-1){ja=document.cookie.length;}
return unescape(document.cookie.substring(ia,ja));}
function SetCookie(ca,da){var ea=new Date();ea.setTime(ea.getTime());expires=10*365*1000*60*60*24;var fa=new Date(ea.getTime()+(expires));document.cookie=ca+"="+escape(da)+((expires)?";expires="+fa.toGMTString():"");}
function GetCookie(ka){var la=document.cookie.indexOf(ka+"=");var ma=la+ka.length+1;if(!la&&(ka!=document.cookie.substring(0,ka.length))){return null;}
if(la==-1){return null;}
var na=document.cookie.indexOf(";",ma);if(na==-1){na=document.cookie.length;}
return unescape(document.cookie.substring(ma,na));}
function printCard(oa){alert('Note: Set your printer page options to landscape mode for best results.');x=document.getElementById('idUsers').value;window.open(oa+'/gemhuntprint.asp?uid='+x,'gemhuntprint','height=400,width=800,scrollbars=no, menubar=no,statusbar=no');}
function GetUsers(){uid=GetCookie('users');i=uid.indexOf(';');while(i>0){document.writeln("<option value="+uid.substring(0,i)+">"+uid.substring(0,i)+"</option>");uid=uid.substring(i+1);i=uid.indexOf(';');}}
function SwitchUser(){x=document.getElementById('idUsers').value;gemsData=GetCookie(x);if(gemsData==null)gemsData='000000000000000000000000000000';count=0;for(i=0;i<30;i++){if(gemsData.substring(i,i+1)=='1'){eval("document.getElementById('check"+(i+1)+"').checked = true;");count=count+1;}
else{eval("document.getElementById('check"+(i+1)+"').checked = false;");}}
document.getElementById('idName').innerHTML=x+"'s Gem Hunt Card";document.getElementById('idCount').innerHTML='You have collected '+count+' out of 30';}
function AddName(){x=prompt("What name would you like to add?","");if(x==null||x=="null"){alert('You may have popup or script blockers turned on.  Temporarily turn them off for this site to add a new name.');}
else{control=document.getElementById('idUsers');control.options.length=control.options.length+1;control.options[control.options.length-1]=new Option(x,x);users='';for(i=0;i<control.length;i++){users=users+control[i].value+';';}
SetCookie('users',users);control.value=x;SwitchUser();}}
function checkGemBox(){gemsData='';count=0;for(i=1;i<=30;i++){if(eval("document.getElementById('check"+i+"').checked")){gemsData+='1';count=count+1;}
else{gemsData+='0';}}
SetCookie(document.getElementById('idUsers').value,gemsData);document.getElementById('idCount').innerHTML='You have collected '+count+' out of 30';}
function PrintSwitchUser(pa){gemsData=GetCookie(pa);for(i=0;i<30;i++){if(gemsData.substring(i,i+1)=='1'){eval("document.getElementById('check"+(i+1)+"').checked = true;");}
else{eval("document.getElementById('check"+(i+1)+"').checked = false;");}}}
function SwitchUser2(){x=document.getElementById('idUsers').value;gemsData=GetCookie(x);if(gemsData==null)gemsData='000000000000000000000000000000';count=0;for(i=0;i<30;i++){num=gemsData.substring(i,i+1);if(isNaN(num))num=0;if(num>0)count=count+1;eval("document.getElementById('check"+(i+1)+"').innerHTML = num;");}
document.getElementById('idName').innerHTML=x+"'s Gem Hunt Card";document.getElementById('idCount').innerHTML='You have collected '+count+' out of 30';}
function checkGemBox2(id,qa){count=parseInt(document.getElementById(id).innerHTML);if(isNaN(count))count=0;if(qa){if(count<9)count=count+1;}
else{if(count>0)count=count-1;}
document.getElementById(id).innerHTML=count;gemsData='';count=0;for(i=1;i<=30;i++){x=eval("document.getElementById('check"+i+"').innerHTML");if(x==null||x.length!=1)x='0';gemsData+=x;if(x>0)count=count+1;}
SetCookie(document.getElementById('idUsers').value,gemsData);document.getElementById('idCount').innerHTML='You have collected '+count+' out of 30';}
function resetCardVerify(){if(confirm('Reset all counters back to 0?')){resetCard();}}
function crownCardVerify(){if(confirm('This will take away 1 from the count on every gem.')){crownOfWonderCard();}}
function resetCard(){gemsData='000000000000000000000000000000';SetCookie(document.getElementById('idUsers').value,gemsData);for(i=0;i<30;i++){num=gemsData.substring(i,i+1);eval("document.getElementById('check"+(i+1)+"').innerHTML = num;");}
document.getElementById('idName').innerHTML=x+"'s Gem Hunt Card";document.getElementById('idCount').innerHTML='You have collected 0 out of 30';}
function crownOfWonderCard(){x=document.getElementById('idUsers').value;gemsData=GetCookie(x);if(gemsData.indexOf('0')>-1){alert('Sorry, one or more of your counters is already 0.');return;}
newGemData='';totalCount=0;for(jj=0;jj<30;jj++){count=parseInt(gemsData.charAt(jj));count=count-1;if(count>0)totalCount++;newGemData=newGemData+''+count;}
SetCookie(document.getElementById('idUsers').value,newGemData);SwitchUser2();}
function printCard2(ra){alert('Note: Set your printer page options to landscape mode for best results.');x=document.getElementById('idUsers').value;window.open(ra+'/gemhuntprint2.asp?uid='+x,'gemhuntprint','height=400,width=800,scrollbars=no, menubar=no,statusbar=no');}
function PrintSwitchUser2(sa){gemsData=GetCookie(sa);if(gemsData==null)gemsData='000000000000000000000000000000';count=0;for(i=0;i<30;i++){num=gemsData.substring(i,i+1);if(num>0)count=count+1;eval("document.getElementById('check"+(i+1)+"').innerHTML = num;");}
document.getElementById('idName').innerHTML=sa+"'s Gem Hunt Card";document.getElementById('idName2').innerHTML='You have collected '+count+' out of 30';}
function AddName2(){x=prompt("What name would you like to add?","");if(x==null||x=="null"){alert('You may have popup or script blockers turned on.  Temporarily turn them off for this site to add a new name.');}
else{control=document.getElementById('idUsers');control.options.length=control.options.length+1;control.options[control.options.length-1]=new Option(x,x);users='';for(i=0;i<control.length;i++){users=users+control[i].value+';';}
SetCookie('users',users);control.value=x;SwitchUser2();}}
function checkTradingCard(ta,ua,va){cardData='';x1_count=0;for(i=1;i<=va;i++){if(eval("document.getElementById('"+ta+i+"').checked")){cardData+='1';x1_count=x1_count+1;}
else{cardData+='0';}}
SetCookie(ta,cardData);document.getElementById(ua).innerHTML='You have collected '+x1_count+' out of '+va;}
function initTradingCardCheckBoxes(){q2=initOneSet('card',80);document.getElementById('idCount').innerHTML='You have collected '+q2+' out of 80';q2=initOneSet('chall',15);document.getElementById('idCountChall').innerHTML='You have collected '+q2+' out of 15';q2=initOneSet('curio',8);document.getElementById('idCountCurio').innerHTML='You have collected '+q2+' out of 8';q2=initOneSet('Doodlez',8);document.getElementById('idCountDoodlez').innerHTML='You have collected '+q2+' out of 8';q2=initOneSet('Free',4);document.getElementById('idCountFree').innerHTML='You have collected '+q2+' out of 4';}
function initTradingCard2CheckBoxes(){q3=initOneSet('cardTC2_',85);document.getElementById('idCountTC2').innerHTML='You have collected '+q3+' out of 85';q3=initOneSet('chall2_',15);document.getElementById('idCountChall2').innerHTML='You have collected '+q3+' out of 15';q3=initOneSet('wtales_',8);document.getElementById('idCountWTales').innerHTML='You have collected '+q3+' out of 8';q3=initOneSet('atpaw_',8);document.getElementById('idCountAtPaw').innerHTML='You have collected '+q3+' out of 8';}
function initTradingCard3CheckBoxes(){q3=initOneSet('newarr3_',20);document.getElementById('idCountNewArrive3').innerHTML='You have collected '+q3+' out of 20';q3=initOneSet('recfoo3_',10);document.getElementById('idCountRecFoo3').innerHTML='You have collected '+q3+' out of 10';q3=initOneSet('funweb3_',10);document.getElementById('idCountFunWeb3').innerHTML='You have collected '+q3+' out of 10';q3=initOneSet('rarrar3_',5);document.getElementById('idCountRarRar3').innerHTML='You have collected '+q3+' out of 5';q3=initOneSet('favfri3_',10);document.getElementById('idCountFavFri3').innerHTML='You have collected '+q3+' out of 10';q3=initOneSet('citkin3_',10);document.getElementById('idCountCitKin3').innerHTML='You have collected '+q3+' out of 10';q3=initOneSet('petown3_',10);document.getElementById('idCountPetOwn3').innerHTML='You have collected '+q3+' out of 10';q3=initOneSet('webwin3_',10);document.getElementById('idCountWebWin3').innerHTML='You have collected '+q3+' out of 10';q3=initOneSet('holkin3_',5);document.getElementById('idCountHolKin3').innerHTML='You have collected '+q3+' out of 5';q3=initOneSet('webpro3_',10);document.getElementById('idCountWebPro3').innerHTML='You have collected '+q3+' out of 10';q3=initOneSet('sparkle3_',8);document.getElementById('idCountSparkle3').innerHTML='You have collected '+q3+' out of 8';}
function initTradingCard3PrizesCheckBoxes(){q3=initOneSet('tc3_char_',21);document.getElementById('idCountTC3Chars').innerHTML='You have collected '+q3+' out of 21';q3=initOneSet('tc3_condo_',17);document.getElementById('idCountTC3Condo').innerHTML='You have collected '+q3+' out of 17';q3=initOneSet('tc3_posters_',12);document.getElementById('idCountTC3Posters').innerHTML='You have collected '+q3+' out of 12';q3=initOneSet('tc3_coll_',8);document.getElementById('idCountTC3Coll').innerHTML='You have collected '+q3+' out of 8';}
function initTradingCard4PrizesCheckBoxes(){q3=initOneSet('tc4_char_',34);document.getElementById('idCounttc4Chars').innerHTML='You have collected '+q3+' out of 34';q3=initOneSet('tc4_posters_',9);document.getElementById('idCounttc4Posters').innerHTML='You have collected '+q3+' out of 9';q3=initOneSet('tc4_coll_',17);document.getElementById('idCounttc4Coll').innerHTML='You have collected '+q3+' out of 17';}
function initOneSet(wa,xa){count=0;cardData=GetCookie(wa);if(cardData==null){cardData='';for(i=0;i<xa;i++)cardData=cardData+'0';}
for(i=0;i<=cardData.length-1;i++){if(cardData.substring(i,i+1)=='1'){eval("document.getElementById('"+wa+(i+1)+"').checked = true;");count=count+1;}
else{eval("document.getElementById('"+wa+(i+1)+"').checked = false;");}}
return count;}
function printTradingCardChecklist(ya){window.open(ya+'/tradingcardprint.asp','tradingcardprint','height=400,width=800,scrollbars=no, menubar=no,statusbar=no');}
function printTradingCard2Checklist(za){window.open(za+'/tradingcard2checklist_print.asp','tradingcard2print','height=400,width=800,scrollbars=no, menubar=no,statusbar=no');}
function printTradingCard3Checklist(Aa){window.open(Aa+'/tradingcard3checklist_print.asp','tradingcard3print','height=400,width=800,scrollbars=no, menubar=no,statusbar=no');}
function printTradingCard3PrizesChecklist(Ba){window.open(Ba+'/tradingcard3prizeschecklist_print.asp','tradingcard3prizesprint','height=400,width=800,scrollbars=no, menubar=no,statusbar=no');}
function printTradingCard4PrizesChecklist(Ca){window.open(Ca+'/tradingcard4prizeschecklist_print.asp','tradingcard4prizesprint','height=400,width=800,scrollbars=no, menubar=no,statusbar=no');}
function checkCharm(Da,Ea,Fa){charmData='';count=0;for(i=1;i<=Fa;i++){if(eval("document.getElementById('"+Da+i+"').checked")){charmData+='1';count=count+1;}
else{charmData+='0';}}
SetCookie('charm',charmData);document.getElementById(Ea).innerHTML='You have collected '+count+' out of '+Fa;}
function initCheckBoxes(){count=0;charmData=GetCookie('charm');if(charmData==null){document.getElementById('idCount').innerHTML='You have collected 0 out of 24';return;}
for(i=0;i<=charmData.length-1;i++){if(charmData.substring(i,i+1)=='1'){eval("document.getElementById('charm"+(i+1)+"').checked = true;");count=count+1;}
else{eval("document.getElementById('charm"+(i+1)+"').checked = false;");}}
document.getElementById('idCount').innerHTML='You have collected '+count+' out of 24';}
function printCharmChecklist(Ga){window.open(Ga+'/charmchecklistprint.asp','charmchecklistprint','height=400,width=800,scrollbars=no, menubar=no,statusbar=no');}
function checkFigurine(Ha,Ia,Ja){figurineData='';count=0;for(i=1;i<=Ja;i++){if(eval("document.getElementById('"+Ha+i+"').checked")){figurineData+='1';count=count+1;}
else{figurineData+='0';}}
SetCookie('figurine',figurineData);document.getElementById(Ia).innerHTML='You have collected '+count+' out of '+Ja;}
function initFigurineCheckBoxes(){count=0;figurineData=GetCookie('figurine');if(figurineData==null){document.getElementById('idCount').innerHTML='You have collected 0 out of 24';return;}
for(i=0;i<=figurineData.length-1;i++){if(figurineData.substring(i,i+1)=='1'){eval("document.getElementById('figurine"+(i+1)+"').checked = true;");count=count+1;}
else{eval("document.getElementById('figurine"+(i+1)+"').checked = false;");}}
document.getElementById('idCount').innerHTML='You have collected '+count+' out of 24';}
function printFigurineChecklist(Ka){window.open(Ka+'/webkinz_figurines_checklist_print.asp','figurinechecklistprint','height=400,width=800,scrollbars=no, menubar=no,statusbar=no');}
function checkFigurine2(La,Ma,Na,Oa){figurineData='';count=0;for(i=1;i<=Na;i++){if(eval("document.getElementById('"+La+i+"').checked")){figurineData+='1';count=count+1;}
else{figurineData+='0';}}
SetCookie(Oa,figurineData);document.getElementById(Ma).innerHTML='You have collected '+count+' out of '+Na;}
function initFigurine2CheckBoxes(Pa,Qa,Ra,Sa){count=0;figurineData=GetCookie(Sa);if(figurineData==null){document.getElementById(Qa).innerHTML='You have collected 0 out of '+Ra;return;}
for(i=0;i<=figurineData.length-1;i++){if(figurineData.substring(i,i+1)=='1'){eval("document.getElementById('"+Pa+(i+1)+"').checked = true;");count=count+1;}
else{eval("document.getElementById('"+Pa+(i+1)+"').checked = false;");}}
document.getElementById(Qa).innerHTML='You have collected '+count+' out of '+Ra;}
function printFigurine2Checklist(Ta){window.open(Ta+'/webkinz_figurines2_checklist_print.asp','figurinechecklistprint','height=400,width=800,scrollbars=no, menubar=no,statusbar=no');}
function checkPet(Ua){x="";count=0;field=document.f1.pettype;for(i=0;i<field.length;i++){if(field[i].checked==true){x=x+";"+field[i].value;count++;}}
x=x+";";SetCookie('pettypes',x);document.getElementById('idCount').innerHTML='You have collected '+count+' out of '+Ua;}
function initPetCheckBoxes(Va){count=0;field=document.f1.pettype;for(i=0;i<field.length;i++){if(field[i].checked==true)count++;}
document.getElementById('idCount').innerHTML='You have collected '+count+' out of '+Va;}
function printPetChecklist(Wa){window.open(Wa+'/petchecklist_print.asp','petchecklist_print','height=400,width=800,scrollbars=no, menubar=no,statusbar=no');}
function checkRare(){x="";count=0;field=document.f1.rareitemID;for(i=0;i<field.length;i++){if(field[i].checked==true){x=x+";"+field[i].value;count++;}}
x=x+";";SetCookie('rareitemID',x);}
function printRareChecklist(Xa){window.open(Xa+'/rarechecklist_print.asp','petchecklist_print','height=400,width=800,scrollbars=no, menubar=no,statusbar=no');}
function checkExclusive(){x="";count=0;field=document.f1.exclusiveitemID;for(i=0;i<field.length;i++){if(field[i].checked==true){x=x+";"+field[i].value;count++;}}
x=x+";";SetCookie('exclusiveitemID',x);}
function printExclusiveChecklist(Ya){window.open(Ya+'/checklist_exclusive_print.asp','petchecklist_print','height=400,width=800,scrollbars=no, menubar=no,statusbar=no');}
function checkGeneric(Za,$a){x="";eval('field=document.f1.'+Za);count=0;for(i=0;i<field.length;i++){if(field[i].checked==true){x=x+";"+field[i].value;count++;}}
x=x+";";SetCookie($a,x);}
function printGenericChecklist(ab){window.open(ab+'/checklist_exclusive_print.asp','petchecklist_print','height=400,width=800,scrollbars=no, menubar=no,statusbar=no');}
function asc_AddName(){x=prompt("What name would you like to add?","");if(x==null||x=="null"){alert('You may have popup or script blockers turned on.  Temporarily turn them off for this site to add a new name.');}
else{control=document.getElementById('idUsers');control.options.length=control.options.length+1;control.options[control.options.length-1]=new Option(x,x);users='';for(i=0;i<control.length;i++){users=users+control[i].value+';';}
SetCookie('users',users);control.value=x;asc_SwitchUser();}}
function asc_GetUsers(){uid=GetCookie('users');i=uid.indexOf(';');while(i>0){document.writeln("<option value="+uid.substring(0,i)+">"+uid.substring(0,i)+"</option>");uid=uid.substring(i+1);i=uid.indexOf(';');}}
function asc_SwitchUser(){x=document.getElementById('idUsers').value;asc_Data=GetCookie('asc_'+x);if(asc_Data==null)asc_Data='000000000000000000000';count=0;for(i=0;i<21;i++){if(asc_Data.substring(i,i+1)=='1'){eval("document.getElementById('asc_check"+(i+1)+"').checked = true;");count=count+1;}
else{eval("document.getElementById('asc_check"+(i+1)+"').checked = false;");}}
document.getElementById('idName').innerHTML=x+"'s Star Challenge Card";document.getElementById('idCount').innerHTML='You have collected '+count+' out of 21';}
function asc_check(){asc_Data='';count=0;for(i=1;i<=21;i++){if(eval("document.getElementById('asc_check"+i+"').checked")){asc_Data+='1';count=count+1;}
else{asc_Data+='0';}}
SetCookie('asc_'+document.getElementById('idUsers').value,asc_Data);document.getElementById('idCount').innerHTML='You have collected '+count+' out of 21';}
function asc_PrintSwitchUser(bb){asc_Data=GetCookie('asc_'+bb);if(asc_Data==null)asc_Data='000000000000000000000000000000';count=0;for(i=0;i<21;i++){if(asc_Data.substring(i,i+1)=='1'){eval("document.getElementById('asc_check"+(i+1)+"').checked = true;");count=count+1;}
else{eval("document.getElementById('asc_check"+(i+1)+"').checked = false;");}}
document.getElementById('idName').innerHTML=bb+"'s Star Challenge Card";document.getElementById('idCount').innerHTML='You have collected '+count+' out of 21';}
function asc_PrintCard(cb){alert('Note: Set your printer page options to landscape mode for best results.');x=document.getElementById('idUsers').value;window.open(cb+'/checklist_starchallenge_print.asp?uid='+x,'starchallengeprint','height=400,width=800,scrollbars=no, menubar=no,statusbar=no');}
function checkStudio(){x="";count=0;field=document.f1.studioID;for(i=0;i<field.length;i++){if(field[i].checked==true){x=x+";"+field[i].value;count++;}}
x=x+";";SetCookie('studioID',x);}
function checkRecipe(id,db){x="";count=0;field=eval('document.f1.'+id);for(i=0;i<field.length;i++){if(field[i].checked==true){x=x+";"+field[i].value;count++;}}
x=x+";";SetCookie(id,x);document.getElementById('id'+id+'Count').innerHTML='You have collected '+count+' out of '+db;}