var i=0;$(document).ready(function(){if($("#image").attr("id")!=undefined){$("#image").sortable({placeholder:"vacant",update:function(h,f){var a=[],c={};$(".success",$("#left")).remove();$("#image img").each(function(k){var e=$("#ctl00_DefaultContent_ucPhotes_HidPhotoCount").val();if(e==undefined){e=1}var j={id:$(this).parent().attr("id"),order:parseInt(e)+k};a.push(j)});for(var d=0;d<=a.length-1;d++){var b=a[d]["id"];var g=a[d]["order"];$("#sp"+b).text(g)}c.d=a;if($("#ctl00_DefaultContent_ucPhotes_hidIsUpdate").val()=="true"){$.ajax({type:"POST",url:"../ImageOrganiser.asmx/updateImageOrder",data:JSON.stringify(c),contentType:"application/json; charset=utf-8",success:function(e){},failure:function(e){}})}else{if($("#ctl00_DefaultContent_Wizard1_ucAdPhotos_hidIsUpdate").val()=="false"){$.ajax({type:"POST",url:"../ImageOrganiser.asmx/updateDataSetOrder",data:JSON.stringify(c),contentType:"application/json; charset=utf-8",success:function(e){},failure:function(e){}})}}}})}if($("#navigation").attr("id")!=undefined){$("#navigation").treeview({persist:"location",collapsed:true,unique:true})}});$(document).ready(function(){if($("#xApprove").attr("id")!=undefined){$("#xApprove").sortable({placeholder:"vacant",update:function(h,f){var a=[],c={};$(".success",$("#left")).remove();$("#xApprove img").each(function(j){var e={id:$(this).parent().attr("id"),order:j+1};a.push(e)});for(var d=0;d<=a.length-1;d++){var b=a[d]["id"];var g=a[d]["order"];$("#sp"+b).text(g)}c.d=a;if($("#ctl00_DefaultContent_ucPhotes_hidIsApproveUpdate").val()=="true"){$.ajax({type:"POST",url:"../ImageOrganiser.asmx/updateImageOrder",data:JSON.stringify(c),contentType:"application/json; charset=utf-8",success:function(e){},failure:function(e){}})}else{if($("#ctl00_DefaultContent_Wizard1_ucAdPhotos_hidIsApproveUpdate").val()=="false"){$.ajax({type:"POST",url:"../ImageOrganiser.asmx/updateDataSetOrder",data:JSON.stringify(c),contentType:"application/json; charset=utf-8",success:function(e){},failure:function(e){}})}}}})}if($("#navigation").attr("id")!=undefined){$("#navigation").treeview({persist:"location",collapsed:true,unique:true})}});function toggleVisibilityPhoto(){var a=document.getElementById("divArrowOpenPhoto");var b=document.getElementById("divArrowClosePhoto");if(a.style.visibility=="visible"||a.style.visibility==""){a.style.visibility="hidden";b.style.visibility="visible"}else{a.style.visibility="visible";b.style.visibility="hidden"}}function toggleVisibilitySellerType(){var a=document.getElementById("divArrowOpenSellerType");var b=document.getElementById("divArrowCloseSellerType");if(a.style.visibility=="visible"||a.style.visibility==""){a.style.visibility="hidden";b.style.visibility="visible"}else{a.style.visibility="visible";b.style.visibility="hidden"}}function toggleVisibilityPrice(){var a=document.getElementById("divArrowOpenPrice");var b=document.getElementById("divArrowClosePrice");if(a.style.visibility=="visible"||a.style.visibility==""){a.style.visibility="hidden";b.style.visibility="visible"}else{a.style.visibility="visible";b.style.visibility="hidden"}}function toggleVisibilityVehicleYear(){var a=document.getElementById("divArrowOpenVehicleYear");var b=document.getElementById("divArrowCloseVehicleYear");if(a.style.visibility=="visible"||a.style.visibility==""){a.style.visibility="hidden";b.style.visibility="visible"}else{a.style.visibility="visible";b.style.visibility="hidden"}}function toggleVisibilityExtColor(){var a=document.getElementById("divArrowOpenExtColor");var b=document.getElementById("divArrowCloseExtColor");if(a.style.visibility=="visible"||a.style.visibility==""){a.style.visibility="hidden";b.style.visibility="visible"}else{a.style.visibility="visible";b.style.visibility="hidden"}}function toggleVisibilityMiles(){var a=document.getElementById("divArrowOpenMiles");var b=document.getElementById("divArrowCloseMiles");if(a.style.visibility=="visible"||a.style.visibility==""){a.style.visibility="hidden";b.style.visibility="visible"}else{a.style.visibility="visible";b.style.visibility="hidden"}}function toggleVisibilityTransmission(){var a=document.getElementById("divArrowOpenTransmission");var b=document.getElementById("divArrowCloseTransmission");if(a.style.visibility=="visible"||a.style.visibility==""){a.style.visibility="hidden";b.style.visibility="visible"}else{a.style.visibility="visible";b.style.visibility="hidden"}}function toggleVisibilityFuelType(){var a=document.getElementById("divArrowOpenFuelType");var b=document.getElementById("divArrowCloseFuelType");if(a.style.visibility=="visible"||a.style.visibility==""){a.style.visibility="hidden";b.style.visibility="visible"}else{a.style.visibility="visible";b.style.visibility="hidden"}}function toggleVisibilityDoor(){var a=document.getElementById("divArrowOpenDoor");var b=document.getElementById("divArrowCloseDoor");if(a.style.visibility=="visible"||a.style.visibility==""){a.style.visibility="hidden";b.style.visibility="visible"}else{a.style.visibility="visible";b.style.visibility="hidden"}}function toggleVisibilityVehicleCity(){var a=document.getElementById("divArrowOpenVehicleCity");var b=document.getElementById("divArrowCloseVehicleCity");if(a.style.visibility=="visible"||a.style.visibility==""){a.style.visibility="hidden";b.style.visibility="visible"}else{a.style.visibility="visible";b.style.visibility="hidden"}}function toggleVisibilityListingDate(){var a=document.getElementById("divArrowOpenListingDate");var b=document.getElementById("divArrowCloseListingDate");if(a.style.visibility=="visible"||a.style.visibility==""){a.style.visibility="hidden";b.style.visibility="visible"}else{a.style.visibility="visible";b.style.visibility="hidden"}}function toggleVisibilityEngine(){var a=document.getElementById("divArrowOpenEngine");var b=document.getElementById("divArrowCloseEngine");if(a.style.visibility=="visible"||a.style.visibility==""){a.style.visibility="hidden";b.style.visibility="visible"}else{a.style.visibility="visible";b.style.visibility="hidden"}}function toggleVisibilityDrivetrain(){var a=document.getElementById("divArrowOpenDrivetrain");var b=document.getElementById("divArrowCloseDrivetrain");if(a.style.visibility=="visible"||a.style.visibility==""){a.style.visibility="hidden";b.style.visibility="visible"}else{a.style.visibility="visible";b.style.visibility="hidden"}}function CheckYouTubeVideoExist(a){var b="ReviewPhotos.aspx/GetAdVideos";$.ajax({type:"POST",url:b,data:"{AdId:' "+a+"'}",contentType:"application/json; charset=utf-8",dataType:"json",success:function(c){var d=c.d.split("~");if(d[1]==""){$("#ctl00_DefaultContent_ucPhotes_divYouTube").css("visibility","hidden");$("#ctl00_DefaultContent_ucPhotes_btnUploadToYouTube").attr("style","display:inline");$("#ctl00_DefaultContent_ucPhotes_divYoutubeUploadNote").attr("style","display:inline")}else{$("#ctl00_DefaultContent_ucPhotes_hypAdLink").attr("href",d[1]);$("#ctl00_DefaultContent_ucPhotes_hypAdLink").text(d[1])}},failure:function(c){}})}function WinAddDocumentForAllTheWeb2(c,f,b){var e=document.getElementById(f);var a=document.getElementById(b).value;var d=a.replace(/\s/g,"+");c=c+d;e.setAttribute("href",c)}function WinAddDocumentForAllTheWeb1(){var b=document.getElementById("hypalltheweb");var a="http://us.yhs4.search.yahoo.com/yhs/search?fr=alltheweb&cat=web&q=";a+=document.getElementById("ctl00_DefaultContent_txtalltheweb").value;b.setAttribute("href",a)}function WinAddDocumentForAltavista1(){var b=document.getElementById("hypAltavista");var a="http://us.yhs4.search.yahoo.com/yhs/search?fr=altavista&q=";a+=document.getElementById("ctl00_DefaultContent_txtaltavista").value;b.setAttribute("href",a)}function WinAddDocumentForYahoo1(){var b=document.getElementById("hypyahoo");var a="http://search.yahoo.com/search?p=";a+=document.getElementById("ctl00_DefaultContent_txtyahoo").value;b.setAttribute("href",a)}function WinAddDocumentForGoogle1(){var b=document.getElementById("hypGoogle");var a="http://www.google.com/search?q=";a+=document.getElementById("ctl00_DefaultContent_txtgoogle").value;b.setAttribute("href",a)}function WinAddDocumentForBing1(){var b=document.getElementById("hypBing");var a="http://www.bing.com/search?q=";a+=document.getElementById("ctl00_DefaultContent_txtbing").value;b.setAttribute("href",a)}function WinAddDocumentForAllTheWeb(){var a=document.getElementById("ctl00_DefaultContent_txtalltheweb").value;myFloater=window.open("","myWindow","scrollbars=yes,location=yes,toolbar=yes,menubar=yes,resizable=yes,status=yes,width=700,height=400");myFloater.location.href="http://us.yhs4.search.yahoo.com/yhs/search?fr=alltheweb&cat=web&q="+a}function WinAddDocumentForAltavista(){var a=document.getElementById("ctl00_DefaultContent_txtaltavista").value;myFloater=window.open("","myWindow","scrollbars=yes,location=yes,toolbar=yes,menubar=yes,resizable=yes,status=yes,width=700,height=400");myFloater.location.href="http://us.yhs4.search.yahoo.com/yhs/search?fr=altavista&q="+a}function WinAddDocumentForYahoo(){var a=document.getElementById("ctl00_DefaultContent_txtyahoo").value;myFloater=window.open("","myWindow","scrollbars=yes,location=yes,toolbar=yes,menubar=yes,resizable=yes,status=yes,width=700,height=400");myFloater.location.href="http://search.yahoo.com/search?p="+a}function WinAddDocumentForGoogle(){var a=document.getElementById("ctl00_DefaultContent_txtgoogle").value;myFloater=window.open("","myWindow","scrollbars=yes,location=yes,toolbar=yes,menubar=yes,resizable=yes,status=yes,width=700,height=400");myFloater.location.href="http://www.google.com/search?q="+a}function WinAddDocumentForBing(){var a=document.getElementById("ctl00_DefaultContent_txtbing").value;myFloater=window.open("","myWindow","scrollbars=yes,location=yes,toolbar=yes,menubar=yes,resizable=yes,status=yes,width=700,height=400");myFloater.location.href="http://www.bing.com/search?q="+a}function ValidateUploadImages(){var a=parseInt($(".MultiFile-list div").size());if(a==0){alert("Please browse images");return false}}function tabs(){var a=$("#tabs > div > ul").tabs({});var f=$("#ctl00_DefaultContent_hidCatStep").val();a.tabs("select",parseInt(f));var e=$("#tabs > div > ul > li:eq("+f+") > a").attr("rel");var d=$("#tabs > div > ul > li:eq("+f+") > a").attr("title");$("#ctl00_DefaultContent_hidCategoryID").val(e);$("#ctl00_DefaultContent_hidCategory").val(d);var b=parseInt($(".tabnav li").size());$(".header").jCarouselLite({btnNext:".next",btnPrev:".prev",start:parseInt((f<=0)?0:f-1),visible:(b<4)?b:4,circular:false});$(".header ul").css("width","1740px");$("#tabs > div > ul > li > a").click(function(){$("#ctl00_DefaultContent_hidCatStep").val($(this).attr("id"));$("#ctl00_DefaultContent_hidCategoryID").val($(this).attr("rel"))});$("#imgPrev").click(function(){var g=a.data("selected.tabs");a.tabs("select",parseInt(g)-1);$("#ctl00_DefaultContent_hidCatStep").val(parseInt(g)-1)});$("#imgNext").click(function(){var g=a.data("selected.tabs");a.tabs("select",parseInt(g)+1);$("#ctl00_DefaultContent_hidCatStep").val(parseInt(g)+1)});$("#tabs .tabdiv").each(function(){var j=$(this).attr("id");var g=$("#"+j+" .panel").size();var h=$("#ctl00_DefaultContent_hidSubCategoryPosition").val();if(parseInt(g)>0){$("#"+j).movingBoxes({startPanel:0,width:600,imageRatio:16/9,speed:0})}});var c=parseInt($("#ctl00_DefaultContent_hidSubCategoryPosition").val())-1;if(c>=0){$("#tabs-"+e+"> div > div > div:eq("+2+")").css("border","1px solid red")}}function SubCategoryOnClientClick(e,f,d,b,c){var a="#ctl00_DefaultContent_";$(a+"hidSubCategoryID").val(e);$(a+"hidSubCategory").val(f);$(a+"hidSubCategoryPosition").val(d);$(a+"hidCategory").val(c);$(a+"hidCategoryID").val(b);getProgressBar()}function getProgressBar(){$.showprogress()}function HomeGetProgressBar(a){$.HomeShowProgress(a)}function getProgressBar1(){$.showprogress1()}function VehicleSearchShowprogress(){$.VehicleSearchShowprogress()}function hideProgressBar(){$("#processing_container").css("display","none");$("#processing_overlay").remove()}function clearHistory(){$("#ctl00_DefaultContent_txtNotes").val("")}function RoundCorners(){$(".roundcorner").each(function(){if($(".roundcorner").corner==="function"){$(".roundcorner").corner()}})}function HoverSlideShow(a){if($("#divEnable"+a).attr("class")=="check"){var c=$("#slider"+a+" img").length;var b=Math.floor(Math.random()*c);$("#slider"+a).nivoSlider({effect:"random",slices:15,animSpeed:500,pauseTime:1000,startSlide:b,directionNav:false,directionNavHide:true,controlNav:false,controlNavThumbs:false,controlNavThumbsFromRel:false,controlNavThumbsSearch:".jpg",controlNavThumbsReplace:"_thumb.jpg",keyboardNav:true,pauseOnHover:false,manualAdvance:false,captionOpacity:0.8,beforeChange:function(){},afterChange:function(){},slideshowEnd:function(){}})}$("#divEnable"+a).removeClass("check").addClass("checked")}function ShowVideoInPopUp(){$("div.popupDiv").fancybox({autoScale:true,transitionIn:"none",transitionOut:"none",type:"modal window",href:"GMaps.aspx"})}function PlayVideo(b,a){var c=new SWFObject("/Flash/flvPlayer1.swf","flvPlayer","353","363","8","#000000");c.addVariable("file",b);c.addVariable("showScaleModes","false");c.addVariable("autostart","true");c.addVariable("defaultVolume","80");c.addVariable("javascriptid","flvPlayer");c.addVariable("showcontrolbar","0");c.addVariable("hiddenGui","true");c.addVariable("jsCallback","true");c.addParam("allowFullScreen","true");c.addVariable("enablejs","true");c.write(a)}function validateXMLUpload(){var b="#ctl00_DefaultContent_xmlvalidator1_";var a=$(b+"fuXmlFile").val();if(a.trim()==""){alert("Please browse xml file");return false}var c=a.substr((a.lastIndexOf(".")+1));if(c.toLowerCase()!="xml"){alert("Please upload xml files only");return false}return true}function validateXMLFile(){var b="#ctl00_DefaultContent_";var a=$(b+"fuXmlFile").val();if($(b+"txtXMLData").val().trim()==""&&a.trim()==""){alert("Please browse xml file (or) copy and paste your xml");return false}else{if($(b+"txtXMLData").val().trim()==""){if(a.trim()==""){alert("Please browse xml file");return false}if(a.trim()!=""){var c=a.substr((a.lastIndexOf(".")+1));if(c.toLowerCase()!="xml"){alert("Please upload xml files only");return false}}}}return true}function NpSlideShow(a,b){$("#"+a+" a[rel^='prettyPhoto']").prettyPhoto({animationSpeed:"fast",theme:"light_square",slideshow:2000,autoplay_slideshow:true})}function clickButton(c,b){var a=document.getElementById(b);if(typeof a=="object"){if(navigator.appName.indexOf("Netscape")>(-1)){if(c.keyCode==13){a.click();return false}}if(navigator.appName.indexOf("Microsoft Internet Explorer")>(-1)){if(event.keyCode==13){a.click();return false}}}}function ShowPaymentPanels(c){var a="#ctl00_DefaultContent_ucPayment_";var b=$(c).val();$("#ctl00_DefaultContent_pnlPayment").css("display","inline");if(b=="-1"){$("#ctl00_DefaultContent_pnlPayment").css("display","none");$(a+"pnlDemandDraft").css("display","none");$(a+"pnlCashPayment").css("display","none");$(a+"pnlCreditCard").css("display","none")}else{if(b=="9"){$(a+"pnlDemandDraft").css("display","none");$(a+"pnlCashPayment").css("display","inline");$(a+"pnlCreditCard").css("display","none")}else{if(b=="8"){$(a+"pnlDemandDraft").css("display","inline");$(a+"pnlCashPayment").css("display","none");$(a+"pnlCreditCard").css("display","none")}else{$(a+"pnlDemandDraft").css("display","none");$(a+"pnlCashPayment").css("display","none");$(a+"pnlCreditCard").css("display","inline")}}}}function SetPaymentType(f,g){var b="";var c=$(g).attr("id").split("_");var a="#";for(var d=0;d<c.length-1;d++){a+=c[d]+"_";b+=c[d]+"_"}$(a+"hidPaymentType").val(f);$(a+"hidIsAdd").val("add");ChangeChequeSpan();if(!paymentsDateValidation(b+"pnlOptionalPackages")){return false}}function SetPayedAmount(f){var c=$(f).attr("id").split("_");var a="#";for(var d=0;d<c.length-1;d++){a+=c[d]+"_"}$(a+"hidIsAdd").val("add");var b=$(".paymentvalue").text();$(a+"hidPayment").val(b)}function PaymentChangeMode(){var a="#ctl00_DefaultContent_ucPayment_";$(a+"hidIsAdd").val("edit")}function ClearCreditCardPayments(d){var b=$(d).attr("id").split("_");var a="#";for(var c=0;c<b.length-1;c++){a+=b[c]+"_"}$(a+"txtNameOfCard").val("");$(a+"txtCardNo").val("");$(a+"txtVerifyNumber").val("");$(a+"txtCreditAmt").val("");$(a+"ddlExpMonth").get(0).selectedIndex=0;$(a+"lblResp").text("")}function ClearDemandDraftPayments(g){var c=$(g).attr("id").split("_");var a="#";for(var d=0;d<c.length-1;d++){a+=c[d]+"_"}var f=parseFloat($(a+"txtRemaingAmount").val());var b=parseFloat($(a+"hidAmount").val());$(a+"txtRemaingAmount").val((f-b));$(a+"txtDraftNumber").val("");$(a+"txtBankName").val("");$(a+"txtBranchName").val("");$(a+"txtChequeAmtinFig").val("");$(a+"txtChequeAmount").val("");$(a+"txtChequeReceivedFrom").val("");$(a+"rdlPaymentType_0").attr("checked","checked")}function ClearCashPayments(g){var c=$(g).attr("id").split("_");var a="#";for(var d=0;d<c.length-1;d++){a+=c[d]+"_"}var f=parseFloat($(a+"txtRemaingAmount").val());var b=parseFloat($(a+"hidAmount").val());$(a+"txtRemaingAmount").val((f-b));$(a+"txtCashAmtInFig").val("");$(a+"txtCashAmt").val("");$(a+"txtReceivedFrom").val("")}function ChangeNumberToWords(f,d,g){var b=$(g).attr("id").split("_");var a="#";for(var c=0;c<b.length-1;c++){a+=b[c]+"_"}$.ajax({type:"POST",url:"./PaymentInfo.aspx/GetNumberInWords",data:"{strNumber:' "+f+"'}",contentType:"application/json; charset=utf-8",dataType:"json",success:function(e){var h=e.d;$(a+d).val(h);$(a+"hidAmountInWords").val(h)},failure:function(e){}})}function ChangeChequeSpan(){var a="#ctl00_DefaultContent_ucPayment_";if($("#ctl00_DefaultContent_ucPayment_rdlPaymentType input:radio:checked").val()=="Check"){$("#spCheque").css("display","inline");$("#spDD").css("display","none")}else{$("#spDD").css("display","inline");$("#spCheque").css("display","none")}}function UncheckPackageRadioButtons(h,b){var a="#";a+=h;var l=$(a+" tr");var c=l.length;var g;var j;var d;for(var k=1;k<=c-1;k++){var f=l[k];j=f.cells[2];inputPackageInfo=f.cells[0];g=inputPackageInfo.getElementsByTagName("input")[0];if(b==g.id){d=j.getElementsByTagName("span")[0];g.checked=true}else{g.checked=false}}}function UncheckRadioButtonsPackage(a){var h="#ctl00_DefaultContent_AdvertisementWizard_";var j=$(h+"gvCustPackage tr");var b=j.length;var e;var f;var c;for(var g=1;g<=b-1;g++){var d=j[g];f=d.cells[2];inputPackageInfo=d.cells[0];e=inputPackageInfo.getElementsByTagName("input")[0];if(a==e.id){c=f.getElementsByTagName("span")[0];e.checked=true}else{e.checked=false}}}function validateFileUpload(){$(".uploadvalidation").val($("#image li").length)}function PlayVideoForQueues(b,a){PlayVideo(b,a);$(".video").each(function(){var c=$(this).attr("id");$("#"+c).fancybox({titlePosition:"inside",transitionIn:"none",transitionOut:"none"})})}function ShowPaymentModalPopup(){var a="#ctl00_DefaultContent_ucCustomerAssistent_";if($(a+"lbtnFeaturedListing").text()=="No"){$(a+"hidIsShowPopup").val("true")}else{$(a+"hidIsShowPopup").val("false")}}function UpdateFeatureList(){var a="#ctl00_DefaultContent_ucCustomerAssistent_";$(a+"btnFeatureList").click()}function showFinishModalPopup(){var b="ctl00_DefaultContent_ucCustomerAssistent_ucPayment_";var a=$(b+"mpeFinish");a.show()}function imposeMaxLength(b,a){return(b.value.length<a)}function CalcGrandTotal(h){var b=$(h).attr("id").split("_");var k="#";for(var c=0;c<b.length-1;c++){k+=b[c]+"_"}var f=$(k+"txtTotal").val();var j=h.value;if(parseFloat(f)>parseFloat(j)){var a=parseFloat(f)-parseFloat(j);var d=$(k+"hidPayment").val();var g=parseFloat(a)-parseFloat(d);$(k+"txtGrandTotal").val(a);$(k+"hidGrandTotal").val(a);$(k+"txtRemaingAmount").val(g)}else{return false}}function ClearNetWorkPartnerDetails(){var a="#ctl00_DefaultContent_fv_NetworkPartnerServerDetails_";$(a+"ddlNetWorkPartner").val("-1");$(a+"txtHostOrServerIP").val("");$(a+"txtUserName").val("");$(a+"txtPassword").val("");$(a+"txtFolderName").val("");$(a+"txtFileName").val("");return false}function ApprovedImages(){var a="ctl00_DefaultContent_WizardACQ_AdsPhotos_dtPhoto";var c=document.getElementById(a);var b=0;if(c!=null){var d=c.getElementsByTagName("input");for(i=0;i<d.length;i++){if(d[i].type=="checkbox"){if(d[i].checked){b++}}}document.getElementById("ctl00_DefaultContent_WizardACQ_AdsPhotos_txtApprovedPhotoCount").value=b}}function SetToDate(j){if($("#"+j).attr("id")!=undefined){var g=$("#"+j).attr("id").split("_");var a="#";for(var h=0;h<g.length-1;h++){a+=g[h]+"_"}if($("#"+j).val()!=""){var c=$(a+"hidValidity").val();var f=$("#"+j).val().split("/");var d=new Date();d.setYear(f[2]);d.setMonth(parseInt(f[0]-1));d.setDate(f[1]);d.setDate(d.getDate()+parseInt(c));if(d!=NaN){var b=d.format("MM/dd/yyyy");$(a+"txtToDate").val(b);$(a+"hidTodate").val(b)}}}}function dateSelectionChanged(c,b){var a="#ctl00_DefaultContent_ucCustomerAssistent_";$(a+"txtFromDate").focus()}function CheckIsFeatureList(b){var a="#ctl00_DefaultContent_ucCustomerAssistent_";$(a+"hidIsFeatureList").val(b)}function optionalPackagedateSelectionChanged(e,c){var b=e._id.split("_");var a="#";for(var d=0;d<b.length-1;d++){a+=b[d]+"_"}$(a+"txtOptionalFromDate").focus()}function SetOptionalToDate(h,a){if($(h).attr("id")!=undefined){var c=$(h).attr("id").split("_");var k="#";for(var f=0;f<c.length-1;f++){k+=c[f]+"_"}if($(h).val()!=""){var d=a;var j=$(h).val().split("/");var b=new Date();b.setYear(j[2]);b.setMonth(parseInt(j[0]-1));b.setDate(j[1]);b.setDate(b.getDate()+parseInt(d));if(b!=NaN){var g=b.format("MM/dd/yyyy");$(k+"txtToDate").val(g);$(k+"txtDummyToDate").val(g)}}}}function PayPalPaymentUrl(n,k,a,f,h,m,d){var b;var g=parseFloat(d);b=n+"?cmd=_xclick&business="+f;b+="&item_name="+m;b+="&amount="+g;b+="&currency="+k;b+="&return="+a+"/Advertisements/PayPalResponse.aspx?merchant_return_link=OneStopMotors&&QLT="+h;b+="&cancel_return="+a+"/Advertisements/PayPalResponse.aspx?merchant_return_link=Failure";b+="&notify_url="+a+"/Advertisements/paypalIPNresponse.aspx";b+="&request_id=5";b+="&rm=1";b+="&cbt=Return to OneStopMotors";var c=950;var o=580;var e=parseInt((screen.availWidth/2)-(c/2));var l=parseInt((screen.availHeight/2)-(o/2));var j="location=no,status=yes,scrollbars=yes,resizable=yes,width="+c+",height="+o+",status,resizable,left="+e+",top="+l+"screenX="+e+",screenY="+l;window.open(b,null,j)}function paymentsDateValidation(e){if(document.getElementById(e)!=null){var d=document.getElementById(e).getElementsByTagName("INPUT");for(var b=0;b<d.length;b++){if(d[b].type.toUpperCase()=="CHECKBOX"){if(document.getElementById(d[b].id).checked==true&&document.getElementById(d[b].id).disabled==false){var c=d[b].id;var a=c.substr(0,c.lastIndexOf("_")+1)+"txtOptionalFromDate";if(document.getElementById(a).value==""){alert("From date is required");document.getElementById(a).focus();return false}}}}}return true}function testCreditCard(g){var d=$(g).attr("id").split("_");var a="";for(var f=0;f<d.length-1;f++){a+=d[f]+"_"}var b=document.getElementById(a+"txtCardNo");var c="";if(document.getElementById(a+"rbtnMasterCard").checked==true){c="MasterCard"}else{if(document.getElementById(a+"rbtnVisa").checked==true){c="Visa"}else{if(document.getElementById(a+"rbtnAmericanExp").checked==true){c="AmEx"}else{if(document.getElementById(a+"rbtnDiscover").checked==true){c="Discover"}}}}if(c==""){alert("Unknown card type");document.getElementById(a+"rbtnMasterCard").focus();return false}if(document.getElementById(a+"txtNameOfCard").value!=""){if(!checkCreditCard(b.value,c)){alert(ccErrors[ccErrorNo]);b.focus();return false}else{return true}}else{document.getElementById(a+"txtNameOfCard").focus();return true}}function AssignCategoryId(a){$("#tabul li a[rel="+a+"]").each(function(){var b=($(this).attr("id"));$("#ctl00_DefaultContent_hidCatStep").val(b);tabs()})}function divOnClickForAdDetails(a,c){alert(c);var b=a;if(b.id.search("lkAddToFavourite")==-1){window.location=c}else{return false}}function divOnClickForAdDetailsAsp(b,c,a){document.getElementById("ctl00_DefaultContent_hidAdId").value=a;if(b.type!=undefined){return true}else{if(b.type==undefined){window.location=c}}}function divOnClickForAdminDashBoard(a,c){var b=a;if(b.id.search("hypViewAd")==-1){window.location=c}else{return false}}function MyFavMessage(){alert("Please login as Interested buyer to add this vehicle to your favorites");return false}var duration=2;var _progressWidth=100;var _progressBar=new String("»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»");var _progressEnd=10;var _progressAt=0;function ProgressCreate(b){_progressEnd=b;_progressAt=0;if(document.all){progress.className="show";progress.style.left=(document.body.clientWidth/2)-(progress.offsetWidth/2);progress.style.top=document.body.scrollTop+(document.body.clientHeight/2)-(progress.offsetHeight/2)}else{if(document.layers){document.progress.visibility=true;document.progress.left=(window.innerWidth/2)-100;document.progress.top=pageYOffset+(window.innerHeight/2)-40}else{if(document.getElementById){document.getElementById("progress").className="show";var a=(window.innerWidth/2)-100;var c=pageYOffset+(window.innerHeight/2)-40;document.getElementById("progress").style.left=a+"px";document.getElementById("progress").style.top=c+"px"}}}ProgressUpdate()}function ProgressDestroy(){if(document.all){progress.className="hide"}else{if(document.layers){document.progress.visibility=false}else{if(document.getElementById){document.getElementById("progress").className="hide"}}}}function ProgressStepIt(){_progressAt++;if(_progressAt>_progressEnd){_progressAt=_progressAt%_progressEnd}ProgressUpdate()}function ProgressUpdate(){var b=(_progressWidth/_progressEnd)*_progressAt;if(document.all){}else{if(document.layers){b=b*0.55}else{if(document.getElementById){}}}var a=_progressBar.substring(0,b)}function VideoUpload(){ProgressCreate(10)}function Click(){if(_progressAt>=_progressEnd){ProgressDestroy();return}ProgressStepIt();window.setTimeout("Click()",(duration-1)*1000/10)}function CallJS(jsStr){if(document.getElementById("ctl00_DefaultContent_ucPhotes_fluVideo")!=null&&document.getElementById("ctl00_DefaultContent_ucPhotes_fluVideo").value==""){alert("Please upload your Vehicle Video");return false}else{if(document.getElementById("ctl00_DefaultContent_AdvertisementWizard_ucAdPhotos_fluVideo")!=null&&document.getElementById("ctl00_DefaultContent_AdvertisementWizard_ucAdPhotos_fluVideo").value==""){alert("Please upload your Vehicle Video");return false}else{var fileName=new String();var fileExtension=new String();if(document.getElementById("ctl00_DefaultContent_ucPhotes_fluVideo")==null){fileName=document.getElementById("ctl00_DefaultContent_AdvertisementWizard_ucAdPhotos_fluVideo").value}else{fileName=document.getElementById("ctl00_DefaultContent_ucPhotes_fluVideo").value}fileExtension=fileName.substr(fileName.length-3,3);if(fileExtension=="wmv"||fileExtension=="mp4"||fileExtension=="3gp"||fileExtension=="flv"){return eval(jsStr)}}}}function FindBreadcrumbSearch(b,f){if($(f).attr("id")!=undefined){var c=$(f).attr("id").split("_");var a="";for(var d=0;d<c.length-1;d++){a+=c[d]+"_"}if(b=="Category"){document.getElementById(a+"hidFindBreadcrumbSearch").value=b}else{if(b=="Make"){document.getElementById(a+"hidFindBreadcrumbSearch").value=b}else{if(b=="Model"){document.getElementById(a+"hidFindBreadcrumbSearch").value=b}}}}};
