// JavaScript Document
function get_frm(str,str1,str2,str3)
{ 

	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	document.getElementById(str2).innerHTML='<img src="images/ajax_loader.gif" border="0">';
	
	var url=str
	url=url+"?id="+str1+"&str="+str3;
	
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=function()
	{
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
			document.getElementById(str2).innerHTML=xmlHttp.responseText;	
		}
	};

	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function get_frm_state(str,str1,str2,str3,str4,str5,str6,str7)
{ 

	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	document.getElementById(str2).innerHTML='<img src="images/ajax_loader.gif" border="0">';
	
	var url=str
	url=url+"?id="+str1+"&str="+str3;
	
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=function()
	{
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
			document.getElementById(str2).innerHTML=xmlHttp.responseText;
			if(document.getElementById(str7))
			{
				document.getElementById(str4).innerHTML="<input type=\"text\" name=\""+str6+"\" id=\""+str6+"\" value=\"\">";
			}
			else
			{
				document.getElementById(str4).innerHTML="<select name=\""+str5+"\" id=\""+str5+"\"><option value=\"\">--select city--</option></select>";
			}
		}
	};

	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function get_frm_time(str,str1,str2,str3)
{ 

	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	document.getElementById(str2).innerHTML='<img src="images/ajax_loader.gif" border="0">';
	
	var url=str
	url=url+"?id="+str1+"&str="+str3;
	
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=function()
	{
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
			document.getElementById(str2).innerHTML=xmlHttp.responseText;			
			init(document.getElementById('count_row').value);			
		}
	};

	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function get_frm_menu(str,str1,str2,str3)
{ 
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 

	if (  frm_check.search_by[0].checked == true  ) 
		{
			str3='name'; 
		}
		else
		{
			str3='id'; 
		}

	//if ( check[0].checked == true )
//		{
//			alert('name');
//		}
//	if ( check[1].checked == true )
//		{
//			alert('id');
//		}
	
	document.getElementById(str2).innerHTML='<img src="images/ajax_loader.gif" border="0">';
	
	var url=str
	url=url+"?id="+str1+"&str="+str3;
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=function()
	{
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
			
			document.getElementById(str2).innerHTML=xmlHttp.responseText;
			ddaccordion.init({
				headerclass: "expandable", //Shared CSS class name of headers group that are expandable
				contentclass: "categoryitems", //Shared CSS class name of contents group
				revealtype: "click", //Reveal content when user clicks or onmouseover the header? Valid value: "click", "clickgo", or "mouseover"
				mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover
				collapseprev: true, //Collapse previous content (so only one open at any time)? true/false 
				defaultexpanded: [], //index of content(s) open by default [index1, index2, etc]. [] denotes no content
				onemustopen: false, //Specify whether at least one header should be open always (so never all headers closed)
				animatedefault: false, //Should contents open by default be animated into view?
				persiststate: false, //persist state of opened contents within browser session?
				toggleclass: ["", "openheader"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
				togglehtml: ["prefix", "", ""], //Additional HTML added to the header when it's collapsed and expanded, respectively  ["position", "html1", "html2"] (see docs)
				animatespeed: "fast", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow"
				oninit:function(headers, expandedindices){ //custom code to run when headers have initalized
					//do nothing
					
				},
				onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
					//do nothing
				}
			})
		}
	};


	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function get_frm1(str,str1,str2)
{ 
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	document.getElementById(str2).innerHTML="<img src='images/ajax_loader.gif'>";
	var url=str
	url=url+"?id="+str1
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=function()
	{
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
		
			document.getElementById(str2).innerHTML=xmlHttp.responseText;
		}
	};

	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function get_frm_new(str,str1,str2,str3,str4)
{ 
	
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	document.getElementById(str2).innerHTML='<img src="images/ajax_loader.gif" border="0">';
	
	var url=str
	url=url+"?id="+str1+"&str="+str3+"&str4="+str4;
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=function()
	{
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
			document.getElementById(str2).innerHTML=xmlHttp.responseText;
		}
	};

	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}
function GetXmlHttpObject()
{ 
	var objXMLHttp=null
	if (window.XMLHttpRequest)
	{
		objXMLHttp=new XMLHttpRequest()
	}
	else if (window.ActiveXObject)
	{
		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
	}
	return objXMLHttp
}

var xmlHttp=GetXmlHttpObject();

function get_frm2(str,str1,str2,str3)
{ 
	xmlHttp2=GetXmlHttpObject2();
	if (xmlHttp2==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	document.getElementById(str2).innerHTML='<img src="images/loader.gif" border="0">';
	
	var url=str
	url=url+"?id="+str1+"&str="+str3;
	url=url+"&sid="+Math.random()
	xmlHttp2.onreadystatechange=function()
	{
		if (xmlHttp2.readyState==4 || xmlHttp2.readyState=="complete")
		{ 
			document.getElementById(str2).innerHTML=xmlHttp2.responseText;
		}
	};

	xmlHttp2.open("GET",url,true)
	xmlHttp2.send(null)
}

function get_frm_post(str,str1,str2,str3,str4,str5,str6)
{ 
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	document.getElementById(str2).innerHTML='<img src="images/ajax_loader.gif" border="0">';
	
	var url=str
	url=url+"?id="+str1+"&str="+str3;
	
	url=url+"&sid="+Math.random()
	var params = "str4="+str4+"&str5="+str5+"&str6="+str6;

	xmlHttp.open("POST",url,true)
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("Content-length", params.length);
	xmlHttp.setRequestHeader("Connection", "close");

	xmlHttp.onreadystatechange=function()
	{
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
			document.getElementById(str2).innerHTML=xmlHttp.responseText;	
		}
	};
	xmlHttp.send(params)
}

function GetXmlHttpObject2()
{ 
	var objXMLHttp2=null
	if (window.XMLHttpRequest)
	{
		objXMLHttp2=new XMLHttpRequest()
	}
	else if (window.ActiveXObject)
	{
		objXMLHttp2=new ActiveXObject("Microsoft.XMLHTTP")
	}
	return objXMLHttp2
}

var xmlHttp2=GetXmlHttpObject2();