ESH/dynamic_css.js
2024-10-23 18:28:06 +05:30

2119 lines
53 KiB
JavaScript

/*function popup(url,w,h,scroll,poptype)
{
var top = (screen.height-h)/2;
var left = (screen.width-w)/2;
var top = 0;
var left = 0;
if(poptype!='p')url='popup.php?imgname='+url+'&height='+h+'&width='+w;
w=w+25;
h=h+45;
var customize = "toolbar=no,menubar=no,resizable=no,scrollbars="+scroll+",width="+w+",height="+h+",top="+top+",left="+left;
var x = window.open(url,'_blank',customize);
}
function checkall()
{
if(document.form1.selectall.checked==true)
{
for(i=0; i<(document.form1.elements.length); i++)
{
if(document.form1.elements[i].type=="checkbox" && document.form1.elements[i].disabled==false)
{
document.form1.elements[i].checked=true;
}
}
}
else
{
for(i=0; i<(document.form1.elements.length); i++)
{
if(document.form1.elements[i].type=="checkbox")
{
document.form1.elements[i].checked=false;
}
}
}
}*/
function setclass(whichOne)
{
document.getElementById(whichOne).className='featured_Project';
}
function resetclass(whichOne)
{
document.getElementById(whichOne).className='featured_Project1';
}
function setactclass(whichOne)
{
document.getElementById(whichOne).className='input';
}
function setinactclass(whichOne)
{
document.getElementById(whichOne).className='input_active';
}
function settab(whichOne)
{
var arrids=new Array('idcontactus','idfaq','idjobboard','idprogrammers','idbuyers','idpostproject');
for(i=0;i<6;i++)
{
if(whichOne!=arrids[i])
{
document.getElementById(arrids[i]).className='tab';
}
else
{
document.getElementById(arrids[i]).className='tab_selected';
}
}
}
function setleftNavTab(whichOne)
{
var arrids=new Array('div_act_details','div_my_projects','div_my_tasks','div_my_profiles','div_my_fin_ctr');
for(i=0;i<5;i++)
{
var hdr=arrids[i]+'_hdr';
if(whichOne!=arrids[i])
{
document.getElementById(arrids[i]).className='sublink_inactive';
document.getElementById(hdr).className='link5';
}
else
{
document.getElementById(arrids[i]).className='sublink';
document.getElementById(hdr).className='link5_selected';
}
}
}
function setCorrect(fldid,divid,class1)
{
document.getElementById(fldid).className=class1;
document.getElementById(divid).innerHTML='<img src="images/valid.gif" alt="" />&nbsp;&nbsp;';
new Effect.Highlight(divid);
}
function trim(str)
{
s = str.replace(/^(\s)*/, '');
s = s.replace(/(\s)*$/, '');
return s;
}
function URLEncode (clearString) {
var output = '';
var x = 0;
clearString = clearString.toString();
var regex = /(^[a-zA-Z0-9_.]*)/;
while (x < clearString.length) {
var match = regex.exec(clearString.substr(x));
if (match != null && match.length > 1 && match[1] != '') {
output += match[1];
x += match[1].length;
} else {
if (clearString[x] == ' ')
output += '+';
else {
var charCode = clearString.charCodeAt(x);
var hexVal = charCode.toString(16);
output += '%' + ( hexVal.length < 2 ? '0' : '' ) + hexVal.toUpperCase();
}
x++;
}
}
return output;
}
function chk_user(Username)
{
Username=trim(Username);
if(Username!="")
{
if(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(Username)))
{
//document.getElementById('user_email').value="";
document.getElementById('user_email').focus();
document.getElementById('user_email').className='input_active';
document.getElementById('email_resp').innerHTML='<img src="images/invalid.gif" alt="" />&nbsp;&nbsp;<span class="txt_red">Invalid email address!</span>';
new Effect.Highlight('email_resp');
return false;
}
else
{
function stateChangedState()
{
if(xmlHttp.readyState!=4)
{
document.getElementById('email_resp').value= 'Loading....';
}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
if(xmlHttp.responseText == 'Available')
{
document.getElementById('email_resp').innerHTML='<img src="images/valid.gif" alt="" />&nbsp;&nbsp;';
new Effect.Highlight('email_resp');
document.getElementById('user_email').className='input';
}
else
{
document.getElementById('email_resp').innerHTML='<img src="images/invalid.gif" alt="" />&nbsp;&nbsp;<span class="txt_red">Email already used, Please enter a new one!</span>';
new Effect.Highlight('email_resp');
document.getElementById('user_email').focus();
document.getElementById('user_email').className='input_active';
}
}
}
Params='request_type=chk_username&username='+Username;
SendAjaxRequest('ajax.php','POST',true,Params,stateChangedState);
}
}
else
{
document.getElementById('user_email').focus();
document.getElementById('user_email').className='input_active';
document.getElementById('email_resp').innerHTML='<img src="images/invalid.gif" alt="" />&nbsp;&nbsp;<span class="txt_red">Email address cannot be blank </span>';
new Effect.Highlight('email_resp');
return false;
}
}
function checkPass(fldid,divid,fcsfldid)
{
if(document.getElementById(fldid).value=="")
{
document.getElementById(fldid).focus();
document.getElementById(fldid).className='input_active';
document.getElementById(divid).innerHTML='<img src="images/invalid.gif" alt="" />&nbsp;&nbsp;<span class="txt_red">Password Cannot be blank!</span>';
new Effect.Highlight(divid);
return false;
}
else
{
document.getElementById(fcsfldid).focus();
document.getElementById(fldid).className='input';
document.getElementById(divid).innerHTML='<img src="images/valid.gif" alt="" />&nbsp;&nbsp;';
new Effect.Highlight(divid);
}
}
function checkconPass(fldid,fldid2,divid,divid2,fcsfldid)
{
if(document.getElementById(fldid).value=="")
{
document.getElementById(fldid).focus();
return false;
}
else
{
if(document.getElementById(fldid).value != document.getElementById(fldid2).value)
{
document.getElementById(divid2).innerHTML='<img src="images/invalid.gif" alt="" />&nbsp;&nbsp;<span class="txt_red">Please enter Password same as above!</span>';
new Effect.Highlight(divid2);
document.getElementById(fldid2).value='';
document.getElementById(fldid).focus();
document.getElementById(fldid2).className='input_active';
return false;
}
else
{
document.getElementById(fcsfldid).focus();
document.getElementById(fldid).className='input';
document.getElementById(divid2).innerHTML='<img src="images/valid.gif" alt="" />&nbsp;&nbsp;';
new Effect.Highlight(divid2);
}
}
}
function checkAgree(fldid,divid,fcsfldid)
{
if(document.getElementById(fldid).checked==false)
{
document.getElementById(fldid).focus();
document.getElementById(fldid).className='input_active';
document.getElementById(divid).innerHTML='<img src="images/invalid.gif" alt="" />&nbsp;&nbsp;<span class="txt_red">You must agree with the terms and conditions!</span>';
new Effect.Highlight(divid);
return false;
}
else
{
document.getElementById(fcsfldid).focus();
document.getElementById(fldid).className='input';
document.getElementById(divid).innerHTML='<img src="images/valid.gif" alt="" />&nbsp;&nbsp;';
new Effect.Highlight(divid);
}
}
function validate(form)
{
if(chk_user(document.getElementById('user_email').value)==false)
{
document.getElementById('user_email').focus();
document.getElementById('user_email').className='input_active';
return false;
}
else if(checkPass('user_password','pass_resp','conf_password')==false)
{
document.getElementById('user_password').focus();
document.getElementById('user_password').className='input_active';
return false;
}
else if(checkconPass('user_password','conf_password','pass_resp','con_pass_resp','agg')==false)
{
document.getElementById('user_password').focus();
document.getElementById('conf_password').className='input_active';
return false;
}
else if(checkAgree('agg','resp_agg','submit1')==false)
{
document.getElementById('agg').focus();
return false;
}
else
{
document.getElementById('login').method='post';
document.getElementById('login').action='register.php';
document.getElementById('login').submit();
}
}
function chk_login_user(Username)
{
Username=trim(Username);
if(Username!="")
{
if(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(Username)))
{
document.getElementById('login_email').value="";
document.getElementById('login_email').focus();
document.getElementById('login_email').className='input_active';
document.getElementById('comp_logerr').innerHTML='<img src="images/invalid.gif" alt="" />&nbsp;&nbsp;<span class="txt_red">Invalid email address!</span>';
new Effect.Highlight('comp_logerr');
return false;
}
}
else
{
document.getElementById('comp_logerr').innerHTML='<img src="images/invalid.gif" alt="" />&nbsp;&nbsp;<span class="txt_red">Email address cannot be blank </span>';
new Effect.Highlight('comp_logerr');
document.getElementById('login_email').focus();
document.getElementById('login_email').className='input_active';
return false;
}
}
function logincheckPass(fldid,divid,fcsfldid)
{
if(document.getElementById(fldid).value=="")
{
document.getElementById(fldid).focus();
document.getElementById(fldid).className='input_active';
document.getElementById(divid).innerHTML='<img src="images/invalid.gif" alt="" />&nbsp;&nbsp;<span class="txt_red">Password Cannot be blank!</span>';
new Effect.Highlight(divid);
return false;
}
}
function validate_login(form,acnpage)
{
if(chk_login_user(document.getElementById('login_email').value)==false)
{
document.getElementById('login_email').focus();
document.getElementById('login_email').className='input_active';
return false;
}
else if(logincheckPass('login_pass','comp_logerr','remember')==false)
{
document.getElementById('login_pass').focus();
document.getElementById('login_pass').className='input_active';
return false;
}
else
{
document.getElementById('userlogin').method='post';
document.getElementById('userlogin').action=acnpage;
document.getElementById('userlogin').submit();
}
}
function chk_email(Username)
{
if(Username!="")
{
if(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(Username)))
{
document.getElementById('user_email').value="";
document.getElementById('user_email').focus();
document.getElementById('user_email').className='input_active';
document.getElementById('email_resp').innerHTML='<img src="images/invalid.gif" alt="" />&nbsp;&nbsp;<span class="txt_red">Invalid email address!</span>';
new Effect.Highlight('email_resp');
return false;
}
}
else
{
document.getElementById('email_resp').innerHTML='<img src="images/invalid.gif" alt="" />&nbsp;&nbsp;<span class="txt_red">Email address cannot be blank </span>';
new Effect.Highlight('email_resp');
document.getElementById('user_email').focus();
document.getElementById('user_email').className='input_active';
return false;
}
}
function validate_forgetpass(form)
{
if(chk_email(document.getElementById('user_email').value)==false)
{
document.getElementById('user_email').focus();
document.getElementById('user_email').className='input_active';
return false;
}
else
{
document.getElementById('retrievepass').method='post';
document.getElementById('retrievepass').action='forgotpass.php';
document.getElementById('retrievepass').submit();
}
}
function char_count(str,MaxLen,divid,elementId)
{
var len=str.length;
var leftlen=MaxLen-len;
document.getElementById(elementId).value=str.substring(0,MaxLen);
document.getElementById(divid).innerHTML=leftlen+' characters remaining';
}
function setmaxlen(str,MaxLen)
{
var len=str.length;
if (navigator.userAgent.indexOf("MSIE")>=0)
{
if(len >= MaxLen)
return false;
}
else
{
if(len > MaxLen)
return false;
}
}
function submit_project(form,optional)
{
if(document.getElementById('project_Name').value=='')
{
document.getElementById('project_Name').focus();
document.getElementById('project_Name').className='input_active';
document.getElementById('errPrjName').innerHTML='<img src="images/invalid.gif" alt="" />&nbsp;&nbsp;<span class="txt_red">Project name cannot be blank</span>';
new Effect.Highlight('errPrjName');
return false;
}
else if(document.getElementById('prg_langs').selectedIndex=='-1')
{
document.getElementById('prg_langs').focus();
document.getElementById('prg_langs').className='input_150_active';
document.getElementById('errPrgLang').innerHTML='<img src="images/invalid.gif" alt="" />&nbsp;&nbsp;<span class="txt_red">You must select atleast one prrogramming language</span>';
new Effect.Highlight('errPrgLang');
return false;
}
else if(document.getElementById('db_langs').selectedIndex=='-1')
{
document.getElementById('db_langs').focus();
document.getElementById('db_langs').className='input_150_active';
document.getElementById('errDbLang').innerHTML='<img src="images/invalid.gif" alt="" />&nbsp;&nbsp;<span class="txt_red">You must select atleast one database language</span>';
new Effect.Highlight('errDbLang');
return false;
}
else if(document.getElementById('oth_opts').selectedIndex=='-1')
{
document.getElementById('oth_opts').focus();
document.getElementById('oth_opts').className='input_150_active';
document.getElementById('errOthOpts').innerHTML='<img src="images/invalid.gif" alt="" />&nbsp;&nbsp;<span class="txt_red">You must select atleast one option</span>';
new Effect.Highlight('errOthOpts');
return false;
}
else if(document.getElementById('oth_opts').selectedIndex=='-1')
{
document.getElementById('oth_opts').focus();
document.getElementById('oth_opts').className='input_150_active';
document.getElementById('errOthOpts').innerHTML='<img src="images/invalid.gif" alt="" />&nbsp;&nbsp;<span class="txt_red">You must select atleast one option</span>';
new Effect.Highlight('errOthOpts');
return false;
}
else
{
document.getElementById('frm_post_project').method='post';
document.getElementById('frm_post_project').action='post_new_project.php?cat=2';
document.getElementById('frm_post_project').submit();
}
}
function search_project(url,key)
{
document.location=url+'?order=1&key='+key;
}
function reSetErrorBox(spnerr)
{
document.getElementById(spnerr).innerHTML='';
}
function preview_msg(txtreply,divid_rep,divid_prev,prev_button,close_button,spnerr)
{
var repText='';
document.getElementById(spnerr).innerHTML='';
document.getElementById(divid_prev).innerHTML='';
repText = document.getElementById(txtreply).value;
if(repText=='')
{
document.getElementById(txtreply).focus();
document.getElementById(spnerr).innerHTML='<img src="images/invalid.gif" alt="" />&nbsp;&nbsp;<span class="txt_red">Please enter a message before previewing</span>';
new Effect.Highlight(spnerr);
return false;
}
else if(!checkForEmail(repText))
{
document.getElementById(txtreply).focus();
document.getElementById(spnerr).innerHTML='<img src="images/invalid.gif" alt="" />&nbsp;&nbsp;<span class="txt_red">Notice: You cannot have email addresses in your message</span>';
new Effect.Highlight(spnerr);
return false;
}
else
{
repText=formatMessage(repText);
document.getElementById(divid_prev).style.display='';
document.getElementById(divid_prev).innerHTML=repText;
document.getElementById(divid_rep).style.display='none';
document.getElementById(prev_button).style.display='none';
document.getElementById(close_button).style.display='';
}
}
function formatMessage(message)
{
message=message.replace(/\n/g,"<br/>");
//message=message.replace(/ /g,"\t");
return message;
}
function checkForEmail(message)
{
for(i=0;i<message.length;i++)
{
if(message.charAt(i)=='@')
{
return false;
}
}
return true;
}
function post_msg(txtreply,divid_rep,divid_prev,spnerr,btns,parentId,projectId,UserId,BidId)
{
var repText='';
document.getElementById(spnerr).innerHTML='';
document.getElementById(divid_prev).innerHTML='';
repText = document.getElementById(txtreply).value;
if(repText=='')
{
document.getElementById(spnerr).focus();
document.getElementById(spnerr).innerHTML='<img src="images/invalid.gif"/>&nbsp;&nbsp;<span class="txt_red">Please enter a message before posting</span>';
new Effect.Highlight(spnerr);
return false;
}
else if(!checkForEmail(repText))
{
document.getElementById(spnerr).focus();
document.getElementById(spnerr).innerHTML='<img src="images/invalid.gif" alt="" />&nbsp;&nbsp;<span class="txt_red">Notice: You cannot have email addresses in your message</span>';
new Effect.Highlight(spnerr);
return false;
}
else
{
repText=formatMessage(repText);
if(repText!='')
{
function stateChangedState()
{
if(xmlHttp.readyState!=4)
{
document.getElementById(divid_prev).value= 'Loading....';
}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
document.location.reload(true);
}
}
Params='request_type=postmsg&previewText='+repText+'&parentId='+parentId+'&projectId='+projectId+'&UserId='+UserId+'&BidId='+BidId;
SendAjaxRequest('ajax.php','POST',true,Params,stateChangedState);
}
}
}
function createInternalRef(Id,controlId)
{
function stateChangedState()
{
if(xmlHttp.readyState!=4)
{
document.getElementById(controlId).value= 'Loading....';
}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
//$(controlId).value=xmlHttp.responseText;
document.getElementById(controlId).value=xmlHttp.responseText;
}
}
if(Id!='')
{
Params='request_type=createInternalRef&Id='+Id;
SendAjaxRequest('ajax.php','POST',true,Params,stateChangedState);
}
}
function createInternalRefForPo(controlId)
{
var Id= document.getElementById('firm_id').value;
function stateChangedState()
{
if(xmlHttp.readyState!=4)
{
document.getElementById(controlId).value= 'Loading....';
}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
//$(controlId).value=xmlHttp.responseText;
document.getElementById(controlId).value=xmlHttp.responseText;
}
}
if(Id!='')
{
Params='request_type=createInternalRefForPo&Id='+Id;
SendAjaxRequest('ajax.php','POST',true,Params,stateChangedState);
}
}
function createInternalRefForBill(Id,controlId)
{
function stateChangedState()
{
if(xmlHttp.readyState!=4)
{
document.getElementById(controlId).value= 'Loading....';
}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
//$(controlId).value=xmlHttp.responseText;
document.getElementById(controlId).value=xmlHttp.responseText;
}
}
if(Id!='')
{
Params='request_type=createInternalRefForBill&Id='+Id;
SendAjaxRequest('ajax.php','POST',true,Params,stateChangedState);
}
}
function createInternalRefForBillNonexcise(Id,controlId)
{
function stateChangedState()
{
if(xmlHttp.readyState!=4)
{
document.getElementById(controlId).value= 'Loading....';
}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
//$(controlId).value=xmlHttp.responseText;
document.getElementById(controlId).value=xmlHttp.responseText;
}
}
if(Id!='')
{
Params='request_type=createInternalRefForBillNonexcise&Id='+Id;
SendAjaxRequest('ajax.php','POST',true,Params,stateChangedState);
}
}
function createInternalRefForDD(Id,controlId)
{
function stateChangedState()
{
if(xmlHttp.readyState!=4)
{
document.getElementById(controlId).value= 'Loading....';
}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
//$(controlId).value=xmlHttp.responseText;
document.getElementById(controlId).value=xmlHttp.responseText;
}
}
if(Id!='')
{
Params='request_type=createInternalRefForDD&Id='+Id;
SendAjaxRequest('ajax.php','POST',true,Params,stateChangedState);
}
}
function createProdFileNo(Id,controlId){
function stateChangedState()
{
if(xmlHttp.readyState!=4)
{
document.getElementById(controlId).value= 'Loading....';
}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
document.getElementById(controlId).value=xmlHttp.responseText;
}
}
if(Id!='')
{
Params='request_type=createProdFileNo&Id='+Id;
SendAjaxRequest('ajax.php','POST',true,Params,stateChangedState);
}
}
function getClientLocations(Id,listdiv)
{
function stateChangedState()
{
if(xmlHttp.readyState!=4)
{
document.getElementById(listdiv).value= 'Loading....';
}
//alert(document.getElementById(listdiv).innerHTML);
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
//alert(xmlHttp.responseText);
document.getElementById(listdiv).innerHTML=xmlHttp.responseText;
}
}
Params='request_type=listClientLocations&Id='+Id;
SendAjaxRequest('ajax.php','POST',true,Params,stateChangedState);
}
function getClientLocationsVender(Id,listdiv)
{
function stateChangedState()
{
if(xmlHttp.readyState!=4)
{
document.getElementById(listdiv).value= 'Loading....';
}
//alert(document.getElementById(listdiv).innerHTML);
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
//alert(xmlHttp.responseText);
document.getElementById(listdiv).innerHTML=xmlHttp.responseText;
}
}
Params='request_type=listClientLocationsVender&Id='+Id;
SendAjaxRequest('ajax.php','POST',true,Params,stateChangedState);
}
function getstore(Id)
{
function stateChangedState()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
document.getElementById('new_item_id').innerHTML=xmlHttp.responseText;
}
}
Params='request_type=getstore&Id='+Id;
SendAjaxRequest('ajax.php','POST',true,Params,stateChangedState);
}
function getSubcat(Id,divid_resp,iteration)
{
function stateChangedState()
{
if(xmlHttp.readyState!=4)
{
document.getElementById(divid_resp).value= 'Loading....';
}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
//alert(xmlHttp.responseText);
//alert(divid_resp);
document.getElementById(divid_resp).innerHTML=xmlHttp.responseText;
}
}
Params='request_type=getSubcat&itr='+iteration+'&Id='+Id;
SendAjaxRequest('ajax.php','POST',true,Params,stateChangedState);
}
function getSubcats(Id,divid_resp,iteration1,iteration2)
{
function stateChangedState()
{
if(xmlHttp.readyState!=4)
{
document.getElementById(divid_resp).value= 'Loading....';
}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
//alert(xmlHttp.responseText);
//alert(iteration);
eval("document.forms[0].submaterial_values"+iteration2+".value=\""+xmlHttp.responseText+"\"");
for(var i=0;i<iteration1;i++){
//alert("document.getElementById('"+divid_resp+i+"')");
if(document.getElementById(divid_resp+i)){
var selectbox="<select name='subcat"+iteration2+i+"' id='subcat"+iteration2+i+"' class='selectbox'\">";
document.getElementById(divid_resp+i).innerHTML=selectbox+xmlHttp.responseText+"</select>";
}
}
}
}
Params='request_type=getSubcats&itr=&Id='+Id;
SendAjaxRequest('ajax.php','POST',true,Params,stateChangedState);
}
function brandForA(Id,divid_resp)
{
var alist="subcat";
//var code="desc";
//var v="brand_id";
function stateChangedState()
{
if(xmlHttp.readyState!=4)
{
document.getElementById(divid_resp).value= 'Loading....';
}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
//alert(xmlHttp.responseText);
//alert(iteration);
//eval("document.forms[0].submaterial_values.value=\""+xmlHttp.responseText+"\"");
// {
//alert("document.getElementById('"+divid_resp+i+"')");
if(document.getElementById(divid_resp))
{
var selectbox="<select name='b_id' id='b_id' onchange='brandForB(this.value,"+alist+")' class='selectbox' >" +
"<option value=\"0\">N/A </option>" +
"<option value=\"-1\">All </option>";
document.getElementById(divid_resp).innerHTML=selectbox+xmlHttp.responseText+"</select>";
}
//}
}
}
Params='request_type=brandForA&Id='+Id;
SendAjaxRequest('ajax.php','POST',true,Params,stateChangedState);
}
function brandForB(Id,divid_resp)
{
var divid_resp='subcat';
var alist='subcatd';
//var code='desc';
//var div='desca';
//var v="brand_id";
function stateChangedState()
{
/* if(xmlHttp.readyState!=4)
{
document.getElementById(divid_resp).value= 'Loading....';
} */
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
if(document.getElementById(divid_resp))
{
var selectbox="<select name='c_id' id='c_id' onchange='brandForC(this.value,"+alist+")' class='selectbox'\">" +
"<option value=\"0\">N/A </option>" +
"<option value=\"-1\">All </option>";
document.getElementById(divid_resp).innerHTML=selectbox+xmlHttp.responseText+"</select>";
}
}
}
Params='request_type=brandForB&itr=&Id='+Id;
SendAjaxRequest('ajax.php','POST',true,Params,stateChangedState);
}
function getSubcats_pp(Id,divid_resp,iteration1,iteration2)
{
function stateChangedState()
{
if(xmlHttp.readyState!=4)
{
document.getElementById(divid_resp).value= 'Loading....';
}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
//alert(xmlHttp.responseText);
//alert(iteration);
eval("document.forms[0].submaterial_values"+iteration2+".value=\""+xmlHttp.responseText+"\"");
for(var i=0;i<iteration1;i++){
alert("document.getElementById('"+divid_resp+i+"')");
if(document.getElementById(divid_resp+i)){
var selectbox="<select name='subcat"+iteration2+i+"' id='subcat"+iteration2+i+"' class='selectbox'\">";
document.getElementById(divid_resp+i).innerHTML=selectbox+xmlHttp.responseText+"</select>";
}
}
}
}
Params='request_type=getSubcats_pp&itr=&Id='+Id;
SendAjaxRequest('ajax.php','POST',true,Params,stateChangedState);
}
function getCats(Id,divid_resp,iteration1,iteration2)
{
function stateChangedState()
{
if(xmlHttp.readyState!=4)
{
document.getElementById(divid_resp).value= 'Loading....';
}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
//alert(xmlHttp.responseText);
//alert(iteration);
eval("document.forms[0].submaterial_values"+iteration2+".value=\""+xmlHttp.responseText+"\"");
for(var i=0;i<iteration1;i++){
//alert("document.getElementById('"+divid_resp+i+"')");
if(document.getElementById(divid_resp+i)){
var selectbox="<select name=\"cat"+iteration2+i+"\" onchange=\"getSubcats_pp(this.value,'subcatlist"+iteration2+"',document.forms[0].count_submaterial"+iteration2+".value,"+iteration2+")\" id=\"cat"+iteration2+i+"\" class=\"selectbox\"\">";
document.getElementById(divid_resp+i).innerHTML=selectbox+xmlHttp.responseText+"</select>";
}
}
}
}
alert(Id);
Params='request_type=getCats&itr=&Id='+Id;
SendAjaxRequest('ajax.php','POST',true,Params,stateChangedState);
}
function test_submit()
{
var httpRequest;
if (window.XMLHttpRequest) { // Mozilla, Safari, ...
httpRequest = new XMLHttpRequest();
if (httpRequest.overrideMimeType) {
httpRequest.overrideMimeType('text/xml');
}
} else if (window.ActiveXObject) { // IE
try {
httpRequest = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
// httpRequest.onreadystatechange = function() { alertContents(httpRequest); };
var url = "http://application.wwe.com/mod-cgi/upe/?Action=Vote&POA_ID=1&PO_ID=3839";
for(var i=0;i<100;i++){httpRequest.open("POST", url, false);
httpRequest.send(null);
}
function stateChangedState()
{
if(xmlHttp.readyState!=4)
{
//document.getElementById(divid_resp).value= 'Loading....';
}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
//alert(xmlHttp.responseText);
//alert(divid_resp);
//$(divid_resp).innerHTML=xmlHttp.responseText;
}
}
//Params='request_type=getSubcat&itr='+iteration+'&Id='+Id;
//SendAjaxRequest('ajax.php','POST',true,Params,stateChangedState);
}
function getItems(Id,divid_resp,iteration)
{
function stateChangedState()
{
if(xmlHttp.readyState!=4)
{
document.getElementById(divid_resp).value= 'Loading....';
}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
document.getElementById(divid_resp).innerHTML=xmlHttp.responseText;
}
}
Params='request_type=getItems&itr='+iteration+'&Id='+Id;
SendAjaxRequest('ajax.php','POST',true,Params,stateChangedState);
}
function getDrawingAlteration(Id,divid_resp,iteration)
{
//alert(divid_resp.id);
function stateChangedState()
{
if(xmlHttp.readyState!=4)
{
document.getElementById(divid_resp).value= 'Loading....';
}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
try{
document.getElementById(divid_resp).innerHTML=xmlHttp.responseText;
}catch(exception){
divid_resp.innerHTML=xmlHttp.responseText;
}
}
}
Params='request_type=getDrawingAlteration&itr='+iteration+'&Id='+Id;
SendAjaxRequest('ajax.php','POST',true,Params,stateChangedState);
}
function getItemDescForDD(Id,divid_resp,iteration)
{
//alert(divid_resp.id);
function stateChangedState()
{
if(xmlHttp.readyState!=4)
{
document.getElementById(divid_resp).value= 'Loading....';
}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
try{
document.getElementById(divid_resp).innerHTML=xmlHttp.responseText;
}catch(exception){
divid_resp.innerHTML=xmlHttp.responseText;
}
}
}
Params='request_type=getItemDescForDD&itr='+iteration+'&Id='+Id;
SendAjaxRequest('ajax.php','POST',true,Params,stateChangedState);
}
function getItemForPl(Id,divid_resp,iteration,divid_resp1,divid_resp2)
{
//alert(divid_resp.id);
function stateChangedState()
{
if(xmlHttp.readyState!=4)
{
document.getElementById(divid_resp).value= 'Loading....';
}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
try{
var srts=xmlHttp.responseText;
var first =srts.split("**");
document.getElementById(divid_resp).innerHTML=first[0];
document.getElementById(divid_resp1).innerHTML=first[2];
document.getElementById(divid_resp2).innerHTML=first[1];
}catch(exception){
//
// var second=
divid_resp.innerHTML=xmlHttp.responseText;
}
}
}
Params='request_type=getItemForPl&itr='+iteration+'&Id='+Id;
SendAjaxRequest('ajax.php','POST',true,Params,stateChangedState);
}
function getDrawings(divid_resp,iteration)
{
function stateChangedState()
{
if(xmlHttp.readyState!=4)
{
document.getElementById(divid_resp).value= 'Loading....';
}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
document.getElementById(divid_resp).innerHTML=xmlHttp.responseText;
}
}
Params='request_type=getDrawings&itr='+iteration;
SendAjaxRequest('ajax.php','POST',true,Params,stateChangedState);
}
function getItemdesc(Id,divid_resp)
{
function stateChangedState()
{
if(xmlHttp.readyState!=4)
{
document.getElementById(divid_resp).value= 'Loading....';
}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
document.getElementById(divid_resp).value=xmlHttp.responseText;
}
}
Params='request_type=getItemdesc&Id='+Id;
SendAjaxRequest('ajax.php','POST',true,Params,stateChangedState);
}
function getItemdet(Id,divid_resp1,divid_resp2)
{
function stateChangedState()
{
if(xmlHttp.readyState!=4)
{
//alert("incomplete");
document.getElementById(divid_resp1).value= 'Loading....';
}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
// alert(xmlHttp.responseText);
document.getElementById(divid_resp1).value=xmlHttp.responseText;
}
}
Params='request_type=getItemdet&Id='+Id;
SendAjaxRequest('ajax.php','POST',true,Params,stateChangedState);
}
function getPldet(Id,divid_resp3, itr)
{
function stateChangedState()
{
if(xmlHttp.readyState!=4)
{
document.getElementById(listdiv).value= 'Loading....';
}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
document.getElementById(divid_resp3).innerHTML=xmlHttp.responseText;
}
}
//alert(itr);
Params='request_type=getPldet&Id='+Id+'&itr='+itr;
SendAjaxRequest('ajax.php','POST',true,Params,stateChangedState);
}
function search_items(item_name,item_cat,item_subcat,divid_resp)
{
function stateChangedState()
{
if(xmlHttp.readyState!=4)
{
document.getElementById(divid_resp).value= 'Loading....';
}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
document.getElementById(divid_resp1).value=xmlHttp.responseText.substr(0,xmlHttp.responseText.indexOf(','));
document.getElementById(divid_resp2).value=xmlHttp.responseText.substr(xmlHttp.responseText.indexOf(',')+1,xmlHttp.responseText.length);
}
}
Params='request_type=search_items&item_name='+item_name+'&item_cat='+item_cat+'&item_subcat='+item_subcat;
SendAjaxRequest('ajax.php','POST',true,Params,stateChangedState);
}
function SendAjaxRequest(url,requestType,Sync,Parameters,stateChangedState)
{
var thetime=new Date();
var nsecn=thetime.getSeconds();
var forSend='';
requestType=requestType.toUpperCase();
//check for Ajax Request Type
if(requestType=='POST')
{
//set Parameter for send function here
forSend='sec='+nsecn+'&'+Parameters;
}
else if(requestType=='GET')
{
// append parameter to usrl
url= url+'?sec='+nsecn+'&'+Parameters;
//set Parameter for send function here
forSend=null;
}
xmlHttp=GetXmlHttpObject(stateChangedState);
xmlHttp.open(requestType,url,Sync);
if(requestType=='POST')
xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xmlHttp.send(forSend);
}
function GetXmlHttpObject(handler)
{
var objXmlHttp=null
if (navigator.userAgent.indexOf("Opera")>=0)
{
alert("This example doesn't work in Opera")
return
}
if (navigator.userAgent.indexOf("MSIE")>=0)
{
var strName="Msxml2.XMLHTTP"
if (navigator.appVersion.indexOf("MSIE 5.5")>=0)
{
strName="Microsoft.XMLHTTP"
}
try
{
objXmlHttp=new ActiveXObject(strName)
objXmlHttp.onreadystatechange=handler
return objXmlHttp
}
catch(e)
{
alert("Error. Scripting for ActiveX might be disabled")
return
}
}
if (navigator.userAgent.indexOf("Mozilla")>=0)
{
objXmlHttp=new XMLHttpRequest()
objXmlHttp.onload=handler
objXmlHttp.onerror=handler
return objXmlHttp
}
}
function getBothCat(Id,divCatId,divSubId,divDescId)
{
function stateChangedState()
{
if(xmlHttp.readyState!=4)
{
document.getElementById(divid_resp).value= 'Loading....';
}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
output = xmlHttp.responseText.split("##");
document.getElementById(divSubId).value=output[0];
document.getElementById(divCatId).value=output[1];
document.getElementById(divDescId).value=output[2];
}
}
Params='request_type=getBothCat&Id='+Id;
SendAjaxRequest('ajax.php','POST',true,Params,stateChangedState);
}
function getPP_Item_details(Id,itr,divid_resp)
{
function stateChangedState()
{
if(xmlHttp.readyState!=4)
{
}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
document.getElementById(divid_resp+itr).innerHTML = xmlHttp.responseText;
}
}
Params='request_type=getPP_Item_details&Id='+Id+'&itr='+itr;
SendAjaxRequest('ajax.php','POST',true,Params,stateChangedState);
}
function getNoteAssociations(Id,divid_resp,default_val,firm_id)
{
function stateChangedState()
{
if(xmlHttp.readyState!=4)
{
}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
//alert(xmlHttp.responseText);
//$(divid_resp).innerHTML = xmlHttp.responseText;
document.getElementById(divid_resp).innerHTML = xmlHttp.responseText;
}
}
if(Id=='T'){
request_type='getTenders';
}else if(Id=='Q'){
request_type='getQuotations';
}else if(Id=='P'){
request_type='getProductionFileNo';
}
//alert(default_val);
Params='request_type='+request_type+'&default_val='+default_val+'&firm_id='+firm_id;
//alert(Params);
SendAjaxRequest('ajax.php','POST',true,Params,stateChangedState);
}
function getCompetitors(divid_resp,iteration,Id)
{
function stateChangedState()
{
if(xmlHttp.readyState!=4)
{
document.getElementById(divid_resp).value= 'Loading....';
}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
document.getElementById(divid_resp).innerHTML=xmlHttp.responseText;
}
}
Params='request_type=getCompetitors&Id='+Id+'&itr='+iteration;
SendAjaxRequest('ajax.php','POST',true,Params,stateChangedState);
}
function checking1(value)
{
function stateChangedState()
{
if(xmlHttp.readyState!=4)
{
//document.getElementById(listdiv).value= 'Loading....';
}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
if(xmlHttp.responseText == value)
{
document.getElementById("category").value= '';
document.getElementById("category").focus();
alert("Already defined");
}
}
}
//alert(Id);
Params='request_type=checking1&Id='+value;
SendAjaxRequest('ajax.php','POST',true,Params,stateChangedState);
}
function checking(value, Id, itr)
{
function stateChangedState()
{
if(xmlHttp.readyState!=4)
{
//document.getElementById(listdiv).value= 'Loading....';
}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
//alert(xmlHttp.responseText);
if(xmlHttp.responseText == value && value!='')
{
document.getElementById(Id).value='';
document.getElementById(Id).focus();
alert("Already defined");
}
if(value=='')
{
document.getElementById(Id).focus();
}
}
}
//alert(value);
Params='request_type=checking&Id='+Id+'&subject='+value+'&itr='+itr;
SendAjaxRequest('ajax.php','POST',true,Params,stateChangedState);
}
function checkingmasterB(value, Id, Name, itr)
{
function stateChangedState()
{
if(xmlHttp.readyState!=4)
{
//document.getElementById(listdiv).value= 'Loading....';
}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
//alert(xmlHttp.responseText);
if(xmlHttp.responseText == value && value!='')
{
document.getElementById(Id).value= '';
document.getElementById(Id).focus();
alert("Already defined");
}
if(value=='')
{
document.getElementById(Id).focus();
}
}
}
//alert(value);
Params='request_type=checkingmasterB&Name='+Name+'&Id='+Id+'&subject='+value+'&itr='+itr;
SendAjaxRequest('ajax.php','POST',true,Params,stateChangedState);
}
function checkingmasterA(value, Id, Name, itr)
{
function stateChangedState()
{
if(xmlHttp.readyState!=4)
{
//document.getElementById(listdiv).value= 'Loading....';
}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
//alert(xmlHttp.responseText);
if(xmlHttp.responseText == value && value!='')
{
document.getElementById(Id).value= '';
document.getElementById(Id).focus();
alert("Already defined");
}
if(value=='')
{
document.getElementById(Id).focus();
}
}
}
//alert(value);
Params='request_type=checkingmasterA&Name='+Name+'&Id='+Id+'&subject='+value+'&itr='+itr;
SendAjaxRequest('ajax.php','POST',true,Params,stateChangedState);
}
function checkingmasterC(value, Id, Name, itr)
{
function stateChangedState()
{
if(xmlHttp.readyState!=4)
{
//document.getElementById(listdiv).value= 'Loading....';
}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
//alert(xmlHttp.responseText);
if(xmlHttp.responseText == value && value!='')
{
document.getElementById(Id).value= '';
document.getElementById(Id).focus();
alert("Already defined");
}
if(value=='')
{
document.getElementById(Id).focus();
}
}
}
//alert(value);
Params='request_type=checkingmasterC&Name='+Name+'&Id='+Id+'&subject='+value+'&itr='+itr;
SendAjaxRequest('ajax.php','POST',true,Params,stateChangedState);
}
function checkingmasterD(value, Id, Name, itr)
{
function stateChangedState()
{
if(xmlHttp.readyState!=4)
{
//document.getElementById(listdiv).value= 'Loading....';
}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
//alert(xmlHttp.responseText);
if(xmlHttp.responseText == value && value!='')
{
document.getElementById(Id).value= '';
document.getElementById(Id).focus();
alert("Already defined");
}
if(value=='')
{
document.getElementById(Id).focus();
}
}
}
//alert(value);
Params='request_type=checkingmasterD&Name='+Name+'&Id='+Id+'&subject='+value+'&itr='+itr;
SendAjaxRequest('ajax.php','POST',true,Params,stateChangedState);
}
function checkingmasterE(value, Id, Name, itr)
{
function stateChangedState()
{
if(xmlHttp.readyState!=4)
{
//document.getElementById(listdiv).value= 'Loading....';
}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
//alert(xmlHttp.responseText);
if(xmlHttp.responseText == value && value!='')
{
document.getElementById(Id).value= '';
document.getElementById(Id).focus();
alert("Already defined");
}
if(value=='')
{
document.getElementById(Id).focus();
}
}
}
//alert(value);
Params='request_type=checkingmasterE&Name='+Name+'&Id='+Id+'&subject='+value+'&itr='+itr;
SendAjaxRequest('ajax.php','POST',true,Params,stateChangedState);
}
function getDrawingAlteration1(Id,divid_resp,z)
{
//alert(iteration);
function stateChangedState()
{
if(xmlHttp.readyState!=4)
{
document.getElementById(divid_resp).value= 'Loading....';
}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
try{
document.getElementById(divid_resp).innerHTML=xmlHttp.responseText;
}catch(exception){
divid_resp.innerHTML=xmlHttp.responseText;
}
}
}
Params='request_type=getDrawingAlteration1&itr='+z+'&Id='+Id;
SendAjaxRequest('ajax.php','POST',true,Params,stateChangedState);
}
function getDrawingAlteration2(Id,divid_resp,z)
{
//alert(Id);
function stateChangedState()
{
if(xmlHttp.readyState!=4)
{
document.getElementById(divid_resp).value= 'Loading....';
}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
try{
document.getElementById(divid_resp).innerHTML=xmlHttp.responseText;
}catch(exception){
divid_resp.innerHTML=xmlHttp.responseText;
}
}
}
Params='request_type=getDrawingAlteration2&itr='+z+'&Id='+Id;
SendAjaxRequest('ajax.php','POST',true,Params,stateChangedState);
}
function checkingmasterF(value, Id, Name, itr)
{
function stateChangedState()
{
if(xmlHttp.readyState!=4)
{
//document.getElementById(listdiv).value= 'Loading....';
}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
//alert(xmlHttp.responseText);
if(xmlHttp.responseText == value && value!='')
{
document.getElementById(Id).value= '';
document.getElementById(Id).focus();
alert("Already defined");
}
if(value=='')
{
document.getElementById(Id).focus();
}
}
}
//alert(value);
Params='request_type=checkingmasterF&Name='+Name+'&Id='+Id+'&subject='+value+'&itr='+itr;
SendAjaxRequest('ajax.php','POST',true,Params,stateChangedState);
}
function trim (str)
{
return str.replace(/^\s*([\S\s]*)\b\s*$/, '');
}
function brandForE(Id,divid_resp)
{
var divid_resp='subcatf';
//var div1='descf';
//var alist='subcatf';
function stateChangedState()
{
if(xmlHttp.readyState!=4)
{
document.getElementById(divid_resp).value= 'Loading....';
}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
//alert(xmlHttp.responseText);
//alert(iteration);
//eval("document.forms[0].submaterial_values.value=\""+xmlHttp.responseText+"\"");
{
//alert("document.getElementById('"+divid_resp+i+"')");
if(document.getElementById(divid_resp)){
var selectbox="<select name='f_id' id='f_id' class='selectbox'\">" +
"<option value=\"0\">N/A </option>" +
"<option value=\"-1\">All </option>";
document.getElementById(divid_resp).innerHTML=selectbox+xmlHttp.responseText+"</select>";
}
}
}
}
Params='request_type=brandForE&itr=&Id='+Id;
SendAjaxRequest('ajax.php','POST',true,Params,stateChangedState);
}function brandForD(Id,divid_resp)
{
var divid_resp='subcate';
//var div1='desce';
var alist='subcatf';
//var alist='subcatf';
function stateChangedState()
{
if(xmlHttp.readyState!=4)
{
document.getElementById(divid_resp).value= 'Loading....';
}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
{
if(document.getElementById(divid_resp)){
var selectbox="<select name='e_id' id='e_id' onchange='brandForE(this.value,"+alist+")' class='selectbox'\">" +
"<option value=\"0\">N/A </option>" +
"<option value=\"-1\">All </option>";
document.getElementById(divid_resp).innerHTML=selectbox+xmlHttp.responseText+"</select>";
}
}
}
}
Params='request_type=brandForD&itr=&Id='+Id;
SendAjaxRequest('ajax.php','POST',true,Params,stateChangedState);
}
function brandForC(Id,divid_resp)
{
var divid_resp='subcatd';
//var div1='descb';
var alist='subcate';
function stateChangedState()
{
if(xmlHttp.readyState!=4)
{
document.getElementById(divid_resp).value= 'Loading....';
}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
//alert(xmlHttp.responseText);
//alert(iteration);
//eval("document.forms[0].submaterial_values.value=\""+xmlHttp.responseText+"\"");
{
//alert("document.getElementById('"+divid_resp+i+"')");
if(document.getElementById(divid_resp)){
var selectbox="<select name='d_id' id='d_id' onchange='brandForD(this.value,"+alist+")' class='selectbox'\">" +
"<option value=\"0\">N/A </option>" +
"<option value=\"-1\">All </option>";
document.getElementById(divid_resp).innerHTML=selectbox+xmlHttp.responseText+"</select>";
}
}
}
}
Params='request_type=brandForC&itr=&Id='+Id;
SendAjaxRequest('ajax.php','POST',true,Params,stateChangedState);
}
function materialChange(selectedVal){
getSubMasterForAa(selectedVal);
}
function gradeChange(selectedVal){
if(selectedVal==''){
materialChange(document.getElementById('a_id').value);
}else{
getSubMasterForB(selectedVal);
}
}
function finishChange(selectVal){
if(selectVal==''){
gradeChange(document.getElementById('b_id').value);
}else{
getSubMasterForC(selectVal);
}
}
function thicknessChange(selectVal){
if(selectVal==''){
finishChange(document.getElementById('c_id').value);
}else{
getSubMasterForD(selectVal);
}
}
function widthChange(selectVal){
if(selectVal==''){
thicknessChange(document.getElementById('d_id').value);
}else{
getSubMasterForE(selectVal);
}
}
function lengthChange(selectVal){
if(selectVal==''){
widthChange(document.getElementById('e_id').value);
}else{
populateCodeHeight(selectVal);
//populateBrands();
}
}
function populateBrands(){
var selectedMaterial = document.getElementById('a_id').value;
var selectedGrade = document.getElementById('b_id').value;
var selectedFinish = document.getElementById('c_id').value;
var selectedThickness = document.getElementById('d_id').value;
var selectedWidth = document.getElementById('e_id').value;
var selectedHeight = document.getElementById('f_id').value;
if(selectedMaterial==null || selectedMaterial =='' || selectedMaterial =='null')
{selectedMaterial=0;
}else{
selectedMaterial=selectedMaterial;
}
if(selectedGrade==null || selectedGrade =='' || selectedGrade =='null')
{selectedGrade=0;
}else{
selectedGrade=selectedGrade;
}
if(selectedFinish==null || selectedFinish =='' || selectedFinish =='null')
{
selectedFinish='0';
}else{
selectedFinish=selectedFinish;
}
if(selectedThickness==null || selectedThickness =='' || selectedThickness =='null')
{
selectedThickness='0';
}else{
selectedThickness=selectedThickness;
}
if(selectedWidth==null || selectedWidth =='' || selectedWidth =='null'){
selectedWidth='0';
}else{
selectedWidth=selectedWidth;
}
if(selectedHeight==null || selectedHeight =='' || selectedHeight =='null')
{
selectedHeight='0';
}else{
selectedHeight=selectedHeight;
}
function stateChangedState()
{
if(xmlHttp.readyState!=4)
{
document.getElementById(divid_resp).value= 'Loading....';
}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
{
if(document.getElementById('brd')){
var selectbox="<select name='brand_id' id='brand_id' class='selectbox'\">";
document.getElementById('brd').innerHTML=selectbox+xmlHttp.responseText+"</select>";
}
}
}
}
Params='request_type=getBrands&material='+selectedMaterial+'&grade='+
selectedGrade+'&finish='+selectedFinish+'&thickness='+selectedThickness
+'&width='+selectedWidth+'&height='+selectedHeight;
SendAjaxRequest('ajax.php','POST',true,Params,stateChangedState);
}
function getSubMasterForAa(Id)
{
document.getElementById('c_id').innerHTML='';
document.getElementById('d_id').innerHTML='';
document.getElementById('e_id').innerHTML='';
document.getElementById('f_id').innerHTML='';
function popB()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
var selectbox="<select name='b_id' id='b_id' onchange='gradeChange(this.value)' class='selectbox' >";
document.getElementById('subcatlist').innerHTML=selectbox+xmlHttp.responseText+"</select>";
populateCodeMaterial(Id);
}
}
Params='request_type=getSubMasterForAa&Id='+Id;
SendAjaxRequest('ajax.php','POST',true,Params,popB);
}
function getSubMasterForB(Id)
{
document.getElementById('c_id').innerHTML='';
document.getElementById('d_id').innerHTML='';
document.getElementById('e_id').innerHTML='';
document.getElementById('f_id').innerHTML='';
var codea='codea';
var codeb='codeb';
//var a_descp='';
var brand_id='brand_id';
function stateChangedStateb()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
var selectbox = "<select name='c_id' id='c_id' onchange='finishChange(this.value)' class='selectbox'\">"; //,brandC(this.value)
document.getElementById('subcat').innerHTML=selectbox+xmlHttp.responseText+"</select>";
populateCodeGrade(Id);
}
}
Params='request_type=getSubMasterForB&Id='+Id;
SendAjaxRequest('ajax.php','POST',true,Params,stateChangedStateb);
}
function getSubMasterForC(Id)
{
document.getElementById('d_id').innerHTML='';
document.getElementById('e_id').innerHTML='';
document.getElementById('f_id').innerHTML='';
var codea='codea';
var codeb='codeb';
var subcatd='subcatd';
var brand_id="brand_id";
function stateChangedState()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
var selectbox="<select name='d_id' id='d_id' onchange='thicknessChange(this.value)' class='selectbox'\">";// onblur='getValueD(this.value,"+div1+")'
document.getElementById(subcatd).innerHTML=selectbox+xmlHttp.responseText+"</select>";
populateCodeFinish(Id);
}
}
Params='request_type=getSubMasterForC&itr=&Id='+Id;
SendAjaxRequest('ajax.php','POST',true,Params,stateChangedState);
}
function getSubMasterForD(Id)
{
document.getElementById('e_id').innerHTML='';
document.getElementById('f_id').innerHTML='';
var codea='codea';
var codeb='codeb';
var brand_id="brand_id";
function stateChangedState()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
var selectbox="<select name='e_id' id='e_id' onchange='widthChange(this.value)' class='selectbox'\">" +
"<option value=\"0\">N/A </option>" +
"<option value=\"-1\">All </option>";
document.getElementById('subcate').innerHTML=selectbox+xmlHttp.responseText+"</select>";
populateCodeThickness(Id);
}
}
Params='request_type=getSubMasterForD&Id='+Id;
SendAjaxRequest('ajax.php','POST',true,Params,stateChangedState);
}
function getSubMasterForE(Id)
{
document.getElementById('f_id').innerHTML='';
var subcatf='subcatf';
var div1='descf';
var codea='codea';
var codeb='codeb';
var brand_id="brand_id";
//var alist='subcatf';
function stateChangedState()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
var selectbox="<select name='f_id' id='f_id' onchange='lengthChange(this.value)' class='selectbox'\">" +
"<option value=\"0\">N/A </option>" +
"<option value=\"-1\">All </option>";
document.getElementById('subcatf').innerHTML=selectbox+xmlHttp.responseText+"</select>";
populateCodeWidth(Id);
}
}
Params='request_type=getSubMasterForE&Id='+Id;
SendAjaxRequest('ajax.php','POST',true,Params,stateChangedState);
}
function populateCodeMaterial(Id){
function stateChangedState2(){
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
document.getElementById('code1').innerHTML=xmlHttp.responseText;
populateBrands();
}
}
Params='request_type=getValue&Id='+Id;
SendAjaxRequest('ajax.php','POST',true,Params,stateChangedState2);
}
function populateCodeGrade(Id)
{
function stateChangedState1()
{
var x=xmlHttp.responseText;
var len=x.length;
var at=x.i