function populateList(B,A,C){var D={method:"POST",formNode:B,load:function(F,G,E){dojo.byId("detailsId").innerHTML=G
},mimetype:"text/plain"};
dojo.io.bind(D)
}function signUp(B,C){if(document.getElementById("username").disabled==true){return 
}var D=trim(document.getElementById("username").value);
var H=trim(document.getElementById("password").value);
var G=trim(document.getElementById("contactNumber").value);
var A=trim(document.getElementById("name").value);
var E=trim(document.getElementById("confPassword").value);
var F=document.getElementById("isDealer").checked;
if(A==""){alert("I知 confused!\nPlease fill all mandatory fields");
document.getElementById("name").focus();
return 
}if(D==""){alert("I知 confused!\nPlease fill all mandatory fields");
document.getElementById("username").focus();
return 
}if(G==""){alert("I知 confused!\nPlease fill all mandatory fields");
document.getElementById("contactNumber").focus();
return 
}if(H==""){alert("I知 confused!\nPlease fill all mandatory fields");
document.getElementById("password").focus();
return 
}if(!emailCheck(D)){alert("Identity Crisis!\nPlease enter a valid email address");
document.getElementById("username").focus();
return 
}if(isNaN(G)||G.length>10){alert("Please enter a valid mobile number.");
document.getElementById("contactNumber").focus();
return 
}if(H!=E){alert("Password do not match");
return 
}var I={method:"POST",url:"signUp.action?username="+D+"&password="+H+"&contactNumber="+G+"&name="+A+"&isDealer="+F,load:function(K,L,J){dojo.byId(C).innerHTML=L
},mimetype:"text/plain"};
dojo.io.bind(I);
dojo.byId(C).innerHTML="Loading...."
}function signIn(C,B){if(document.getElementById("loginUsername").disabled==true){return 
}var E=trim(document.getElementById("loginUsername").value);
var A=trim(document.getElementById("loginPassword").value);
if(E==""){alert("I知 confused!\nPlease fill all mandatory fields");
document.getElementById("loginUsername").focus();
return 
}if(A==""){alert("I知 confused!\nPlease fill all mandatory fields");
document.getElementById("loginPassword").focus();
return 
}var D={method:"POST",formNode:C,load:function(G,H,F){dojo.byId(B).innerHTML=H
},mimetype:"text/plain"};
dojo.io.bind(D);
dojo.byId(B).innerHTML="Loading...."
}function getEditExtraItems(A,B){var C={method:"POST",url:"getEditExtrasList.action?text="+B,load:function(E,F,D){dojo.byId(A).innerHTML=F
},mimetype:"text/plain"};
dojo.io.bind(C);
dojo.byId(A).innerHTML="Loading...."
}function getExtraItems(A,B){var C={method:"POST",url:"getExtrasList.action?text="+B,load:function(E,F,D){dojo.byId(A).innerHTML=F
},mimetype:"text/plain"};
dojo.io.bind(C);
dojo.byId(A).innerHTML="Loading...."
}function getListingFeatures(A,B){var C={method:"POST",url:"showDetailsByAjax.action?variantId="+B,load:function(E,F,D){dojo.byId(A).innerHTML=F
},mimetype:"text/plain"};
dojo.io.bind(C);
dojo.byId(A).innerHTML="Loading...."
}function getMarketPrice(B,C){var A=document.getElementById("variantId").value;
var D={method:"POST",url:"getMarketPrice.action?yrOfManufacture="+C+"&variantId="+A,load:function(F,G,E){dojo.byId(B).innerHTML=G
},mimetype:"text/plain"};
dojo.io.bind(D);
dojo.byId(B).innerHTML="Loading...."
}function getFeatures(A,B){var C={method:"POST",url:"getVariantFeatures.action?variant="+B,load:function(E,F,D){dojo.byId(A).innerHTML=F
},mimetype:"text/plain"};
dojo.io.bind(C);
dojo.byId(A).innerHTML="Loading...."
}function getAreaListByCity(A,B){if(B!="-1"){var C={method:"POST",url:"getAreaListByCity.action?city="+B,load:function(E,F,D){dojo.byId(A).innerHTML=F
},mimetype:"text/plain"};
dojo.io.bind(C);
dojo.byId(A).innerHTML="Loading...."
}else{document.forms[0].area.selectedIndex="0";
document.forms[0].area.disabled="true"
}}function getModelListByMake(C,A){document.getElementById("month").selectedIndex=0;
document.getElementById("month").disabled=true;
document.getElementById("year").selectedIndex=0;
document.getElementById("year").disabled=true;
document.getElementById("variantId").selectedIndex=0;
document.getElementById("variantId").disabled=true;
var B=document.getElementById("year").value;
var D=document.getElementById("month").value;
document.getElementById("variantId").selectedIndex="0";
document.getElementById("variantId").disabled="true";
if(A!="-1"){var E={method:"POST",url:"getModelForModelWithPrice.action?Year="+B+"&Month="+D+"&Makes="+A,load:function(G,H,F){dojo.byId(C).innerHTML=H
},mimetype:"text/plain"};
dojo.io.bind(E);
dojo.byId(C).innerHTML="Loading...."
}else{disableModelVar()
}}function disableModelVar(){document.getElementById("modelId").selectedIndex="0";
document.getElementById("variantId").selectedIndex="0";
document.getElementById("modelId").disabled="true";
document.getElementById("variantId").disabled="true"
}function getListingModelListByMake(B,A){document.forms[0].variantId.selectedIndex="0";
document.forms[0].variantId.disabled="true";
if(A!="-1"){var C={method:"POST",url:"getListingModelListByMake.action?makeId="+A,load:function(E,F,D){dojo.byId(B).innerHTML=F
},mimetype:"text/plain"};
dojo.io.bind(C);
dojo.byId(B).innerHTML="Loading...."
}else{disableListingModelVar()
}}function disableListingModelVar(){document.forms[0].modelId.selectedIndex="0";
document.forms[0].variantId.selectedIndex="0";
document.forms[0].modelId.disabled="true";
document.forms[0].variantId.disabled="true"
}function getAreaListForCity(A,C){if(C!="-1"){var B={method:"POST",url:"getAreasForCity.action?cityName="+C,load:function(E,F,D){dojo.byId(A).innerHTML=F
},mimetype:"text/plain"};
dojo.io.bind(B);
dojo.byId(A).innerHTML="Loading...."
}else{document.forms[0].areaId.selectedIndex="0";
document.forms[0].areaId.disabled="true"
}}function getVariantsByMake(B,E){document.getElementById("month").selectedIndex=0;
document.getElementById("month").disabled=true;
document.getElementById("year").selectedIndex=0;
document.getElementById("year").disabled=true;
var A=document.getElementById("year").value;
var C=document.getElementById("month").value;
if(E!=""){var D={method:"POST",url:"getVariantForModelWithPrice.action?Year="+A+"&Month="+C+"&Models="+E,load:function(G,H,F){dojo.byId(B).innerHTML=H
},mimetype:"text/plain"};
dojo.io.bind(D);
dojo.byId(B).innerHTML="Loading...."
}else{disableVar()
}}function disableVar(){document.getElementById("variantId").selectedIndex="0";
document.getElementById("variantId").disabled="true"
}function getListingVariantsByMake(A,C){if(C!=""){var B={method:"POST",url:"getListingVariantsForModel.action?modelId="+C,load:function(E,F,D){dojo.byId(A).innerHTML=F
},mimetype:"text/plain"};
dojo.io.bind(B);
dojo.byId(A).innerHTML="Loading...."
}else{disableListingVar()
}}function disableListingVar(){document.forms[0].variantId.selectedIndex="0";
document.forms[0].variantId.disabled="true"
}function getPriceRangeForVariant(E){var D=document.getElementById("year").value;
var A=document.getElementById("variantId").value;
var F=document.getElementById("month").value;
var B=document.getElementById("makeId").value;
var C=document.getElementById("modelId").value;
if(B=="-1"||B==""){dojo.byId(E).innerHTML="";
alert("I知 confused!\nPlease select a make");
return 
}else{if(C==""){dojo.byId(E).innerHTML="";
alert("I知 confused!\nPlease select a model");
return 
}else{if(A=="-1"){dojo.byId(E).innerHTML="";
alert("I知 confused!\nPlease select a variant");
return 
}else{if(D=="-1"){dojo.byId(E).innerHTML="";
alert("I知 confused!\nPlease select the year of manufacture");
return 
}else{if(F=="-1"){dojo.byId(E).innerHTML="";
alert("I知 confused!\nPlease select the month of manufacture");
return 
}}}}}var G={method:"POST",url:"getPriceRangeForVariant.action?year="+D+"&variantId="+A+"&month="+F,load:function(I,J,H){dojo.byId(E).innerHTML=J
},mimetype:"text/plain"};
dojo.io.bind(G);
dojo.byId(E).innerHTML="Loading...."
}function forgotPassword(A){var C=document.getElementById("loginUsername").value;
if(C==""){alert("Identity Crisis!\nPlease enter your username.");
document.getElementById("loginUsername").focus();
return 
}var B={method:"POST",url:"forgotPassword.action?username="+C,load:function(E,F,D){dojo.byId(A).innerHTML=F
},mimetype:"text/plain"};
dojo.io.bind(B);
dojo.byId(A).innerHTML="Loading...."
}function LTrim(B){var A=/\s*((\S+\s*)*)/;
return B.replace(A,"$1")
}function RTrim(B){var A=/((\s*\S+)*)\s*/;
return B.replace(A,"$1")
}function trim(A){return LTrim(RTrim(A))
}function emailCheck(F){var A="@";
var B=".";
var E=F.indexOf(A);
var C=F.length;
var D=F.indexOf(B);
if(F.indexOf(A)==-1){return false
}if(F.indexOf(A)==-1||F.indexOf(A)==0||F.indexOf(A)==C){return false
}if(F.indexOf(B)==-1||F.indexOf(B)==0||F.indexOf(B)==C){return false
}if(F.indexOf(A,(E+1))!=-1){return false
}if(F.substring(E-1,E)==B||F.substring(E+1,E+2)==B){return false
}if(F.indexOf(B,(E+2))==-1){return false
}if(F.indexOf(" ")!=-1){return false
}return true
}function getFileSize(A){var B={method:"POST",url:"getFileSize.action?path="+A,load:function(D,E,C){dojo.byId("fileStatusId").innerHTML=E;
if(document.getElementsByName("fileStatus")[0].value=="false"){alert("Selected file exceeds the limit for video Upload.You can upload a video of less then 2 MB.");
return false
}else{document.forms[0].submit();
return true
}},mimetype:"text/plain"};
dojo.io.bind(B)
}function getMakesForYear(B,C){document.getElementById("modelId").selectedIndex=0;
document.getElementById("modelId").disabled=true;
document.getElementById("variantId").selectedIndex=0;
document.getElementById("variantId").disabled=true;
var A=document.getElementById("year").value;
var D={method:"POST",url:"getMakeForYearWithPrice.action?Year="+A+"&Month="+C,load:function(F,G,E){dojo.byId(B).innerHTML=G
},mimetype:"text/plain"};
dojo.io.bind(D);
dojo.byId(B).innerHTML="Loading...."
}function getYearsForVariant(B,A){document.getElementById("month").selectedIndex=0;
document.getElementById("month").disabled=true;
var C={method:"POST",url:"getYearsForVariantWithPrice.action?Variant="+A,load:function(E,F,D){dojo.byId(B).innerHTML=F
},mimetype:"text/plain"};
dojo.io.bind(C);
dojo.byId(B).innerHTML="Loading...."
}function getMonthsForVariant(C,B){var A=document.getElementById("variantId").value;
var B=document.getElementById("year").value;
var D={method:"POST",url:"getMonthsForVariantWithPrice.action?Year="+B+"&Variant="+A,load:function(F,G,E){dojo.byId(C).innerHTML=G
},mimetype:"text/plain"};
dojo.io.bind(D);
dojo.byId(C).innerHTML="Loading...."
}function getModelListByMakeNew(B,A){if(A!="-1"){var C={method:"POST",url:"getModelListForMakeNew.action?makeIdNew="+A,load:function(E,F,D){dojo.byId(B).innerHTML=F
},mimetype:"text/plain"};
dojo.io.bind(C);
dojo.byId(B).innerHTML="Loading...."
}else{document.getElementById("modelIdNew").selectedIndex="0";
document.getElementById("modelIdNew").disabled="true";
}}function refreshCombos(){document.getElementById("month").selectedIndex=0;
document.getElementById("makeId").selectedIndex=0;
document.getElementById("makeId").disabled=true;
document.getElementById("modelId").selectedIndex=0;
document.getElementById("modelId").disabled=true;
document.getElementById("variantId").selectedIndex=0;
document.getElementById("variantId").disabled=true
};