var login="Member ID";

var spass="Password";

var sre="Confirm-Password";

var nam="Name";

var mail="E-Mail";

var add="Address";

var cit="City";

var stat="State";

var coun="Country";

var ref="Reference";

var mod="Mode Of Payment";

var frid="Friend User ID";

var ddn="Demand Draft Number";

var dodd="Demand Draft Date";

var bnam="Bank Name";

var bcit="Bank City";

var bcode="Bank Code";

var delid="Dealer ID";

var delpass="Dealer Password"

var sque="Question";

var sans="Answer";

var im=new Image()

//var reset1=true

/*function checkdt(dt)

{

var p=/[0-3][0-9]\/[0-1][0-2]\/[1900-9999]/;

var x=p.test(dt)

if (ValidatorEvaluateIsValid(fieldValue,expr,msg,alertStatus)

	{



	}

/*var arr=dt.split("/")

if(parseInt(dt(0))==0||x==false)

{

alert("Date is not valid")

return false*/

function expandmessagebox(lyr) {

  	var x = new getObj(lyr);

 	x.style.display = (x.style.display=='none') ? 'block': 'none';

}



function expandbox (elemid) {

	 getdom(elemid).style.display = (getdom(elemid).style.display=='none') ? 'block': 'none';

}

function getdom(objid) {

	return (document.getElementById(objid));

}



function getObj(name) { 

 	if (document.getElementById) { 

		this.obj = document.getElementById(name);

		this.style = document.getElementById(name).style;

	} else if (document.all) {

		this.obj = document.all[name];

		this.style = document.all[name].style;

	}

}



function check_url(address) 

{

if ((address == "") || (address.indexOf ('http://') == -1) || (address.indexOf ('.') == -1))

      return false;

  return true;

}



function checkdt(fld,str)

{



	dt=fld.value;

var p=/[0-3][0-9]\/[0-1][0-2]\/[1900-9999]/;

var x=p.test(dt)

var arr=dt.split("/")

if(parseInt(arr[0])==0||x==false)

{

alert(str+" is not valid")

fld.focus();

return false;



}

}

function updateDay(change,formName,yearName,monthName,dayName)

{	

	var form = document.forms[formName];

	var yearSelect = form[yearName];

	var monthSelect = form[monthName];

	var daySelect = form[dayName];

	var year = yearSelect[yearSelect.selectedIndex].value;

	var month = monthSelect[monthSelect.selectedIndex].value;

	var day = daySelect[daySelect.selectedIndex].value;



	if (change == 'month' || (change == 'year' && month == 2))

	{

		var i = 31;

		var flag = true;

		while(flag)

		{

			var date = new Date(year,month-1,i);

			if (date.getMonth() == month - 1)

			{

				flag = false;

			}

			else

			{

				i = i - 1;

			}

		}



		daySelect.length = 0;

		daySelect.length = i;

		var j = 0;

		while(j < i)

		{

			daySelect[j] = new Option(j+1,j+1);

			j = j + 1;

		}

		if(day==0)

		{

			daySelect.selectedIndex = 0;

		}

		else if (day <= i)

		{

			daySelect.selectedIndex = day - 1;

		}

		else

		{

			daySelect.selectedIndex = daySelect.length - 1;

		}

	}

}

function CheckCountry(val)

{

if (val==-1)

{

alert("Country must be selected")

return false

}

return true

}



function isEmpty(s) {

        return ((s == null) || (s.length == 0));

}

function isWhitespace (s) {

        var i;

      if (isEmpty(s)) return true;

      for (i = 0; i < s.length; i++){

                var c = s.charAt(i);

            if (c == " ") return true;

        }

        return false;

}

function isSame(fir,sec){

        var j,k;

      var lnt;

      if(fir.length > sec.length){

                lnt=fir.length;

                        }

        else{

                lnt=sec.length;

        }

                for (j = 0; j < lnt; j++)

                {

                      if(fir.charAt(j) !=sec.charAt(j))

                          return true;}

                                return false;}

function warnEmpty (theField, s)

        {   theField.focus()

                alert( s+" can not be empty and White spaces are not allowed in   "+ s + " field. ")

                return false}

     <!--### PASSWORD  VALIDATION ###-->

function checkPassuserSame(fir,sec){

if(isSame(fir.value,sec.value))

{	

return true;

}

else{

alert("Password should not  be same as User ID");

                        return false;}

}

function checkSamePass(Pas,theFields, si)

        {          

			var ll=theFields.value.length;

    //           if (isWhitespace(theFields.value))

      //             return warnEmpty (theFields, si);

            if(isSame(Pas.value,theFields.value)) {

            	alert(si+"  should not be empty.");

            	theFields.focus();

            	return false;

            }else return true;

        }

function checkPassLen (theField, s){ 

       var l=theField.value.length;

	  var fieldValue1 = theField.value;

          if(isEmpty(theField.value)) { 

          	alert(s + "  should not be empty."); 

         	theField.focus();

         	return false;

          }

           if(isWhitespace(theField.value)){

                  return warnEmpty (theField, s);

}               if(l < 5) { 

                	alert("The length of "+s+" should minimum of 5 characters.");

                      theField.focus();

                      return false;

                    }

                 if(l > 15) {

  	              alert("The length of "+s +" should not more than 15 characters");

  	               theField.focus();

  	              return false;}

                        return true;     }



function checkCorrect3(theField, s,s1){ 

   	  //var fieldValue1 = theField.value;

          if (isEmpty(theField.value) || (theField.value==s1)) { 

          	alert(s + " should not be empty."); 

          	theField.focus();

          	return false;

          }

        return true;     

    }



function checkEmpty(theField, s){ 

   

	  //var fieldValue1 = theField.value;

          if (isEmpty(theField.value)) { 

          	alert("Enter "+s); 

          	theField.focus();

          	return false;

          }

        return true;     

    }

<!--### E MAil Validaation ###-->

function checkpass(theField,s)

{	

	if(isEmpty(theField.value))

	{

	alert(s+"  should not be empty.");

	theField.focus();

	return false;

	}

}

function checkEmail(theField,s,s1)

{



var l=theField.value.length;

var fieldvalue=theField.value;



          if (isEmpty(theField.value) || (theField.value==s1)) { 

          	alert(s  + "  should not be empty."); 

          	theField.focus();

          	return false;

          }

    	for(i=0;i<l;i++)

	{

		

		if(fieldvalue.charAt(i)=='@')

		{

		

			for(j=i;j<l;j++)

			{

				if(fieldvalue.charAt(j)=='.')

				{

				

					break;

				}

				

				if((j+1)==l)

				{

				

				alert(s + "  not valid");

				theField.focus();

				return false;

				break;

				}

				

			}

		

		break;

		}

	

		if((i+1)==l)

		{

			

			alert(s + "  not valid");

			theField.focus();

			return false;

			break;

			

		}		

	

	}

		



return true;						

		

}



	

function checkDealerID(theField,s)

{

if(document.all.payment.value=="By Cash")

	{

	var l=theField.value.length;

        var fieldValue1 = theField.value;

        if (isEmpty(theField.value)) 

		{ 

	       	alert(s + " can not be empty."); 

          	theField.focus();

        	return false;

        	}

	return true;

	   }

	else

	return true;

}

//----------for Numeric validation-----------

function checkNumeric(theField,s,emptycheck)

{	var l=theField.value.length;

	validString = "0123456789.";

	var fieldvalue = theField.value;

	if(emptycheck!=false)

	{

        if(isEmpty(theField.value))

	{

	alert(s+" Enter.");

	theField.focus();

	return false;

	}

	}

	 if(theField.value!="")

	{	var j;

		for (j = 0; j < l ; j++)

	        {



			if(validString.indexOf(fieldvalue.charAt(j)) == -1)

			{

				alert ("Enter 0-9//dot(.) in"+s +" Field");

				theField.focus();

				return false;

			}

         }



	}

return true;



}



function checkNumericWithOutDot(theField,s,checkempty,s1)

{	var l=theField.value.length;

	validString = "0123456789";

	var fieldvalue = theField.value;

	if(theField.value==s1)

	{

	alert(s + " should not be empty."); 

	theField.focus();

	return false;

	}	

    else if((isEmpty(theField.value)&&checkempty!=false) )

	{

	alert(s+" Enter.");

	theField.focus();

	return false;

	}

	else

	{	var j;

		for (j = 0; j < l ; j++)

	        {



			if(validString.indexOf(fieldvalue.charAt(j)) == -1)

			{

				alert ("Enter 0-9 in"+s +" Field");

				theField.focus();

				return false;

			}

         }



	}

return true;



}

function checkAlphaNumeric(theField,s,checkempty)

{	var l=theField.value.length;

	validString = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_.- ,";

	var fieldvalue = theField.value;

        if(isEmpty(theField.value)&&checkempty!=false)

	{

	alert(s+" May not be empty.");

	theField.focus();

	return false;

	}

	else

	{	var j;

		for (j = 0; j < l ; j++)

	        {



			if(validString.indexOf(fieldvalue.charAt(j)) == -1)

			{

				alert ("Enter 0-9/A-Z/a-z/ in "+ s +" Field");

				theField.focus();

				return false;

			}

         }



	}

return true;
}

function checkAlphachar(theField,s,s1,checkempty)

{	var l=theField.value.length;

	validString = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ";

	var fieldvalue = theField.value;

        if((isEmpty(theField.value)&&checkempty!=false) || (fieldvalue==s1))

	{

	alert(s+" May not be empty.");

	theField.focus();

	return false;

	}

	else

	{	var j;

		for (j = 0; j < l ; j++)

	        {



			if(validString.indexOf(fieldvalue.charAt(j)) == -1)

			{

				alert ("Enter Only Character in "+ s +" Field");

				theField.focus();

				return false;

			}

         }



	}

return true;



}


//--------------for draft date--------

function checkDraftDate(form,s)

{

alert("date")

date=new Date()

			day=date.getDate()

			yy=date.getYear()

		    mm=date.getMonth()

	        if(frmMain.elements["yob"].value==yy)

			{

			 if(frmMain.elements["mob"].selectedIndex<mm)

			  {alert("Month cann't be lesser then current month")

			  return false

  			  }

			 if(frmMain.elements["mob"].selectedIndex==mm)

			 {

		      if(day>frmMain.elements["dob"].value)

			  {

			  alert("Day cann't be lesser then current day")

			  return false

			  }

			 }

			}

		  

}





<!--### USER ID VALIDATION ###-->

function checkUserID(theField,s)

{	var l=theField.value.length;

	validString = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_.";

	var fieldvalue = theField.value;

        if(isEmpty(theField.value))

	{

	alert(s+" can not be empty.");

	theField.focus();

	return false;

	}

	else

	{	var j;

		for (j = 0; j < l ; j++)

	        {



			if(validString.indexOf(fieldvalue.charAt(j)) == -1)

			{

				alert ("Please enter 0-9/A-Z/a-z/underscore(_)/dot(.) in User ID Field");

				theField.focus();

				return false;

			}

         }



	}

return true;



}



function ValidatorEvaluateIsValid(fieldValue,expr,msg,alertStatus) {

	

    var value = fieldValue

   if (ValidatorTrim(value).length == 0)

        return true;        

    var rx = new RegExp(expr)

    var matches = rx.exec(value);

    if((matches != null && value == matches[0])==false)

    {

    if(alertStatus==true)

    {

    alert(msg)

    }

    return false

    }

    return true

}

function ValidatorTrim(s) {

    var m = s.match(/^\s*(\S+(\s+\S+)*)\s*$/);

   return (m == null) ? "" : m[1];

   // return("d")

}



function checkImage(field,emptyflag,str,format)

{

value=field.value

var divHtml,imgsrc,ss

var divHtml1,imgHt,imgWt,imgSize,name

//imgHt=height //frm.hdnHeight.value

//imgWt=width //frm.hdnWidth.value

//imgsrc=value//frm.imgFile.value

//imgSize=size//frm.hdnSize.value

var str,arrStr,fileName,filen,filearr



	filearr=value.split('.');

	filearr.reverse()

filen=filearr[0];



if(emptyflag==true)

{

	if(value=="")

	{

 alert(str+" should not be empty.")

 field.focus()

 return false

	}

}



if(filen.toUpperCase()!="JPEG"&&filen.toUpperCase()!="JPG"&&filen.toUpperCase()!="GIF"&&filen.toUpperCase()!="")

{

alert(str+" should be jpeg/jpg/gif .");

return false;

}



return true

}







function checkFile(field,emptyflag,str,format)

{

value=field.value

var divHtml,imgsrc,ss

var divHtml1,imgHt,imgWt,imgSize,name

//imgHt=height //frm.hdnHeight.value

//imgWt=width //frm.hdnWidth.value

//imgsrc=value//frm.imgFile.value

//imgSize=size//frm.hdnSize.value

var str,arrStr,fileName,filen,filearr



	filearr=value.split('.');

	filearr.reverse()

filen=filearr[0];



if(emptyflag==true)

{

	if(value=="")

	{

 alert(str+" cannot be left blank.")

 field.focus()

 return false

	}

}

if(filen.toUpperCase()!="XLS")

{

alert(str+" should be .XLS");

return false;

}



return true

}





function GetFileExtension(val,type,msg)

{

var arr=val.split(".")

if((arr[arr.length-1]).toUpperCase()!=type.toUpperCase())

{

 alert(msg)

 return false

}

}



function checkAttchmentFile(field,emptyflag,str,format)

{

value=field.value

var divHtml,imgsrc,ss

var divHtml1,imgHt,imgWt,imgSize,name

//imgHt=height //frm.hdnHeight.value

//imgWt=width //frm.hdnWidth.value

//imgsrc=value//frm.imgFile.value

//imgSize=size//frm.hdnSize.value

var str,arrStr,fileName,filen,filearr



	filearr=value.split('.');

	filearr.reverse()

filen=filearr[0];







	if(value=="")

	{

		if(emptyflag==true)

		{

 alert("Attachment cannot be left blank.")

 field.focus()

 return false

	}

}

}



function checkFile1(x)

{

document.getElementById("div1").style.visibility="hidden"

if (frm.file.value=="")

{

	return 0;

	}

document.getElementById("div1").style.visibility="visible"

document.getElementById("1").src=frm.file.value

}



function checkFile2(x)

{

document.getElementById("div2").style.visibility="hidden"

if (frm.file2.value=="")

{

	return 0;

}

document.getElementById("div2").style.visibility="visible"

document.getElementById("2").src=frm.file2.value

}

function checkFile3(x)

{

document.getElementById("div3").style.visibility="hidden"

if (frm.file3.value=="")

{

	return 0;

	}

document.getElementById("div3").style.visibility="visible"

document.getElementById("3").src=frm.file3.value

}





function checksynphone(dt)

{



var p=/\d{3,5}[" "]\d{6,8}$/;

var q=/\(\d{3,5}\)[" "]\d{6,8}$/;

var x=p.test(dt)

var y=q.test(dt)

//var arr=dt.split("/")



if(x==true ||y==true )

{}

else

{

alert("Phone No. is not valid")

return false;



}

}



function checksynpostcode(dt)

{

var p=/\D{2}\d{1,2}[" "]\d{1}\D{2}/;

var q=/\D{1}\d{2,3}[" "]\d{1}\D{2}/;



var x=p.test(dt)

	var y=q.test(dt)



//var arr=dt.split("/")

if(x==true ||y==true )

{}

else

{

alert("Post code is not valid")

return false;



}

}

function checkFile1(x)

{

	

document.getElementById("div1").style.visibility="hidden"

if (frm.file.value=="")

{

	return 0;

	}

document.getElementById("div1").style.visibility="visible"

document.getElementById("1").src=frm.file.value

}



function checkFile2(x)

{

document.getElementById("div2").style.visibility="hidden"

if (frm.file2.value=="")

{

	return 0;

}

document.getElementById("div2").style.visibility="visible"

document.getElementById("2").src=frm.file2.value

}

function checkFile3(x)

{

document.getElementById("div3").style.visibility="hidden"

if (frm.file3.value=="")

{

	return 0;

	}

document.getElementById("div3").style.visibility="visible"

document.getElementById("3").src=frm.file3.value

}

function DateDiff(date1,date2)

{

	var s,s1

s=date1

s1=date2



var d=Date.parse(s)



var myd=new Date(d)

var d1=Date.parse(s1)



var myd1=new Date(d1)



if((myd1-myd)<0)

	{

	 alert("End date should be greater than start date")

        return false

	}

	 return true

}



	 function checkAllImage()

	 {

      for (var i=1;i<=3;i++)

	{



    j=i

 	if (document.getElementById(j).src!="" && document.getElementById(j).width>200)

	{

	if(j==1&&frm.file.value!="")

	{

	alert("Image"+j+" width can not be more than 200px ")

	frm.file.focus()

	document.getElementById("div1").style.visibility="hidden"

	

	return false

	}

	if(j==2&&frm.file2.value!="")

	{



	alert("Image"+j+" width can not be more than 200px ")

	frm.file2.focus()

	document.getElementById("div2").style.visibility="hidden"

	return false

	}

	if(j==3&&frm.file3.value!="")

	{	

		alert("Image"+j+" width can not be more than 200px ")

	frm.file3.focus()

	document.getElementById("div3").style.visibility="hidden"

	return false

	}



	}

 }



 return true

	 }



 function checkdiscount(field)

 {

var val=field.value;

if (val<=0 || val>100)

	 {

	alert("Discount can be between 1 to 100 percent")

		return false

}

 }



 function checkimages(theField,str,height,width,size,emptyFlag)

{

	

if (theField.value=="")

{

if (emptyFlag==true)

{

alert(str+" Can not be empty")

return false

}

}

else

{

  

   // alert(im)

 im.src=theField.value

//alert(im.fileSize+ " "+ im.height+ "sdsds"+im.width)

	   

  if (parseInt(im.fileSize)/1024>parseInt(size))

{

alert(str+" size Can not be greater than "+size +"KB")

return false

}



  if (parseInt(im.height)>parseInt(height))

{

alert(str+" height Can not be greater than "+height +"px")

return false

}

  if (parseInt(im.width)>parseInt(width))

{

alert(str+" width Can not be greater than "+width +"px")

return false

}

 

  

}

return true

}



function isValidDate(dateStr) {

// Checks for the following valid date formats:

// MM/DD/YY   MM/DD/YYYY   MM-DD-YY   MM-DD-YYYY

// Also separates date into month, day, and year variables



var datePat = /^(\d{1,2})(\/|-)(\d{1,2})\2(\d{2}|\d{4})$/;



// To require a 4 digit year entry, use this line instead:

// var datePat = /^(\d{1,2})(\/|-)(\d{1,2})\2(\d{4})$/;



var matchArray = dateStr.match(datePat); // is the format ok?

if (matchArray == null) {

alert("Date is not in a valid format.")

return false;

}

month = matchArray[1]; // parse date into variables

day = matchArray[3];

year = matchArray[4];

if (month < 1 || month > 12) { // check month range

alert("Month must be between 1 and 12.");

return false;

}

if (day < 1 || day > 31) {

alert("Day must be between 1 and 31.");

return false;

}

if ((month==4 || month==6 || month==9 || month==11) && day==31) {

alert("Month "+month+" doesn't have 31 days!")

return false

}

if (month == 2) { // check for february 29th

var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));

if (day>29 || (day==29 && !isleap)) {

alert("February " + year + " doesn't have " + day + " days!");

return false;

   }

}

return true;  // date is valid

}

function MM_swapImgRestore() { //v3.0

  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;

}



function MM_preloadImages() { //v3.0

  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();

    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)

    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}

}



function MM_findObj(n, d) { //v4.01

  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];

  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);

  if(!x && d.getElementById) x=d.getElementById(n); return x;

}



function MM_swapImage() { //v3.0

  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)

   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}

}







//for printing



var div2print;



function printDiv (id) {

  if (document.all && window.print) {

    div2print = document.all[id];

    window.onbeforeprint = hideDivs;

    window.onafterprint = showDivs;

    window.print();

  }

}



function hideDivs () {

  var divs = document.all.tags('DIV');

  for (var d = 0; d < divs.length; d++)

    if (divs[d] != div2print)

      divs[d].style.display = 'none';

}



function showDivs () {

  var divs = document.all.tags('DIV');

  for (var d = 0; d < divs.length; d++)

    divs[d].style.display = 'block';

}



function printproperty()

{

  var sOption="toolbar=yes,location=no,directories=yes,menubar=yes,"; 

       sOption+="scrollbars=yes,width=750,height=600,left=100,top=25"; 



   var sWinHTML = document.getElementById('divprint').innerHTML; 

   

   var winprint=window.open("","",sOption); 

       winprint.document.open(); 

	 

       winprint.document.write('<html><LINK href=../css/common.css rel=Stylesheet><div onload="self.print();">'); 

       winprint.document.write(sWinHTML);          

       winprint.document.write('</body></html>'); 

	//alert("sd")

	  

	 // setTimeout(winprint.print,1000)

	   

    

     //winprint.close()

}





function enable(str)

{

if (str==1)

{

 document.forms[0].abc.disabled=false

 document.forms[0].sele.disabled=false

 document.forms[0].card.disabled=false

 document.forms[0].cardholder.disabled=false

 document.forms[0].sign.disabled=false

 document.forms[0].amount.disabled=false 

} 

else

{

 document.forms[0].abc.disabled=true

 document.forms[0].sele.disabled=true

 document.forms[0].card.disabled=true

 document.forms[0].cardholder.disabled=true

 document.forms[0].sign.disabled=true

 document.forms[0].amount.disabled=true

 } 



}

function callback()

{

 var x;

 var url;

 var str;

 url="./script/subscribe.php?fl=1&email="+frmnews.email.value

 x=new ActiveXObject("microsoft.xmlhttp")

	 x.open("GET",url,false)

	 x.send(null)

	 str=x.responseText;

 alert(str);

}

function submitform1()

{

if (chkvalidation1()==true)

{



frmnews.action="index.php?fl=2"

frmnews.submit();

//callback()

return true

}

else

return false

}

function chkvalidation1()

{

return(checkEmail(frmnews.email,"Email Address "))



}



function validation()

{



if(checkCorrect3(frm.txtoldpass," Old Password ",true)==false)

return false

if(checkCorrect3(frm.txtpass," New Passowrd ",true)==false)

return false

if(checkPassLen (frm.txtpass," New Password ",true)==false)

return false

if(checkCorrect3(frm.txtrepass," Confirm Password ",true)==false)

return false

if(checkSamePass(frm.txtpass,frm.txtrepass, "")==false)

return false



return true

}

//-------------------------------------------- create request ---------------------------------

function createRequest() {

    try {

        xmlRequest = new XMLHttpRequest();

    } catch (microsoft) {

        try {

            xmlRequest = new ActiveXObject('Msxml2.XMLHTTP');

        } catch(autremicrosoft) {

            try {

                xmlRequest = new ActiveXObject('Microsoft.XMLHTTP');

            } catch(echec) {

                xmlRequest = null;

            }

        }

    }

    if(xmlRequest == null) {

        alert('Votre navigateur ne semble pas supporter les object XMLHttpRequest.');

    }

}

//-------------------------------------------- get data ---------------------------------

function getData(object,cntrl,url,type)

	{

	var thisVal=object.value;

	var control=document.getElementById(cntrl);

	var pageUrl=url;

	pageUrl=pageUrl + "?cat="+thisVal+"&type="+type;

	createRequest();



if(xmlRequest){

	

	xmlRequest.open("GET", pageUrl, true);

	xmlRequest.onreadystatechange = function() {

        if(xmlRequest.readyState == 4) {

			//alert(xmlRequest.responseText)

				Fillcbo(xmlRequest.responseText,control)

        }

    };

	 xmlRequest.send(null);



}

}

function Fillcbo(str,cont)

{

if(str==0)

	{

	var elem=cont.length-1

	for(var j=elem;j>=0;j--)

	cont.remove(j);

	var option = document.createElement("OPTION");

	option.value=0;

	option.innerHTML="--------";

	cont.appendChild(option);

	}

	else

	{

	var str1=str.split("#");

	var elem=cont.length-1

	for(var j=elem;j>=0;j--)

	cont.remove(j);

	for (var i=0;i<=str1.length-2;i++)

		{

		var splitcontent=str1[i].split("^");

		var values = splitcontent[0];

		var option = document.createElement("OPTION");

		option.value = values;

		option.innerHTML = splitcontent[1];

		cont.appendChild(option);

		norecord=false;

		}

	}

}

//------------------------------------- check url -----------------------------------------------

function check_url(address) 

{

if ((address.indexOf ('http://')!= -1))

	{

      return true;

	}

  return false;

}

//--------------------------------------------combo--------------------------------------------------------



function fillprdcombo(object,cntrl,url,field)

{

var thisVal=object.value; 

var control=document.getElementById(cntrl);

var pageUrl=url;

pageUrl=pageUrl + "?id="+thisVal+"&field="+field;

createRequest();



if(xmlRequest){



xmlRequest.open("GET", pageUrl, true);

xmlRequest.onreadystatechange = function() {

        if(xmlRequest.readyState == 4) { 

Fillcbo(xmlRequest.responseText,control)

        }

    };

xmlRequest.send(null);



}

}



function check_user()

	{

		

		var uname=document.forms['frmuser'].user_login.value;

		 if (uname=="")

		  {

		  document.getElementById("txtHint").innerHTML="";

		  return;

		  }

	 	  if (window.XMLHttpRequest)

		  {// code for IE7+, Firefox, Chrome, Opera, Safari

		  xmlhttp=new XMLHttpRequest();

		  }

		  else

		  {// code for IE6, IE5

		  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

		  }

		  xmlhttp.onreadystatechange=function()

		  {

		  if (xmlhttp.readyState==4 && xmlhttp.status==200)

			{

				var arr=xmlhttp.responseText.split(",");

							

				//document.forms['frmuser'].txtHint.innerHTML=xmlhttp.responseText;

				if(arr[0]==1)

				{

				document.getElementById("txtHint").style.color="red";

				document.getElementById("txtHint").innerHTML=arr[1]+" is not available.";

				}

				else

				{

				document.getElementById("txtHint").style.color="green";

				document.getElementById("txtHint").innerHTML=arr[1]+" is available.";	

				}

			}

		  }

		xmlhttp.open("GET","getuser.php?q="+uname,true);

		xmlhttp.send();

	}


