var expired="Wed, 13 Jun 2000 00:00:01 UTC";var expires;setExpires(24*365);var ismac=(navigator.appVersion.indexOf("Mac")!=-1)?true:false;function MM_swapImgRestore(){var i,x,a=document.MM_sr;for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)x.src=x.oSrc;}
function MM_preloadImages(){var d=document;if(d.images){if(!d.MM_p)d.MM_p=new Array();var i,j=d.MM_p.length,a=MM_preloadImages.arguments;for(i=0;i<a.length;i++)
if(a[i].indexOf("#")!=0){d.MM_p[j]=new Image;d.MM_p[j++].src=a[i];}}}
function MM_swapImage(){var i,j=0,x,a=MM_swapImage.arguments;document.MM_sr=new Array;for(i=0;i<(a.length-2);i+=3)
if((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x;if(!x.oSrc)x.oSrc=x.src;x.src=a[i+2];}}
function MM_findObj(n,d){var p,i,x;if(!d)d=document;if((p=n.indexOf("?"))>0&&parent.frames.length){d=parent.frames[n.substring(p+1)].document;n=n.substring(0,p);}
if(!(x=d[n])&&d.all)x=d.all[n];for(i=0;!x&&i<d.forms.length;i++)x=d.forms[i][n];for(i=0;!x&&d.layers&&i<d.layers.length;i++)x=MM_findObj(n,d.layers[i].document);if(!x&&document.getElementById)x=document.getElementById(n);return x;}
function MM_showHideLayers(){var i,p,v,obj,args=MM_showHideLayers.arguments;for(i=0;i<(args.length-2);i+=3)if((obj=MM_findObj(args[i]))!=null){v=args[i+2];if(obj.style){obj=obj.style;v=(v=='show')?'visible':(v=='hide')?'hidden':v;}
obj.visibility=v;}}
function getKey(name){name=name.replace(/s:/,"");return"s:"+name;}
function removeCookie(name){emptyStr="=; path=/; expires="+expired;document.cookie=name+emptyStr;}
function resetExpires(){expires=expired;}
function setExpires(hours){var now=(new Date()).getTime();var d=new Date(now+hours*60*60*1000);expires=d.toGMTString();return expires;}
function setCookie(name,value){document.cookie=name+"="+value+"; path=/"+"; expires="+expires;return value;}
function setKey(name,value){var now=getCookie("dccart");var keyname=getKey(name);if(now){document.cookie="dccart="+now+"|"+getKey(name)+"^"+value+"; path=/"+"; expires=";}
else{document.cookie="dccart="+getKey(name)+"^"+value+"; path=/"+"; expires=";}
return value;}
function sumCookie(name,value){var qtynow=getCookie(name);var qty=parseInt(value)+parseInt(qtynow);return qty;}
function sumKey(name,value){return sumCookie(getCookie(getKey(name)),value);}
function removeKey(name){removeCookie(getKey(name));}
function removeCart(cartname){var oldvalue=cartname.replace(/\.[0-9]+/,"");cartname=cartname.replace(/\.[0-9]+/,".[0-9]+");removeCookie(oldvalue);var cart=getCookie('dccart');cart=eval("cart.replace(/"+cartname+"/g,\"\")");cart=cart.replace(/^\|+/,"");cart=cart.replace(/\|+$/,"");setCookie('dccart',cart);}
function getCookieVal(offset){var endstr=document.cookie.indexOf(";",offset);if(endstr==-1)
endstr=document.cookie.length;return document.cookie.substring(offset,endstr);}
function getCookie(name){var arg=name+"=";var alen=arg.length;var clen=document.cookie.length;var i=0;while(i<clen){var j=i+alen;if(document.cookie.substring(i,j)==arg)
return getCookieVal(j);i=document.cookie.indexOf(" ",i)+1;if(i==0)break;}
return 0;}
function addToCart(sku,name,price,qty,invcount){var key=getKey(sku);var msg="";var doit=false;document.cookie="testcookie=mytestvalue; path=/";if(getCookie("testcookie")!="mytestvalue"){alert("\nNO COOKIE SUPPORT\n \nYou will not be able to use the shopping basket without cookie support.\n \nFor more information on Cookie Support and turning it on please see your Browsers help section.\n");}else if(qty>0){qty=sumCookie(key,qty);if(invcount==0){alert("Your selection is out-of-stock, please make another choice");}
else{doit=true;}}else{removeCookie(key);alert("Removed "+unescape(name)+" from shopping basket.");}
return doit;}
function toPrice(price){var s=(price+".0").toString().split(".");var t="";s[1]=s[1].substring(0,2);if(s[1]<10){t="0";}else{t="";}
return'$'+s[0]+"."+s[1]+t;}
function calcTotal(qty,price){var q=parseInt(qty);var p=toFloat(price);var total=0;for(i=0;i<q;i++){total+=p;}
return toPrice(total);}
function toFloat(price){price=price.replace(/\$/,"");return parseFloat(price);}
function checkValue(ret,name,val){var s=ret;if(!val){alert("The value of "+name+" needs to be filled in.");s="";}
return s;}
function condSetCookie(name,value){if(getCookie('rememberme')!=""){setCookie(name,value);}}
function condGetCookie(name){var s=getCookie(name);return s?s:"";}
function emptyField(field){return(!field||field.value==""||(field.type=="checkbox"&&!field.checked))?true:false;}
function makeArray(n){this.length=n;for(var i=1;i<=n;i++){this[i]=0;}
return this;}
function printDateNow(){var now=new Date();document.write(now.toLocaleString());}
function stripSpace(strNumber){var strNoSpace="";var i;for(i=0;i<strNumber.length;i++){var c=strNumber.charAt(i);if(c==' ')
continue;strNoSpace+=c;}
return strNoSpace;}
var triesleft=1;function oneClick(){if(triesleft>0){triesleft-=1;return true;}
else{return false;}}
var luhntries=0;function verifyCard(){document.billing.cartcreditcardnumber.value=stripSpace(document.billing.cartcreditcardnumber.value);var dateNow=new Date();var nCurrentYear=dateNow.getFullYear();luhntries+=1;if(luhntries>4){alert("For security reasons we have chosen to not accept any more credit card attempts.\nPlease contact customer service if you are continuing to have problems entering your credit card.");return false;}
var nSelectedYear="20"+document.billing.cartyear.options[document.billing.cartyear.selectedIndex].value;if(nSelectedYear<nCurrentYear){alert("The expiry date you specified is in the past!\n\nPlease use another credit card or enter the proper expiry date.");document.billing.cartyear.focus();return false;}else if(nSelectedYear==nCurrentYear){var nSelectedMonth=document.billing.cartmonth.selectedIndex;var nCurrentMonth=dateNow.getMonth()+1;if(nSelectedMonth<nCurrentMonth){alert("The expiry date you specified is in the past!\n\nPlease use another credit card or enter the proper expiry date.");document.billing.cartmonth.focus();return false;}}
if(document.billing.cartcreditcardnumber.value.search("^[0-9]([0-9]| )*[0-9]$")){alert("Use only digits to specify your credit card number!");document.billing.cartcreditcardnumber.focus();return false;}
var ccnumber=stripSpace(document.billing.cartcreditcardnumber.value);var sum=0;var i;var digit;var lastDoubled=0;for(i=(ccnumber.length-1);i>=0;i--){digit=ccnumber.charAt(i);sum+=parseInt(digit);lastDoubled++;if(lastDoubled>1){lastDoubled=0;sum+=parseInt(digit);if(digit>4)
sum-=9;}}
var strSum=sum.toString();if(strSum.charAt(strSum.length-1)!="0"||ccnumber.length<10||ccnumber.length>17||sum==0){alert("Invalid Credit Card Number.");document.billing.cartcreditcardnumber.focus();return false;}
return true;}
function checkHow(){if(document.billing.tagentstring.selectedIndex==0){alert('Please tell us how you found out about us!');document.billing.tagentstring.focus();return false;}
return true;}
function checkSubmitCreditCard(checkcvv2){var size=checkcvv2?4:3;var required=new makeArray(size);var requiredMessage=new makeArray(size);var i;required[0]="document.billing.cartcardholdername";required[1]="document.billing.cartcreditcardnumber";required[2]="document.billing.cartcreditcardtype";if(checkcvv2){required[3]="document.billing.cartsecuritycode";}
requiredMessage[0]='"Card Holder Name" is a required field.';requiredMessage[1]='"Credit Card Number" is a required field.';requiredMessage[2]='"Credit Card Type" is a required field.';if(checkcvv2){requiredMessage[3]='"Security Code" is a required field.';}
if(!loopValid(required,requiredMessage)){return false;}
if(document.billing.cartmonth.selectedIndex==0){alert('"Expiry Month" is a required field.');document.billing.cartmonth.focus();return false;}
if(document.billing.cartyear.selectedIndex==0){alert('"Expiry Year" is a required field.');document.billing.cartyear.focus();return false;}
return verifyCard();}
function checkMember(password,extrapassword)
{var required=new makeArray(3);var requiredMessage=new makeArray(3);required[0]="document.billing.user";required[1]="document.billing.password";required[2]="document.billing.extrapassword";requiredMessage[0]='"User Name" is a required field.';requiredMessage[1]='"Password" is a required field.';requiredMessage[2]='"Password Again" is a required field.';if(password.value!=extrapassword.value){alert("Password and Password Again do not match, please try again.");eval(required[1]).focus();return false;}
return loopValid(required,requiredMessage);}
function checkRegister(j)
{var required=new makeArray(7);var requiredMessage=new makeArray(7);if(!checkMember(document.billing.password,document.billing.extrapassword)){return false;}
required[0]="document.billing.firstname";required[1]="document.billing.lastname";required[2]="document.billing.address";required[3]="document.billing.city";required[4]="document.billing.state";required[5]="document.billing.zip";required[6]="document.billing.email";requiredMessage[0]='"First Name" is a required field.';requiredMessage[1]='"Last Name" is a required field.';requiredMessage[2]='"Address" is a required field.';requiredMessage[3]='"City/Town" is a required field.';requiredMessage[4]='"State/Province" is a required field.';requiredMessage[5]='"Zip" is a required field.';requiredMessage[6]='"Email" is a required field.';return loopValid(required,requiredMessage)&&VerifyEmailAddress(document.billing);}
function checkSubmitAddressBilling()
{var required=new makeArray(8);var requiredMessage=new makeArray(8);required[0]="document.billing.cartfirstname";required[1]="document.billing.cartlastname";required[2]="document.billing.cartaddress";required[3]="document.billing.cartcity";required[4]="document.billing.cartstate";required[5]="document.billing.cartzip";required[6]="document.billing.cartphone";required[7]="document.billing.cartemail";requiredMessage[0]='"First Name" is a required field.';requiredMessage[1]='"Last Name" is a required field.';requiredMessage[2]='"Address" is a required field.';requiredMessage[3]='"City/Town" is a required field.';requiredMessage[4]='"State/Province" is a required field.';requiredMessage[5]='"Zip" is a required field.';requiredMessage[6]='"Phone" is a required field.';requiredMessage[7]='"Email" is a required field.';return loopValid(required,requiredMessage);}
function checkShippingPhone()
{var required=new makeArray(1);var requiredMessage=new makeArray(1);required[0]="document.billing.cartsphone";requiredMessage[0]='"Shipping Phone" is a required field.';return loopValid(required,requiredMessage);}
function checkSubmitAddressShipping(){var required=new makeArray(6);var requiredMessage=new makeArray(6);required[0]="document.billing.cartsfirstname";required[1]="document.billing.cartslastname";required[2]="document.billing.cartsaddress";required[3]="document.billing.cartscity";required[4]="document.billing.cartsstate";required[5]="document.billing.cartszip";requiredMessage[0]='"Ship To First Name" is a required field.';requiredMessage[1]='"Ship To Last Name" is a required field.';requiredMessage[2]='"Ship To Address" is a required field.';requiredMessage[3]='"Ship To City/Town" is a required field.';requiredMessage[4]='"Ship To State/Province" is a required field.';requiredMessage[5]='"Ship To Zip" is a required field.';return loopValid(required,requiredMessage);}
function checkSubmitAddress(){return checkSubmitAddressBilling()&&checkSubmitAddressShipping();}
function checkSubmitAddressNew(){return checkSubmitAddress()&&VerifyEmail(document.billing.cartemail,"Billing Email",true)&&VerifyEmail(document.billing.cartsemail,"Shipping Email",false);}
function saveAddress(){setCookie('cartlastname',document.billing.cartlastname.value);setCookie('cartcompanyname',document.billing.cartcompanyname.value);setCookie('cartfirstname',document.billing.cartfirstname.value);setCookie('cartaddress',document.billing.cartaddress.value);setCookie('cartextraaddress',document.billing.cartextraaddress.value);setCookie('cartcity',document.billing.cartcity.value);setCookie('cartstate',document.billing.cartstate.value);setCookie('cartzip',document.billing.cartzip.value);setCookie('cartcountry',document.billing.cartcountry.value);setCookie('cartphone',document.billing.cartphone.value);setCookie('cartfax',document.billing.cartfax.value);setCookie('cartemail',document.billing.cartemail.value);}
function fillAddress(){if(getCookie('cartsasb')=='true'){document.billing.cartsasb.checked=true;copyBilling();}}
function copyBilling(){document.billing.cartslastname.value=document.billing.cartlastname.value;document.billing.cartscompanyname.value=document.billing.cartcompanyname.value;document.billing.cartsfirstname.value=document.billing.cartfirstname.value;document.billing.cartsaddress.value=document.billing.cartaddress.value;document.billing.cartsextraaddress.value=document.billing.cartextraaddress.value;document.billing.cartscity.value=document.billing.cartcity.value;document.billing.cartsstate.value=document.billing.cartstate.value;document.billing.cartszip.value=document.billing.cartzip.value;document.billing.cartscountry.value=document.billing.cartcountry.value;document.billing.cartsphone.value=document.billing.cartphone.value;document.billing.cartsfax.value=document.billing.cartfax.value;document.billing.cartsemail.value=document.billing.cartemail.value;}
function fillShipping(firstname,lastname,companyname,address,extraaddress,city,county,state,zip,country,phone,fax,email){document.billing.cartsfirstname.value=firstname;document.billing.cartslastname.value=lastname;document.billing.cartscompanyname.value=companyname;document.billing.cartsaddress.value=address;document.billing.cartsextraaddress.value=extraaddress;document.billing.cartscity.value=city;document.billing.cartsstate.value=state;document.billing.cartszip.value=zip;document.billing.cartscountry.value=country;document.billing.cartsphone.value=phone;document.billing.cartsfax.value=fax;document.billing.cartsemail.value=email;}
function fillBilling(firstname,lastname,companyname,address,extraaddress,city,county,state,zip,country,phone,fax,email){document.billing.cartfirstname.value=firstname;document.billing.cartlastname.value=lastname;document.billing.cartcompanyname.value=companyname;document.billing.cartaddress.value=address;document.billing.cartextraaddress.value=extraaddress;document.billing.cartcity.value=city;document.billing.cartstate.value=state;document.billing.cartzip.value=zip;document.billing.cartcountry.value=country;document.billing.cartphone.value=phone;document.billing.cartfax.value=fax;document.billing.cartemail.value=email;}
function getState(i){var states=new makeArray(53);states[0]='';states[1]='AL';states[2]='AK';states[3]='AZ';states[4]='AR';states[5]='CA';states[6]='CO';states[7]='CT';states[8]='DE';states[9]='DC';states[10]='FL';states[11]='GA';states[12]='HI';states[13]='ID';states[14]='IL';states[15]='IN';states[16]='IA';states[17]='KS';states[18]='KY';states[19]='LA';states[20]='ME';states[21]='MD';states[22]='MA';states[23]='MI';states[24]='MN';states[25]='MS';states[26]='MO';states[27]='MT';states[28]='NE';states[29]='NV';states[30]='NH';states[31]='NJ';states[32]='NM';states[33]='NY';states[34]='NC';states[35]='ND';states[36]='OH';states[37]='OK';states[38]='OR';states[39]='PA';states[40]='PR';states[41]='RI';states[42]='SC';states[43]='SD';states[44]='TN';states[45]='TX';states[46]='UT';states[47]='VT';states[48]='VA';states[49]='WA';states[50]='WV';states[51]='WI';states[52]='WY';return(states[i]);}
function clearBilling(){document.billing.cartslastname.value="";document.billing.cartscompanyname.value="";document.billing.cartsfirstname.value="";document.billing.cartsaddress.value="";document.billing.cartsextraaddress.value="";document.billing.cartscity.value="";document.billing.cartsstate.value="";document.billing.cartszip.value="";document.billing.cartscounty.value="";document.billing.cartscountry.value="";document.billing.cartsphone.value="";document.billing.cartsfax.value="";document.billing.cartsemail.value="";}
function VerifyEmailAddress(EmailForm)
{var Reason="Incorrect Email Address! Please click OK and re-enter a valid email address.\n\nReason:"
var checkStr=EmailForm.email.value;var ix=(checkStr.length-4)
var RC=true;var x=AtSignValid=BackQuote=DoublePeriod=PeriodValid=SpaceValid=ExtValid=RL=0;if(checkStr=='$in[cartemail]'){return true;}
for(i=0;i<checkStr.length;i++){if(checkStr.charAt(i)=='@')AtSignValid++;else if(checkStr.charAt(i)=='`')BackQuote++;else if(checkStr.charAt(i)=='.'){if(x>1&&x==(i-1))DoublePeriod++;else{x=i;PeriodValid++;}}else if(checkStr.charAt(i)==' ')
SpaceValid++;}
ExtValid++;RL=Reason.length;if(AtSignValid!=1)Reason+="\nOnly one '@' allowed, "+AtSignValid+" found.";if(PeriodValid==0)Reason+="\nAddress must contain at least one period.";if(SpaceValid>0)Reason+="\nNo Spaces allowed. Address contains "+SpaceValid+"space";if(SpaceValid>1)Reason+="s.";if(DoublePeriod>0)Reason+="\nAddress contains multiple periods in a row.";if(BackQuote>0)Reason+="\nYour email address contains an invalid characters.";if(ExtValid==0)Reason+="\nInvalid Domain Suffix entered. If you have an unverifiable suffix that is valid, email us your info at \n(Valid: .com, .edu, .net, .org, .gov, .de, .uk)";if(checkStr.length>120)Reason+="\nPlease limit the Email Address to 120 characters.";if(RL!=Reason.length){confirm(Reason);EmailForm.email.focus();RC=false;}else
RC=true;return RC;}
function fieldEmpty(inField,inName)
{if(inField.value==""){alert("\nThe field \""+inName+"\" must be filled in.");inField.focus();return true;}
return false;}
function do_submit(inForm)
{if(!VerifyEmailAddress(inForm))
return false;if(fieldEmpty(inForm.FNAM,"First Name"))
return false;if(fieldEmpty(inForm.LNAM,"Last Name"))
return false;if(fieldEmpty(inForm.ZIP2,"Zip Code"))
return false;return true;}
function checkSubmitAll(){return checkSubmitAddress()&&checkSubmitCreditCard();}
function loopValid(required,requiredMessage)
{var i=0;for(i=0;i<required.length;i++){if(emptyField(eval(required[i]))){alert(requiredMessage[i]);if(eval(required[i]).type!="hidden"){eval(required[i]).focus();}
return false;}}
return true;}
function checkSubmitSingleItem()
{var required=new makeArray(1);var requiredMessage=new makeArray(1);required[0]="document.billing.cartsinglepayment";requiredMessage[0]='"Payment Amount" is a required field.';return loopValid(required,requiredMessage);}
function checkSubmitFastPay(domember){if(domember&&!checkMember(document.billing.password,document.billing.extrapassword)){return false;}
return checkSubmitSingleItem()&&checkSubmitAll();}
function normalEmail(s){return s.toLowerCase().replace(/\s+/g,"");}
function selectall(form,button,count,posn)
{var i=1,j;var s;for(i=1;i<=count;i++){j=i<10?"0"+i:i;obj=form+"."+button+"_"+j;if(eval(obj)!=null){s=obj+"["+posn+"].checked = true";eval(s);}}}
function checkDelete(s){return confirm('Do you really want to delete this '+s+'?\nPress Ok if you do, and Cancel otherwise.');}
function checkSelect(s){return confirm('Do you really want to add '+s+'?\nPress Ok if you do, and Cancel otherwise.');}
function checkSubmitDonate(){return checkSubmitSingleItem()&&checkSubmitAddressBilling()&&checkSubmitCreditCard();}
function checkFederal(s,t)
{var required=new makeArray(2);var requiredMessage=new makeArray(2);required[0]="document.billing.donate_check_1";requiredMessage[0]='"'+s+'" is a required field.';required[1]="document.billing.donate_check_2";requiredMessage[1]='"'+t+'" is a required field.';return loopValid(required,requiredMessage);}
function checkCountry()
{var required=new makeArray(2);var requiredMessage=new makeArray(2);required[0]="document.billing.cartcountry";requiredMessage[0]='"Billing Country" is a required field.';required[1]="document.billing.cartscountry";requiredMessage[1]='"Shipping Country" is a required field.';return loopValid(required,requiredMessage);}
function setAutoSku(){document.forms[0].sku.value="dataNextKey";}
function leaptourl(form)
{var key=form.url.options[form.url.selectedIndex].value;window.location.href=key;}
function checkstars()
{if(document.review.score.selectedIndex==0){alert("Please select the number of stars for your review (5 is highest)!");document.review.score.focus();return false;}
return true;}
function leaptourl2(opt,url)
{var key=opt.options[opt.selectedIndex].value;window.location.href=url+key;}
function openLookupEditor(keywords){window.open('/?nd=lookupvalues&keywords='+keywords,'popup','width=650,height=700,scrollbars=1');return false;}
function openAdvancedLookupEditor(keywords){window.open('/?nd=lookupvalues&advanced_mode=1&keywords='+keywords,'popup','width=650,height=700,scrollbars=1');return false;}
function checkAtt(myform){if(myform.att1done.value==0){alert("Please Select "+atlabel1+"!");myform.attribute1.focus();return false;}
if(myform.att2done.value==0){alert("Please Select "+atlabel2+"!");myform.attribute2.focus();return false;}
if(myform.att3done.value==0){alert("Please Select "+atlabel3+"!");myform.attribute3.focus();return false;}
return true;}
function overlay_show(content,noclose){var winHeight=$(window).height();var winWidth=$(window).width();if($('#overlay').length>0){var overlay=$('#overlay').appendTo('body');}else{var overlay=$('<div />').html(content).attr('id','overlay').appendTo('body');if(noclose!=true){$(overlay).prepend("<a id='closeBtn'>CLOSE</a>");$('#overlay a#closeBtn').click(function(){overlay_hide();});}}
$(overlay).css({'left':winWidth/2-$(overlay).width()/2,'top':winHeight/2-$(overlay).height()/2});$(overlay).fadeIn('fast');var overlayBg=$('<div />').attr('id','overlay_bg').appendTo('body').css('height',$(document).height()).css('opacity',0.66).fadeIn('fast');}
function overlay_hide(noremove){var overlay=$('#overlay');var overlayBg=$('#overlay_bg');if(noremove==true){$(overlay).fadeOut('slow');}else{$(overlay).fadeOut('slow',function(){$(this).remove()});}
$(overlayBg).fadeOut('slow',function(){$(this).remove()});return false;}
function initTabs(tablist){var currentTab;var currentContent;$(tablist).children('li').each(function(){$($(this).children('a').attr('href')).hide();});if($(tablist).children('li.current').size()>0){currentTab=$(tablist).children('li.current');}else{currentTab=$(tablist).children('li:eq(0)').addClass('current');}
currentContent=$($(currentTab).children('a').attr('href')).show();$(tablist).children('li').click(function(e){e.preventDefault();$(currentTab).removeClass('current');currentTab=$(this).addClass('current');$(currentContent).hide();currentContent=$($(this).children('a').attr('href')).show();});}
function imposeMaxLength(o,max){if(o.value.length>=max){o.value=o.value.substr(0,max);}}
function toggleQuicksearch(){$('#quicksearch').toggle();return false;}
function launchLookupEditor(keywords,script_location){window.open(script_location+'?nd=lookupvalues&keywords='+keywords,'popup','width=550,height=700,scrollbars=1');}
function hideDHTML(element_id){document.getElementById(element_id).style.display='none';}
function showDHTML(element_id){document.getElementById(element_id).style.display='';}
function toggleDHTML(element_id){var element=document.getElementById(element_id);if(element.style.display==''){element.style.display='none';}else{element.style.display='';}}
function objExists(el){var obj=document.getElementById(el);if(obj==null){return false;}else{return true;}}
function toggleViewableByClass(theclass){var allPagetags=new Array();var allPagetags=document.getElementsByTagName("*");for(i=0;i<allPagetags.length;i++){if(allPagetags[i].className==theclass){element=allPagetags[i];if(element.style.display==''){element.style.display='none';}else{element.style.display='';}}}}
function restrictChars(elem,rc,silent){el=document.getElementById(elem);var input=el.value;if(input.length>=1){var restricted_chars='';if(rc.length>=1){for(x=0;x<rc.length;x++){var rc_char=rc.substr(x,1);if(rc_char=='['||rc_char=='^'||rc_char=='$'||rc_char=='.'||rc_char=='|'||rc_char=='?'||rc_char=='*'||rc_char=='+'||rc_char=='('||rc_char==')'||rc_char=='+')
{restricted_chars=restricted_chars+'\\'+rc_char+',';}else{restricted_chars=restricted_chars+rc_char+',';}}
restricted_chars=restricted_chars.substring(0,restricted_chars.length-1);var myregex=new RegExp(restricted_chars.replace(/,/g,"|"),["g"]);if(myregex.test(input)){if(silent==null||silent==false){alert('Restricted Characters Detected.  Please do not use the following characters: '+restricted_chars.replace(/\\/g,""));}
el.value=input.replace(myregex,"");return false;}}}
return true;}
var last_dhtml_href_reference=0;var last_dhtml_select_reference=0;var last_dhtml_value='';function show_dynamic_select(reference_select_id,reference_href_id,selected_value,original_list,sku,table,column,column_type,friendly_name){if(reference_select_id==last_dhtml_select_reference){return false;}
var original_select_id=document.getElementById(original_list);var new_select_id=document.getElementById(reference_select_id);var new_href_id=document.getElementById(reference_href_id);new_select_id.innerHTML=original_select_id.innerHTML;new_select_id.onchange=function(){return saveXMLHttpSku($sku,'jlla_placement_group_advisor','account_id','Number','Advisor Name');}
if(last_dhtml_select_reference!=0){var inuse_select_id=document.getElementById(last_dhtml_select_reference);var inuse_href_id=document.getElementById(last_dhtml_href_reference);inuse_href_id.innerHTML=inuse_href_id.options[inuse_href_id.selectedIndex].text;inuse_select_id.style.display='none';inuse_href_id.style.display='';}
new_select_id.style.display='';new_href_id.style.display='none';last_dhtml_href_reference=reference_href_id;last_dhtml_select_reference=reference_select_id;new_select_id.focus();}
function getHashSetFromString(mystring){var token="";var myarray=new Array();for(i=0;i<mystring.length;i++){if(mystring.charAt(i)==","){myarray[token]=token;token="";}else{token=token+mystring.charAt(i);}}
myarray[token]=token;return myarray;}
function storepage(pagelocation){setCookie('pagelocation',pagelocation);}
var fragment_quicklink_body='';var use_fragment_anchor_name='';var use_fragment_name='';function addFragmentQuickLink(fragment_anchor_name,fragment_name,hide_quicklink_list){if(hide_quicklink_list==true){}else{fragment_quicklink_body+='<span class=systemsmallvalue><a href="#'+fragment_anchor_name+'" class="systemsmalllink"><img src="/editor/images/ad/square.gif" width="16" height="16" border="0">'+fragment_name+'</a></span><br>';}}
function writeFragmentQuickLink(div_id){document.getElementById(div_id).innerHTML=fragment_quicklink_body;}
function addLoadEvent(func){var oldonload=window.onload;if(typeof window.onload!='function'){window.onload=func;}else{window.onload=function(){oldonload();func();}}}
function restorepage(suffix,default_location){var restore_location=getCookie('pagelocation');if((!restore_location||restore_location=="0"||restore_location=="")){if(!default_location){restore_location="/";}else{restore_location=default_location;}}else{restore_location=restore_location+suffix;}
window.location=restore_location;}
function hideTable(tableId){var table=document.getElementById(tableId);table.style.display="none";}
function showTable(tableId){var table=document.getElementById(tableId);table.style.display="";}
function setRadioGroupValue(group,selection){for(i=0;i<group.length;i++){if(group[i].value==selection){group[i].checked=true;}else{group[i].checked=false;}}}
function getRadio(radiogroup){var radio_value=getRadiogroupValue(radiogroup);if(radio_value==null){radio_value=getRadioValue(radiogroup);}
return radio_value;}
function getRadioValue(radiogroup){var useradio=document.getElementsByName(radiogroup.name);if(useradio.length==null&&useradio.checked==true){return(useradio.value);}
for(i=0;i<useradio.length;i++){if(useradio[i].checked){return useradio[i].value;}}
return null;}
function getRadiogroupValue(radiogroup){if(radiogroup.length==null&&radiogroup.checked==true){return(radiogroup.value);}
for(i=0;i<radiogroup.length;i++){if(radiogroup[i].checked){return radiogroup[i].value;}}
return null;}
function setCheckbox(formname,checkboxname,textfieldname){var textfieldvalue=document.forms[formname].elements[textfieldname].value;if(textfieldvalue==""){document.forms[formname].elements[checkboxname].checked=false;}else{document.forms[formname].elements[checkboxname].checked=true;}}
function setTextfield(formname,checkboxname,textfieldname){if(document.forms[formname].elements[checkboxname].checked==true){document.forms[formname].elements[textfieldname].focus();}else{document.forms[formname].elements[textfieldname].value="";}}
function setSelectValue(sel,val){for(var i=0;i<sel.options.length;i++){if(sel.options[i].value==val){sel.options[i].selected=true;return;};}}
function setSelectValueByText(sel,val){for(var i=0;i<sel.options.length;i++){if(sel.options[i].text==val){sel.options[i].selected=true;return;};}}
function uncheckall(form){setformchecks(form,false);}
function checkall(form){setformchecks(form,true);}
function setformchecks(myform,value){var len=myform.elements.length;for(z=0;z<len;z++){var myname=myform.elements[z].name;var myvalue=myform.elements[z].value;if(myname!=myform.name){if(myform.elements[z].type=="checkbox"){myform.elements[z].checked=value;}}}
return true;}
function is_one_checked(myform){var len=myform.elements.length;for(z=0;z<len;z++){var myname=myform.elements[z].name;var myvalue=myform.elements[z].value;if(myname!=myform.name){if(myform.elements[z].type=="checkbox"&&myform.elements[z].checked==true){return true;}}}
return false;}
function getSelectionText(sel){return sel.options[sel.selectedIndex].text;}
var selectedRow=null;function selectRow(row,selectedClass,unselectedClass){if(selectedClass==null){selectedClass="selectedRow";}
if(unselectedClass==null){unselectedClass="unselectedRow";}
if(selectedRow!=null){selectedRow.className=unselectedClass;}
row.className=selectedClass;selectedRow=row;}
function getSelectedRow(){return selectedRow;}
function BGNew(obj,new_style,message){obj.className=new_style;window.status=message;}
function openWindow(url,parameters){var pop1=window.open(url,'pop_1',parameters);pop1.focus();}<!--Begin
function move(fbox,tbox,all){var arrFbox=new Array();var arrTbox=new Array();var arrLookup=new Array();var i;for(i=0;i<tbox.options.length;i++){arrLookup[tbox.options[i].text]=tbox.options[i].value;arrTbox[i]=tbox.options[i].text;}
var fLength=0;var tLength=arrTbox.length;for(i=0;i<fbox.options.length;i++){arrLookup[fbox.options[i].text]=fbox.options[i].value;if((fbox.options[i].selected||all)&&fbox.options[i].value!=""){arrTbox[tLength]=fbox.options[i].text;tLength++;}else{arrFbox[fLength]=fbox.options[i].text;fLength++;}}
fbox.length=0;tbox.length=0;var c;for(c=0;c<arrFbox.length;c++){var no=new Option();no.value=arrLookup[arrFbox[c]];no.text=arrFbox[c];fbox[c]=no;}
for(c=0;c<arrTbox.length;c++){var no=new Option();no.value=arrLookup[arrTbox[c]];no.text=arrTbox[c];tbox[c]=no;}}
function additem(item,box){var len=box.options.length;box.options[len]=new Option(item.value,item.value,false,false);item.value='';}
function moveup(box){var i;var tmp;for(i=0;i<box.options.length;i++){if(box.options[i].selected&&i>0){tmp=box.options[i-1].text;box.options[i-1].value=box.options[i-1].text=box.options[i].text;box.options[i].value=box.options[i].text=tmp;box.options[i-1].selected=true;box.options[i].selected=false;}}}
function movedown(box){var i;var tmp;var done=false;for(i=0;!done&&i<box.options.length;i++){if(box.options[i].selected&&(i<(box.options.length+1))){tmp=box.options[i+1].text;box.options[i+1].value=box.options[i+1].text=box.options[i].text;box.options[i].value=box.options[i].text=tmp;box.options[i+1].selected=true;box.options[i].selected=false;done=true;}}}
function listToString(box,separator){var i;var s='';for(i=0;i<box.options.length;i++){if(i==0){s=box.options[i].value;}else{s=s+separator+box.options[i].value;}}
return s;}
function _replaceString(replaceString,findString,replaceWithString){var location=replaceString.indexOf(findString);while(location!=-1){replaceString=replaceString.substring(0,location)+replaceWithString+_replaceString(replaceString.substring(location+findString.length),findString,replaceWithString);location=replaceString.indexOf(findString);}
return replaceString;}
function clearFields(field_ids){var myid='';for(i=0;i<field_ids.length;i++){if(field_ids.charAt(i)==','){document.getElementById(myid).value='';myid='';}else{myid=myid+field_ids.charAt(i);}}
document.getElementById(myid).value='';}
function clearForm(clean_form_id){var myform=document.getElementById(clean_form_id);var len=myform.elements.length;for(z=0;z<len;z++){if(myform.elements[z].type=="text"||myform.elements[z].type=="textarea"||myform.elements[z].type=="select-one"){myform.elements[z].value='';}}}

