SHIPPING_METHOD_FLAT_RATE="1";SHIPPING_METHOD_VARIABLE_RATE="2";SHIPPING_METHOD_TBD="3";DURATION_UNTIL_I_CANCEL="0";DURATION_SPECIFY_A_DATE="1";SHIPPING_METHOD_VARIABLE_RATE_USPS="2";SHIPPING_METHOD_VARIABLE_RATE_UPS="3";SHIPPING_PROVIDER_USPS="1";SHIPPING_PROVIDER_UPS="2";SHIPPING_PROVIDER_FEDEX="3";ATTRIBUTE_TYPE_FREEFORM="0";ATTRIBUTE_TYPE_BOOLEAN="1";ATTRIBUTE_TYPE_SELECTONE="2";ATTRIBUTE_TYPE_CHECKBOX="3";ATTRIBUTE_TYPE_NUMBERRANGE="4";ATTRIBUTE_TYPE_NUMERIC="5";ATTRIBUTE_TYPE_DATE="6";ATTRIBUTE_TYPE_TEXTAREA="7";isIE=(navigator.appName.toLowerCase().indexOf("internet explorer")!=-1);function focusObj(A,B,C){ret=false;if(!A&&!B){if(C!=null){C.focus();ret=true}}return ret}function S2_isGCheckoutSelected(A){pm=A["payment_methods[]"];if(pm==null){return false}for(i=0;i<pm.length;i++){if(pm[i].checked&&pm[i].value=="3"){return true}}return false}function S2_isPaypalSelected(A){pm=A["payment_methods[]"];if(pm==null){return false}for(i=0;i<pm.length;i++){if(pm[i].checked&&pm[i].value=="1"){return true}}return false}function S2_isUSPSSelected(A){venders=A["shipping_method_variable[]"];for(i=0;i<venders.length;i++){if(venders[i].checked&&venders[i].value=="1"){return true}}return false}function S2_isUPSSelected(A){venders=A["shipping_method_variable[]"];for(i=0;i<venders.length;i++){if(venders[i].checked&&venders[i].value=="2"){return true}}return false}function S2_isFedexSelected(A){venders=A["shipping_method_variable[]"];for(i=0;i<venders.length;i++){if(venders[i].checked&&venders[i].value=="3"){return true}}return false}function S2_isVariableRate(){var A=document.getElementById("fiexedShiipingMethod");if(A.value=="4"){return true}return false}function checkSellOrder2Form(F){isvalid=true;hasfocus=false;if(instanceAttributesNames!=null&&typeof (instanceAttributesNames)!="undefined"&&typeof (instanceAttributesNames.length)!="undefined"){isvalid=checkInstanceAttributes(F,instanceAttributesNames)}isvalid=validateFieldNull(F,"fname","First name should not be blank.");hasfocus=hasfocus||focusObj(isvalid,hasfocus,F["fname"]);isvalid=validateFieldNull(F,"lname","Last name should not be blank.")&&isvalid;hasfocus=hasfocus||focusObj(isvalid,hasfocus,F["lname"]);isvalid=validateFieldNull(F,"street1","Address should not be blank.")&&isvalid;hasfocus=hasfocus||focusObj(isvalid,hasfocus,F["street1"]);isvalid=validateFieldNull(F,"city","City should not be blank.")&&isvalid;hasfocus=hasfocus||focusObj(isvalid,hasfocus,F["city"]);isvalid=validateFieldNull(F,"state","State/Province should not be blank.")&&isvalid;hasfocus=hasfocus||focusObj(isvalid,hasfocus,F["state"]);isvalid=validateFieldNull(F,"country","A Country Or Region should be selected.")&&isvalid;hasfocus=hasfocus||focusObj(isvalid,hasfocus,F["country"]);isvalid=validateFieldNumber(F,"sellprice","Price should be a number greater than 0.","float")&&isvalid;hasfocus=hasfocus||focusObj(isvalid,hasfocus,F["sellprice"]);if(validateFieldNull(F,"zip","Zip should not be blank.")){zip_valid=false;if(F["country"].value==1){var E=/^\d{5}(-\d{4})?$/;zip_valid=E.test(F["zip"].value)}else{if(F["country"].value==3){var E=/^[A-Za-z]\d[A-Za-z]\ \d[A-Za-z]\d$/;zip_valid=E.test(F["zip"].value)}else{if(F["zip"].value!=""){zip_valid=true}}}zpobj=document.getElementById("zip_p");if(!zip_valid){if(zpobj!=null){zpobj.innerHTML="Please input a valid zip code.";zpobj.style.display="";isvalid=false;F["zip"].focus()}}else{if(zpobj!=null){zpobj.innerHTML="";zpobj.style.display="none"}}}else{isvalid=false}hasfocus=hasfocus||focusObj(isvalid,hasfocus,F["sellprice"]);shippingmethod=getRadioValue(F["shipping_method"]);duration=F["duration"].value;if(duration==DURATION_SPECIFY_A_DATE){dur_date=F["duration_datetime"].value;dur_dateP=document.getElementById("duration_datetime_p");if(dur_date==""){if(dur_dateP!=null){dur_dateP.style.display="";dur_dateP.innerHTML="Cancel Date should not be blank.";isvalid=false}}else{datearray=dur_date.split("/");theDate=new Date(parseInt(datearray[2]),parseInt(datearray[0])-1,parseInt(datearray[1]));toDay=new Date();if((Date.parse(theDate.toString())-Date.parse(toDay.toString()))<=0){if(dur_dateP!=null){dur_dateP.style.display="";dur_dateP.innerHTML="Cancel Date should be later than today.";isvalid=false}}else{if(dur_dateP!=null){dur_dateP.style.display="none"}}}hasfocus=hasfocus||focusObj(isvalid,hasfocus,F["duration"])}isGoogle=false;var D=countCheckbox(F["payment_methods[]"]);var C=document.getElementById("payment_methods_validate_div");if(D==0){C.style.display="";var B="<font color=red><strong>At least one payment method should be checked.</strong></font>";C.innerHTML=B;isvalid=false;hasfocus=hasfocus||focusObj(isvalid,hasfocus,F["duration"])}if(D>0){if(F["payment_methods[]"].length==null){if(F["payment_methods[]"].value=="3"&&F["payment_methods[]"].checked){isGoogle=true}}else{for(tempi=0;tempi<F["payment_methods[]"].length;tempi++){if(F["payment_methods[]"][tempi].value=="3"&&F["payment_methods[]"][tempi].checked){isGoogle=true}}}if(C!=null){C.innerHTML="";C.style.display="none"}}clearSpan("pounds");clearSpan("ounces");clearSpan("dimension_length");clearSpan("width");clearSpan("height");clearSpan("shipping_service_other_input");clearSpan("dimension_error_div");frspobj=document.getElementById("flat_rate_service_p");if(frspobj!=null){frspobj.style.display="none"}frspworldwideobj=document.getElementById("flat_rate_service_worldwide_p");if(frspworldwideobj!=null){frspworldwideobj.style.display="none"}isFedex=false;if(shippingmethod==SHIPPING_METHOD_FLAT_RATE){fsciobj=document.getElementById("free_shipping_checked_id");if(fsciobj!=null&&fsciobj.value=="yes"){}else{isvalid=validateFieldNull(F,"flat_rate","Please input a number in Flat Rate (0 is acceptable).")&&isvalid;focusObj(isvalid,hasfocus,F["flat_rate"]);if(F["additional_price"].value==""){F["additional_price"].value="0"}if(F["flat_rate_service"].value=="Other"){isvalid=validateFieldNull(F,"shipping_service_other_input",'Please input the "Other Service Name".')&&isvalid}else{if(F["flat_rate_service"].options[F["flat_rate_service"].selectedIndex].text=="-"){if(frspobj!=null){frspobj.style.display=""}isvalid=false}}if(F["worldwide_flat_rate_sign"].value=="yes"){isvalid=validateFieldNull(F,"flat_rate_worldwide","Please input a number in Worldwide Flat Rate (0 is acceptable).")&&isvalid;focusObj(isvalid,hasfocus,F["flat_rate_worldwide"]);if(F["additional_price_worldwide"].value==""){F["additional_price_worldwide"].value="0"}if(F["flat_rate_service_worldwide"].value=="Other"){isvalid=validateFieldNull(F,"shipping_service_other_worldwide_input",'Please input the "Other Service Name".')&&isvalid}else{if(F["flat_rate_service_worldwide"].options[F["flat_rate_service_worldwide"].selectedIndex].text=="-"){if(frspobj!=null){frspworldwideobj.style.display=""}isvalid=false}}}}}else{if(shippingmethod==SHIPPING_METHOD_VARIABLE_RATE){flatratP=document.getElementById("flat_rate_p");if(flatratP!=null){flatratP.style.display="none"}D=countCheckbox(F["shipping_method_variable[]"]);variableratetr=document.getElementById("variablerate_tr");if(D==0){if(variableratetr!=null){variableratetr.style.display="";B="<font color=red><strong>At least one carrier should be checked.</strong></font>";variableratetr.innerHTML=B;isvalid=false}}else{if(variableratetr!=null){variableratetr.style.display="none"}isvalid=validateFieldNumber(F,"dimension_length","Length should be a number greater than 0.","float")&&isvalid;isvalid=validateFieldNumber(F,"width","Width should be a number greater than 0.","float")&&isvalid;isvalid=validateFieldNumber(F,"height","Height should be a number greater than 0.","float")&&isvalid;isUSPS=false;isUPS=false;venders=F["shipping_method_variable[]"];for(i=0;i<venders.length;i++){if(venders[i].checked&&venders[i].value==SHIPPING_PROVIDER_USPS){isUSPS=true}else{if(venders[i].checked&&venders[i].value==SHIPPING_PROVIDER_UPS){isUPS=true}else{if(venders[i].checked&&venders[i].value==SHIPPING_PROVIDER_FEDEX){isFedex=true}}}}widthValue=parseFloat(F["width"].value);heightValue=parseFloat(F["height"].value);lengthValue=parseFloat(F["dimension_length"].value);size=(widthValue+heightValue)*2+lengthValue;if(size>130){dediv=document.getElementById("dimension_error_div");if(dediv!=null){dediv.style.display=""}isvalid=false}poundsvalue=F["pounds"].value;ouncesvalue=F["ounces"].value;pounds=parseInt(poundsvalue);ounces=parseFloat(ouncesvalue);if(isNaN(pounds)){pounds=0}if(isNaN(ounces)){ounces=0}if(pounds+ounces==0){isvalid=false;poundspobj=document.getElementById("pounds_p");poundspobj.innerHTML="Please input the weight.";poundspobj.style.display=""}}}}if(shippingmethod==SHIPPING_METHOD_FLAT_RATE){is_additional_country_flatrate_valid=true;addedcountryid=F["added_country_ids"].value;tempidstr="";if(addedcountryid!=""&&F["worldwide_flat_rate_sign"].value=="yes"){for(tempnumber=0;tempnumber<=addedcountryid;tempnumber++){temppobj=document.getElementById("country_"+tempnumber+"_p");if(F["country"].value==F["country_"+tempnumber].value){if(temppobj!=null){temppobj.innerHTML='Please select a country different from your "Shipping From" country.';temppobj.style.display=""}is_additional_country_flatrate_valid=false}else{if(F["country_"+tempnumber].value=="0"){temppobj.innerHTML="Please select a country.";temppobj.style.display="";is_additional_country_flatrate_valid=false}else{if(tempidstr.indexOf(";"+F["country_"+tempnumber].value+";")!=-1){temppobj.innerHTML="You have set a Flat Rate for this country, please select another country or remove this one.";temppobj.style.display="";is_additional_country_flatrate_valid=false}else{temppobj.style.display="none";temppobj.innerHTML=""}}}if(tempidstr.length>0){tempidstr=tempidstr+F["country_"+tempnumber].value+";"}else{tempidstr=";"+F["country_"+tempnumber].value+";"}if(F["country_flat_rate_"+tempnumber].value==""){if(temppobj.innerHTML!=""){temppobj.innerHTML=temppobj.innerHTML+"<br/>Please input a number in Flat Rate."}else{temppobj.innerHTML="Please input a number in Flat Rate."}temppobj.style.display="";is_additional_country_flatrate_valid=false}tempcountryservicep=document.getElementById("country_flat_rate_service_"+tempnumber+"_p");if(F["country_flat_rate_service_"+tempnumber].value==""){tempcountryservicep.style.display="";is_additional_country_flatrate_valid=false}else{tempcountryservicep.style.display="none"}countryotherservicep=document.getElementById("shipping_service_other_country_"+tempnumber+"_input_p");if(F["country_flat_rate_service_"+tempnumber].value=="Other"&&F["other_service_country_"+tempnumber+"_input"].value==""){countryotherservicep.style.display="";is_additional_country_flatrate_valid=false}else{countryotherservicep.style.display="none"}if(F["additional_price_country_"+tempnumber].value==""||isNaN(parseFloat(F["additional_price_country_"+tempnumber].value))){F["additional_price_country_"+tempnumber].value="0"}else{F["additional_price_country_"+tempnumber].value=parseFloat(F["additional_price_country_"+tempnumber].value)}}if(!is_additional_country_flatrate_valid){isvalid=false}}}var A=document.getElementById("shipping_provider_error_div");A.style.display="none";if(!S2_isGCheckoutSelected(F)&&S2_isPaypalSelected(F)&&S2_isVariableRate()){if(!S2_isUSPSSelected(F)&&!S2_isUPSSelected(F)&&S2_isFedexSelected(F)){A.innerHTML="Fedex is supported by Google Checkout only, please select other shipping provider.";A.style.display="";isvalid=false}}if(S2_isGCheckoutSelected(F)){}gdcpobj=document.getElementById("gcheckout_default_cost_p");if(gdcpobj!=null){gdcpobj.innerHTML="";gdcpobj.style.display="none"}if(isGoogle&&shippingmethod!=SHIPPING_METHOD_FLAT_RATE&&shippingmethod!=SHIPPING_METHOD_TBD){if(F["gcheckout_default_cost"].value==""){if(gdcpobj!=null){gdcpobj.innerHTML="Please input a valid number in Google Checkout Default Cost.";gdcpobj.style.display=""}isvalid=false}else{isvalid=validateFieldNumber(F,"gcheckout_default_cost","Please input a valid number in Google Checkout Default Cost.","float")&&isvalid}}fgeobj=document.getElementById("fedex_google_error");if(isFedex&&!isGoogle){if(fgeobj!=null){fgeobj.innerHTML="Fedex is only availabe when Google Checkout is selected.";fgeobj.style.display=""}isvalid=false}else{if(fgeobj!=null){fgeobj.innerHTML="";fgeobj.style.display="none"}}deschecks=F["shipping_destination[]"];descheckcount=0;sdpobj=document.getElementById("shipping_destination_p");for(tempcount=0;tempcount<deschecks.length;tempcount++){if(deschecks[tempcount].checked){descheckcount++}}if(descheckcount==0){if(sdpobj!=null){sdpobj.style.display=""}isvalid=false}else{if(sdpobj!=null){sdpobj.style.display="none"}}if(isvalid){submitbutton=F["submitButton"];if(submitbutton){submitbutton.className="button-disable";submitbutton.disabled=true}}return isvalid}function clearSpan(A){spanobj=document.getElementById(A+"_p");if(spanobj!=null){spanobj.style.display="none"}}function checkInstanceAttributes(A,B){isvalid=true;for(i=0;i<B.length;i++){temp=B[i];tempArray=temp.split(",");attFormName=tempArray[0];attName=tempArray[1];attType=tempArray[2];attRange=tempArray[3];if(attType==ATTRIBUTE_TYPE_FREEFORM){}else{if(attType==ATTRIBUTE_TYPE_NUMERIC){avalue=A[attFormName].value;anumber=parseInt(avalue);tempP=document.getElementById(attFormName+"_p");if(avalue==""){}else{if(isNaN(anumber)){A[attFormName].value="";isvalid=false;if(tempP!=null){tempP.innerHTML="Please input a valid number.";tempP.style.display=""}}else{A[attFormName].value=anumber;if(tempP!=null){tempP.style.display="none"}}}}else{if(attType==ATTRIBUTE_TYPE_CHECKBOX){}else{if(attType==ATTRIBUTE_TYPE_NUMBERRANGE){rangearray=null;tempP=document.getElementById(attFormName+"_p");if(attRange.indexOf("-")!=-1){rangearray=attRange.split("-")}else{rangearray=attRange.split("~")}avalue=A[attFormName].value;if(tempP!=null){tempP.style.display="none"}if(avalue==""){}else{anumber=parseInt(avalue);if(isNaN(anumber)){A[attFormName].value="";if(tempP!=null){tempP.innerHTML="Please input a valid number.";tempP.style.display="";isvalid=false}}else{if(anumber>rangearray[1]||anumber<rangearray[0]){if(tempP!=null){tempP.innerHTML="Please input a valid number from "+rangearray[0]+" to "+rangearray[1];tempP.style.display="";isvalid=false}}}}}}}}}return isvalid}function countCheckbox(A){count=0;if(A==null){return count}if(typeof (A.length)=="undefined"){if(A.checked){count=1}}else{for(i=0;i<A.length;i++){if(A[i].checked){count++}}}return count}function getRadioValue(A){value=null;if(typeof (A.length)=="undefined"){if(A.checked){value=A.value}}else{for(i=0;i<A.length;i++){if(A[i].checked){value=A[i].value;break}}}return value}function validateFieldNumber(B,D,C,A){if(A==null||A==""){A="float"}returnValue=true;fieldvalue=B[D].value;if(A=="float"){fieldvalue=parseFloat(B[D].value)}flag=true;numberreg=/^\d+(\.\d+){0,1}$/;if(A=="integer"){numberreg=/^\d+$/}flag=numberreg.test(fieldvalue);if(flag==false||parseFloat(fieldvalue)==0){returnValue=false;tempP=document.getElementById(D+"_p");if(tempP!=null){tempP.innerHTML=C;tempP.style.display=""}}else{tempP=document.getElementById(D+"_p");if(tempP!=null){tempP.style.display="none"}}return returnValue}function validateFieldNull(A,C,B){returnValue=true;fieldvalue=A[C].value;if(fieldvalue==""||(C=="country"&&fieldvalue=="0")){returnValue=false;tempP=document.getElementById(C+"_p");if(tempP!=null){if(tempP.id.indexOf("flat_rate")==-1){tempP.innerHTML=B}tempP.style.display=""}}else{tempP=document.getElementById(C+"_p");if(tempP!=null){tempP.style.display="none"}}return returnValue}function checkNumberBlur(A){isvalid=true;avalue=A.value;minvalue=parseInt(A.getAttribute("minvalue"));maxvalue=parseInt(A.getAttribute("maxvalue"));if(avalue==""||avalue=="0"){isvalid=false;A.value="";if(maxvalue!=-1){}else{}}else{currentvalue=parseInt(avalue);if(isNaN(currentvalue)){isvalid=false;A.value=""}else{A.value=""+currentvalue;if(minvalue>currentvalue){isvalid=false;if(maxvalue!=-1){blinkWarn(A.name+"_span")}A.focus()}else{if(currentvalue>maxvalue&&maxvalue!=-1){isvalid=false;blinkWarn(A.name+"_span");A.focus()}}}}return isvalid}function checkNumber(A){isvalid=true;eventSource=A.srcElement||A.target;currentKey=A.charCode||A.keyCode;if(!isIE&&(A.keyCode==8||A.keyCode==46)){isvalid=true}else{if(!isIE&&(currentKey==9&&currentChar==0)){isvalid=true}else{minvalue=parseInt(eventSource.getAttribute("minvalue"));maxvalue=parseInt(eventSource.getAttribute("maxvalue"));if(currentKey<48||currentKey>57){isvalid=false}else{inputvalue=eventSource.value;if(inputvalue==""){inputvalue="0"}tempnumber=parseInt(inputvalue);willnumber=tempnumber*10+currentKey-48;if(maxvalue!=-1){if(willnumber>maxvalue){}}}}}return isvalid}function checkInt(A){isvalid=true;eventSource=A.srcElement||A.target;tempvalue=eventSource.value;if(isIE){currentKey=A.keyCode;if(currentKey>=48&&currentKey<=57){tempnumber=parseInt(tempvalue+String.fromCharCode(currentKey))}else{isvalid=false}}else{currentChar=A.charCode;currentKey=A.keyCode;if((currentChar==0&&(currentKey==8||currentKey==46))||(currentChar>=48&&currentChar<=57)){tempnumber=parseInt(tempvalue+String.fromCharCode(currentKey))}else{if(currentKey==9&&currentChar==0){isvalid=true}else{isvalid=false}}}return isvalid}function checkFloat(A){isvalid=true;eventSource=A.srcElement||A.target;minvalue=parseFloat(eventSource.getAttribute("minvalue"));maxvalue=parseFloat(eventSource.getAttribute("maxvalue"));tempSpan=document.getElementById(eventSource.name+"_span");tempvalue=eventSource.value;if(isIE){currentKey=A.keyCode;if(currentKey>=48&&currentKey<=57){tempnumber=parseFloat(tempvalue+String.fromCharCode(currentKey));if(maxvalue!=-1){if(tempnumber>maxvalue){isvalid=false;blinkWarnHiddenFinally(tempSpan.id)}}}else{if(currentKey==46){if(eventSource.value.indexOf(".")!=-1){isvalid=false}if(eventSource.value==""){eventSource.value="0."}}else{isvalid=false}}}else{currentChar=A.charCode;currentKey=A.keyCode;if((currentChar==0&&(currentKey==8||currentKey==46))||(currentChar>=48&&currentChar<=57)){tempnumber=parseFloat(tempvalue+String.fromCharCode(currentKey));if(maxvalue!=-1){if(tempnumber>maxvalue){isvalid=false;blinkWarnHiddenFinally(tempSpan.id)}}}else{if(currentKey==9&&currentChar==0){isvalid=true}else{if(currentChar==46){if(eventSource.value.indexOf(".")!=-1){isvalid=false}if(eventSource.value==""){eventSource.value="0"}}else{isvalid=false}}}}return isvalid}function checkFloatBlur(A){isvalid=true;name=A.name;minvalue=parseFloat(A.getAttribute("minvalue"));maxvalue=parseFloat(A.getAttribute("maxvalue"));tempSpan=document.getElementById(A.name+"_span");tempvalue=A.value;tempnumber=parseFloat(tempvalue);if((tempvalue==""||tempnumber==0)&&(name=="additional_price"||name=="additional_price_worldwide")){A.value="0"}else{if(isNaN(tempnumber)){A.value="";isvalid=false}else{if(tempnumber<minvalue&&name!="flat_rate"&&name!="flat_rate_worldwide"){A.value=""}else{}if(maxvalue!=-1){if(tempnumber>maxvalue){blinkWarnHiddenFinally(tempSpan.id);isvalid=false}}if(tempnumber<=minvalue&&name!="flat_rate"){isvalid=false}else{if(tempnumber<minvalue&&name=="flat_rate"){isvalid=false}}}}return isvalid}function blinkWarn(A){spanObj=document.getElementById(A);if(spanObj!=null){current=spanObj.style.fontWeight;if(current==""||current=="normal"){spanObj.style.fontWeight="bolder"}else{spanObj.style.fontWeight="normal"}currentcolor=spanObj.style.color;if(currentcolor=="blue"){spanObj.style.color="red"}else{spanObj.style.color="blue"}count=parseInt(spanObj.getAttribute("counttime"));if(count<5){count++;spanObj.setAttribute("counttime",""+count);setTimeout("blinkWarn('"+A+"')",200)}else{spanObj.setAttribute("counttime","0");spanObj.style.fontWeight="normal";spanObj.style.color="blue"}}}function blinkWarnHiddenFinally(A){spanObj=document.getElementById(A);if(spanObj!=null){spanObj.style.display="";current=spanObj.style.fontWeight;if(current==""||current=="normal"){spanObj.style.fontWeight="bolder"}else{spanObj.style.fontWeight="normal"}currentcolor=spanObj.style.color;if(currentcolor=="blue"){spanObj.style.color="red"}else{spanObj.style.color="blue"}count=parseInt(spanObj.getAttribute("counttime"));if(count<8){count++;spanObj.setAttribute("counttime",""+count);setTimeout("blinkWarnHiddenFinally('"+A+"')",300)}else{spanObj.setAttribute("counttime","0");spanObj.style.fontWeight="normal";spanObj.style.color="blue";spanObj.style.display="none"}}}function blinkWarnOnlyBlue(A){spanObj=document.getElementById(A);if(spanObj!=null){current=spanObj.style.fontWeight;if(current==""||current=="normal"){spanObj.style.fontWeight="bolder"}else{spanObj.style.fontWeight="normal"}count=parseInt(spanObj.getAttribute("counttime"));if(count<5){count++;spanObj.setAttribute("counttime",""+count);setTimeout("blinkWarnOnlyBlue('"+A+"')",200)}else{spanObj.setAttribute("counttime","0");spanObj.style.fontWeight="normal";spanObj.style.color="blue"}}}function blinkWarnOnlyBlueHiddenFinally(A){spanObj=document.getElementById(A);if(spanObj!=null){spanObj.style.display="";current=spanObj.style.fontWeight;if(current==""||current=="normal"){spanObj.style.fontWeight="bolder"}else{spanObj.style.fontWeight="normal"}count=parseInt(spanObj.getAttribute("counttime"));if(count<8){count++;spanObj.setAttribute("counttime",""+count);setTimeout("blinkWarnOnlyBlueHiddenFinally('"+A+"')",300)}else{spanObj.setAttribute("counttime","0");spanObj.style.fontWeight="normal";spanObj.style.color="blue";spanObj.style.display="none"}}}function checkFixShippingMethod(A){venders=A.form[A.name];ischecked=false;isUPS=false;for(i=0;i<venders.length;i++){if(venders[i].checked){ischecked=true;if(venders[i].value==SHIPPING_METHOD_VARIABLE_RATE_UPS){isUPS=true}}}if(ischecked){venderradio=document.getElementById("fiexedShiipingMethod");venderradio.checked=true;widthdimension=document.getElementById("weight-dimensions");A.form["flat_rate"].value="";A.form["additional_price"].value="0";displaySingleFlatrate(false);displayDoubleFlatrate(false);if(widthdimension!=null){widthdimension.style.display="block"}insuranceselect=document.getElementById("insurance_select");insurancespan=document.getElementById("insurance_span_no");if(insuranceselect!=null){insuranceselect.style.display="";insurancespan.style.display="none"}}}function focusOnFlatRate(A){venders=A.form["shipping_method_variable[]"];for(i=0;i<venders.length;i++){venders[i].checked=false}flatradio=document.getElementById("flatShiipingMethod");flatradio.checked=true;widthdimension=document.getElementById("weight-dimensions");if(widthdimension!=null){widthdimension.style.display="none"}insuranceselect=document.getElementById("insurance_select");insurancespan=document.getElementById("insurance_span_no");if(insuranceselect!=null){insuranceselect.style.display="none";insurancespan.style.display=""}}function checkSellOrder3Form(A,C,B){submit=false;if(C=="Y"&&B!=null&&B!=""&&B!="0"){launchPopUp("offer_my_item_confim_div",false)}else{if(A["is_private"].value=="yes"){launchPopUp("private_to_public_div",false)}else{submitbutton=A["submitbutton"];submitbutton.className="button-disable";submitbutton.disabled=true;submit=true}}return submit}function checkStep3Submitable(A,C,B){submitable=false;cn=A.className;if(cn=="wigix-button-disable"){submitbuttonP=document.getElementById(A.name+"_p");if(submitbuttonP!=null){blinkWarnOnlyBlueHiddenFinally(submitbuttonP.id)}}else{submitable=true}return submitable}function submitSell3Form(A){theform=document.getElementById("sellorder3");if(theform!=null){disableButton(A.id);theform.submit()}}function checkAgree(B){if(B.checked){B.form["submitbutton"].className="wigix-button";var A=document.getElementById("submitbutton_p");if(A!=null){A.style.display="none"}}else{B.form["submitbutton"].className="wigix-button-disable"}}function showAddresses(){url=base_url+"/index.php/addressmanage/displayalladdress";var A={success:function(B){reply=B.responseText;madiv=document.getElementById("mailing_addresses_div");if(madiv!=null){madiv.innerHTML=reply;launchPopUpEx("mailing_addresses_div_outer",false,madiv.id)}},failure:function(B){}};YAHOO.util.Connect.asyncRequest("GET",url,A)}function xd_showAddresses(){url=base_url+"/index.php/addressmanage/xd_displayalladdress";var A={success:function(B){reply=B.responseText;madiv=document.getElementById("mailing_addresses_div");if(madiv!=null){madiv.innerHTML=reply;yuiLaunchPopup("mailing_addresses_div","Address",false)}},failure:function(B){}};YAHOO.util.Connect.asyncRequest("GET",url,A)}function fillinAddress(){addressradios=document.getElementsByName("selected_address");selectedid="0";addnum=0;for(i=0;i<addressradios.length;i++){if(addressradios[i].checked){selectedid=addressradios[i].value;addnum=i}}firstname=document.getElementById("address_firstname_"+selectedid).value;lastname=document.getElementById("address_lastname_"+selectedid).value;address1=document.getElementById("address_address1_"+selectedid).value;address2=document.getElementById("address_address2_"+selectedid).value;city=document.getElementById("address_city_"+selectedid).value;country=document.getElementById("address_country_"+selectedid).value;state=document.getElementById("address_state_"+selectedid).value;zip=document.getElementById("address_zip_"+selectedid).value;document.getElementById("fname_id").value=firstname;document.getElementById("lname_id").value=lastname;document.getElementById("street1_id").value=address1;document.getElementById("street2_id").value=address2;document.getElementById("city_id").value=city;document.getElementById("zip_id").value=zip;countryselect=document.getElementById("country");countryselect.value=country;for(i=0;i<countryselect.options.length;i++){if(countryselect.options[i].value==country){}}var A={success:function(B){document.getElementById("stats_div").innerHTML=B.responseText;document.getElementById("state").value=state;defaultaddressidobj=document.getElementById("default_address_id");if(defaultaddressidobj==null||defaultaddressidobj.value!=selectedid){newcallback={success:function(C){defaultadddiv=document.getElementById("set_default_address_div");if(defaultadddiv!=null){defaultadddiv.innerHTML=C.responseText;launchPopUpEx("set_default_address_div_outer",false,defaultadddiv.id)}}};newurl=base_url+"/index.php/addressmanage/displaySetDefaultPopup/"+selectedid+"/"+(addnum+1);YAHOO.util.Connect.asyncRequest("GET",newurl,newcallback)}}};url=base_url+"/index.php/address/getStates/"+country;YAHOO.util.Connect.asyncRequest("GET",url,A)}function setDefaultAddress(B){var A={success:function(C){}};url=base_url+"/index.php/addressmanage/setDefaultAddress/"+B;if(B!="0"){YAHOO.util.Connect.asyncRequest("GET",url,A)}}function gotoEditSellOrder(A){var B={success:function(C){reply=C.responseText;if(reply=="yes"){location.href=base_url+"index.php/item/editsellorder/"+A}else{launchPopUp("cannot_edit_sell_order_div",false);return false}}};url=base_url+"/index.php/item/isSellorderEditable/"+A;YAHOO.util.Connect.asyncRequest("GET",url,B)}function checkEditSellOrderForm(A){isvalid=false;return isvalid}function changeShippingMethods(B,A){cbobjs=B[A];parm=0;if(cbobjs!=null){for(i=0;i<cbobjs.length;i++){if(cbobjs[i].checked){parm=parm+cbobjs[i].value}}}var C={success:function(D){reply=D.responseText;if(reply!=""){tdcontainerobj=document.getElementById("shipping_service_td_id");ositobj=document.getElementById("other_service_input_tr");if(tdcontainerobj!=null){tdcontainerobj.innerHTML=reply}if(ositobj!=null){ositobj.style.display="none"}clearSpan("flat_rate_service");clearSpan("shipping_service_other_input")}}};url=base_url+"/index.php/shipping/shippingServiceAjax/"+parm;YAHOO.util.Connect.asyncRequest("GET",url,C)}function showOtherInput(A){trobj=document.getElementById("other_service_input_tr");if(A.value=="Other"){if(trobj!=null){trobj.style.display=""}}else{if(trobj!=null){trobj.style.display="none";theinput=document.getElementById("shipping_service_other_input_id");if(theinput!=null){theinput.value=""}}}}function showOtherInputCountry(A){selectname=A.name;idnumber=selectname.substr(selectname.lastIndexOf("_")+1);trobj=document.getElementById("other_service_country_"+idnumber+"_input_tr");if(A.value=="Other"){if(trobj!=null){trobj.style.display=""}}else{if(trobj!=null){trobj.style.display="none";theinput=document.getElementById("other_service_country_"+idnumber+"_input_id");if(theinput!=null){theinput.value=""}}}}function showOtherInputWorldwide(A){trobj=document.getElementById("other_service_worldwide_input_tr");if(A.value=="Other"){if(trobj!=null){trobj.style.display=""}}else{if(trobj!=null){trobj.style.display="none";theinput=document.getElementById("shipping_service_other_worldwide_input_id");if(theinput!=null){theinput.value=""}}}}function showWorldwideFlatrate(){hasworldwide=false;sign=document.getElementById("worldwide_flat_rate_sign_id");if(sign!=null){if(sign.value=="yes"){sign.value="no";hasworldwide=true}else{sign.value="yes"}}aobj=document.getElementById("add_worldwide_flat_rate_text");if(aobj!=null){if(!hasworldwide){aobj.innerHTML="Remove flat rate for worldwide shipping"}else{aobj.innerHTML="Add another flat rate for worldwide shipping"}}trnumber=6;for(temp=1;temp<trnumber;temp++){objname="worldwide_flat_rate_tr_"+temp;obj=document.getElementById(objname);if(obj!=null){if(hasworldwide){obj.style.display="none"}else{obj.style.display=""}}}}function disableUSPS(A){checkboxobj=document.getElementById("usps_checkbox_id");imageobj=document.getElementById("usps_image_id");if(A){if(checkboxobj!=null){checkboxobj.checked=false;checkboxobj.style.display="none"}if(imageobj!=null){imageobj.style.display="none"}}else{if(checkboxobj!=null){checkboxobj.style.display=""}if(imageobj!=null){imageobj.style.display=""}}}function isDestinationOutsideUSCAN(){is=false;theform=document.getElementById("item");dests=theform["shipping_destination[]"];for(temp=0;temp<dests.length;temp++){if(dests[temp].value!="2"&&dests[temp].value!="3"&&dests[temp].checked){is=true;break}}return is}function checkDestinationCountry(A){obj=document.getElementById("selected_countries");selectedcountobj=document.getElementById("selected_countries_count");selectedcountvalue=selectedcountobj.innerHTML;selectedcount=parseInt(selectedcountvalue);if(A.checked){ihtml=obj.innerHTML;if(ihtml.indexOf("countryli_"+A.value)==-1){ihtml=ihtml+'<li id="countryli_'+A.value+'">'+countrycodes[A.value]+"</li>";obj.innerHTML=ihtml;selectedcount++}}else{tempobj=document.getElementById("countryli_"+A.value);if(tempobj!=null){obj.removeChild(tempobj);selectedcount--}}selectedcountobj.innerHTML=""+selectedcount}function changeContinent(A){names=new Array("as","oc","eu","af","sa","na");tohide=new Array();for(temp=0;temp<names.length;temp++){if(names[temp]!=A){tohide.push(names[temp])}}for(temp=0;temp<tohide.length;temp++){obj=document.getElementById(tohide[temp]+"countries");aobj=document.getElementById(tohide[temp]+"li");if(aobj!=null){aobj.className=""}if(obj!=null){obj.style.display="none"}}obj=document.getElementById(A+"countries");aobj=document.getElementById(A+"li");if(aobj!=null){aobj.className="selected"}if(obj!=null){obj.style.display=""}selectconobj=document.getElementById("selected_continent_id");if(selectconobj!=null){selectconobj.value=A}}function selectAllCountries(){selectedcon="na";selectconobj=document.getElementById("selected_continent_id");if(selectconobj!=null){selectedcon=selectconobj.value}checks=document.getElementsByName("shipping_destination[]");for(i=0;i<checks.length;i++){if(!checks[i].checked){if(checks[i].id.indexOf(selectedcon)!=-1){checks[i].checked=true;checkDestinationCountry(checks[i])}}}}function clearAllCountries(){selectedcon="na";selectconobj=document.getElementById("selected_continent_id");if(selectconobj!=null){selectedcon=selectconobj.value}checks=document.getElementsByName("shipping_destination[]");for(i=0;i<checks.length;i++){if(checks[i].checked){if(checks[i].id.indexOf(selectedcon)!=-1){checks[i].checked=false;checkDestinationCountry(checks[i])}}}}function showOrHideSelectedCountries(){selcoobj=document.getElementById("selected_countries");spanobj=document.getElementById("display_showhide_span");if(selcoobj!=null){if(selcoobj.style.display=="none"){selcoobj.style.display="";if(spanobj!=null){spanobj.innerHTML="[Collapse]"}}else{selcoobj.style.display="none";if(spanobj!=null){spanobj.innerHTML="[Expand]"}}}}function addCountryFlatrate(){ids=document.getElementById("added_country_ids").value;adda=document.getElementById("add_country_flat_rate_a");removea=document.getElementById("remove_country_flat_rate_a");if(ids==""){ids="0";displayCountryFlatRate(ids,true);if(removea!=null){removea.style.display=""}}else{idnumber=parseInt(ids);ids=(idnumber+1);displayCountryFlatRate(ids,true);if(ids==9){if(adda!=null){adda.style.display="none"}}}document.getElementById("added_country_ids").value=ids}function removeCountryFlatrate(){ids=document.getElementById("added_country_ids").value;adda=document.getElementById("add_country_flat_rate_a");removea=document.getElementById("remove_country_flat_rate_a");if(ids=="0"){displayCountryFlatRate(ids,false);ids="";if(removea!=null){removea.style.display="none"}}else{idnumber=parseInt(ids);if(idnumber==9){if(adda!=null){adda.style.display=""}}displayCountryFlatRate(ids,false);ids=(idnumber-1)}document.getElementById("added_country_ids").value=ids}function displayCountryFlatRate(B,A){for(temp=0;temp<=4;temp++){tempobj=document.getElementById("country_flat_rate_tr_"+B+"_"+temp);if(tempobj!=null){if(A){tempobj.style.display=""}else{tempobj.style.display="none"}}}}function displayAllCountryFlatRate(A){for(ttemp=0;ttemp<10;ttemp++){displayCountryFlatRate(ttemp,A)}}function shelvesExpand(){var A=document.getElementById("o_m_data_tb_con");var B=document.getElementById("btn_shelves");var C=document.getElementById("shelves_list");if(C.style.display=="none"){B.innerHTML="<img src='"+base_image_url+"images/buttons/btn_shelves.gif'>";C.style.display="block";A.style.cssText="margin-left:154px;border-left:1px solid #E6E6E6;padding-left:1px;"}else{B.innerHTML="<img src='"+base_image_url+"images/buttons/btn_shelves_closed.gif'>";C.style.display="none";A.style.cssText="margin-left:0px;border-left:0 none;padding-left:0px;"}}function showShelfList(){var A=document.getElementById("add_to_shelf_list");if(A.style.display=="none"){A.style.display="block"}else{A.style.display="none"}}