// JavaScript Document
function backwin()
{
	window.back();
}
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)
		{
  		objXMLHttpRequest.onreadystatechange=login_Output;
		var Url = "AdminLog_Srv.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......
  		}
				return false;
  }
  
  function login_Output()
  {
	if(objXMLHttpRequest.readyState == "4" )	
	{
	//document.getElementById("a").innerHTML = objXMLHttpRequest.responseText
		var MsgDet = objXMLHttpRequest.responseText.split("*");
		//alert(objXMLHttpRequest.responseText)
		if(parseInt(MsgDet[1])==2)
		{
		document.getElementById("output").innerHTML=MsgDet[2];
		document.getElementById("userid").value="";
		document.getElementById("password").value="";
		}
		else if(parseInt(MsgDet[1])==20)
		{
			document.getElementById("output").innerHTML=MsgDet[2];
			document.getElementById("userid").value="";
			document.getElementById("password").value="";
		}
		else if(parseInt(MsgDet[1])==1)
		{
		document.location.href ="index.asp";
		}
		objXMLHttpRequest.abort();
	}
  }  
  
//===============================  Admin ======================================
 //---------------add / modify 
   function addadmin()
  {	
	Para = GetPara()
	//alert(Para);
		if((document.form1.activestatus[0].checked==false) && (document.form1.activestatus[1].checked==false))
		{
		document.getElementById("Sactivestatus").innerHTML = "<font color=red>*</font>"
		}
		else
		{
		document.getElementById("Sactivestatus").innerHTML = ""	
			if (Para)
			{
				if(document.form1.activestatus[0].checked==true)
				Para=Para + "&activestatus=1"
				else
				Para=Para + "&activestatus=0"	

				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.indiabuilders.in");
				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" )	
	{
//alert(objXMLHttpRequest.responseText);
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 if(parseInt(MsgStr[1])==3)
			{
				document.location.href="admin.asp?output=3"
			}
			else
			{
				document.location.href="admin.asp?output=2"							
			}	
	}
  }
  
 //-----------------modify 
  //-------- Modify 
  
//===============================  Admin ======================================
 //---------------add / modify 
   function addusertype()
  {	
	Para = GetPara()
		//alert(Para);
		if((document.form1.activestatus[0].checked==false) && (document.form1.activestatus[1].checked==false))
		{
		document.getElementById("Sactivestatus").innerHTML = "<font color=red>*</font>"
		}
		else
		{
		document.getElementById("Sactivestatus").innerHTML = ""	
			if (Para)
			{

				if(document.form1.activestatus[0].checked==true)
				Para=Para + "&activestatus=1"
				else
				Para=Para + "&activestatus=0"	

				objXMLHttpRequest.onreadystatechange=addusertype_output;
				var Url = "usertype_Srv.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......
				document.getElementById("butSave").disabled = true;
				
			}
	}
  }
  
  function addusertype_output()
  {
	if(objXMLHttpRequest.readyState == "4" )	
	{
//alert(objXMLHttpRequest.responseText);
var	MsgStr = objXMLHttpRequest.responseText.split("*");
//document.getElementById("a").innerHTML = objXMLHttpRequest.responseText
			if(parseInt(MsgStr[1])==1)
			{
				document.location.href="usertype.asp?output=1"
			}
			else if(parseInt(MsgStr[1])==2)
			{
				document.location.href="usertype.asp?output=2"
			}
			else
			{
				document.location.href="usertype.asp?output=2"							
			}	
	}
  }
  //=============================
  
function modipermission(Id)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "usertypeid";
	Input.id = "usertypeid";
	Input.value = Id;
	Form.appendChild(Input);

	document.body.appendChild(Form);
	Form.action = "modipermission.asp";
	Form.method="post"
	Form.submit();
}
  
function modiusertype(Id)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "usertypeid";
	Input.id = "usertypeid";
	Input.value = Id;
	Form.appendChild(Input);

	document.body.appendChild(Form);
	Form.action = "modiusertype.asp";
	Form.method="post"
	Form.submit();
}

//=============================
function modiadmin(Id)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "adminid";
	Input.id = "adminid";
	Input.value = Id;
	Form.appendChild(Input);

	document.body.appendChild(Form);
	Form.action = "modiadmin.asp";
	Form.method="post"
	Form.submit();
}

function modioffer(Id)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "offerid";
	Input.id = "offerid";
	Input.value = Id;
	Form.appendChild(Input);

	document.body.appendChild(Form);
	Form.action = "modioffer.asp";
	Form.method="post"
	Form.submit();
}


//===============================  AddCategory ======================================
 //---------------add / modify 
  function addcategory()
  {	
	Para = GetPara()

		if((document.form1.activestatus[0].checked==false) && (document.form1.activestatus[1].checked==false))
		{
			document.getElementById("Sactivestatus").innerHTML = "<font color=red>*</font>"
		}
		else
		{
			document.getElementById("Sactivestatus").innerHTML = ""	
			if (Para)
			{
				if(document.form1.activestatus[0].checked==true)
					Para=Para + "&activestatus=1"
				else
					Para=Para + "&activestatus=0"	
				
				objXMLHttpRequest.onreadystatechange=addcategory_output;
				var Url = "category_Srv.asp"; //Url of the file in the server.......
				objXMLHttpRequest.open("POST",Url,true);
				objXMLHttpRequest.setRequestHeader("Host","www.indiabuilders.in");
				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 addcategory_output()
  {
	if(objXMLHttpRequest.readyState == "4" )	
	{
//alert(objXMLHttpRequest.responseText);
var	MsgStr = objXMLHttpRequest.responseText.split("*");
//document.getElementById("a").innerHTML = objXMLHttpRequest.responseText
			if(parseInt(MsgStr[1])==1)
			{
				document.location.href="category.asp?output=1"
			}
			else if(parseInt(MsgStr[1])==2)
			{
				document.location.href="category.asp?output=2"
			}
			else
			{
				document.location.href="category.asp?output=1"							
			}	
	}
  }
  
 //-----------------modify 
  function addadzone()
  {	
		Para = GetPara()

		if((document.form1.activestatus[0].checked==false) && (document.form1.activestatus[1].checked==false))
		{
		document.getElementById("Sactivestatus").innerHTML = "<font color=red>*</font>"
		}
		else
		{
		document.getElementById("Sactivestatus").innerHTML = ""	
			if (Para)
			{
				if(document.form1.activestatus[0].checked==true)
				Para=Para + "&activestatus=1"
				else
				Para=Para + "&activestatus=0"	

				objXMLHttpRequest.onreadystatechange=addadzone_output;
				var Url = "adzone_Srv.asp"; //Url of the file in the server.......
				objXMLHttpRequest.open("POST",Url,true);
				objXMLHttpRequest.setRequestHeader("Host","www.indiabuilders.in");
				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 addadzone_output()
  {
	if(objXMLHttpRequest.readyState == "4" )	
	{
	//alert(objXMLHttpRequest.responseText);
var	MsgStr = objXMLHttpRequest.responseText.split("*");
//document.getElementById("a").innerHTML = objXMLHttpRequest.responseText
			if(parseInt(MsgStr[1])==1)
			{
				document.location.href="adzone.asp?output=1"
			}
			else if(parseInt(MsgStr[1])==2)
			{
				document.location.href="adzone.asp?output=2"
			}
			else
			{
				document.location.href="adzone.asp?output=1"							
			}	
	}
  }
 function modiadzone(Id)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "adzoneid";
	Input.id = "adzoneid";
	Input.value = Id;
	Form.appendChild(Input);

	document.body.appendChild(Form);
	Form.action = "modiadzone.asp";
	Form.method="post"
	Form.submit();
}
  //-------- Modify 
 function modicategory(Id)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "categoryid";
	Input.id = "categoryid";
	Input.value = Id;
	Form.appendChild(Input);

	document.body.appendChild(Form);
	Form.action = "modicategory.asp";
	Form.method="post"
	Form.submit();
}

 function modiads(Id)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "adsid";
	Input.id = "adsid";
	Input.value = Id;
	Form.appendChild(Input);

	document.body.appendChild(Form);
	Form.action = "modiads.asp";
	Form.method="post"
	Form.submit();
}
//===============================  AddSubCategory ======================================
 //---------------add / modify 
  function addsubcategory()
  {	
	Para = GetPara()

		if((document.form1.activestatus[0].checked==false) && (document.form1.activestatus[1].checked==false))
		{
			document.getElementById("Sactivestatus").innerHTML = "<font color=red>*</font>"
		}
		else
		{
			document.getElementById("Sactivestatus").innerHTML = ""	
			if (Para)
			{
				if(document.form1.activestatus[0].checked==true)
				Para=Para + "&activestatus=1"
				else
				Para=Para + "&activestatus=0"	
				
				//alert(Para);
				objXMLHttpRequest.onreadystatechange=addsubcategory_output;
				var Url = "subcategory_Srv.asp"; //Url of the file in the server.......
				objXMLHttpRequest.open("POST",Url,true);
				objXMLHttpRequest.setRequestHeader("Host","www.indiabuilders.in");
				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 addsubcategory_output()
  {
	if(objXMLHttpRequest.readyState == "4" )	
	{
//alert(objXMLHttpRequest.responseText);
var	MsgStr = objXMLHttpRequest.responseText.split("*");
//document.getElementById("a").innerHTML = objXMLHttpRequest.responseText
			if(parseInt(MsgStr[1])==1)
			{
				document.location.href="subcategory.asp?output=1"
			}
			else if(parseInt(MsgStr[1])==2)
			{
				document.location.href="subcategory.asp?output=2"
			}
			else
			{
				document.location.href="subcategory.asp?output=1"							
			}	
	}
  }
  
 //-----------------modify 
 //-------- Modify 
function modiSubcategory(Id)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "subcategoryid";
	Input.id = "subcategoryid";
	Input.value = Id;
	Form.appendChild(Input);

	document.body.appendChild(Form);
	Form.action = "modisubcategory.asp";
	Form.method="post"
	Form.submit();
}
//===========outlet
function modioutlet(Id)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "outletid";
	Input.id = "outletid";
	Input.value = Id;
	Form.appendChild(Input);

	document.body.appendChild(Form);
	Form.action = "modioutlet.asp";
	Form.method="post"
	Form.submit();
}

/////////////////////////////////////////////////////////////////////
function NewsUpdt()
{
	var a, c, b	
	a=0
	c=0
	b=0

	cmt="<font color='#FF0000'>*</font>"	  
	
	if(document.getElementById("newsdate").value=="")
	{
		b=1
		document.getElementById("Snewsdate").innerHTML=cmt
	}
	else
	{
		b=0
		document.getElementById('Snewsdate').innerHTML=""
	}	

	 
	if(document.getElementById("newstitle").value=="")
	{
		a=1
		document.getElementById("Snewstitle").innerHTML=cmt
	}
	else
	{
		a=0
		document.getElementById('Snewstitle').innerHTML=""
	}	

	if(updateRTEs()==0)
	{
		c=1
		document.getElementById("Snewsdescription").innerHTML = cmt
	}
	else
	{
		c=0
		document.getElementById("Snewsdescription").innerHTML=""
	}	
	
	if((a==1) || (c==1) || (b==1))//|| (e==1) || (f==1)|| (g==1)|| (k==1))
	{
		return false;
	}
	else
	{
		return true;
	}
}  

function modinews(Id)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "newsid";
	Input.id = "newsid";
	Input.value = Id;
	Form.appendChild(Input);

	document.body.appendChild(Form);
	Form.action = "AddNews.asp";
	Form.method="post"
	Form.submit();
}
//================ School ==============================
//===============================  Admin ======================================
 //---------------add / modify 
   function addschool()
  {	
	Para = GetPara()
	if (Para)
	{
		objXMLHttpRequest.onreadystatechange=addschool_output;
		var Url = "School_Srv.asp"; //Url of the file in the server.......
		objXMLHttpRequest.open("POST",Url,true);
		objXMLHttpRequest.setRequestHeader("Host","www.indiabuilders.in");
		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 addschool_output()
  {
	if(objXMLHttpRequest.readyState == "4" )	
	{
var	MsgStr = objXMLHttpRequest.responseText.split("*");
//document.getElementById("a").innerHTML = objXMLHttpRequest.responseText
//alert(objXMLHttpRequest.responseText);
			if(parseInt(MsgStr[1])==1)
			{
				document.location.href="schools.asp?output=1"
			}
			else if(parseInt(MsgStr[1])==2)
			{
				document.location.href="schools.asp?output=2"
			}
			else
			{
				document.location.href="schools.asp?output=2"							
			}	
	}
  }

function modischool(Id)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "schoolid";
	Input.id = "schoolid";
	Input.value = Id;
	Form.appendChild(Input);

	document.body.appendChild(Form);
	Form.action = "modischool.asp";
	Form.method="post"
	Form.submit();
}


//===============================  Admin ======================================
 //---------------add / modify 
   function addTeacher()
  {	
	Para = GetPara()
	if (Para)
	{
		objXMLHttpRequest.onreadystatechange=addTeacher_output;
		var Url = "Teacher_Srv.asp"; //Url of the file in the server.......
		objXMLHttpRequest.open("POST",Url,true);
		objXMLHttpRequest.setRequestHeader("Host","www.indiabuilders.in");
		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 addTeacher_output()
  {
	if(objXMLHttpRequest.readyState == "4" )	
	{
			var	MsgStr = objXMLHttpRequest.responseText.split("*");
			//document.getElementById("a").innerHTML = objXMLHttpRequest.responseText
			//alert(objXMLHttpRequest.responseText);
			if(parseInt(MsgStr[1])==1)
			{
				document.location.href="Teacher.asp?output=1"
			}
			else if(parseInt(MsgStr[1])==2)
			{
				document.location.href="Teacher.asp?output=2"
			}
			else
			{
				document.location.href="Teacher.asp?output=2"							
			}	
	}
  }


 //---------------add / modify 
   function addStudent()
  {	
	Para = GetPara()
	if (Para)
	{
		objXMLHttpRequest.onreadystatechange=addStudent_output;
		var Url = "Student_srv.asp"; //Url of the file in the server.......
		objXMLHttpRequest.open("POST",Url,true);
		objXMLHttpRequest.setRequestHeader("Host","www.indiabuilders.in");
		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 addStudent_output()
  {
	if(objXMLHttpRequest.readyState == "4" )	
	{
			var	MsgStr = objXMLHttpRequest.responseText.split("*");
			//document.getElementById("a").innerHTML = objXMLHttpRequest.responseText
			//alert(objXMLHttpRequest.responseText);
			if(parseInt(MsgStr[1])==1)
			{
				document.location.href="student.asp?output=1"
			}
			else if(parseInt(MsgStr[1])==2)
			{
				document.location.href="student.asp?output=2"
			}
			else
			{
				document.location.href="student.asp?output=2"							
			}	
	}
  }

function modistudent(Id)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "studentid";
	Input.id = "studentid";
	Input.value = Id;
	Form.appendChild(Input);

	document.body.appendChild(Form);
	Form.action = "modistudent.asp";
	Form.method="post"
	Form.submit();
}


function moditeacher(Id)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "teacherid";
	Input.id = "teacherid";
	Input.value = Id;
	Form.appendChild(Input);

	document.body.appendChild(Form);
	Form.action = "moditeacher.asp";
	Form.method="post"
	Form.submit();
}

function del_floorplan(fpid,pid,mnid)
{
	Form = document.createElement("form");
	Form.name = "frmSrch";
	Form.id = "frmSrch";
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "fpid";
	Input.id = "fpid";
	Input.value = fpid;
	Form.appendChild(Input);

	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "pid";
	Input.id = "pid";
	Input.value = pid;
	Form.appendChild(Input);
	
	Input = document.createElement("input");
	Input.type = "hidden";
	Input.name = "mnid";
	Input.id = "mnid";
	Input.value = mnid;
	Form.appendChild(Input);		

	document.body.appendChild(Form);
	Form.action = "delete_floorplan.asp";
	Form.method="post"
	Form.submit();
}

 //------------delete admin --------------------------------------
   function Delete_UserTypeOnclick(Id){
	var VarChoic = confirm("Are you sure!.. want to delete");
	if(VarChoic)
	{
		Para=GetPara() + '&Id='+Id
		//alert(Para);
  		objXMLHttpRequest.onreadystatechange=DelUserTypeClientOutput;
		var Url = "DelData.asp"; 
		objXMLHttpRequest.open("POST",Url,true);
		objXMLHttpRequest.setRequestHeader("Host","www.indiabuilders.in");
		objXMLHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		objXMLHttpRequest.setRequestHeader("Content-Length","12");
		objXMLHttpRequest.send(Para);
	}	
  }
  
  function DelUserTypeClientOutput()
  {
	if(objXMLHttpRequest.readyState == "4" )	
	{
		//alert(objXMLHttpRequest.responseText);
		var	MsgStr = objXMLHttpRequest.responseText.split("*");
			if(parseInt(MsgStr[1])==4)
			{
				document.location.href="usertype.asp?output=1"
			}
			else if(parseInt(MsgStr[1])==2)
			{
				document.location.href="usertype.asp?output=5"
			}
			else if(parseInt(MsgStr[1])==3)
			{
				document.location.href="usertype.asp?output=3"
			}			
			else if(parseInt(MsgStr[1])==0)
			{
				document.location.href="usertype.asp?output=4"
			}			
			else
			{
				document.location.href="usertype.asp?output=5"				
			}
	}
  } 
  

 //------------delete admin --------------------------------------
   function Delete_AOnclick(Id){
	var VarChoic = confirm("Are you sure!.. want to delete");
	if(VarChoic)
	{
		Para=GetPara() + '&Id='+Id
		//alert(Para);
  		objXMLHttpRequest.onreadystatechange=DelAClientOutput;
		var Url = "DelData.asp"; 
		objXMLHttpRequest.open("POST",Url,true);
		objXMLHttpRequest.setRequestHeader("Host","www.indiabuilders.in");
		objXMLHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		objXMLHttpRequest.setRequestHeader("Content-Length","12");
		objXMLHttpRequest.send(Para);
	}	
  }
  
  function DelAClientOutput()
  {
	if(objXMLHttpRequest.readyState == "4" )	
	{
		//alert(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"				
			}
	}
  } 
  
//------------delete Category --------------------------------------
   function Delete_CategoryOnclick(Id){
	var VarChoic = confirm("Are you sure!.. want to delete");
	if(VarChoic)
	{
		Para=GetPara() + '&Id='+Id
		//alert(Para);
  		objXMLHttpRequest.onreadystatechange=DelCatClientOutput;
		var Url = "DelData.asp"; 
		objXMLHttpRequest.open("POST",Url,true);
		objXMLHttpRequest.setRequestHeader("Host","www.indiabuilders.in");
		objXMLHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		objXMLHttpRequest.setRequestHeader("Content-Length","12");
		objXMLHttpRequest.send(Para);
	}	
  }
  
  function DelCatClientOutput()
  {
	if(objXMLHttpRequest.readyState == "4" )	
	{
		//alert(objXMLHttpRequest.responseText);
		var	MsgStr = objXMLHttpRequest.responseText.split("*");
			if(parseInt(MsgStr[1])==4)
			{
				document.location.href="category.asp?output=1"
			}
			else if(parseInt(MsgStr[1])==2)
			{
				document.location.href="category.asp?output=5"
			}
			else if(parseInt(MsgStr[1])==3)
			{
				document.location.href="category.asp?output=3"
			}			
			else if(parseInt(MsgStr[1])==0)
			{
				document.location.href="category.asp?output=4"
			}			
			else
			{
				document.location.href="category.asp?output=5"				
			}
	}
  } 
  
  //------------delete SubCategory -----------------------------
   function Delete_SubCategoryOnclick(Id){
	var VarChoic = confirm("Are you sure!.. want to delete");
	if(VarChoic)
	{
		Para=GetPara() + '&Id='+Id
		//alert(Para);
  		objXMLHttpRequest.onreadystatechange=DelSubCatClientOutput;
		var Url = "DelData.asp"; 
		objXMLHttpRequest.open("POST",Url,true);
		objXMLHttpRequest.setRequestHeader("Host","www.indiabuilders.in");
		objXMLHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		objXMLHttpRequest.setRequestHeader("Content-Length","12");
		objXMLHttpRequest.send(Para);
	}	
  }
  
  function DelSubCatClientOutput()
  {
	if(objXMLHttpRequest.readyState == "4" )	
	{
		//alert(objXMLHttpRequest.responseText);
		var	MsgStr = objXMLHttpRequest.responseText.split("*");
			if(parseInt(MsgStr[1])==4)
			{
				document.location.href="subcategory.asp?output=1"
			}
			else if(parseInt(MsgStr[1])==2)
			{
				document.location.href="subcategory.asp?output=5"
			}
			else if(parseInt(MsgStr[1])==3)
			{
				document.location.href="subcategory.asp?output=3"
			}			
			else if(parseInt(MsgStr[1])==0)
			{
				document.location.href="subcategory.asp?output=4"
			}			
			else
			{
				document.location.href="subcategory.asp?output=5"				
			}
	}
  } 
  
    //------------delete AdsZone-----------------------------
   function Delete_AdZoneOnclick(Id){
	var VarChoic = confirm("Are you sure!.. want to delete");
	if(VarChoic)
	{
		Para=GetPara() + '&Id='+Id
		//alert(Para);
  		objXMLHttpRequest.onreadystatechange=DelAdZoneClientOutput;
		var Url = "DelData.asp"; 
		objXMLHttpRequest.open("POST",Url,true);
		objXMLHttpRequest.setRequestHeader("Host","www.indiabuilders.in");
		objXMLHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		objXMLHttpRequest.setRequestHeader("Content-Length","12");
		objXMLHttpRequest.send(Para);
	}	
  }
  
  function DelAdZoneClientOutput()
  {
	if(objXMLHttpRequest.readyState == "4" )	
	{
		//alert(objXMLHttpRequest.responseText);
		var	MsgStr = objXMLHttpRequest.responseText.split("*");
			if(parseInt(MsgStr[1])==4)
			{
				document.location.href="adzone.asp?output=1"
			}
			else if(parseInt(MsgStr[1])==2)
			{
				document.location.href="adzone.asp?output=5"
			}
			else if(parseInt(MsgStr[1])==3)
			{
				document.location.href="adzone.asp?output=3"
			}			
			else if(parseInt(MsgStr[1])==0)
			{
				document.location.href="adzone.asp?output=4"
			}			
			else
			{
				document.location.href="adzone.asp?output=5"				
			}
	}
  } 
  
  
      //------------delete AdsZone-----------------------------
   function Delete_AdsOnclick(Id){
	var VarChoic = confirm("Are you sure!.. want to delete");
	if(VarChoic)
	{
		Para=GetPara() + '&Id='+Id
		//alert(Para);
  		objXMLHttpRequest.onreadystatechange=DelAdClientOutput;
		var Url = "DelData.asp"; 
		objXMLHttpRequest.open("POST",Url,true);
		objXMLHttpRequest.setRequestHeader("Host","www.indiabuilders.in");
		objXMLHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		objXMLHttpRequest.setRequestHeader("Content-Length","12");
		objXMLHttpRequest.send(Para);
	}	
  }
  
  function DelAdClientOutput()
  {
	if(objXMLHttpRequest.readyState == "4" )	
	{
		//alert(objXMLHttpRequest.responseText);
		var	MsgStr = objXMLHttpRequest.responseText.split("*");
			if(parseInt(MsgStr[1])==4)
			{
				document.location.href="AdsPage.asp?output=1"
			}
			else if(parseInt(MsgStr[1])==2)
			{
				document.location.href="AdsPage.asp?output=5"
			}
			else if(parseInt(MsgStr[1])==3)
			{
				document.location.href="AdsPage.asp?output=3"
			}			
			else if(parseInt(MsgStr[1])==0)
			{
				document.location.href="AdsPage.asp?output=4"
			}			
			else
			{
				document.location.href="AdsPage.asp?output=5"				
			}
	}
  } 
  
  //===================== DelOutlet ==============
//------------delete Outlet-----------------------------
   function Delete_OutletOnclick(Id){
	var VarChoic = confirm("Are you sure!.. want to delete");
	if(VarChoic)
	{
		Para=GetPara() + '&Id='+Id
		//alert(Para);
  		objXMLHttpRequest.onreadystatechange=DelOutletClientOutput;
		var Url = "DelData.asp"; 
		objXMLHttpRequest.open("POST",Url,true);
		objXMLHttpRequest.setRequestHeader("Host","www.indiabuilders.in");
		objXMLHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		objXMLHttpRequest.setRequestHeader("Content-Length","12");
		objXMLHttpRequest.send(Para);
	}	
  }
  
  function DelOutletClientOutput()
  {
	if(objXMLHttpRequest.readyState == "4" )	
	{
		//alert(objXMLHttpRequest.responseText);
		var	MsgStr = objXMLHttpRequest.responseText.split("*");
			if(parseInt(MsgStr[1])==4)
			{
				document.location.href="outlet.asp?output=1"
			}
			else if(parseInt(MsgStr[1])==2)
			{
				document.location.href="outlet.asp?output=5"
			}
			else if(parseInt(MsgStr[1])==3)
			{
				document.location.href="outlet.asp?output=3"
			}			
			else if(parseInt(MsgStr[1])==0)
			{
				document.location.href="outlet.asp?output=4"
			}			
			else
			{
				document.location.href="outlet.asp?output=5"				
			}
	}
  } 
  
  //------------delete Outlet-----------------------------
   function Delete_OfferOnclick(Id){
	var VarChoic = confirm("Are you sure!.. want to delete");
	if(VarChoic)
	{
		Para=GetPara() + '&Id='+Id
		//alert(Para);
  		objXMLHttpRequest.onreadystatechange=DelOfferClientOutput;
		var Url = "DelData.asp"; 
		objXMLHttpRequest.open("POST",Url,true);
		objXMLHttpRequest.setRequestHeader("Host","www.indiabuilders.in");
		objXMLHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		objXMLHttpRequest.setRequestHeader("Content-Length","12");
		objXMLHttpRequest.send(Para);
	}	
  }
  
  function DelOfferClientOutput()
  {
	if(objXMLHttpRequest.readyState == "4" )	
	{
		//alert(objXMLHttpRequest.responseText);
		var	MsgStr = objXMLHttpRequest.responseText.split("*");
			if(parseInt(MsgStr[1])==4)
			{
				document.location.href="offerpage.asp?output=1"
			}
			else if(parseInt(MsgStr[1])==2)
			{
				document.location.href="offerpage.asp?output=5"
			}
			else if(parseInt(MsgStr[1])==3)
			{
				document.location.href="offerpage.asp?output=3"
			}			
			else if(parseInt(MsgStr[1])==0)
			{
				document.location.href="offerpage.asp?output=4"
			}			
			else
			{
				document.location.href="offerpage.asp?output=5"				
			}
	}
  } 
  
    //------------delete New-----------------------------
   function News_Delete(Id){
	var VarChoic = confirm("Are you sure!.. want to delete");
	if(VarChoic)
	{
		Para=GetPara() + '&Id='+Id
		//alert(Para);
  		objXMLHttpRequest.onreadystatechange=DelNewsClientOutput;
		var Url = "DelData.asp"; 
		objXMLHttpRequest.open("POST",Url,true);
		objXMLHttpRequest.setRequestHeader("Host","www.indiabuilders.in");
		objXMLHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		objXMLHttpRequest.setRequestHeader("Content-Length","12");
		objXMLHttpRequest.send(Para);
	}	
  }
  
  function DelNewsClientOutput()
  {
	if(objXMLHttpRequest.readyState == "4" )	
	{
		alert(objXMLHttpRequest.responseText);
		var	MsgStr = objXMLHttpRequest.responseText.split("*");
			if(parseInt(MsgStr[1])==4)
			{
				document.location.href="news_events.asp?output=1"
			}
			else if(parseInt(MsgStr[1])==2)
			{
				document.location.href="news_events.asp?output=5"
			}
			else if(parseInt(MsgStr[1])==3)
			{
				document.location.href="news_events.asp?output=3"
			}			
			else if(parseInt(MsgStr[1])==0)
			{
				document.location.href="news_events.asp?output=4"
			}			
			else
			{
				document.location.href="news_events.asp?output=5"				
			}
	}
  } 
  
  
 function Sel_ondblclick(LstSrc,LstDist) {
	if(document.getElementById(LstSrc).selectedIndex==-1)
		alert("Select Properly");
	else
	{	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;
		document.getElementById(LstDist).options.add(Opt);
		document.getElementById(LstSrc).remove(document.getElementById(LstSrc).selectedIndex);	
	}
}




//----------------------add / modify  
function addpermission()
{	
var abcd
abcd=0
	for(i=0;i<document.getElementById("LstPgDis").options.length;i++)
	{
		document.getElementById("LstPgDis").options[i].selected=true;
		abcd = abcd + "-" + document.getElementById("LstPgDis").options[i].value;
		document.getElementById("page").value=abcd
	}
		Para = GetPara()
		if (Para) {
		//alert(Para)
  		objXMLHttpRequest.onreadystatechange=addpermission_output;
		var Url = "Permission_srv.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......
		document.getElementById("butSave").disabled = true;
		}
  }
  
  function addpermission_output()
  {
	if(objXMLHttpRequest.readyState == "4" )	
	{
		//alert(objXMLHttpRequest.responseText)
		var		MsgStr = objXMLHttpRequest.responseText.split("*");
		//document.getElementById("a").innerHTML = objXMLHttpRequest.responseText
			if(parseInt(MsgStr[1])==1)
			{
			document.location.href="permission.asp?output=1"
			}
			else if(parseInt(MsgStr[1])==2)
			{
				document.location.href="permission.asp?output=2"
			}
			else
			{
				document.location.href="permission.asp?output=2"
			}	
	}
  }
