// 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 jsInstr(Str,Wrd)
{
	for(i=0;i<=Str.length;i++)
	{
		if(Str.substring(i, i+1) == Wrd)
		{
			return i+1;
		}
	}
	return 0;
}

function Validation_SpnMsg()

{//alert("in valid ")
	ObjNos = document.getElementsByTagName("LABEL").length 
	Obj = document.getElementsByTagName("LABEL")
	Flag = 0;
//alert("in valid 1")
	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)
			{//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==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.sipacademyindia.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])==1)
		{
		document.location.href ="home.asp";
		}
		objXMLHttpRequest.abort();

	}
  }  
  
  //---------------add / modify 
   function addadmin()
  {	
	Para = GetPara()
	if (Para)
	{
	//	alert(Para)
		objXMLHttpRequest.onreadystatechange=addadmin_output;
		var Url = "Admin_Srv.asp"; //Url of the file in the server.......
		objXMLHttpRequest.open("POST",Url,true);
		objXMLHttpRequest.setRequestHeader("Host","www.sipacademyindia.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 addadmin_output()
  {
	if(objXMLHttpRequest.readyState == "4" )	
	{
var	MsgStr = objXMLHttpRequest.responseText.split("*");
//document.getElementById("a").innerHTML = objXMLHttpRequest.responseText

			if(parseInt(MsgStr[1])==1)
			{
				document.location.href="admin.asp?output=1"
			}
			else if(parseInt(MsgStr[1])==2)
			{
				document.location.href="admin.asp?output=2"
			}
		
			else
			{
				document.location.href="admin.asp?output=5"				
			}	
	
	}
  }
  
 //-----------------modify 
  //-------- Modify 

function modiadmin(Id)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "AdId";
	Input.id = "AdId";
	Input.value = Id;
	Form.appendChild(Input);

	document.body.appendChild(Form);
	Form.action = "AddAdmin.asp";
	Form.method="post"
	Form.submit();
}


 //------------delete admin
   function Delete_AOnclick(Id){
	var VarChoic = confirm("Are you sure!.. want to delete");
	if(VarChoic)
	{
		Para=GetPara() + '&Id='+Id
		//Para='Id='+Id +'&dr=' +Id11 +'&dr=' +Id11
		//alert(Para)
  		objXMLHttpRequest.onreadystatechange=DelAClientOutput;
		var Url = "DelData.asp"; 
		objXMLHttpRequest.open("POST",Url,true);
		objXMLHttpRequest.setRequestHeader("Host","www.sipacademyindia.com");
		objXMLHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		objXMLHttpRequest.setRequestHeader("Content-Length","12");
		objXMLHttpRequest.send(Para);
	}	
  }
  
  function DelAClientOutput()
  {
	if(objXMLHttpRequest.readyState == "4" )	
	{
	//document.getElementById("a").innerHTML = objXMLHttpRequest.responseText
		var	MsgStr = objXMLHttpRequest.responseText.split("*");
			if(parseInt(MsgStr[1])==4)
			{
				document.location.href="admin.asp?output=1"
			}
			else if(parseInt(MsgStr[1])==2)
			{
				document.location.href="admin.asp?output=5"
			}
			else if(parseInt(MsgStr[1])==3)
			{
				document.location.href="admin.asp?output=3"
			}			
			else if(parseInt(MsgStr[1])==0)
			{
				document.location.href="admin.asp?output=4"
			}			
			else
			{
				document.location.href="admin.asp?output=5"				
			}

	}
  } 
  

//-------------------------------------------Product-------------------------------------------------

function modiproduct(pdtid)
{
	Form = document.createElement("form");
	Form.name = "frmPdt";
	Form.id = "frmPdt";
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "PrdtId";
	Input.id = "PrdtId";
	Input.value = pdtid;
	Form.appendChild(Input);

	document.body.appendChild(Form);
	Form.action = "AddProduct.asp";
	Form.method="post"
	Form.submit();
}
//----------------------------delete product----------------------------------------------------------------
 function prdtDelclick(Id){
	var VarChoic = confirm("Are you sure!.. want to delete");
	if(VarChoic)
	{
		Para=GetPara() + '&Id='+Id
  		objXMLHttpRequest.onreadystatechange = prdtDelclick_Output;
		var Url = "DelData.asp"; 
		objXMLHttpRequest.open("POST",Url,true);
		objXMLHttpRequest.setRequestHeader("Host","www.sipacademyindia.com");
		objXMLHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		objXMLHttpRequest.setRequestHeader("Content-Length","12");
		objXMLHttpRequest.send(Para);
	}	
  }
  
  function prdtDelclick_Output()
  {
	if(objXMLHttpRequest.readyState == "4" )	
	{
		var	MsgStr = objXMLHttpRequest.responseText.split("*");
			if(parseInt(MsgStr[0])==1)
			{
				document.location.href="Product.asp?output=1"
			}
			else if(parseInt(MsgStr[0])==2)
			{
				document.location.href="Product.asp?output=5"
			}
			else if(parseInt(MsgStr[0])==0)
			{
				document.location.href="Product.asp?output=4"
			}			
			else
			{
				document.location.href="Product.asp?output=5"				
			}

	}
  } 
  
  
  //===============================  Admin ======================================
 //---------------add / modify 
   function AddStates()
  {	
	Para = GetPara()
	if (Para)
	{
		objXMLHttpRequest.onreadystatechange=AddStates_output;
		var Url = "states_Srv.asp"; //Url of the file in the server.......
		objXMLHttpRequest.open("POST",Url,true);
		objXMLHttpRequest.setRequestHeader("Host","www.sipacademyindia.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 AddStates_output()
  {
	if(objXMLHttpRequest.readyState == "4" )	
	{
var	MsgStr = objXMLHttpRequest.responseText.split("*");
//document.getElementById("a").innerHTML = objXMLHttpRequest.responseText
			if(parseInt(MsgStr[1])==1)
			{
				document.location.href="states.asp?output=1"
			}
			else if(parseInt(MsgStr[1])==2)
			{
				document.location.href="states.asp?output=2"
			}
			else if(parseInt(MsgStr[1])==3)
			{
				document.location.href="states.asp?output=3"
			}			
			else
			{
				document.location.href="states.asp?output=2"							
			}	
	}
  }
  
 //-----------------modify 
  //-------- Modify 

function modistate(Id)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "StId";
	Input.id = "StId";
	Input.value = Id;
	Form.appendChild(Input);

	document.body.appendChild(Form);
	Form.action = "addstates.asp";
	Form.method="post"
	Form.submit();
}


 //------------delete state
   function Delete_StateOnclick(Id){
	var VarChoic = confirm("Are you sure!.. want to delete");
	if(VarChoic)
	{
		Para=GetPara() + '&Id='+Id
		//alert(Para)
  		objXMLHttpRequest.onreadystatechange=DelStateClientOutput;
		var Url = "DelData.asp"; 
		objXMLHttpRequest.open("POST",Url,true);
		objXMLHttpRequest.setRequestHeader("Host","www.sipacademyindia.com");
		objXMLHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		objXMLHttpRequest.setRequestHeader("Content-Length","12");
		objXMLHttpRequest.send(Para);
	}	
  }
  
  function DelStateClientOutput()
  {
	if(objXMLHttpRequest.readyState == "4" )	
	{
		var	MsgStr = objXMLHttpRequest.responseText.split("*");
			if(parseInt(MsgStr[1])==4)
			{
				document.location.href="states.asp?output=1"
			}
			else if(parseInt(MsgStr[1])==2)
			{
				document.location.href="states.asp?output=5"
			}
			else if(parseInt(MsgStr[1])==0)
			{
				document.location.href="states.asp?output=4"
			}			
			else
			{
				document.location.href="states.asp?output=5"				
			}


	}
  } 
  
  //---------------add / modify 
   function AddCity()
  {	
	Para = GetPara()
	if (Para)
	{
		objXMLHttpRequest.onreadystatechange=addcity_output;
		var Url = "City_Srv.asp"; //Url of the file in the server.......
		objXMLHttpRequest.open("POST",Url,true);
		objXMLHttpRequest.setRequestHeader("Host","www.sipacademyindia.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 addcity_output()
  {
	if(objXMLHttpRequest.readyState == "4" )	
	{
var	MsgStr = objXMLHttpRequest.responseText.split("*");
//document.getElementById("a").innerHTML = objXMLHttpRequest.responseText
			if(parseInt(MsgStr[1])==1)
			{
				document.location.href="City.asp?output=1"
			}
			else if(parseInt(MsgStr[1])==2)
			{
				document.location.href="City.asp?output=2"
			}
			else if(parseInt(MsgStr[1])==3)
			{
				document.location.href="City.asp?output=3"
			}			
			else
			{
				document.location.href="City.asp?output=2"							
			}	
	}
  }
  
 //-----------------modify 
  //-------- Modify 

  //-------- Modify 

function modicity(Id)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "CityId";
	Input.id = "CityId";
	Input.value = Id;
	Form.appendChild(Input);

	document.body.appendChild(Form);
	Form.action = "AddCity.asp";
	Form.method="post"
	Form.submit();
}



 //------------delete admin
   function Delete_CityOnclick(Id){
	var VarChoic = confirm("Are you sure!.. want to delete");
	if(VarChoic)
	{
		Para=GetPara() + '&Id='+Id
  		objXMLHttpRequest.onreadystatechange=DelCityOutput;
		var Url = "DelData.asp"; 
		objXMLHttpRequest.open("POST",Url,true);
		objXMLHttpRequest.setRequestHeader("Host","www.sipacademyindia.com");
		objXMLHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		objXMLHttpRequest.setRequestHeader("Content-Length","12");
		objXMLHttpRequest.send(Para);
	}	
  }
  
  function DelCityOutput()
  {
	if(objXMLHttpRequest.readyState == "4" )	
	{
		var	MsgStr = objXMLHttpRequest.responseText.split("*");
			if(parseInt(MsgStr[1])==4)
			{
				document.location.href="City.asp?output=1"
			}
			else if(parseInt(MsgStr[1])==2)
			{
				document.location.href="City.asp?output=5"
			}
			else if(parseInt(MsgStr[1])==0)
			{
				document.location.href="City.asp?output=4"
			}			
			else
			{
				document.location.href="City.asp?output=5"				
			}
	}
  } 

 //----------------------------News-----------------------------------------------------------------
  
  //---------------add / modify 
   function AddNews()
  {	
	Para = GetPara()
	if (Para)
	{
		//alert(Para)
		objXMLHttpRequest.onreadystatechange=AddNews_output;
		var Url = "News_Srv.asp"; //Url of the file in the server.......
		objXMLHttpRequest.open("POST",Url,true);
		objXMLHttpRequest.setRequestHeader("Host","www.sipacademyindia.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 AddNews_output()
  {
	if(objXMLHttpRequest.readyState == "4" )	
	{
var	MsgStr = objXMLHttpRequest.responseText.split("*");
document.getElementById("a").innerHTML = objXMLHttpRequest.responseText
			if(parseInt(MsgStr[1])==1)
			{
				document.location.href="News.asp?output=1"
			}
			else if(parseInt(MsgStr[1])==2)
			{
				document.location.href="News.asp?output=2"
			}
			else if(parseInt(MsgStr[1])==3)
			{
				document.location.href="News.asp?output=3"
			}			
			else
			{
				document.location.href="News.asp?output=2"							
			}	
	}
  }
  
   //-------- Modify 

function modiNews(Id)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "NwId";
	Input.id = "NwId";
	Input.value = Id;
	Form.appendChild(Input);

	document.body.appendChild(Form);
	Form.action = "AddNews.asp";
	Form.method="post"
	Form.submit();
}

//------------DELETE
   function Delete_NewsOnclick(Id){
	var VarChoic = confirm("Are you sure!.. want to delete");
	if(VarChoic)
	{
		Para=GetPara() + '&Id='+Id
  		objXMLHttpRequest.onreadystatechange=Delete_NewsOnclick_Output;
		var Url = "DelData.asp"; 
		objXMLHttpRequest.open("POST",Url,true);
		objXMLHttpRequest.setRequestHeader("Host","www.sipacademyindia.com");
		objXMLHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		objXMLHttpRequest.setRequestHeader("Content-Length","12");
		objXMLHttpRequest.send(Para);
	}	
  }
  
  function Delete_NewsOnclick_Output()
  {
	if(objXMLHttpRequest.readyState == "4" )	
	{
		var	MsgStr = objXMLHttpRequest.responseText.split("*");
			if(parseInt(MsgStr[0])==1)
			{
				document.location.href="News.asp?output=1"
			}
			else if(parseInt(MsgStr[0])==2)
			{
				document.location.href="News.asp?output=5"
			}
			else if(parseInt(MsgStr[0])==0)
			{
				document.location.href="News.asp?output=4"
			}			
			else
			{
				document.location.href="News.asp?output=5"				
			}

	}
  } 

function ViewNews(nid)
{
	Form = document.createElement("form");
	Form.name = "frmNews";
	Form.id = "frmNews";
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "NwId";
	Input.id = "NwId";
	Input.value = nid;
	Form.appendChild(Input);

	document.body.appendChild(Form);
	Form.action = "ViewNews.asp";
	Form.method="post"
	Form.submit();
}

function ViewMedia(nid)
{
	Form = document.createElement("form");
	Form.name = "frmNews";
	Form.id = "frmNews";
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "MedId";
	Input.id = "MedId";
	Input.value = nid;
	Form.appendChild(Input);

	document.body.appendChild(Form);
	Form.action = "ViewMedia.asp";
	Form.method="post"
	Form.submit();
}

  

//===============================  Admin ======================================
 //---------------add / modify 
   function AddTestimon()
  {	
	Para = GetPara()
	if (Para)
	{
		objXMLHttpRequest.onreadystatechange=AddTestimon_output;
		var Url = "Testimon_Srv.asp"; //Url of the file in the server.......
		objXMLHttpRequest.open("POST",Url,true);
		objXMLHttpRequest.setRequestHeader("Host","www.sipacademyindia.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 AddTestimon_output()
  {
	if(objXMLHttpRequest.readyState == "4" )	
	{
var	MsgStr = objXMLHttpRequest.responseText.split("*");
//document.getElementById("a").innerHTML = objXMLHttpRequest.responseText
			if(parseInt(MsgStr[1])==1)
			{
				document.location.href="TestAuthor.asp?output=1"
			}
			else if(parseInt(MsgStr[1])==2)
			{
				document.location.href="TestAuthor.asp?output=2"
			}
			else if(parseInt(MsgStr[1])==3)
			{
				document.location.href="TestAuthor.asp?output=3"
			}			
			else
			{
				document.location.href="TestAuthor.asp?output=2"							
			}	
	}
  }
  
 //-----------------modify 
  //-------- Modify 

function modiAuthor(Id)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "TestId";
	Input.id = "TestId";
	Input.value = Id;
	Form.appendChild(Input);

	document.body.appendChild(Form);
	Form.action = "AddTestimon.asp";
	Form.method="post"
	Form.submit();
}


 //------------delete state
   function Delete_AuthOnclick(Id){
	var VarChoic = confirm("Are you sure!.. want to delete");
	if(VarChoic)
	{
		Para=GetPara() + '&Id='+Id
		//alert(Para)
  		objXMLHttpRequest.onreadystatechange=Delete_AuthOnclickOutput;
		var Url = "DelData.asp"; 
		objXMLHttpRequest.open("POST",Url,true);
		objXMLHttpRequest.setRequestHeader("Host","www.sipacademyindia.com");
		objXMLHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		objXMLHttpRequest.setRequestHeader("Content-Length","12");
		objXMLHttpRequest.send(Para);
	}	
  }
  
  function Delete_AuthOnclickOutput()
  {
	if(objXMLHttpRequest.readyState == "4" )	
	{
		var	MsgStr = objXMLHttpRequest.responseText.split("*");
			if(parseInt(MsgStr[1])==4)
			{
				document.location.href="TestAuthor.asp?output=1"
			}
			else if(parseInt(MsgStr[1])==2)
			{
				document.location.href="TestAuthor.asp?output=5"
			}
			else if(parseInt(MsgStr[1])==0)
			{
				document.location.href="TestAuthor.asp?output=4"
			}			
			else
			{
				document.location.href="TestAuthor.asp?output=5"				
			}


	}
  } 

function navigate(pg,fid)
{
	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);

	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 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.sipacademyindia.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 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.sipacademyindia.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 Search_Stat(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 = "States.asp";
	Form.method="post"
	Form.submit();
}
function Search_Products(PgId,prdtid,StId,CityId)
{
//alert(PgId)
//alert(prdtid)
//alert(StId)
//alert(CityId)
	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 = "PrdtId";
	Input.id = "PrdtId";
	Input.value = prdtid;
	Form.appendChild(Input);
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "StId";
	Input.id = "StId";
	Input.value = StId;
	Form.appendChild(Input);
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "CityId";
	Input.id = "CityId";
	Input.value = CityId;
	Form.appendChild(Input);
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "KeyWd";
	Input.id = "KeyWd";
	Input.value = document.getElementById("KeyWd").value
	Form.appendChild(Input);
	
	document.body.appendChild(Form);
	Form.action = "Franchisee_Srch.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.sipacademyindia.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.sipacademyindia.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.sipacademyindia.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.sipacademyindia.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.sipacademyindia.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 AddFrn()
  {	
  	Para = GetPara()		
		if (Para) 
		{	
				//alert(Para)
				objXMLHttpRequest.onreadystatechange=AddFrn_output;
				var Url = "Franch_Srv.asp"; //Url of the file in the server.......
				objXMLHttpRequest.open("POST",Url,true);		
				objXMLHttpRequest.setRequestHeader("Host","www.sipacademyindia.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 AddFrn_output()
  {
	if(objXMLHttpRequest.readyState == "4" )	
	{
		var	MsgStr = objXMLHttpRequest.responseText.split("*");
		//document.getElementById("a").innerHTML = objXMLHttpRequest.responseText
			if(parseInt(MsgStr[1])==1)
			{
			document.location.href="Franchisee.asp?output=1"
			}
			else if(parseInt(MsgStr[1])==2)
			{
				document.location.href="Franchisee.asp?output=2"
			}
			else
			{
				document.location.href="Franchisee.asp?output=2"
			}
	}
  }
  
  
  

 //-------- Modify 

function modiFrnch(Id)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "FrnId";
	Input.id = "FrnId";
	Input.value = Id;
	Form.appendChild(Input);

	document.body.appendChild(Form);
	Form.action = "AddFranch.asp";
	Form.method="post"
	Form.submit();
}


//------------DELETE
   function Delete_FrnOnclick(Id,ext){
 	var VarChoic = confirm("Are you sure!.. want to delete");
	if(VarChoic)
	{
		Para=GetPara() + '&Id='+Id 
		//alert(Para)
  		objXMLHttpRequest.onreadystatechange=DelFrn_Output;
		var Url = "DelData.asp"; 
		objXMLHttpRequest.open("POST",Url,true);
		objXMLHttpRequest.setRequestHeader("Host","www.sipacademyindia.com");
		objXMLHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		objXMLHttpRequest.setRequestHeader("Content-Length","12");
		objXMLHttpRequest.send(Para);
	}	
  }
  
  function DelFrn_Output()
  {
	if(objXMLHttpRequest.readyState == "4" )	
	{//document.getElementById("a").innerHTML = objXMLHttpRequest.responseText
		var	MsgStr = objXMLHttpRequest.responseText.split("*");
			if(parseInt(MsgStr[0])==1)
			{
				document.location.href="Franchisee.asp?output=1"
			}
			else if(parseInt(MsgStr[0])==2)
			{
				document.location.href="Franchisee.asp?output=5"
			}
			else if(parseInt(MsgStr[0])==0)
			{
				document.location.href="Franchisee.asp?output=4"
			}			
			else
			{
				document.location.href="Franchisee.asp?output=5"				
			}

	}
  } 
  

//------------DELETE
   function Delete_MediaOnclick(Id,ext){
 	var VarChoic = confirm("Are you sure!.. want to delete");
	if(VarChoic)
	{
		Para=GetPara() + '&Id='+Id + '&extn=' + ext
		//alert(Para)
  		objXMLHttpRequest.onreadystatechange=DelMedia_Output;
		var Url = "DelDataMedia.asp"; 
		objXMLHttpRequest.open("POST",Url,true);
		objXMLHttpRequest.setRequestHeader("Host","www.sipacademyindia.com");
		objXMLHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		objXMLHttpRequest.setRequestHeader("Content-Length","12");
		objXMLHttpRequest.send(Para);
	}	
  }
  
  function DelMedia_Output()
  {
	if(objXMLHttpRequest.readyState == "4" )	
	{//document.getElementById("a").innerHTML = objXMLHttpRequest.responseText
		var	MsgStr = objXMLHttpRequest.responseText.split("*");
			if(parseInt(MsgStr[0])==1)
			{
				document.location.href="Media.asp?output=1"
			}
			else if(parseInt(MsgStr[0])==2)
			{
				document.location.href="Media.asp?output=5"
			}
			else if(parseInt(MsgStr[0])==0)
			{
				document.location.href="Media.asp?output=4"
			}			
			else
			{
				document.location.href="Media.asp?output=5"				
			}

	}
  } 
  
  //----------------------add / modify  
  function AddEvnt()
  {	
  	Para = GetPara()		
		if (Para) 
		{	
				//alert(Para)
				objXMLHttpRequest.onreadystatechange=AddEvnt_output;
				var Url = "Events_srv.asp"; //Url of the file in the server.......
				objXMLHttpRequest.open("POST",Url,true);		
				objXMLHttpRequest.setRequestHeader("Host","www.sipacademyindia.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 AddEvnt_output()
  {
	if(objXMLHttpRequest.readyState == "4" )	
	{
		var	MsgStr = objXMLHttpRequest.responseText.split("*");
		document.getElementById("a").innerHTML = objXMLHttpRequest.responseText
			if(parseInt(MsgStr[1])==1)
			{
			document.location.href="Events.asp?output=1"
			}
			else if(parseInt(MsgStr[1])==2)
			{
				document.location.href="Events.asp?output=2"
			}
			else
			{
				document.location.href="Events.asp?output=2"
			}
	}
  }

function modiEvnt(Id)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "EvId";
	Input.id = "EvId";
	Input.value = Id;
	Form.appendChild(Input);

	document.body.appendChild(Form);
	Form.action = "AddEvents.asp";
	Form.method="post"
	Form.submit();
}


//------------DELETE
   function Delete_EvntOnclick(Id){
 	var VarChoic = confirm("Are you sure!.. want to delete");
	if(VarChoic)
	{
		Para=GetPara() + '&Id='+Id 
		//alert(Para)
  		objXMLHttpRequest.onreadystatechange=DelEvt_Output;
		var Url = "DelData.asp"; 
		objXMLHttpRequest.open("POST",Url,true);
		objXMLHttpRequest.setRequestHeader("Host","www.sipacademyindia.com");
		objXMLHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		objXMLHttpRequest.setRequestHeader("Content-Length","12");
		objXMLHttpRequest.send(Para);
	}	
  }
  
  function DelEvt_Output()
  {
	if(objXMLHttpRequest.readyState == "4" )	
	{//document.getElementById("a").innerHTML = objXMLHttpRequest.responseText
		var	MsgStr = objXMLHttpRequest.responseText.split("*");
			if(parseInt(MsgStr[0])==1)
			{
				document.location.href="Events.asp?output=1"
			}
			else if(parseInt(MsgStr[0])==2)
			{
				document.location.href="Events.asp?output=5"
			}
			else if(parseInt(MsgStr[0])==0)
			{
				document.location.href="Events.asp?output=4"
			}			
			else
			{
				document.location.href="Events.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 AddMedia()
{
	if(Validation_SpnMsg())
//		return true;
	document.getElementById("frmMedia").submit();
	else
		return false;
}
//------------------------modi media --------------------------------------------------
function modiMedia(Id)
{
	Form = document.createElement("form");
	Form.name = "frmMedia";
	Form.id = "frmMedia";
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "MedId";
	Input.id = "MedId";
	Input.value = Id;
	Form.appendChild(Input);

	document.body.appendChild(Form);
	Form.action = "AddMedia.asp";
	Form.method="post"
	Form.submit();
}

//-------------------------testimonials-----------------------------------------------------

function AddTrTest()
{
	if(Validation_SpnMsg())
//		return true;
	document.getElementById("frmTestimon").submit();
	else
		return false;
}
//------------------------modi media --------------------------------------------------
function modiTrTest(Id)
{
	Form = document.createElement("form");
	Form.name = "frmMedia";
	Form.id = "frmMedia";
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "TrTestId";
	Input.id = "TrTestId";
	Input.value = Id;
	Form.appendChild(Input);

	document.body.appendChild(Form);
	Form.action = "AddTrTestimon.asp";
	Form.method="post"
	Form.submit();
}

//------------DELETE
   function Delete_TrTestiOnclick(Id,ext){
 	var VarChoic = confirm("Are you sure!.. want to delete");
	if(VarChoic)
	{
		Para=GetPara() + '&Id='+Id + '&extn=' + ext
		//alert(Para)
  		objXMLHttpRequest.onreadystatechange=DelTrTesi_Output;
		var Url = "DelDataTestimon.asp"; 
		objXMLHttpRequest.open("POST",Url,true);
		objXMLHttpRequest.setRequestHeader("Host","www.sipacademyindia.com");
		objXMLHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		objXMLHttpRequest.setRequestHeader("Content-Length","12");
		objXMLHttpRequest.send(Para);
	}	
  }
  
  function DelTrTesi_Output()
  {
	if(objXMLHttpRequest.readyState == "4" )	
	{//document.getElementById("a").innerHTML = objXMLHttpRequest.responseText
		var	MsgStr = objXMLHttpRequest.responseText.split("*");
			if(parseInt(MsgStr[0])==1)
			{
				document.location.href="Testimonials.asp?output=1"
			}
			else if(parseInt(MsgStr[0])==2)
			{
				document.location.href="Testimonials.asp?output=5"
			}
			else if(parseInt(MsgStr[0])==0)
			{
				document.location.href="Testimonials.asp?output=4"
			}			
			else
			{
				document.location.href="Testimonials.asp?output=5"				
			}

	}
  } 
  
function MkActive(pzid,stat)
{
		Para = GetPara()
		Para = Para + "&nid=" + pzid + "&Stat=" + stat ;
		//alert(Para)
		objXMLHttpRequest.onreadystatechange=MkActive_output;
		var Url = "ActInact.asp"; //Url of the file in the server.......
		objXMLHttpRequest.open("POST",Url,true);
		objXMLHttpRequest.setRequestHeader("Host","localhost");
		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 MkActive_output()
{
	if(objXMLHttpRequest.readyState == "4" )	
	{
		if (objXMLHttpRequest.status == 200)
		{
			MsgStr = objXMLHttpRequest.responseText.split("*");
			//alert(MsgStr[1])
			document.getElementById("StatDet_"+MsgStr[1]).innerHTML = MsgStr[2]	
		}
		else
		{
			alert("Problem with server response Try later or contact your software vendor");
		}	
		//objXMLHttpRequest.abort();
	}	
	
}
  
  function getCityNms()
	{//alert("dddd")
	//alert(document.getElementById("BrandId").value)
		try{	
		var StId = escape(document.getElementById("StId").value);
		//var BrandId = escape(document.getElementById("BrandId").value);
		
		Para = 'StId=' + StId
	//	alert(Para)
  		objXMLHttpRequest.onreadystatechange=getCityNms_Output;
		var Url = "getCity.asp"; //Url of the file in the server.......
		objXMLHttpRequest.open("POST",Url,true);
		objXMLHttpRequest.setRequestHeader("Host","www.sipacademyindia.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......
		}catch(e)
		{
			//alert(e)
		}	
	}
		
	function getCityNms_Output()
	{
		//4 - request is completed.......
		if(objXMLHttpRequest.readyState == "4" )	
		{
			//alert(objXMLHttpRequest.responseText )
			//alert(document.getElementById("state").innerHTML)
			document.getElementById("cit").innerHTML =objXMLHttpRequest.responseText 
			objXMLHttpRequest.abort();
		}
	}
	
	function Search_Cit(PgId,StId)
	{
		Form = document.createElement("form");
		Form.name = "frmMedia";
		Form.id = "frmMedia";
		
		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 = "StId";
		Input.id = "StId";
		Input.value = StId;
		Form.appendChild(Input);
	
		document.body.appendChild(Form);
		Form.action = "getCity.asp";
		Form.method="post"
		Form.submit();
	}
	function Search_CitAll(PgId)
	{
		Form = document.createElement("form");
		Form.name = "frmMedia";
		Form.id = "frmMedia";
		
		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 = "City.asp";
		Form.method="post"
		Form.submit();
	}
function Search_Med(PgId)
{
		Form = document.createElement("form");
		Form.name = "frmMedia";
		Form.id = "frmMedia";
		
		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 = "Media.asp";
		Form.method="post"
		Form.submit();
}


function Search_Evnt(PgId)
{
		Form = document.createElement("form");
		Form.name = "frmMedia";
		Form.id = "frmMedia";
		
		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 = "Events.asp";
		Form.method="post"
		Form.submit();
}


function Search_New(PgId)
{
		Form = document.createElement("form");
		Form.name = "frmMedia";
		Form.id = "frmMedia";
		
		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 = "News.asp";
		Form.method="post"
		Form.submit();
}

function Search_Upld(PgId)
{
		Form = document.createElement("form");
		Form.name = "frmMedia";
		Form.id = "frmMedia";
		
		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 = "UploadedFiles.asp";
		Form.method="post"
		Form.submit();
}
function Search_Testimon(PgId)
{
		Form = document.createElement("form");
		Form.name = "frmMedia";
		Form.id = "frmMedia";
		
		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 = "Testimonials.asp";
		Form.method="post"
		Form.submit();
}
function GetFilBox(typ)
{
	if(typ == "img")
	{
		document.getElementById("TrTestTypVal").value = "img"
		document.getElementById("TrTestDes").value = "<YOU NEED NOT WRITE THE CONTENT. THE IMAGE WHICH IS GOING TO BE UPLOADED ALONE WILL BE DISPLAYED>"
	}
	else
	{
		document.getElementById("TrTestTypVal").value = "txt"
		document.getElementById("TrTestDes").value =""
	}
}
