// JavaScript Document


function Rtrim(Rval)
{
	if(Rval.length == 1 || Rval.length == 0)
	{
		if(Rval==" ")
		{
			Rval="";
			return Rval;
		}
		else
		{
			return Rval;
		}
	}
	else
	{
		while(Rval.length != 0)
		{
			if(Rval.substring(Rval.length-1,Rval.length)==" ")
			{
				Rval = Rval.substring(0,Rval.length-1);
				//alert(Rval.length);
			}
			else
			{
				return Rval;
				break;
			}
		}
	}
}



function Ltrim(Lval)
{
	if(Lval.length == 1 || Lval.length == 0)
	{
		if(Lval==" ")
		{
			Lval="";
			return Lval;
		}
		else
		{
			return Lval;
		}
	}
	else
	{
		while(Lval.length != 0)
		{
			if(Lval.substring(0,1)==" ")
			{
				Lval = Lval.substring(1,Lval.length);
				//alert(Lval.length);
			}
			else
			{
				//alert(val);
				return Lval;
				break;
			}
		}
	}
}

function Mid(str, start, len)
{
    if (start < 0 || len < 0) 
	return "";
    var iEnd, iLen = String(str).length;
    if (start + len > iLen)
          iEnd = iLen;
    else
          iEnd = start + len;
    return String(str).substring(start,iEnd);
}



function jsInstr(Str,Wrd)
{
	for(i=0;i<=Str.length;i++)
	{
		if(Str.substring(i, i+1) == Wrd)
		{
			return i+1;
		}
	}
	return 0;
}

function validat()
{
	if(Validation_SpnMsg())
		return true;
	else
		return false;
}

function Validation_SpnMsg()
{
	ObjNos = document.getElementsByTagName("LABEL").length 
	Obj = document.getElementsByTagName("LABEL")
	Flag = 0;
	var mchar
	var cnt
	var cnt1
	var cnt2
	cnt=0
	cnt1=0
	cnt2=0

	for(ObjCnt=0;ObjCnt<ObjNos;ObjCnt++)
	{
		ObjCtrol = document.getElementById(Obj[ObjCnt].htmlFor)
		ObjCtrol.value=Rtrim(Ltrim(ObjCtrol.value));
	//	alert(ObjCtrol.value)
		if(Obj[ObjCnt].id!=0)
		{//alert("in valid 2")
		//alert(Obj[ObjCnt].id)
			if(ObjCtrol.value=="" && Obj[ObjCnt].id!=6 && Obj[ObjCnt].id!=7 && Obj[ObjCnt].id!=9 && Obj[ObjCnt].id!=21 && Obj[ObjCnt].id!=13 && Obj[ObjCnt].id!=14)
			{//alert("in valid 3")
				ObjErrDis = eval("S"+Obj[ObjCnt].htmlFor);
				ObjErrDis.innerHTML = "<font color='red'>Should not be blank</font>";
				Flag = 1;
			}
			else
			{
				if(Obj[ObjCnt].id==2)
				{
					CntDot = jsInstr(ObjCtrol.value,".");
					CntAt = jsInstr(ObjCtrol.value,"@");
					if(CntDot==0||CntAt==0)
					{
						ObjErrDis = eval("S"+Obj[ObjCnt].htmlFor);
						ObjErrDis.innerHTML = "<font color='red'>Not a valid E-mail Id</font>";					
						Flag =1;
					}
					else
					{
						ObjErrDis = eval("S"+Obj[ObjCnt].htmlFor);
						ObjErrDis.innerHTML = "";									
					}	
				}

				else if(Obj[ObjCnt].id==222)
				{			
						len=ObjCtrol.value.length
						for (i=0;i<len;i++)	
						{
							mchar =(Mid(ObjCtrol.value,i,1))
												
							if(mchar=='@')
							 cnt = cnt + 1;
							if(mchar=='.')
							 cnt1 = cnt1 + 1;
							if(mchar==',')
							 cnt2 = cnt2 + 1;							 							 							 
						}
			
			if(cnt2!=0)
			{
				ObjErrDis = eval("S"+Obj[ObjCnt].htmlFor);
				ObjErrDis.innerHTML = "<font color='red'>Enter Only 1 Email Id</font>";					
				Flag =1;			
			}
			else
			{
						if ((parseInt(cnt)==1) && (parseInt(cnt1)==1))
						{
						ObjErrDis = eval("S"+Obj[ObjCnt].htmlFor);
						ObjErrDis.innerHTML = "";							
						}
						else if ((parseInt(cnt)==0) || (parseInt(cnt1)==0))
						{
							ObjErrDis = eval("S"+Obj[ObjCnt].htmlFor);
							ObjErrDis.innerHTML = "<font color='red'>Not a valid E-mail Id</font>";					
							Flag =1;							
						}
						else if ((parseInt(cnt)>1))
						{
							ObjErrDis = eval("S"+Obj[ObjCnt].htmlFor);
							ObjErrDis.innerHTML = "<font color='red'>Enter Only 1 Email Id</font>";						
							Flag =1;
						}					
						else
						{
							ObjErrDis = eval("S"+Obj[ObjCnt].htmlFor);
							ObjErrDis.innerHTML = "";									
						}
				}	
			}
				
								
				else if(Obj[ObjCnt].id==3)
				{
					var obVal = ObjCtrol.value;
					//if (obVal.length == 0){alert("Please enter a value.");} 
  					//else if (chkNumeric(obVal) == false) 
	    			if(isNaN(obVal)==true)
		 			{
						 ObjErrDis = eval("S"+Obj[ObjCnt].htmlFor);
						 ObjErrDis.innerHTML = "<font color='red'>Non numeric value</font>";
       					 Flag=1;
	      			}
					else
					{
						ObjErrDis = eval("S"+Obj[ObjCnt].htmlFor);
						ObjErrDis.innerHTML = "";
					}				
				}
				
				else if(Obj[ObjCnt].id==5)
				{	
					var obVal = ObjCtrol.value;
					b=obVal.lastIndexOf(".");
					b1=b+5;
					ext=obVal.substring(b,b1);
					if((ext==".jpg")|| (ext==".JPG")||(ext==".jpeg")||(ext==".JPEG")||(ext==".gif")||(ext==".GIF"))
					{
						ObjErrDis = eval("S"+Obj[ObjCnt].htmlFor);
						ObjErrDis.innerHTML = "";
					}
					else
		 			{
						 ObjErrDis = eval("S"+Obj[ObjCnt].htmlFor);
						 ObjErrDis.innerHTML = "<font color='red'>Only jpg or gif are allowed</font>";
       					 Flag=1;
	      			}
				}

				else if(Obj[ObjCnt].id==6)
				{	
					if(ObjCtrol.value!="")
					{		
						var obVal = ObjCtrol.value;
						b=obVal.lastIndexOf(".");
						b1=b+5;
						ext=obVal.substring(b,b1);
						if((ext==".jpg")|| (ext==".JPG")||(ext==".jpeg")||(ext==".JPEG")||(ext==".gif")||(ext==".GIF"))
						{
							ObjErrDis = eval("S"+Obj[ObjCnt].htmlFor);
							ObjErrDis.innerHTML = "";
						}
						else
		 				{
							 ObjErrDis = eval("S"+Obj[ObjCnt].htmlFor);
							 ObjErrDis.innerHTML = "<font color='red'>Only jpg or gif or swf works are allowed</font>";
       						 Flag=1;
	    	  			}
					}
				}
				

				else if(Obj[ObjCnt].id==61)
				{	
					if(ObjCtrol.value!="")
					{		
						var obVal = ObjCtrol.value;
						b=obVal.lastIndexOf(".");
						b1=b+5;
						ext=obVal.substring(b,b1);
						if((ext==".jpg")|| (ext==".JPG")||(ext==".jpeg")||(ext==".JPEG")||(ext==".gif")||(ext==".GIF") ||(ext==".swf")||(ext==".SWF"))
						{
							ObjErrDis = eval("S"+Obj[ObjCnt].htmlFor);
							ObjErrDis.innerHTML = "";
						}
						else
		 				{
							 ObjErrDis = eval("S"+Obj[ObjCnt].htmlFor);
							 ObjErrDis.innerHTML = "<font color='red'>Only jpg or gif or swf or swf banners are allowed</font>";
       						 Flag=1;
	    	  			}
					}
				}
								

				else if(Obj[ObjCnt].id==7)
				{	
					if(ObjCtrol.value!="")
					{		
						var obVal = ObjCtrol.value;
						b=obVal.lastIndexOf(".");
						b1=b+5;
						ext=obVal.substring(b,b1);
						if((ext==".jpg")|| (ext==".JPG")||(ext==".jpeg")||(ext==".JPEG")||(ext==".gif")||(ext==".GIF"))
						{
							ObjErrDis = eval("S"+Obj[ObjCnt].htmlFor);
							ObjErrDis.innerHTML = "";
						}
						else
		 				{
							 ObjErrDis = eval("S"+Obj[ObjCnt].htmlFor);
							 ObjErrDis.innerHTML = "<font color='red'>Only jpg or gif photos allowed</font>";
       						 Flag=1;
	    	  			}
					}
				}
				

				else if(Obj[ObjCnt].id==21)
				{	
					if(ObjCtrol.value!="")
					{		
					var obVal = ObjCtrol.value;
					b=obVal.lastIndexOf(".");
					b1=b+5;
					ext=obVal.substring(b,b1);
					if((ext==".swf")|| (ext==".SWF")||(ext==".avi")||(ext==".AVI")||(ext==".mpg")||(ext==".MPG")||(ext==".mpeg")||(ext==".MPEG")||(ext==".flv")||(ext==".FLV")||(ext==".wmv")||(ext==".WMV"))
					{
						ObjErrDis = eval("S"+Obj[ObjCnt].htmlFor);
						ObjErrDis.innerHTML = "";
					}
					else
		 			{
						 ObjErrDis = eval("S"+Obj[ObjCnt].htmlFor);
						 ObjErrDis.innerHTML = "<font color='red'>Only avi or flv or mpg or swf are allowed</font>";
       					 Flag=1;
	      			}
				}
			}								
										

				else if(Obj[ObjCnt].id==22)
				{	
					var obVal = ObjCtrol.value;
					b=obVal.lastIndexOf(".");
					b1=b+5;
					ext=obVal.substring(b,b1);
					if((ext==".swf")|| (ext==".SWF")||(ext==".avi")||(ext==".AVI")||(ext==".mpg")||(ext==".MPG")||(ext==".mpeg")||(ext==".MPEG")||(ext==".flv")||(ext==".FLV") ||(ext==".wmv")||(ext==".WMV"))
					{
						ObjErrDis = eval("S"+Obj[ObjCnt].htmlFor);
						ObjErrDis.innerHTML = "";
					}
					else
		 			{
						 ObjErrDis = eval("S"+Obj[ObjCnt].htmlFor);
						 ObjErrDis.innerHTML = "<font color='red'>Only avi or flv or mpg or swf are allowed</font>";
       					 Flag=1;
	      			}
				}

			
				else
				{			
					ObjErrDis = eval("S"+Obj[ObjCnt].htmlFor);
					ObjErrDis.innerHTML = "";				
				}
			}
		}
	}	
	if(Flag==1)
		return false;
	else
		return true;
}


function onlynos()
{
var a=window.event.keyCode;
if((a<48 || a>57) && (a!=45) && (a!=32))
{
window.event.keyCode =0;
}
}

//---------------admin login
  function login()
  {	
		Para=GetPara()
		if(Para)
		{
		//	alert(Para)
			objXMLHttpRequest.onreadystatechange=login_Output;
			var Url = "AdminLog_Srv.asp"; //Url of the file in the server.......
			objXMLHttpRequest.open("POST",Url,true);
			objXMLHttpRequest.setRequestHeader("Host","www.lookmansecurity.com");
			objXMLHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
			objXMLHttpRequest.setRequestHeader("Content-Length","12");
			objXMLHttpRequest.send(Para); //Data - to be sent to the server......
  		}
  }
  
  function login_Output()
  {
	if(objXMLHttpRequest.readyState == "4" )	
	{
//document.getElementById("a").innerHTML = objXMLHttpRequest.responseText
		var MsgDet = objXMLHttpRequest.responseText.split("*");
	//	alert(MsgDet[2])
		if(parseInt(MsgDet[1])==2)
		{
		document.getElementById("output").innerHTML=MsgDet[2];
		uid.value="";
		pwd.value="";
		}
		else if(parseInt(MsgDet[1])==3)
		{
		document.getElementById("output").innerHTML=MsgDet[2];
		uid.value="";
		pwd.value="";
		}		
		else if(parseInt(MsgDet[1])==1)
		{
		document.location.href ="home.asp";
		}
		objXMLHttpRequest.abort();

	}
  }  
  


  //---------------------------- Product Category -------------------------------
  
  //----------------------add / modify  
  function AddPCategory()
  {	
  	Para = GetPara()		
		if (Para) 
		{	
				//alert(Para)
				objXMLHttpRequest.onreadystatechange=AddPCategory_output;
				var Url = "PCategory_SrvPg_N.asp"; //Url of the file in the server.......
				objXMLHttpRequest.open("POST",Url,true);		
				objXMLHttpRequest.setRequestHeader("Host","www.lookmansecurity.com");
				objXMLHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
				objXMLHttpRequest.setRequestHeader("Content-Length","12");
				objXMLHttpRequest.send(Para); //Data - to be sent to the server......
				document.getElementById("butSave").disabled = true;
			}
  }
  
  function AddPCategory_output()
  {
	if(objXMLHttpRequest.readyState == "4" )	
	{
		var	MsgStr = objXMLHttpRequest.responseText.split("*");
		//document.getElementById("a").innerHTML = objXMLHttpRequest.responseText
			if(parseInt(MsgStr[1])==1)
			{
			document.location.href="pcategory.asp?output=1"
			}
			else if(parseInt(MsgStr[1])==2)
			{
				document.location.href="pcategory.asp?output=2"
			}
			else
			{
				document.location.href="pcategory.asp?output=2"
			}
	}
  }
  

 //-------- Modify 

function modipcat(Id)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "CatId";
	Input.id = "CatId";
	Input.value = Id;
	Form.appendChild(Input);

	document.body.appendChild(Form);
	Form.action = "PAddCategory.asp";
	Form.method="post"
	Form.submit();
}


//------------DELETE
   function pCat_Delete(Id){
 	var VarChoic = confirm("Are you sure!.. want to delete");
	if(VarChoic)
	{
		Para=GetPara() + '&Id='+Id
	//	alert(Para)
  		objXMLHttpRequest.onreadystatechange=PCat_DeleteOutput;
		var Url = "DelData.asp"; 
		objXMLHttpRequest.open("POST",Url,true);
		objXMLHttpRequest.setRequestHeader("Host","www.lookmansecurity.com");
		objXMLHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		objXMLHttpRequest.setRequestHeader("Content-Length","12");
		objXMLHttpRequest.send(Para);
	}	
  }
  
  function PCat_DeleteOutput()
  {
	if(objXMLHttpRequest.readyState == "4" )	
	{//alert(objXMLHttpRequest.responseText)
		var	MsgStr = objXMLHttpRequest.responseText.split("*");
			if(parseInt(MsgStr[0])==1)
			{
				document.location.href="pcategory.asp?output=1"
			}
			else if(parseInt(MsgStr[0])==2)
			{
				document.location.href="pcategory.asp?output=5"
			}
			else if(parseInt(MsgStr[0])==0)
			{
				document.location.href="pcategory.asp?output=4"
			}			
			else
			{
				document.location.href="pcategory.asp?output=5"				
			}

	}
  } 
  
  


   function Delete_DgOnclick(Id){
 	var VarChoic = confirm("Are you sure!.. want to delete");
	if(VarChoic)
	{
		Para=GetPara() + '&Id='+Id
	//	alert(Para)
  		objXMLHttpRequest.onreadystatechange=Delete_DgOnclickOutput;
		var Url = "DelData.asp"; 
		objXMLHttpRequest.open("POST",Url,true);
		objXMLHttpRequest.setRequestHeader("Host","www.lookmansecurity.com");
		objXMLHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		objXMLHttpRequest.setRequestHeader("Content-Length","12");
		objXMLHttpRequest.send(Para);
	}	
  }
  
  function Delete_DgOnclickOutput()
  {
	if(objXMLHttpRequest.readyState == "4" )	
	{//alert(objXMLHttpRequest.responseText)
//document.getElementById("a").innerHTML = objXMLHttpRequest.responseText
		var	MsgStr = objXMLHttpRequest.responseText.split("*");
	//	alert(MsgStr[1])
			if(parseInt(MsgStr[1])==1)
			{
				document.location.href="dealers.asp?output=1"
			}
			else if(parseInt(MsgStr[1])==00)
			{
				document.location.href="dealers.asp?output=5"
			}
			else if(parseInt(MsgStr[1])==0)
			{
				document.location.href="dealers.asp?output=4"
			}			
			else
			{
				document.location.href="dealers.asp?output=4"				
			}

	}
  } 
  
  
/*
function modipcat1(Id)
{
		Para = "CatId=" + Id;
  		objXMLHttpRequest.onreadystatechange=modipcat1Output;
		var Url = "PAddCategory.asp"; //Url of the file in the server.......
		objXMLHttpRequest.open("POST",Url,true);
		objXMLHttpRequest.setRequestHeader("Host","www.lookmansecurity.com");
		objXMLHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		objXMLHttpRequest.setRequestHeader("Content-Length","12");
		objXMLHttpRequest.send(Para);	
}

function modipcat1Output()
{
	if (objXMLHttpRequest.readyState == 4) 
	{
		if (objXMLHttpRequest.status == 200) 
		{document.getElementById("inputarea").innerHTML=objXMLHttpRequest.responseText} 
		else 
		{alert("Problem with the server response " + objXMLHttpRequest.statusText);}
		var browser=navigator.appName
		if (browser=="Netscape")
		{
			var requestTimer = setTimeout(function() { objXMLHttpRequest.abort(); }, 0);
			clearTimeout(requestTimer);
		}
		else
  		{objXMLHttpRequest.abort()}		
	}
	else
	{document.getElementById("inputarea").innerHTML = "Loading..."}
}
*/
function navigate(pg,fid,id)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "fid";
	Input.id = "fid";
	Input.value = fid;
	Form.appendChild(Input);

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "id";
	Input.id = "id";
	Input.value = id;
	Form.appendChild(Input);	

	document.body.appendChild(Form);
	Form.action = pg
	Form.method="post"
	Form.submit();
}

function modipcatAll(Id)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "CatId";
	Input.id = "CatId";
	Input.value = Id;
	Form.appendChild(Input);

	document.body.appendChild(Form);
	Form.action = "PAddCategory.asp";
	Form.method="post"
	Form.submit();
}


function dispat(Id)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "DealrId";
	Input.id = "DealrId";
	Input.value = Id;
	Form.appendChild(Input);

	document.body.appendChild(Form);
	Form.action = "dealer_dispatchnew.asp";
	Form.method="post"
	Form.submit();
}

function Vdispat(Id)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "DealrId";
	Input.id = "DealrId";
	Input.value = Id;
	Form.appendChild(Input);

	document.body.appendChild(Form);
	Form.action = "viewdispatches.asp";
	Form.method="post"
	Form.submit();
}

function addp()
  {
  		Para = "ctype=forgot";
  		objXMLHttpRequest.onreadystatechange=addp_output;
		var Url = "pAddCategory.asp"; //Url of the file in the server.......
		objXMLHttpRequest.open("POST",Url,true);
		objXMLHttpRequest.setRequestHeader("Host","www.lookmansecurity.com");
		objXMLHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		objXMLHttpRequest.setRequestHeader("Content-Length","12");
		objXMLHttpRequest.send(Para);
  }
  

function addp_output()
{
	if (objXMLHttpRequest.readyState == 4) {
		if (objXMLHttpRequest.status == 200) 
		{
		document.getElementById("content").innerHTML=objXMLHttpRequest.responseText} 
		else 
		{alert("Problem with the server response " + objXMLHttpRequest.statusText);}
		var browser=navigator.appName
		if (browser=="Netscape")
		{
			var requestTimer = setTimeout(function() { objXMLHttpRequest.abort(); }, 0);
			clearTimeout(requestTimer);
		}
		else
  		{objXMLHttpRequest.abort()}		
	}
	else
	{document.getElementById("content").innerHTML = "Loading..."}
}


function modidealer(Id)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "DealrId";
	Input.id = "DealrId";
	Input.value = Id;
	Form.appendChild(Input);

	document.body.appendChild(Form);
	Form.action = "editdealer.asp";
	Form.method="post"
	Form.submit();
}

function viewdealer(Id)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "DealrId";
	Input.id = "DealrId";
	Input.value = Id;
	Form.appendChild(Input);

	document.body.appendChild(Form);
	Form.action = "viewdealer.asp";
	Form.method="post"
	Form.submit();
}
function AddCriteria(Id)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "DealrId";
	Input.id = "DealrId";
	Input.value = Id;
	Form.appendChild(Input);

	document.body.appendChild(Form);
	Form.action = "AddDealerTrans.asp";
	Form.method="post"
	Form.submit();
}

function ModiCriteria(Id,Trn)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "DealrId";
	Input.id = "DealrId";
	Input.value = Id;
	Form.appendChild(Input);
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "TranId";
	Input.id = "TranId";
	Input.value = Trn;
	Form.appendChild(Input);

	document.body.appendChild(Form);
	Form.action = "AddDealerTrans.asp";
	Form.method="post"
	Form.submit();
}


function ChkCat()
{
		var br=escape(document.getElementById("BrandId").value);
		//alert(pdt)
		objXMLHttpRequest.onreadystatechange=ChkCat_output;
		var Url = "scategory.asp"; //Url of the file in the server.......
		objXMLHttpRequest.open("POST",Url,true);
		objXMLHttpRequest.setRequestHeader("Host","www.lookmansecurity.com");
		objXMLHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		objXMLHttpRequest.setRequestHeader("Content-Length","12");
		objXMLHttpRequest.send('brand=' + br); //Data - to be sent to the server......	
}

function ChkCat_output()
{
	if (objXMLHttpRequest.readyState == 4) 
	{
		if (objXMLHttpRequest.status == 200) 
		{
		document.getElementById("CatDet").innerHTML=objXMLHttpRequest.responseText
		objXMLHttpRequest.abort();
		} 
		
		else 
		{
		alert("Problem with the server response " + objXMLHttpRequest.statusText);
		}
		
		var browser=navigator.appName
		if (browser=="Netscape")
		{
			var requestTimer = setTimeout(function() { objXMLHttpRequest.abort(); }, 0);
			clearTimeout(requestTimer);
		}
		else
  		{
		objXMLHttpRequest.abort()
		}
	}
	
	else
	{
	document.getElementById("CatDet").innerHTML = "<font face='verdana' size='2'><em>Loading...</em></font>"
	}
}

function warno()
{
		var di=escape(document.getElementById("dealrid").value);
	//	alert(di)
		objXMLHttpRequest.onreadystatechange=warno_output;
		var Url = "warr_no.asp"; //Url of the file in the server.......
		objXMLHttpRequest.open("POST",Url,true);
		objXMLHttpRequest.setRequestHeader("Host","www.lookmansecurity.com");
		objXMLHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		objXMLHttpRequest.setRequestHeader("Content-Length","12");
		objXMLHttpRequest.send('dealrId=' + di); //Data - to be sent to the server......	
}

function warno_output()
{
	if (objXMLHttpRequest.readyState == 4) 
	{
		if (objXMLHttpRequest.status == 200) 
		{
		document.getElementById("Frm").innerHTML=objXMLHttpRequest.responseText
		objXMLHttpRequest.abort();
		} 
		
		else 
		{
		alert("Problem with the server response " + objXMLHttpRequest.statusText);
		}
		
		var browser=navigator.appName
		if (browser=="Netscape")
		{
			var requestTimer = setTimeout(function() { objXMLHttpRequest.abort(); }, 0);
			clearTimeout(requestTimer);
		}
		else
  		{
		objXMLHttpRequest.abort()
		}
	}
	
	else
	{
	document.getElementById("Frm").innerHTML = "<font face='verdana' size='2'><em>Loading...</em></font>"
	}
}


function Search_Products(PgId,brandid,catid,scatid,keywords)
{
//alert("TEST")
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "mypage";
	Input.id = "mypage";
	Input.value = PgId;
	Form.appendChild(Input);	

if(brandid==0)
brandid=""

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "brandid";
	Input.id = "brandid";
	Input.value = brandid;
	Form.appendChild(Input);

if(catid==0)
catid=""
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "catid";
	Input.id = "catid";
	Input.value = catid;
	Form.appendChild(Input);

if(scatid==0)
scatid=""

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "scatid";
	Input.id = "scatid";
	Input.value = scatid;
	Form.appendChild(Input);

if(keywords==0)
keywords=""

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "keywords";
	Input.id = "keywords";
	Input.value = keywords;
	Form.appendChild(Input);	

/*alert(PgId)
alert(brandid)
alert(catid)
alert(scatid)
alert(keywords)	*/
	
	document.body.appendChild(Form);
//	document.appendChild(Form);
	Form.action = "Product.asp";
	Form.method="post"
	Form.submit();
}


function Search_Price(PgId,brand,cat,scatid,pdtmodel)
{
//alert("TEST")
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "mypage";
	Input.id = "mypage";
	Input.value = PgId;
	Form.appendChild(Input);	

if(brand==0)
brand=""

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "brand";
	Input.id = "brand";
	Input.value = brand;
	Form.appendChild(Input);

if(cat==0)
cat=""
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "cat";
	Input.id = "cat";
	Input.value = cat;
	Form.appendChild(Input);

if(scatid==0)
scatid=""

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "scatid";
	Input.id = "scatid";
	Input.value = scatid;
	Form.appendChild(Input);

if(pdtmodel==0)
pdtmodel=""

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "pdtmodel";
	Input.id = "pdtmodel";
	Input.value = pdtmodel;
	Form.appendChild(Input);	

/*alert(PgId)
alert(brandid)
alert(catid)
alert(scatid)
alert(keywords)	*/
	
	document.body.appendChild(Form);
//	document.appendChild(Form);
	Form.action = "pricelist.asp";
	Form.method="post"
	Form.submit();
}


function viewlatest(PgId,brandid,catid,scatid,keywords)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "mypage1";
	Input.id = "mypage1";
	Input.value = PgId;
	Form.appendChild(Input);	

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "brandid";
	Input.id = "brandid";
	Input.value = brandid;
	Form.appendChild(Input);

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "catid";
	Input.id = "catid";
	Input.value = catid;
	Form.appendChild(Input);

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "scatid";
	Input.id = "scatid";
	Input.value = scatid;
	Form.appendChild(Input);

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "keywords";
	Input.id = "keywords";
	Input.value = keywords;
	Form.appendChild(Input);	
	
	document.appendChild(Form);
	Form.action = "latestproducts.asp";
	Form.method="post"
	Form.submit();
}

function viewnew(PgId,brandid,catid,scatid,keywords)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "mypage1";
	Input.id = "mypage1";
	Input.value = PgId;
	Form.appendChild(Input);	

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "brandid";
	Input.id = "brandid";
	Input.value = brandid;
	Form.appendChild(Input);

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "catid";
	Input.id = "catid";
	Input.value = catid;
	Form.appendChild(Input);

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "scatid";
	Input.id = "scatid";
	Input.value = scatid;
	Form.appendChild(Input);

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "keywords";
	Input.id = "keywords";
	Input.value = keywords;
	Form.appendChild(Input);	
	
	document.appendChild(Form);
	Form.action = "newproducts.asp";
	Form.method="post"
	Form.submit();
}

function viewdeactivated(PgId,brandid,catid,scatid,keywords)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "mypage1";
	Input.id = "mypage1";
	Input.value = PgId;
	Form.appendChild(Input);	

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "brandid";
	Input.id = "brandid";
	Input.value = brandid;
	Form.appendChild(Input);

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "catid";
	Input.id = "catid";
	Input.value = catid;
	Form.appendChild(Input);

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "scatid";
	Input.id = "scatid";
	Input.value = scatid;
	Form.appendChild(Input);

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "keywords";
	Input.id = "keywords";
	Input.value = keywords;
	Form.appendChild(Input);	
	
	document.appendChild(Form);
	Form.action = "deactivatedproducts.asp";
	Form.method="post"
	Form.submit();
}


function viewactivated(PgId,brandid,catid,scatid,keywords)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "mypage1";
	Input.id = "mypage1";
	Input.value = PgId;
	Form.appendChild(Input);	

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "brandid";
	Input.id = "brandid";
	Input.value = brandid;
	Form.appendChild(Input);

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "catid";
	Input.id = "catid";
	Input.value = catid;
	Form.appendChild(Input);

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "scatid";
	Input.id = "scatid";
	Input.value = scatid;
	Form.appendChild(Input);

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "keywords";
	Input.id = "keywords";
	Input.value = keywords;
	Form.appendChild(Input);	
	
	document.appendChild(Form);
	Form.action = "activatedproducts.asp";
	Form.method="post"
	Form.submit();
}


function viewpercentage(PgId,brandid,catid,scatid,keywords)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "mypage1";
	Input.id = "mypage1";
	Input.value = PgId;
	Form.appendChild(Input);	

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "brandid";
	Input.id = "brandid";
	Input.value = brandid;
	Form.appendChild(Input);

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "catid";
	Input.id = "catid";
	Input.value = catid;
	Form.appendChild(Input);

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "scatid";
	Input.id = "scatid";
	Input.value = scatid;
	Form.appendChild(Input);

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "keywords";
	Input.id = "keywords";
	Input.value = keywords;
	Form.appendChild(Input);	
	
	document.appendChild(Form);
	Form.action = "percent_products.asp";
	Form.method="post"
	Form.submit();
}

function latest(Pdt,PgId,brandid,catid,scatid,keywords)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";
	//Form.enctype="multipart/form-data"
	//alert(Form.enctype)
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "pdt";
	Input.id = "pdt";
	Input.value = Pdt;
	Form.appendChild(Input);
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "mypage";
	Input.id = "mypage";
	Input.value = PgId;
	Form.appendChild(Input);	
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "brandid";
	Input.id = "brandid";
	Input.value = brandid;
	Form.appendChild(Input);
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "catid";
	Input.id = "catid";
	Input.value = catid;
	Form.appendChild(Input);
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "scatid";
	Input.id = "scatid";
	Input.value = scatid;
	Form.appendChild(Input);

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "keywords";
	Input.id = "keywords";
	Input.value = keywords;
	Form.appendChild(Input);	
	
	document.body.appendChild(Form);
	Form.action = "latest.asp";
	Form.method="post"
	Form.submit();
}


function deactivate(Pdt,PgId,brandid,catid,scatid,keywords)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";
	//Form.enctype="multipart/form-data"
	//alert(Form.enctype)
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "pdt";
	Input.id = "pdt";
	Input.value = Pdt;
	Form.appendChild(Input);
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "mypage";
	Input.id = "mypage";
	Input.value = PgId;
	Form.appendChild(Input);	
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "brandid";
	Input.id = "brandid";
	Input.value = brandid;
	Form.appendChild(Input);
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "catid";
	Input.id = "catid";
	Input.value = catid;
	Form.appendChild(Input);
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "scatid";
	Input.id = "scatid";
	Input.value = scatid;
	Form.appendChild(Input);

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "keywords";
	Input.id = "keywords";
	Input.value = keywords;
	Form.appendChild(Input);	

/*alert(Pdt)
alert(PgId)
alert(brandid)
alert(catid)
alert(scatid)
alert(keywords)	*/
	
	document.body.appendChild(Form);
	Form.action = "deactivated.asp";
	Form.method="post"
	Form.submit();
}



function showpdt(Pdt,PgId,brandid,catid,scatid,keywords)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";
	//Form.enctype="multipart/form-data"
	//alert(Form.enctype)
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "pdt";
	Input.id = "pdt";
	Input.value = Pdt;
	Form.appendChild(Input);
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "mypage";
	Input.id = "mypage";
	Input.value = PgId;
	Form.appendChild(Input);	
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "brandid";
	Input.id = "brandid";
	Input.value = brandid;
	Form.appendChild(Input);
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "catid";
	Input.id = "catid";
	Input.value = catid;
	Form.appendChild(Input);
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "scatid";
	Input.id = "scatid";
	Input.value = scatid;
	Form.appendChild(Input);

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "keywords";
	Input.id = "keywords";
	Input.value = keywords;
	Form.appendChild(Input);	

/*alert(Pdt)
alert(PgId)
alert(brandid)
alert(catid)
alert(scatid)
alert(keywords)	*/
	
	document.body.appendChild(Form);
	Form.action = "products_applicable.asp";
	Form.method="post"
	Form.submit();
}

function rlatest(Pdt,PgId)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "pdt";
	Input.id = "pdt";
	Input.value = Pdt;
	Form.appendChild(Input);
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "mypage";
	Input.id = "mypage";
	Input.value = PgId;
	Form.appendChild(Input);	
	
	document.body.appendChild(Form);
	Form.action = "latest1.asp";
	Form.method="post"
	Form.submit();
}


function deactivate1(Pdt,PgId,ty)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "pdt";
	Input.id = "pdt";
	Input.value = Pdt;
	Form.appendChild(Input);
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "mypage";
	Input.id = "mypage";
	Input.value = PgId;
	Form.appendChild(Input);

	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "ty";
	Input.id = "ty";
	Input.value = ty;
	Form.appendChild(Input);		
	
	document.body.appendChild(Form);
	Form.action = "deactivated.asp";
	Form.method="post"
	Form.submit();
}

function pdt_applicable(Pdt,PgId,ty)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "pdt";
	Input.id = "pdt";
	Input.value = Pdt;
	Form.appendChild(Input);
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "mypage";
	Input.id = "mypage";
	Input.value = PgId;
	Form.appendChild(Input);

	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "ty";
	Input.id = "ty";
	Input.value = ty;
	Form.appendChild(Input);		
	
	document.body.appendChild(Form);
	Form.action = "products_applicable.asp";
	Form.method="post"
	Form.submit();
}

function new2(Pdt,PgId,ty)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "pdt";
	Input.id = "pdt";
	Input.value = Pdt;
	Form.appendChild(Input);
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "mypage";
	Input.id = "mypage";
	Input.value = PgId;
	Form.appendChild(Input);

	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "ty";
	Input.id = "ty";
	Input.value = ty;
	Form.appendChild(Input);		
	
	document.body.appendChild(Form);
	Form.action = "newlist.asp";
	Form.method="post"
	Form.submit();
}



function Search_Latest(PgId)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "mypage";
	Input.id = "mypage";
	Input.value = PgId;
	Form.appendChild(Input);
	
	document.body.appendChild(Form);
	Form.action = "latestproducts.asp";
	Form.method="post"
	Form.submit();
}

function Search_deactive(PgId)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "mypage";
	Input.id = "mypage";
	Input.value = PgId;
	Form.appendChild(Input);
	
	document.body.appendChild(Form);
	Form.action = "deactivatedproducts.asp";
	Form.method="post"
	Form.submit();
}

function Search_active(PgId)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "mypage";
	Input.id = "mypage";
	Input.value = PgId;
	Form.appendChild(Input);
	
	document.body.appendChild(Form);
	Form.action = "activatedproducts.asp";
	Form.method="post"
	Form.submit();
}

function Search_aproducts(PgId)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "mypage";
	Input.id = "mypage";
	Input.value = PgId;
	Form.appendChild(Input);
	
	document.body.appendChild(Form);
	Form.action = "percent_products.asp";
	Form.method="post"
	Form.submit();
}

function Search_new(PgId)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "mypage";
	Input.id = "mypage";
	Input.value = PgId;
	Form.appendChild(Input);
	
	document.body.appendChild(Form);
	Form.action = "newproducts.asp";
	Form.method="post"
	Form.submit();
}

function Search_Catalog(PgId,brandid,catid,scatid)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "mypage";
	Input.id = "mypage";
	Input.value = PgId;
	Form.appendChild(Input);	
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "brandid";
	Input.id = "brandid";
	Input.value = brandid;
	Form.appendChild(Input);
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "catid";
	Input.id = "catid";
	Input.value = catid;
	Form.appendChild(Input);
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "scatid";
	Input.id = "scatid";
	Input.value = scatid;
	Form.appendChild(Input);
	
	document.body.appendChild(Form);
	Form.action = "Product_catalog.asp";
	Form.method="post"
	Form.submit();
}

   function addmod()
  {	
	Para = GetPara()
	if (Para)
	{
		objXMLHttpRequest.onreadystatechange=addmod_output;
		var Url = "mod_Srv.asp"; //Url of the file in the server.......
		objXMLHttpRequest.open("POST",Url,true);
		objXMLHttpRequest.setRequestHeader("Host","www.lookmansecurity.com");
		objXMLHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		objXMLHttpRequest.setRequestHeader("Content-Length","12");
		objXMLHttpRequest.send(Para); //Data - to be sent to the server......
		document.getElementById("butSave").disabled = true;
	}
  }  
  function addmod_output()
  {
	if(objXMLHttpRequest.readyState == "4" )	
	{
var	MsgStr = objXMLHttpRequest.responseText.split("*");
//document.getElementById("a").innerHTML = objXMLHttpRequest.responseText
			if(parseInt(MsgStr[1])==1)
			{
				document.location.href="modules.asp?output=1"
			}
			else if(parseInt(MsgStr[1])==2)
			{
				document.location.href="modules.asp?output=2"
			}
			else if(parseInt(MsgStr[1])==3)
			{
				document.location.href="modules.asp?output=3"
			}			
			else
			{
				document.location.href="modules.asp?output=2"							
			}
	}
  }
  
  
  function modimod(Id)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "mId";
	Input.id = "Id";
	Input.value = Id;
	Form.appendChild(Input);

	document.body.appendChild(Form);
	Form.action = "addmodules.asp";
	Form.method="post"
	Form.submit();
}


  function Delete_mOnclick(Id)
   {
	var VarChoic = confirm("Are you sure!.. want to delete");
	if(VarChoic)
	{
		Para=GetPara() + '&Id='+Id
  		objXMLHttpRequest.onreadystatechange=Delete_mOnclickOutput;
		var Url = "DelData.asp"; 
		objXMLHttpRequest.open("POST",Url,true);
		objXMLHttpRequest.setRequestHeader("Host","www.lookmansecurity.com");
		objXMLHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		objXMLHttpRequest.setRequestHeader("Content-Length","12");
		objXMLHttpRequest.send(Para);
	}	
  }
  
  function Delete_mOnclickOutput()
  {
	if(objXMLHttpRequest.readyState == "4" )	
	{
		var	MsgStr = objXMLHttpRequest.responseText.split("*");
		
			if(parseInt(MsgStr[1])==4)
			{
				document.location.href="modules.asp?output=1"
			}
			else if(parseInt(MsgStr[1])==2)
			{
				document.location.href="modules.asp?output=5"
			}
			else if(parseInt(MsgStr[1])==3)
			{
				document.location.href="modules.asp?output=3"
			}			
			else if(parseInt(MsgStr[1])==0)
			{
				document.location.href="modules.asp?output=4"
			}			
			else
			{
				document.location.href="modules.asp?output=5"				
			}

	}
  } 


//----------------------add / modify  
    function addmpermission()
  {	
  var abcd
abcd=0
	for(i=0;i<form1.document.getElementById("LstPgDis").options.length;i++)
	{
	//alert(form1.document.getElementById("LstPgDis").options[i].value)
		form1.document.getElementById("LstPgDis").options[i].selected=true;
		abcd = abcd + "-" + form1.document.getElementById("LstPgDis").options[i].value;
		form1.page.value=abcd
	}
//alert(form1.page.value)	  
		Para = GetPara()
		if (Para) {
	//	alert(Para)
  		objXMLHttpRequest.onreadystatechange=addmpermission_output;
		var Url = "mper_SrvPg_N.asp"; //Url of the file in the server.......
		objXMLHttpRequest.open("POST",Url,true);		
		objXMLHttpRequest.setRequestHeader("Host","www.lookmansecurity.com");
		objXMLHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		objXMLHttpRequest.setRequestHeader("Content-Length","12");
		objXMLHttpRequest.send(Para); //Data - to be sent to the server......
		document.getElementById("butSave").disabled = true;
		}
  }
  
  function addmpermission_output()
  {
	if(objXMLHttpRequest.readyState == "4" )	
	{
		var		MsgStr = objXMLHttpRequest.responseText.split("*");
		//document.getElementById("a").innerHTML = objXMLHttpRequest.responseText
			if(parseInt(MsgStr[1])==1)
			{
			document.location.href="mpermission.asp?output=1"
			}
			else if(parseInt(MsgStr[1])==2)
			{
				document.location.href="mpermission.asp?output=2"
			}
			else
			{
				document.location.href="mpermission.asp?output=2"
			}	
	}
  }
  

 //-------- Modify 

function modimpermission(Id)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "mPermId";
	Input.id = "mPermId";
	Input.value = Id;
	Form.appendChild(Input);

	document.body.appendChild(Form);
	Form.action = "AddmPermission.asp";
	Form.method="post"
	Form.submit();
}	

//------------delete admin
   function Delete_MPermOnclick(Id)
   {
	var VarChoic = confirm("Are you sure!.. want to delete");
	if(VarChoic)
	{
		Para=GetPara() + '&Id='+Id
  		objXMLHttpRequest.onreadystatechange=Delete_mPermOnclickOutput;
		var Url = "DelData.asp"; 
		objXMLHttpRequest.open("POST",Url,true);
		objXMLHttpRequest.setRequestHeader("Host","www.lookmansecurity.com");
		objXMLHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		objXMLHttpRequest.setRequestHeader("Content-Length","12");
		objXMLHttpRequest.send(Para);
	}	
  }
  
  function Delete_mPermOnclickOutput()
  {
	if(objXMLHttpRequest.readyState == "4" )	
	{
		var	MsgStr = objXMLHttpRequest.responseText.split("*");
		
			if(parseInt(MsgStr[1])==4)
			{
				document.location.href="mPermission.asp?output=1"
			}
			else if(parseInt(MsgStr[1])==2)
			{
				document.location.href="mPermission.asp?output=5"
			}
			else if(parseInt(MsgStr[1])==3)
			{
				document.location.href="mPermission.asp?output=3"
			}			
			else if(parseInt(MsgStr[1])==0)
			{
				document.location.href="mPermission.asp?output=4"
			}			
			else
			{
				document.location.href="mPermission.asp?output=5"				
			}

	}
  } 




function Reply(Id)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "qryid";
	Input.id = "qryid";
	Input.value = Id;
	Form.appendChild(Input);

	document.body.appendChild(Form);
	Form.action = "Query_Det.asp";
	Form.method="post"
	Form.submit();
}


  //----------------------add / modify  
  function addqry()
  {	
  	Para = GetPara()		
		if (Para) 
		{	
			//	alert(Para)
				objXMLHttpRequest.onreadystatechange=addqry_output;
				var Url = "addqry_srv.asp"; //Url of the file in the server.......
				objXMLHttpRequest.open("POST",Url,true);		
				objXMLHttpRequest.setRequestHeader("Host","www.lookmansecurity.com");
				objXMLHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
				objXMLHttpRequest.setRequestHeader("Content-Length","12");
				objXMLHttpRequest.send(Para); //Data - to be sent to the server......
				document.getElementById("butSave").disabled = true;
			}
  }
  
  function addqry_output()
  {
	if(objXMLHttpRequest.readyState == "4" )	
	{
		var	MsgStr = objXMLHttpRequest.responseText.split("*");
	//	alert(objXMLHttpRequest.responseText)
		//document.getElementById("a").innerHTML = objXMLHttpRequest.responseText
			if(parseInt(MsgStr[1])==1)
			{
			document.location.href="report4.asp?output=1"
			}
			else if(parseInt(MsgStr[1])==2)
			{
				document.location.href="report4.asp?output=2"
			}
			else
			{
				document.location.href="report4.asp?output=2"
			}
	}
  }
  



 //---------------------------- Product Category -------------------------------
  
  //----------------------add / modify  
  function AddWt()
  {	
  	Para = GetPara()		
		if (Para) 
		{	
				//alert(Para)
				objXMLHttpRequest.onreadystatechange=AddWt_output;
				var Url = "WarrantyTypes_SrvPg_N.asp"; //Url of the file in the server.......
				objXMLHttpRequest.open("POST",Url,true);		
				objXMLHttpRequest.setRequestHeader("Host","www.lookmansecurity.com");
				objXMLHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
				objXMLHttpRequest.setRequestHeader("Content-Length","12");
				objXMLHttpRequest.send(Para); //Data - to be sent to the server......
				document.getElementById("butSave").disabled = true;
			}
  }
  
  function AddWt_output()
  {
	if(objXMLHttpRequest.readyState == "4" )	
	{
		var	MsgStr = objXMLHttpRequest.responseText.split("*");
		//document.getElementById("a").innerHTML = objXMLHttpRequest.responseText
			if(parseInt(MsgStr[1])==1)
			{
			document.location.href="warrantytypes.asp?output=1"
			}
			else if(parseInt(MsgStr[1])==2)
			{
				document.location.href="warrantytypes.asp?output=2"
			}
			else
			{
				document.location.href="warrantytypes.asp?output=2"
			}
	}
  }
  

 //-------- Modify 

function modiwt(Id)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "wtid";
	Input.id = "wtid";
	Input.value = Id;
	Form.appendChild(Input);

	document.body.appendChild(Form);
	Form.action = "AddWarrantyTypes.asp";
	Form.method="post"
	Form.submit();
}


//------------DELETE
   function wt_Delete(Id){
 	var VarChoic = confirm("Are you sure!.. want to delete");
	if(VarChoic)
	{
		Para=GetPara() + '&Id='+Id
	//	alert(Para)
  		objXMLHttpRequest.onreadystatechange=wt_DeleteOutput;
		var Url = "DelData.asp"; 
		objXMLHttpRequest.open("POST",Url,true);
		objXMLHttpRequest.setRequestHeader("Host","www.lookmansecurity.com");
		objXMLHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		objXMLHttpRequest.setRequestHeader("Content-Length","12");
		objXMLHttpRequest.send(Para);
	}	
  }
  
  function wt_DeleteOutput()
  {
	if(objXMLHttpRequest.readyState == "4" )	
	{//alert(objXMLHttpRequest.responseText)
		var	MsgStr = objXMLHttpRequest.responseText.split("*");
			if(parseInt(MsgStr[0])==1)
			{
				document.location.href="warrantytypes.asp?output=1"
			}
			else if(parseInt(MsgStr[0])==2)
			{
				document.location.href="warrantytypes.asp?output=5"
			}
			else if(parseInt(MsgStr[0])==0)
			{
				document.location.href="warrantytypes.asp?output=4"
			}			
			else
			{
				document.location.href="warrantytypes.asp?output=5"				
			}

	}
  } 
  
  
  
  
//----------------------------DISPATCH

  function Adddis()
  {	
  	Para = GetPara()		
		if (Para) 
		{	
				//alert(Para)
				objXMLHttpRequest.onreadystatechange=Adddis_output;
				var Url = "dispatchTypes_SrvPg_N.asp"; //Url of the file in the server.......
				objXMLHttpRequest.open("POST",Url,true);		
				objXMLHttpRequest.setRequestHeader("Host","www.lookmansecurity.com");
				objXMLHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
				objXMLHttpRequest.setRequestHeader("Content-Length","12");
				objXMLHttpRequest.send(Para); //Data - to be sent to the server......
				document.getElementById("butSave").disabled = true;
			}
  }
  
  function Adddis_output()
  {
	if(objXMLHttpRequest.readyState == "4" )	
	{
		var	MsgStr = objXMLHttpRequest.responseText.split("*");
		//document.getElementById("a").innerHTML = objXMLHttpRequest.responseText
			if(parseInt(MsgStr[1])==1)
			{
			document.location.href="dispatchtypes.asp?output=1"
			}
			else if(parseInt(MsgStr[1])==2)
			{
				document.location.href="dispatchtypes.asp?output=2"
			}
			else
			{
				document.location.href="dispatchtypes.asp?output=2"
			}
	}
  }
  

 //-------- Modify 

function modiDis(Id)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "disid";
	Input.id = "disid";
	Input.value = Id;
	Form.appendChild(Input);

	document.body.appendChild(Form);
	Form.action = "AddDispatchTypes.asp";
	Form.method="post"
	Form.submit();
}


//------------DELETE
   function Dis_Delete(Id){
 	var VarChoic = confirm("Are you sure!.. want to delete");
	if(VarChoic)
	{
		Para=GetPara() + '&Id='+Id
	//	alert(Para)
  		objXMLHttpRequest.onreadystatechange=dis_DeleteOutput;
		var Url = "DelData.asp"; 
		objXMLHttpRequest.open("POST",Url,true);
		objXMLHttpRequest.setRequestHeader("Host","www.lookmansecurity.com");
		objXMLHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		objXMLHttpRequest.setRequestHeader("Content-Length","12");
		objXMLHttpRequest.send(Para);
	}	
  }
  
  function dis_DeleteOutput()
  {
	if(objXMLHttpRequest.readyState == "4" )	
	{//alert(objXMLHttpRequest.responseText)
		var	MsgStr = objXMLHttpRequest.responseText.split("*");
			if(parseInt(MsgStr[0])==1)
			{
				document.location.href="dispatchtypes.asp?output=1"
			}
			else if(parseInt(MsgStr[0])==2)
			{
				document.location.href="dispatchtypes.asp?output=5"
			}
			else if(parseInt(MsgStr[0])==0)
			{
				document.location.href="dispatchtypes.asp?output=4"
			}			
			else
			{
				document.location.href="dispatchtypes.asp?output=5"				
			}

	}
  } 
  
  
  function viewpdtreq(Id,Did)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "ty";
	Input.id = "ty";
	Input.value = Id;
	Form.appendChild(Input);	

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "DealrId";
	Input.id = "DealrId";
	Input.value = Did;
	Form.appendChild(Input);
	
	document.body.appendChild(Form);
	Form.action = "viewproductrequest.asp";
	Form.method="post"
	Form.submit();
}
  
function ViewPrdReqst(prsid,prdt,DealrId)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "PrSid";
	Input.id = "PrSid";
	Input.value = prsid;
	Form.appendChild(Input);
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "PrrDate";
	Input.id = "PrrDate";
	Input.value = prdt;
	Form.appendChild(Input);
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "DealrId";
	Input.id = "DealrId";
	Input.value = DealrId;
	Form.appendChild(Input);			
	
	document.body.appendChild(Form);
	Form.action = "ViewPrdReqstd.asp";
	Form.method="post"
	Form.submit();
}

function calendrValues(prsid,prdt)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "PrSid";
	Input.id = "PrSid";
	Input.value = prsid;
	Form.appendChild(Input);
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "date";
	Input.id = "date";
	Input.value = prdt;
	Form.appendChild(Input);		
	
	document.body.appendChild(Form);
	Form.action = "calendar.asp";
	Form.method="post"
	Form.submit();
}
function CalValYear(prsid,prdt)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "PrSid";
	Input.id = "PrSid";
	Input.value = prsid;
	Form.appendChild(Input);
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "date";
	Input.id = "date";
	Input.value = prdt;
	Form.appendChild(Input);		
	
	document.body.appendChild(Form);
	Form.action = "calendar.asp";
	Form.method="post"
	Form.submit();
}

function MkActInact(prsid)
{//alert(pzid)
		//if(document.getElementById("ActInact").checked == true)
		//{
			Para = "PrsId=" + prsid + "&PrrStat=" + "I";
		//}
		//else if(document.getElementById("ActInact").checked == false)
		//{
		//	Para = "PrsId=" + prsid + "&PrrStat=" + "A";
		//}
		
		if(Para)
		{//alert(Para)	
		objXMLHttpRequest.onreadystatechange=MkActInact_output;
		var Url = "PdtActive.asp"; //Url of the file in the server.......
		objXMLHttpRequest.open("POST",Url,true);
		objXMLHttpRequest.setRequestHeader("Host","www.lookmansecurity.com");
		objXMLHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		objXMLHttpRequest.setRequestHeader("Content-Length","12");
		objXMLHttpRequest.send(Para); //Data - to be sent to the server......
		}	
}

function MkActInact_output()
{
	if(objXMLHttpRequest.readyState == "4" )	
	{
		//alert(objXMLHttpRequest.responseText);
		//document.getElementById("a").innerHTML = objXMLHttpRequest.responseText
		if (objXMLHttpRequest.status == 200)
		{
			MsgStr = objXMLHttpRequest.responseText.split("*");
			document.location.href="calendar.asp?output=1"
		
		//	if(parseInt(MsgStr[0])==1)
		//	{
		//		document.getElementById("ActInact").checked = false
		//	}
		//	else
		//	{
		
		//	}	
		}
		else
		{
			alert("Problem with server response Try later or contact your software vendor");
		}	
		objXMLHttpRequest.abort();
	}	
}








function new1(Pdt,PgId,brandid,catid,scatid,keywords)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";
	//Form.enctype="multipart/form-data"
	//alert(Form.enctype)
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "pdt";
	Input.id = "pdt";
	Input.value = Pdt;
	Form.appendChild(Input);
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "mypage";
	Input.id = "mypage";
	Input.value = PgId;
	Form.appendChild(Input);	
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "brandid";
	Input.id = "brandid";
	Input.value = brandid;
	Form.appendChild(Input);
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "catid";
	Input.id = "catid";
	Input.value = catid;
	Form.appendChild(Input);
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "scatid";
	Input.id = "scatid";
	Input.value = scatid;
	Form.appendChild(Input);

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "keywords";
	Input.id = "keywords";
	Input.value = keywords;
	Form.appendChild(Input);	

/*alert(Pdt)
alert(PgId)
alert(brandid)
alert(catid)
alert(scatid)
alert(keywords)	*/
	
	document.body.appendChild(Form);
	Form.action = "newlist.asp";
	Form.method="post"
	Form.submit();
}


function rembrand(Id,ext)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "brandid";
	Input.id = "brandid";
	Input.value = Id;
	Form.appendChild(Input);

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "brandext";
	Input.id = "brandext";
	Input.value = ext;
	Form.appendChild(Input);	

	document.body.appendChild(Form);
	Form.action = "remove_brand.asp";
	Form.method="post"
	Form.submit();
}





  function Sel_ondblclick123(LstSrc,LstDist,Id) {
 // alert(document.getElementById("LstPgDis").value)
	if(document.getElementById(LstSrc).selectedIndex==-1)
		alert("Please select properly...");
	else
	{	
	var tval;
	var b= new Array();
	var i;
	var tval1;
	var tv;
	var j;
	j=0;
	var c= new Array();	
	var Opt = document.createElement("option");
	Opt.text = document.getElementById(LstSrc).options[document.getElementById(LstSrc).selectedIndex].text; 
	Opt.value = document.getElementById(LstSrc).options[document.getElementById(LstSrc).selectedIndex].value;
	tval=document.getElementById("Pdt_Val_"+Id).value
tval1="";

		if(tval=="")
			tv=Opt.value
		else
			tv=tval + "," + Opt.value
	
	if(LstDist=="PDT_LST_"+Id)
	{
		b=tval.split(",");
		for(i=0;i<b.length;i++)
		{
			if(b[i]==Opt.value)
				{
					//c[i]=b[i+1]
				//	i=i+1
				}
			else
				{
					c[j]=b[i]
					j=j+1
				}
				//alert("i value is "+ i + "array of " + b[i]);
		}

		for(i=0;i<j;i++)
		{
	//	alert("i value is "+ i + "array of " + c[i]);
			if(tval1=="")
				tval1=c[i];
			else
				tval1=tval1+","+c[i];
		}		
		tv=tval1; 		
	}


	document.getElementById("Pdt_Val_"+Id).value=tv;

	document.getElementById(LstDist).options.add(Opt);
	document.getElementById(LstSrc).remove(document.getElementById(LstSrc).selectedIndex);				

	}
}










function clrdeal()
{
document.getElementById("CityId").value=""
document.getElementById("srch").value=""
}		





function chkdeal()
{
		var ci=escape(document.getElementById("CityId").value);
		var se=escape(document.getElementById("srch").value);
		//alert('CityId=' + ci + "&searchtext=" + se);		
		objXMLHttpRequest.onreadystatechange=chkdeal_output;
		var Url = "dealer_state.asp"; //Url of the file in the server.......
		objXMLHttpRequest.open("POST",Url,true);
		objXMLHttpRequest.setRequestHeader("Host","www.lookmansecurity.com");
		objXMLHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		objXMLHttpRequest.setRequestHeader("Content-Length","12");
		objXMLHttpRequest.send('CityId=' + ci + "&searchtext=" + se); //Data - to be sent to the server......	
}

function chkdeal_output()
{
	if (objXMLHttpRequest.readyState == 4) 
	{
		if (objXMLHttpRequest.status == 200) 
		{
		document.getElementById("Deal").innerHTML=objXMLHttpRequest.responseText
		objXMLHttpRequest.abort();
		} 
		
		else 
		{
		alert("Problem with the server response " + objXMLHttpRequest.statusText);
		}
		
		var browser=navigator.appName
		if (browser=="Netscape")
		{
			var requestTimer = setTimeout(function() { objXMLHttpRequest.abort(); }, 0);
			clearTimeout(requestTimer);
		}
		else
  		{
		objXMLHttpRequest.abort()
		}
	}
	
	else
	{
	document.getElementById("Deal").innerHTML = "<font face='verdana' size='2'><em>Loading...</em></font>"
	}
}

function chkdeal1()
{
		var ci=escape(document.getElementById("CityId").value);
		var se=escape(document.getElementById("srch").value);
		//alert('CityId=' + ci + "&searchtext=" + se);		
		objXMLHttpRequest.onreadystatechange=chkdeal1_output;
		var Url = "dealers_state.asp"; //Url of the file in the server.......
		objXMLHttpRequest.open("POST",Url,true);
		objXMLHttpRequest.setRequestHeader("Host","www.lookmansecurity.com");
		objXMLHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		objXMLHttpRequest.setRequestHeader("Content-Length","12");
		objXMLHttpRequest.send('CityId=' + ci + "&searchtext=" + se); //Data - to be sent to the server......	
}

function chkdeal1_output()
{
	if (objXMLHttpRequest.readyState == 4) 
	{
		if (objXMLHttpRequest.status == 200) 
		{
		document.getElementById("Deal").innerHTML=objXMLHttpRequest.responseText
		objXMLHttpRequest.abort();
		} 
		
		else 
		{
		alert("Problem with the server response " + objXMLHttpRequest.statusText);
		}
		
		var browser=navigator.appName
		if (browser=="Netscape")
		{
			var requestTimer = setTimeout(function() { objXMLHttpRequest.abort(); }, 0);
			clearTimeout(requestTimer);
		}
		else
  		{
		objXMLHttpRequest.abort()
		}
	}
	
	else
	{
	document.getElementById("Deal").innerHTML = "<font face='verdana' size='2'><em>Loading...</em></font>"
	}
}


function getbrand_dealers()
{
		var br=escape(document.getElementById("BrandId").value);
		objXMLHttpRequest.onreadystatechange=getbrand_dealers_output;
		var Url = "dealers_brand.asp"; //Url of the file in the server.......
		objXMLHttpRequest.open("POST",Url,true);
		objXMLHttpRequest.setRequestHeader("Host","www.lookmansecurity.com");
		objXMLHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		objXMLHttpRequest.setRequestHeader("Content-Length","12");
		objXMLHttpRequest.send('BrandId=' + br); //Data - to be sent to the server......	
}

function getbrand_dealers_output()
{
	if (objXMLHttpRequest.readyState == 4) 
	{
		if (objXMLHttpRequest.status == 200) 
		{
		document.getElementById("dealers_brand").innerHTML=objXMLHttpRequest.responseText
		objXMLHttpRequest.abort();
		} 
		
		else 
		{
		alert("Problem with the server response " + objXMLHttpRequest.statusText);
		}
		
		var browser=navigator.appName
		if (browser=="Netscape")
		{
			var requestTimer = setTimeout(function() { objXMLHttpRequest.abort(); }, 0);
			clearTimeout(requestTimer);
		}
		else
  		{
		objXMLHttpRequest.abort()
		}
	}
	
	else
	{
	document.getElementById("dealers_brand").innerHTML = "<font face='verdana' size='2'><em>Loading...</em></font>"
	}
}
function viewFeedback(usr){
//window.open("ad.html","","height=400,width=430,menubar=0,resizabl e=0,scrollbars=0,status=0,titlebar=0,toolbar=0,left=0,top=0")

//window.open("ViewProduct.asp?pdt=<%=PdtId%>,Popupwin,height='360', width='420',status= no, resizable= no, scrollbars=no, toolbar=no,location=no,menubar=no",true);
//alert(PdtId)
//window.open("ViewProduct.asp?pdt=" + PdtId + ","Popupwin","height=360, width=420,status= no, resizable= no, scrollbars=no, toolbar=no,location=no,menubar=no",true);
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.target="_blank"
	Form.id = "frmSrch";

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "DealrId";
	Input.id = "DealrId";
	Input.value = usr;
	Form.appendChild(Input);
	
	document.body.appendChild(Form);
	Form.action = "ViewFeedback.asp";
	//Form.target="_blank"
	//Form.target = "foobar:width={window.screen.width/2},height={myHeight},scrollbars,{(isResizable)?'resizable':''},status"
	Form.target = "foobar:width={300},height={300},scrollbars,{(isResizable)?'resizable':''},status"
	
	Form.method="post"	
	Form.onSubmit = createTarget(Form);
	Form.submit();
}

function viewpdtDet(PdtId){
//window.open("ad.html","","height=400,width=430,menubar=0,resizabl e=0,scrollbars=0,status=0,titlebar=0,toolbar=0,left=0,top=0")

//window.open("ViewProduct.asp?pdt=<%=PdtId%>,Popupwin,height='360', width='420',status= no, resizable= no, scrollbars=no, toolbar=no,location=no,menubar=no",true);
//alert(PdtId)
//window.open("ViewProduct.asp?pdt=" + PdtId + ","Popupwin","height=360, width=420,status= no, resizable= no, scrollbars=no, toolbar=no,location=no,menubar=no",true);
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.target="_blank"
	Form.id = "frmSrch";

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "pdt";
	Input.id = "pdt";
	Input.value = PdtId;
	Form.appendChild(Input);
	
	document.body.appendChild(Form);
	Form.action = "ViewProduct.asp";
	//Form.target="_blank"
	//Form.target = "foobar:width={window.screen.width/2},height={myHeight},scrollbars,{(isResizable)?'resizable':''},status"
	Form.target = "foobar:width={myWidt},height={myHeight},scrollbars,{(isResizable)?'resizable':''},status"
	
	Form.method="post"	
	Form.onSubmit = createTarget(Form);
	Form.submit();
}

///////////////////////////////////
////////////////////////////////
var myHeight = 600;
var myWidt = 600;

var myHeight1 = 600;
var myWidt1 = 800;
var isResizable = false;

function createTarget(form) {
//alert(form.action)
var _target = form.target;
_colon = _target.indexOf(":");
if(_colon != -1) 
{
	form.target = _target.substring(0,_colon);
	form.args = _target.substring(_colon+1);
} 
else if(typeof(form.args)=="undefined") {
	form.args = "";
}
if(form.args.indexOf("{")!=-1) {
_args = form.args.split("{");
form.args = _args[0];
for(var i = 1; i < _args.length;i++) {
_args[i] = _args[i].split("}");
form.args += eval(_args[i][0]) + _args[i][1];
   }
}
form.args = form.args.replace(/ /g,"");
_win = window.open('',form.target,form.args);
if(typeof(focus)=="function")
_win.focus();
//alert(form.args)
return true;
}



function viewDealr(DealrId)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.target="_blank"
	Form.id = "frmSrch";

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "DealrId";
	Input.id = "DealrId";
	Input.value = DealrId;
	Form.appendChild(Input);
	
	document.body.appendChild(Form);
	Form.action = "Dealer_Details.asp";
	Form.target = "foobar:width={myWidt},height={myHeight},scrollbars,{(isResizable)?'resizable':''},status"
	
	Form.method="post"	
	Form.onSubmit = createTarget(Form);
	Form.submit();
}
function viewDealrOrd(DealrId,prid,prdate)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.target="_blank"
	Form.id = "frmSrch";

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "DealrId";
	Input.id = "DealrId";
	Input.value = DealrId;
	Form.appendChild(Input);
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "prid";
	Input.id = "prid";
	Input.value = prid;
	Form.appendChild(Input);
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "prdate";
	Input.id = "prdate";
	Input.value = prdate;
	Form.appendChild(Input);
		
	document.body.appendChild(Form);
	Form.action = "Dealer_Details_All.asp";
	Form.target = "foobar:width={myWidt1},height={myHeight1},scrollbars,{(isResizable)?'resizable':''},status"
	
	Form.method="post"	
	Form.onSubmit = createTarget(Form);
	Form.submit();
}
//UpdtStat



function order_details(prid){
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.target="_blank"
	Form.id = "frmSrch";

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "prid";
	Input.id = "prid";
	Input.value = prid;
	Form.appendChild(Input);
	
	document.body.appendChild(Form);
	Form.action = "vieworderdetails.asp";
	Form.target = "foobar:width={myWidt},height={myHeight},scrollbars,{(isResizable)?'resizable':''},status"
	
	Form.method="post"	
	Form.onSubmit = createTarget(Form);
	Form.submit();
}

function chng(Id,ty)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "dealrId";
	Input.id = "dealrId";
	Input.value = Id;
	Form.appendChild(Input);

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "ty";
	Input.id = "ty";
	Input.value = ty;
	Form.appendChild(Input);	

	document.body.appendChild(Form);
	Form.action = "change_dealers.asp";
	Form.method="post"
	Form.submit();
}
function chngStat(Id,ty)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "dealrId";
	Input.id = "dealrId";
	Input.value = Id;
	Form.appendChild(Input);

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "ty";
	Input.id = "ty";
	Input.value = ty;
	Form.appendChild(Input);	

	document.body.appendChild(Form);
	Form.action = "change_dealStat.asp";
	Form.method="post"
	Form.submit();
}
function SubmtCriter_old()
{
	Para = GetPara()
	if(Para)
	{
		if((frmTrans.TranExp[0].checked==false) && (frmTrans.TranExp[1].checked==false))
		{
			document.getElementById("STranExp").innerHTML = "<font color=red>Please activate / de-activate the user</font>"
		}
		else
		{
			if(frmTrans.TranExp[0].checked==true)
				Para=Para + "&TranExp=1"
			else
				Para=Para + "&TranExp=0"
			document.getElementById("STranExp").innerHTML = ""
		}
		if((frmTrans.TranPurchas[0].checked==false) && (frmTrans.TranPurchas[1].checked==false))
		{			
			document.getElementById("STranPurchas").innerHTML = "<font color=red>Please activate / de-activate the user</font>"
		}
		else
		{
			if(frmTrans.TranPurchas[0].checked==true)
				Para=Para + "&TranPurchas=1"
			else
				Para=Para + "&TranPurchas=0"
			document.getElementById("STranPurchas").innerHTML = ""
		}
		if((frmTrans.TranRapo[0].checked==false) && (frmTrans.TranRapo[1].checked==false))
		{
			document.getElementById("STranRapo").innerHTML = "<font color=red>Please activate / de-activate the user</font>"
		}
		else
		{
			if(frmTrans.TranRapo[0].checked==true)
				Para=Para + "&TranRapo=1"
			else
				Para=Para + "&TranRapo=0"
			document.getElementById("STranRapo").innerHTML = ""
		}
		if((frmTrans.TranLoyalty[0].checked==false) && (frmTrans.TranLoyalty[1].checked==false))
		{
			document.getElementById("STranLoyalty").innerHTML = "<font color=red>Please activate / de-activate the user</font>"
		}
		else
		{
			if(frmTrans.TranLoyalty[0].checked==true)
				Para=Para + "&TranLoyalty=1"
			else
				Para=Para + "&TranLoyalty=0"
			document.getElementById("STranLoyalty").innerHTML = ""
		}
		if((frmTrans.TranCredt[0].checked==false) && (frmTrans.TranCredt[1].checked==false))
		{
			document.getElementById("STranCredt").innerHTML = "<font color=red>Please activate / de-activate the user</font>"
		}
		else
		{
			if(frmTrans.TranCredt[0].checked==true)
				Para=Para + "&TranCredt=1"
			else
				Para=Para + "&TranCredt=0"
			document.getElementById("STranCredt").innerHTML = ""
		}
		if((frmTrans.TranChkCall[0].checked==false) && (frmTrans.TranChkCall[1].checked==false))
		{
			document.getElementById("STranChkCall").innerHTML = "<font color=red>Please activate / de-activate the user</font>"
		}
		else
		{
			if(frmTrans.TranChkCall[0].checked==true)
				Para=Para + "&TranChkCall=1"
			else
				Para=Para + "&TranChkCall=0"
			document.getElementById("STranChkCall").innerHTML = ""
		}
		if((frmTrans.TranSysInt[0].checked==false) && (frmTrans.TranSysInt[1].checked==false))
		{
			document.getElementById("STranSysInt").innerHTML = "<font color=red>Please activate / de-activate the user</font>"
		}
		else
		{
			if(frmTrans.TranSysInt[0].checked==true)
				Para=Para + "&TranSysInt=1"
			else
				Para=Para + "&TranSysInt=0"
			document.getElementById("STranSysInt").innerHTML = ""
		}
		//alert(Para)	
		objXMLHttpRequest.onreadystatechange=addTran_Output;
		var Url = "DealerTrans_srv.asp"; //Url of the file in the server.......
		objXMLHttpRequest.open("POST",Url,true);
		objXMLHttpRequest.setRequestHeader("Host","www.lookmansecurity.com");
		objXMLHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		objXMLHttpRequest.setRequestHeader("Content-Length","12");
		objXMLHttpRequest.send(Para); //Data - to be sent to the server......
		//document.getElementById("submitBtn").disabled = true;
	}
	else
		return false;
}
   

function SubmtCriter()
{
	Para = GetPara()
	
	var Exp = 0,Loyal = 0,Purch = 0,Rapo = 0,Whom = 0,Credt = 0,Crday = 0,Call = 0,SysInt = 0,Imp = 0,Compet= 0,Infra= 0,Repet= 0
	var Activ= 0,Branch= 0,Client= 0,Prod= 0,Brand= 0,AliIds= 0,Deal= 0,Disp = 0,PricCon = 0,BrOthr = 0
	if(Para)
	{
		if((frmTrans.TranExp[0].checked==false) && (frmTrans.TranExp[1].checked==false)  && (frmTrans.TranExp[2].checked==false) && (frmTrans.TranExp[3].checked==false))
		{
			document.getElementById("STranExp").innerHTML = "<font color=red>Please choose any option</font>"
			 Exp = 0
		}
		else
		{
			if(frmTrans.TranExp[0].checked==true)
				Para=Para + "&TranExp=L"
			else if(frmTrans.TranExp[1].checked==true)
				Para=Para + "&TranExp=A"
			else if(frmTrans.TranExp[2].checked==true)
				Para=Para + "&TranExp=G"
			else if(frmTrans.TranExp[3].checked==true)
				Para=Para + "&TranExp=NA"
			document.getElementById("STranExp").innerHTML = ""
			 Exp = 1
		}
		
		if((frmTrans.TranLoyalty[0].checked==false) && (frmTrans.TranLoyalty[1].checked==false) && (frmTrans.TranLoyalty[2].checked==false) && (frmTrans.TranLoyalty[3].checked==false))
		{
			document.getElementById("STranLoyalty").innerHTML = "<font color=red>Please choose any option</font>"
			Loyal = 0
		}
		else
		{
			if(frmTrans.TranLoyalty[0].checked==true)
				Para=Para + "&TranLoyalty=F"
			else if(frmTrans.TranLoyalty[1].checked==true)
				Para=Para + "&TranLoyalty=G"
			else if(frmTrans.TranLoyalty[2].checked==true)
				Para=Para + "&TranLoyalty=E"
			else if(frmTrans.TranLoyalty[3].checked==true)
				Para=Para + "&TranLoyalty=NA"
			document.getElementById("STranLoyalty").innerHTML = ""
			Loyal = 1
		}
		
		if((frmTrans.TranPurchas[0].checked==false) && (frmTrans.TranPurchas[1].checked==false) && (frmTrans.TranPurchas[2].checked==false) && (frmTrans.TranPurchas[3].checked==false))
		{			
			document.getElementById("STranPurchas").innerHTML = "<font color=red>Please choose any option</font>"
			 Purch = 0
		}
		else
		{
			if(frmTrans.TranPurchas[0].checked==true)
				Para=Para + "&TranPurchas=L"
			else if(frmTrans.TranPurchas[1].checked==true)
				Para=Para + "&TranPurchas=A"
			else if(frmTrans.TranPurchas[2].checked==true)
				Para=Para + "&TranPurchas=G"
			else if(frmTrans.TranPurchas[3].checked==true)				
				Para=Para + "&TranPurchas=NA"
			document.getElementById("STranPurchas").innerHTML = ""
			Purch = 1
		}
		if((frmTrans.TranRapo[0].checked==false) && (frmTrans.TranRapo[1].checked==false) && (frmTrans.TranRapo[2].checked==false) && (frmTrans.TranRapo[3].checked==false))
		{
			document.getElementById("STranRapo").innerHTML = "<font color=red>Please choose any option</font>"
			Rapo = 0
		}
		else
		{
			if(frmTrans.TranRapo[0].checked==true)
				Para=Para + "&TranRapo=F"
			else if(frmTrans.TranRapo[1].checked==true)
				Para=Para + "&TranRapo=G"
			else if(frmTrans.TranRapo[2].checked==true)
				Para=Para + "&TranRapo=E"
			else if(frmTrans.TranRapo[3].checked==true)
				Para=Para + "&TranRapo=NA"
			document.getElementById("STranRapo").innerHTML = ""
			Rapo = 1
		}
		
		//alert("in")
		if(document.getElementById("TranRapoWhom").value != "")
		{
			Para = Para + "&TranRapoWhom=" + encodeURIComponent(document.getElementById("TranRapoWhom").value);
		}
			
		
		
		if((frmTrans.TranCredt[0].checked==false) && (frmTrans.TranCredt[1].checked==false) && (frmTrans.TranCredt[2].checked==false))
		{
			document.getElementById("STranCredt").innerHTML = "<font color=red>Please choose any option</font>"
			Credt = 0
		}
		else
		{
			if(frmTrans.TranCredt[0].checked==true)
				Para=Para + "&TranCredt=Y" //STranRapoWhom
			else if(frmTrans.TranCredt[1].checked==true)
				Para=Para + "&TranCredt=N" //STranRapoWhom
			else if(frmTrans.TranCredt[2].checked==true)
				Para=Para + "&TranCredt=NA"
			document.getElementById("STranCredt").innerHTML = ""
			Credt = 1
		}
		//document.getElementById("CrdtDiv").style.display = "block";
		if(document.getElementById("TranCrDays"))
		{
			if(document.getElementById("TranCrDays").value != "")
				Para=Para + "&TranCrDays=" + encodeURIComponent(document.getElementById("TranCrDays").value);
			else
				Para=Para + "&TranCrDays=" + "";
		}
		
		if((frmTrans.TranChkCall[0].checked==false) && (frmTrans.TranChkCall[1].checked==false) && (frmTrans.TranChkCall[2].checked==false))
		{
			document.getElementById("STranChkCall").innerHTML = "<font color=red>Please choose any option</font>"
			Call = 0
		}
		else
		{
			if(frmTrans.TranChkCall[0].checked==true)
				Para=Para + "&TranChkCall=Y"
			else if(frmTrans.TranChkCall[1].checked==true)
				Para=Para + "&TranChkCall=N"
			else if(frmTrans.TranChkCall[2].checked==true)
				Para=Para + "&TranChkCall=NA"
			document.getElementById("STranChkCall").innerHTML = ""
			Call = 1
		}
		
		if((frmTrans.TranSysInt[0].checked==false) && (frmTrans.TranSysInt[1].checked==false) && (frmTrans.TranSysInt[2].checked==false) && (frmTrans.TranSysInt[3].checked==false))
		{
			document.getElementById("STranSysInt").innerHTML = "<font color=red>Please choose any option</font>"
			SysInt = 0
		}
		else
		{
			if(frmTrans.TranSysInt[0].checked==true)
				Para=Para + "&TranSysInt=S"
			else if(frmTrans.TranSysInt[1].checked==true)
				Para=Para + "&TranSysInt=D"
			else if(frmTrans.TranSysInt[2].checked==true)
				Para=Para + "&TranSysInt=B"
			else if(frmTrans.TranSysInt[3].checked==true)
				Para=Para + "&TranSysInt=NA"
			document.getElementById("STranSysInt").innerHTML = ""
			SysInt = 1
		}
		
		if((frmTrans.TranImp[0].checked==false) && (frmTrans.TranImp[1].checked==false) && (frmTrans.TranImp[2].checked==false) && (frmTrans.TranImp[3].checked==false) && (frmTrans.TranImp[4].checked==false))
		{
			document.getElementById("STranImp").innerHTML = "<font color=red>Please choose any option</font>"
			Imp = 0
		}
		else
		{
			if(frmTrans.TranImp[0].checked==true)
				Para=Para + "&TranImp=CCTV"
			else if(frmTrans.TranImp[1].checked==true)
				Para=Para + "&TranImp=POC"
			else if(frmTrans.TranImp[2].checked==true)
				Para=Para + "&TranImp=OTC"
			else if(frmTrans.TranImp[3].checked==true)
				Para=Para + "&TranImp=NSI"
			else if(frmTrans.TranImp[4].checked==true)
				Para=Para + "&TranImp=NA"
			document.getElementById("STranImp").innerHTML = ""
			Imp = 1
		}
		
		if((frmTrans.TranCompet[0].checked==false) && (frmTrans.TranCompet[1].checked==false) && (frmTrans.TranCompet[2].checked==false))
		{
			document.getElementById("STranCompet").innerHTML = "<font color=red>Please choose any option</font>"
			Compet= 0
		}
		else
		{
			if(frmTrans.TranCompet[0].checked==true)
				Para=Para + "&TranCompet=Y"
			else if(frmTrans.TranCompet[1].checked==true)
				Para=Para + "&TranCompet=N"
			else if(frmTrans.TranCompet[2].checked==true)
				Para=Para + "&TranCompet=NA"
			document.getElementById("STranCompet").innerHTML = ""
			Compet = 1
		}	
		
		
		if((frmTrans.TranInfra[0].checked==false) && (frmTrans.TranInfra[1].checked==false) && (frmTrans.TranInfra[2].checked==false) && (frmTrans.TranInfra[3].checked==false))
		{
			document.getElementById("STranInfra").innerHTML = "<font color=red>Please choose any option</font>"
			Infra= 0
		}
		else
		{
			if(frmTrans.TranInfra[0].checked==true)
				Para=Para + "&TranInfra=F"
			else if(frmTrans.TranInfra[1].checked==true)
				Para=Para + "&TranInfra=G"
			else if(frmTrans.TranInfra[2].checked==true)
				Para=Para + "&TranInfra=E"
			else if(frmTrans.TranInfra[3].checked==true)
				Para=Para + "&TranInfra=NA"
			document.getElementById("STranInfra").innerHTML = ""
			Infra= 1
		}
		
		if((frmTrans.TranRepet[0].checked==false) && (frmTrans.TranRepet[1].checked==false) && (frmTrans.TranRepet[2].checked==false) && (frmTrans.TranRepet[3].checked==false))
		{
			document.getElementById("STranRepet").innerHTML = "<font color=red>Please choose any option</font>"
			Repet= 0
		}
		else
		{
			if(frmTrans.TranRepet[0].checked==true)
				Para=Para + "&TranRepet=F"
			else if(frmTrans.TranRepet[1].checked==true)
				Para=Para + "&TranRepet=G"
			else if(frmTrans.TranRepet[2].checked==true)
				Para=Para + "&TranRepet=E"
			else if(frmTrans.TranRepet[3].checked==true)
				Para=Para + "&TranRepet=NA"
			document.getElementById("STranRepet").innerHTML = ""
			Repet= 1
		}
		
		if((frmTrans.TranActivity[0].checked==false) && (frmTrans.TranActivity[1].checked==false) && (frmTrans.TranActivity[2].checked==false) && (frmTrans.TranActivity[3].checked==false) && (frmTrans.TranActivity[4].checked==false))
		{
			document.getElementById("STranActivity").innerHTML = "<font color=red>Please choose any option</font>"
			Activ= 0
		}
		else
		{
			if(frmTrans.TranImp[0].checked==true)
				Para=Para + "&TranActivity=AI"
			else if(frmTrans.TranActivity[1].checked==true)
				Para=Para + "&TranActivity=SA"
			else if(frmTrans.TranActivity[2].checked==true)
				Para=Para + "&TranActivity=NI"
			else if(frmTrans.TranActivity[3].checked==true)
				Para=Para + "&TranActivity=EU"
			else if(frmTrans.TranActivity[4].checked==true)
				Para=Para + "&TranActivity=NA"
			document.getElementById("STranActivity").innerHTML = ""
			Activ= 1
		}
		
		if(document.getElementById("TranBranch").value =="")
		{
			document.getElementById("STranBranch").innerHTML = "<font color=red>Please Fill in</font>"
			Branch= 0
		}
		else
		{
			Para=Para + "&TranBranch=" + encodeURIComponent(document.getElementById("TranBranch").value)
			document.getElementById("STranBranch").innerHTML = ""
			Branch= 1
		}
		var the_inputs;
		var TranClient = "" 
		the_inputs = document.getElementsByTagName("input");
		for(ivar=0;ivar<the_inputs.length;ivar++)
		{
			if(the_inputs[ivar].type == "checkbox")
			{				
				if(the_inputs[ivar].id == "TranClientId")
				{
					if(the_inputs[ivar].checked == true)
					{		
						if(TranClient == "")
							TranClient = the_inputs[ivar].value;
						else
							TranClient = TranClient + "," + the_inputs[ivar].value;									
					}
				}				
			}
		}	
		Para = Para + "&TranClient=" + encodeURIComponent(TranClient);
		
		var the_inputsCl;
		var TranProd = "" 
		the_inputsCl = document.getElementsByTagName("input");
		for(ivarCl=0;ivarCl<the_inputsCl.length;ivarCl++)
		{
			if(the_inputsCl[ivarCl].type == "checkbox")
			{				
				if(the_inputsCl[ivarCl].id == "TranProdId")
				{
					if(the_inputsCl[ivarCl].checked == true)
					{		
						if(TranProd == "")
							TranProd = the_inputsCl[ivarCl].value;
						else
							TranProd = TranProd + "," + the_inputsCl[ivarCl].value;
							//document.getElementById("PgId").value = TranClient								
					}
				}				
			}
		}	
		Para = Para + "&TranProd=" + encodeURIComponent(TranProd);
		
		var the_inputsBr;
		var TranBrand = "" 
		the_inputsBr = document.getElementsByTagName("input");
		for(ivarBr=0;ivarBr<the_inputsBr.length;ivarBr++)
		{
			if(the_inputsBr[ivarBr].type == "checkbox")
			{				
				if(the_inputsBr[ivarBr].id == "TranBrand")
				{
					if(the_inputsBr[ivarBr].checked == true)
					{		
						if(TranBrand == "")
							TranBrand = the_inputsBr[ivarBr].value;
						else
							TranBrand = TranBrand + "," + the_inputsBr[ivarBr].value;									
					}
				}				
			}
		}	
		Para = Para + "&TranBrand=" + encodeURIComponent(TranBrand);
		
		var the_inputsAli;
		var TranAliIds = "" 
		the_inputsAli = document.getElementsByTagName("input");
		for(ivarAl=0;ivarAl<the_inputsAli.length;ivarAl++)
		{
			if(the_inputsAli[ivarAl].type == "checkbox")
			{				
				if(the_inputsAli[ivarAl].id == "TranAliId")
				{
					if(the_inputsAli[ivarAl].checked == true)
					{		
						if(TranAliIds == "")
							TranAliIds = the_inputsAli[ivarAl].value;
						else
							TranAliIds = TranAliIds + "," + the_inputsAli[ivarAl].value;
							//document.getElementById("PgId").value = TranClient								
					}
				}				
			}
		}	
		Para = Para + "&TranAliIds=" + encodeURIComponent(TranAliIds);
		
		if(document.getElementById("TranAliDeal").value =="")
		{
			document.getElementById("STranAliDeal").innerHTML = "<font color=red>Should not be blank</font>"
		}
		else
		{
			Para=Para + "&TranAliDeal=" + encodeURIComponent(document.getElementById("TranAliDeal").value)
			document.getElementById("STranAliDeal").innerHTML = ""
		}
		
		if(document.getElementById("TranAliDisp").value =="")
		{
			document.getElementById("STranAliDisp").innerHTML = "<font color=red>Should not be blank</font>"
		}
		else
		{
			Para=Para + "&TranAliDisp=" + encodeURIComponent(document.getElementById("TranAliDisp").value)
			document.getElementById("STranAliDisp").innerHTML = ""
		}
		
		if((frmTrans.TranPricCon[0].checked==false) && (frmTrans.TranPricCon[1].checked==false) && (frmTrans.TranPricCon[2].checked==false) && (frmTrans.TranPricCon[3].checked==false))
		{
			document.getElementById("STranPricCon").innerHTML = "<font color=red>Please choose any option</font>"
			PricCon = 0		
		}
		else
		{
			if(frmTrans.TranPricCon[0].checked==true)
				Para=Para + "&TranPricCon=PC"
			else if(frmTrans.TranPricCon[1].checked==true)
				Para=Para + "&TranPricCon=QC"
			else if(frmTrans.TranPricCon[2].checked==true)
				Para=Para + "&TranPricCon=BC"			
			else if(frmTrans.TranPricCon[3].checked==true)
				Para=Para + "&TranPricCon=NA"
			document.getElementById("STranPricCon").innerHTML = ""
			PricCon = 1		
		}
		
		if(document.getElementById("TranBrOthr").value =="")
		{
			document.getElementById("STranBrOthr").innerHTML = "<font color=red>Please Fill in</font>"		
		}
		else
		{
			Para=Para + "&TranBrOthr=" + encodeURIComponent(document.getElementById("TranBrOthr").value)
			document.getElementById("STranBrOthr").innerHTML = ""
		}
		//Para = encodeURIComponent(Para)
		//Para = encodeURIComponent(Para)
		//alert(Para)
		//document.getElementById("tstTran").innerHTML = Para;
		if((frmTrans.TranAPSA[0].checked==false) && (frmTrans.TranAPSA[1].checked==false))
		{
			document.getElementById("STranAPSA").innerHTML = "<font color=red>Please choose any option</font>"
			//apsa = 0
		}
		else
		{
			if(frmTrans.TranAPSA[0].checked==true)
				Para=Para + "&TranAPSA=Y"
			else if(frmTrans.TranAPSA[1].checked==true)
				Para=Para + "&TranAPSA=N"			
			document.getElementById("STranAPSA").innerHTML = ""
			//apsa = 1
		}
		
		if(Exp==0||Loyal==0||Purch==0||Rapo==0||Credt==0||Call==0||SysInt==0||Imp==0||Compet==0||Infra==0||Repet==0||Activ==0||PricCon==0)
		{
			alert("Some of the fields are missing from your entries")
			return false;
		}
		{
			objXMLHttpRequest.onreadystatechange=addTran_Output;
			var Url = "DealerTrans_srv.asp"; //Url of the file in the server.......
			objXMLHttpRequest.open("POST",Url,true);
			objXMLHttpRequest.setRequestHeader("Host","www.lookmansecurity.com");
			objXMLHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
			objXMLHttpRequest.setRequestHeader("Content-Length","12");
			objXMLHttpRequest.send(Para);//Data - to be sent to the server......
			//document.getElementById("submitBtn").disabled = true;

		}
	}
	else
		return false;
}
   
function addTran_Output()
{
	if(objXMLHttpRequest.readyState == "4" )	
	{
		var	MsgStr = objXMLHttpRequest.responseText.split("*");
	//document.getElementById("tstTran").innerHTML = objXMLHttpRequest.responseText	
			if(parseInt(MsgStr[1])==1)
			{
				document.location.href="Dealers.asp?output=1"
			}
			else if(parseInt(MsgStr[1])==2)
			{
				document.location.href="Dealers.asp?output=2"
			}		
			else
			{
				document.location.href="Dealers.asp?output=5"				
			}
			var browser=navigator.appName
		if (browser=="Netscape")
		{
			var requestTimer = setTimeout(function() { objXMLHttpRequest.abort(); }, 0);
			clearTimeout(requestTimer);
		}
		else
  		{objXMLHttpRequest.abort()}
				
	}
}

function ViewCriteria(trn)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.target="_blank"
	Form.id = "frmSrch";

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "DealrId";
	Input.id = "DealrId";
	Input.value = trn;
	Form.appendChild(Input);
	
	document.body.appendChild(Form);
	Form.action = "ViewTrans.asp";
	//Form.target = "foobar:width={window.screen.width/2},height={myHeight},scrollbars,{(isResizable)?'resizable':''},status"
	Form.target = "foobar:width={320},height={520},scrollbars,{(isResizable)?'resizable':''},status"
	
	Form.method="post"	
	Form.onSubmit = createTarget(Form);
	Form.submit();
}

function GetDivCr(fld)
{
	if (fld == "y")
		document.getElementById("CrdtDiv").style.display = "block";
	else if(fld == "n")
		document.getElementById("CrdtDiv").style.display = "none";
}

function GetAlias(id)
{
	var DealrId=id;
	var AlisId = "";
	Para ="DealrId=" + DealrId + "&AlisId=" + AlisId
	objXMLHttpRequest.onreadystatechange=GetAlias_OutPut;
	var Url = "AddAlias.asp"; //Url of the file in the server.......
	objXMLHttpRequest.open("POST",Url,true);
	objXMLHttpRequest.setRequestHeader("Host","www.lookmansecurity.com");
	objXMLHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	objXMLHttpRequest.setRequestHeader("Content-Length","12");
	objXMLHttpRequest.send(Para); //Data - to be sent to the server......	
}

function GetAlias_OutPut()
{
	if (objXMLHttpRequest.readyState == 4) 
	{
		if (objXMLHttpRequest.status == 200) 
		{
		document.getElementById("AlisDet").innerHTML=objXMLHttpRequest.responseText
		objXMLHttpRequest.abort();
		} 
		
		else 
		{
		alert("Problem with the server response " + objXMLHttpRequest.statusText);
		}
		
		var browser=navigator.appName
		if (browser=="Netscape")
		{
			var requestTimer = setTimeout(function() { objXMLHttpRequest.abort(); }, 0);
			clearTimeout(requestTimer);
		}
		else
  		{
		objXMLHttpRequest.abort()
		}
	}
	
	else
	{
	document.getElementById("AlisDet").innerHTML = "<font face='verdana' size='2'><em>Loading...</em></font>"
	}
}

function GetProds(id)
{
	var DealrId=id;
	var TranProdId = "";
	Para ="DealrId=" + DealrId + "&TranProdId=" + TranProdId
	objXMLHttpRequest.onreadystatechange=GetProds_OutPut;
	var Url = "AddTranProd.asp"; //Url of the file in the server.......
	objXMLHttpRequest.open("POST",Url,true);
	objXMLHttpRequest.setRequestHeader("Host","www.lookmansecurity.com");
	objXMLHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	objXMLHttpRequest.setRequestHeader("Content-Length","12");
	objXMLHttpRequest.send(Para); //Data - to be sent to the server......	
}

function GetProds_OutPut()
{
	if (objXMLHttpRequest.readyState == 4) 
	{
		if (objXMLHttpRequest.status == 200) 
		{
		document.getElementById("ProdDet").innerHTML=objXMLHttpRequest.responseText
		objXMLHttpRequest.abort();
		} 
		
		else 
		{
		alert("Problem with the server response " + objXMLHttpRequest.statusText);
		}
		
		var browser=navigator.appName
		if (browser=="Netscape")
		{
			var requestTimer = setTimeout(function() { objXMLHttpRequest.abort(); }, 0);
			clearTimeout(requestTimer);
		}
		else
  		{
		objXMLHttpRequest.abort()
		}
	}
	
	else
	{
	document.getElementById("ProdDet").innerHTML = "<font face='verdana' size='2'><em>Loading...</em></font>"
	}
}
function GetClient(id)
{
	var DealrId=id;
	var TranClientId = "";
	Para ="DealrId=" + DealrId + "&TranClientId=" + TranClientId
	objXMLHttpRequest.onreadystatechange=GetClient_OutPut;
	var Url = "AddTranClient.asp"; //Url of the file in the server.......
	objXMLHttpRequest.open("POST",Url,true);
	objXMLHttpRequest.setRequestHeader("Host","www.lookmansecurity.com");
	objXMLHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	objXMLHttpRequest.setRequestHeader("Content-Length","12");
	objXMLHttpRequest.send(Para); //Data - to be sent to the server......	
}

function GetClient_OutPut()
{
	if (objXMLHttpRequest.readyState == 4) 
	{
		if (objXMLHttpRequest.status == 200) 
		{
		document.getElementById("ClientDet").innerHTML=objXMLHttpRequest.responseText
		objXMLHttpRequest.abort();
		} 
		
		else 
		{
		alert("Problem with the server response " + objXMLHttpRequest.statusText);
		}
		
		var browser=navigator.appName
		if (browser=="Netscape")
		{
			var requestTimer = setTimeout(function() { objXMLHttpRequest.abort(); }, 0);
			clearTimeout(requestTimer);
		}
		else
  		{
		objXMLHttpRequest.abort()
		}
	}
	
	else
	{
	document.getElementById("ClientDet").innerHTML = "<font face='verdana' size='2'><em>Loading...</em></font>"
	}
}