function read_form_action(c,a,d){var b=a.getElementsByTagName("INPUT");attach_element_events(b[0],$(c),d)
}function set_form_action(j,g,n,d){try{var e=new Array();e=n.getElementsByTagName("option");
var l=e[n.selectedIndex].innerHTML;l=l.split(", ");var m=global_response.getElementsByTagName("name");
var b=global_response.getElementsByTagName("appleid");var k="";for(i=0;i<m.length;
i++){if(window.ActiveXObject){if(m[i].text==l[1]){k=b[i].text;break}}else{if(m[i].textContent==l[1]){k=b[i].textContent;
break}}}var a=window.location.toString().split("?");var f=camp_getUrlVars();var h="";
if(a.length>1){h=n.value+"?store="+k;for(i=0;i<f.length;i++){if(f[i]!="store"){h+="&"+f[i]+"="+f[f[i]]
}}}else{h=n.value+"?store="+k}e[n.selectedIndex].value=h}catch(c){}}function attach_element_events(b,c,a){if(window.ActiveXObject){a.attachEvent("onchange",function(){set_form_action(b,c,a)
})}else{a.addEventListener("change",function(){set_form_action(b,c,a)},false)}}function camp_getUrlVars(){var d=[],c;
var a=window.location.href.slice(window.location.href.indexOf("?")+1).split("&");
for(var b=0;b<a.length;b++){c=a[b].split("=");d.push(c[0]);d[c[0]]=c[1]}return d
}function convert_string_to_xml(a){var b=a;try{xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async="false";xmlDoc.loadXML(b);return xmlDoc}catch(c){parser=new DOMParser();
xmlDoc=parser.parseFromString(b,"text/xml");return xmlDoc}}global_response="";Event.onDOMReady(function(){var delegate={storeLinkForStoreWithConciergeIdStateNamed:function(storeCode,stateName){return"/retail/youthworkshops/results.html?store="+storeCode
},shouldSelectStoreWithCode_defaultValue_:function(storeCode,selected){if(typeof global_store_num!=="undefined"&&storeCode===global_store_num){return true
}return selected}};var initStoreSelector=function(){return(function(response){var oCountryStoreStack;
if(response.responseObject){oCountryStoreStack=response.responseObject}else{global_response=response.responseText;
oCountryStoreStack=eval("("+global_response+")")}var requestedCountry=oCountryStoreStack[0].country;
var cache_states=new Array();var xmlstr="<records storeWidgetVersion='1.0' conciergeWidgetVersion='1.0'>";
xmlstr+="<country name='"+requestedCountry+"'>";var hideStates=false;if(oCountryStoreStack[0].availableStores[0].state==oCountryStoreStack[0].country){hideStates=true;
$("youthsignup-location").style.display="none"}else{$("youthsignup-location").style.display="inline"
}for(var i=0;i<oCountryStoreStack[0].availableStores.length;i++){var tempstr="";
switch(oCountryStoreStack[0].availableStores[i].state){case"Alaska":tempstr="<state name='AK'>";
break;case"Alabama":tempstr="<state name='AL'>";break;case"Arizona":tempstr="<state name='AZ'>";
break;case"Arkansas":tempstr="<state name='AR'>";break;case"California":tempstr="<state name='CA'>";
break;case"Colorado":tempstr="<state name='CO'>";break;case"Connecticut":tempstr="<state name='CT'>";
break;case"Delaware":tempstr="<state name='DE'>";break;case"District of Columbia":tempstr="<state name='DC'>";
break;case"Florida":tempstr="<state name='FL'>";break;case"Georgia":tempstr="<state name='GA'>";
break;case"Hawaii":tempstr="<state name='HI'>";break;case"Idaho":tempstr="<state name='ID'>";
break;case"Illinois":tempstr="<state name='IL'>";break;case"Indiana":tempstr="<state name='IN'>";
break;case"Iowa":tempstr="<state name='IA'>";break;case"Kansas":tempstr="<state name='KS'>";
break;case"Kentucky":tempstr="<state name='KY'>";break;case"Louisiana":tempstr="<state name='LA'>";
break;case"Maine":tempstr="<state name='ME'>";break;case"Maryland":tempstr="<state name='MD'>";
break;case"Massachusetts":tempstr="<state name='MA'>";break;case"Michigan":tempstr="<state name='MI'>";
break;case"Minnesota":tempstr="<state name='MN'>";break;case"Mississippi":tempstr="<state name='MS'>";
break;case"Missouri":tempstr="<state name='MO'>";break;case"Montana":tempstr="<state name='MT'>";
break;case"Nebraska":tempstr="<state name='NE'>";break;case"Nevada":tempstr="<state name='NV'>";
break;case"New Hampshire":tempstr="<state name='NH'>";break;case"New Jersey":tempstr="<state name='NJ'>";
break;case"New Mexico":tempstr="<state name='NM'>";break;case"New York":tempstr="<state name='NY'>";
break;case"North Carolina":tempstr="<state name='NC'>";break;case"North Dakota":tempstr="<state name='ND'>";
break;case"Ohio":tempstr="<state name='OH'>";break;case"Oklahoma":tempstr="<state name='OK'>";
break;case"Oregon":tempstr="<state name='OR'>";break;case"Pennsylvania":tempstr="<state name='PA'>";
break;case"Rhode Island":tempstr="<state name='RI'>";break;case"South Carolina":tempstr="<state name='SC'>";
break;case"South Dakota":tempstr="<state name='SD'>";break;case"Tennessee":tempstr="<state name='TN'>";
break;case"Texas":tempstr="<state name='TX'>";break;case"Utah":tempstr="<state name='UT'>";
break;case"Vermont":tempstr="<state name='VT'>";break;case"Virginia":tempstr="<state name='VA'>";
break;case"Washington":tempstr="<state name='WA'>";break;case"West Virginia":tempstr="<state name='WV'>";
break;case"Wisconsin":tempstr="<state name='WI'>";break;case"Wyoming":tempstr="<state name='WY'>";
break;case"Fukuoka":tempstr="<state name='Fukuoka'>";break;case"Tokyo":tempstr="<state name='Tokyo'>";
break;case"Germany":tempstr="<state name='Germany'>";break;case"New South Wales":tempstr="<state name='NSW'>";
break;case"Victoria":tempstr="<state name='VIC'>";break;case"Queensland":tempstr="<state name='QLD'>";
break;case"Queensland":tempstr="<state name='QLD'>";break;case"Quebec":tempstr="<state name='QC'>";
break;case"Ontario":tempstr="<state name='ON'>";break;case"British Columbia":tempstr="<state name='BC'>";
break;case"France":tempstr="<state name='France'>";break;case"Italy":tempstr="<state name='Italy'>";
break;case"Switzerland German":tempstr="<state name='CHDE'>";break;case"Geneva":tempstr="<state name='Geneva'>";
break;case"Surrey":tempstr="<state name='Surrey'>";break;case"Kent":tempstr="<state name='Kent'>";
break;case"UK":tempstr="<state name='UK'>";break;default:tempstr='<state name="'+oCountryStoreStack[0].availableStores[i].state+'">'
}var use_it="true";if(cache_states.length==0){cache_states.push(oCountryStoreStack[0].availableStores[i].state)
}else{for(var x=0;x<cache_states.length;x++){if(oCountryStoreStack[0].availableStores[i].state==cache_states[x]){use_it="false"
}}}if(use_it=="true"){cache_states.push(oCountryStoreStack[0].availableStores[i].state);
xmlstr+=tempstr;for(var g=0;g<oCountryStoreStack[0].availableStores.length;g++){if(oCountryStoreStack[0].availableStores[g].state==oCountryStoreStack[0].availableStores[i].state){xmlstr+="<store><appleid>"+oCountryStoreStack[0].availableStores[g].appleid+"</appleid><name>"+oCountryStoreStack[0].availableStores[g].name+"</name><city>"+oCountryStoreStack[0].availableStores[g].city+"</city><phone>(555) 366-8477</phone><link>default</link></store>"
}}xmlstr+="</state>"}}xmlstr+="</country>";xmlstr+="</records>";global_response=convert_string_to_xml(xmlstr);
var responseDocument=global_response;var countriesWithStores=responseDocument.getElementsByTagName("country");
new StoreSelector(global_response,$("youthsignup-location"),$("youthsignup-store"),$("youthsignup-submit"),"promo",delegate)
})};var lang=document.getElementsByTagName("html")[0].getAttribute("lang");var poststr="appID="+encodeURI("192")+"&";
poststr+="overrideauthentication="+encodeURI("true")+"&";poststr+="locale="+encodeURI(lang?lang:"en_US");
var url="/retail/scripts/concierge_data.php?type=youth";new Ajax.Request(url,{method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",encoding:"UTF-8",parameters:poststr,onSuccess:initStoreSelector()})
});

