	function GetXmlHttpObject(handler)
		{ 
		var objXmlHttp=null
		
		if (navigator.userAgent.indexOf("Opera")>=0)
		{
		alert("This example doesn't work in Opera") 
		return 
		}
		if (navigator.userAgent.indexOf("MSIE")>=0)
		{ 
		var strName="Msxml2.XMLHTTP"
		if (navigator.appVersion.indexOf("MSIE 5.5")>=0)
		{
		strName="Microsoft.XMLHTTP"
		} 
		try
		{ 
		objXmlHttp=new ActiveXObject(strName)
		objXmlHttp.onreadystatechange=handler 
		return objXmlHttp
		} 	
		catch(e)
		{ 
		alert("Error. Scripting for ActiveX might be disabled") 
		return 
		} 
		} 
		if (navigator.userAgent.indexOf("Mozilla")>=0)
		{
		objXmlHttp=new XMLHttpRequest()
		objXmlHttp.onload=handler
		objXmlHttp.onerror=handler 
		return objXmlHttp
		}
		}

	//var url = "ajax.php?param="; // The server-side scripts	
		
		
		
		function editusercall(id,edituserinfo){
			
			var userid = id;
			var edituserinfo=edituserinfo;

			var myRandom=parseInt(Math.random()*99999999);  // cache buster
			xmlHttp=GetXmlHttpObject(handleHttpResponse);
			xmlHttp.open("GET","ajax.php?userid="+userid+"&edituserinfo="+edituserinfo);
			xmlHttp.send(null);
		}
		
		function handleHttpResponse() {
			if (xmlHttp.readyState == 4) {
			//alert(xmlHttp.responseText);
				document.getElementById("edituserdiv").style.display="block";
			  document.getElementById("edituserdiv").innerHTML=xmlHttp.responseText;
			  
			}
		}
		
		function createusercall(createuserinfo){
			
			
			var createuserinfo=createuserinfo;

			var myRandom=parseInt(Math.random()*99999999);  // cache buster
			xmlHttp=GetXmlHttpObject(handleHttpResponsecreate);
			xmlHttp.open("GET","ajax.php?createuserinfo="+createuserinfo);
			xmlHttp.send(null);
		}
		
		function handleHttpResponsecreate() {
			if (xmlHttp.readyState == 4) {
			//alert(xmlHttp.responseText);
				document.getElementById("createuserdiv").style.display="block";
			  document.getElementById("createuserdiv").innerHTML=xmlHttp.responseText;
			  
			}
		}
		
		
		function addclifun(num,addcli){
			//alert(addnote2);
			
			var num=num;
			var addcli=addcli;

			var myRandom=parseInt(Math.random()*99999999);  // cache buster
			xmlHttp=GetXmlHttpObject(handleHttpResponseaddcli);
			xmlHttp.open("GET","ajax.php?num="+num+"&addcli="+addcli);
			xmlHttp.send(null);
		}
		
		function handleHttpResponseaddcli() {
			if (xmlHttp.readyState == 4) {
				//alert(xmlHttp.responseText);
				document.getElementById("addclidiv").style.display="block";
			  document.getElementById("addclidiv").innerHTML=xmlHttp.responseText;
			}
		}
		
//	



var url = "ajax.php"; 

function funproductdetails(val) 
	{
		//alert(val);
		/*var  category= document.getElementById("txtNewCategory").value;*/
		
		
		var params = 'task=client_details&client='+val;
		//alert(params)
		//alert(url)
		xmlHttp=GetXmlHttpObject(handleHttpResponse2);
		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 = handleHttpResponse2;
		xmlHttp.send(params);
		//alert(params);
	}
   function handleHttpResponse2() 
   {      
		if (xmlHttp.readyState == 4) 
		{    
			  if(xmlHttp.status==200) 
			  {   
				  var results=xmlHttp.responseText;
				// alert(results);
				  var id = new Array();
				  var catid = new Array(); 
				  var addnewproduct = new Array();
				
				  id=results.split("&");
				 st=id[4];
					//alert('http://localhost/qlico/pics/images/'+id[5]);
				  if(id[0]==01)
				  {
					  // document.getElementById('schedule_product_cost').value =id[1];
					   //document.getElementById('image_thumb').innerHTML = "<IMG SRC='http://qlico/pics/images/'+id[2]+>";
					 //  document.createschedule.imgthumb.src='http://localhost/qlico/pics/images/'+id[2];
					   document.getElementById('address1').value = id[1];
					   document.getElementById('address2').value = id[2];
					   document.getElementById('city').value = id[3];
					  // document.getElementById('state').options.value[st].selected  = true;
					   document.getElementById('zipcode').value =id[5];
					      document.getElementById('statesel').innerHTML = id[6];
				  }
			  }
		  }
		}













function calrate(val,clientid) {
			
			var positionid = val;
			var clientid=clientid;

			var myRandom=parseInt(Math.random()*99999999);  // cache buster
			xmlHttp=GetXmlHttpObject(handleHttpResponse4);
			xmlHttp.open("GET","ajax.php?positionid="+positionid+"&clientid="+clientid+"&calposrate=yes");
			xmlHttp.send(null);
		}
		
		function handleHttpResponse4() {
			if (xmlHttp.readyState == 4) {
			//alert(xmlHttp.responseText);
				document.getElementById("rate").value=xmlHttp.responseText;
			 // document.getElementById("edituserdiv").innerHTML=xmlHttp.responseText;
			  
			}
		}
		
		
		function assignposition(eventdayid,eventid,posid,qty,posname){
			//alert("hi");
			var eventdayid = eventdayid;
			var eventid=eventid;
			var posid=posid;
			var qty=qty;
			var asspos="yes";
			var posname=posname;
			
			
			

			var myRandom=parseInt(Math.random()*99999999);  // cache buster
			xmlHttp=GetXmlHttpObject(handleHttpResponse5);
			xmlHttp.open("GET","ajax.php?eventdayid="+eventdayid+"&eventid="+eventid+"&posid="+posid+"&qty="+qty+"&asspos="+asspos+"&posname="+posname);
			xmlHttp.send(null);
		}
		
		function handleHttpResponse5() {
			if (xmlHttp.readyState == 4) {
			//alert(xmlHttp.responseText);
				document.getElementById("assignposdiv").style.display="block";
			  document.getElementById("assignposdiv").innerHTML=xmlHttp.responseText;
			  
			}
		}
		
		
			function showeventdetails5(eventid,showdetails,eventname){
			//alert("hi");
		
			var eventid=eventid;
			var showdetails="yes";
			
			
			
			

			var myRandom=parseInt(Math.random()*99999999);  // cache buster
			xmlHttp=GetXmlHttpObject(handleHttpResponse6);
			xmlHttp.open("GET","ajax.php?eventid="+eventid+"&showdetails="+showdetails+"&eventname="+eventname);
			xmlHttp.send(null);
		}
		
		function handleHttpResponse6() {
			if (xmlHttp.readyState == 4) {
			//alert(xmlHttp.responseText);
				document.getElementById("showevedetails").style.display="block";
			  document.getElementById("showevedetails").innerHTML=xmlHttp.responseText;
			  
			}
		}
		
		
		
		
		
		function edituserdetailsposition(userid,eventname,eventid){
			//alert("hi");
		
			var assignpositionid=assignpositionid;
			var editpositiondetails="yes";
			var eventname=eventname;
			var eventid=eventid;
			
			
			

			var myRandom=parseInt(Math.random()*99999999);  // cache buster
			xmlHttp=GetXmlHttpObject(handleHttpResponse7);
			xmlHttp.open("GET","ajax.php?userid="+userid+"&editpositiondetails="+editpositiondetails+"&eventname="+eventname+"&eventid="+eventid);
			xmlHttp.send(null);
		}
		
		function handleHttpResponse7() {
			if (xmlHttp.readyState == 4) {
			//alert(xmlHttp.responseText);
				document.getElementById("editeventassposdetails").style.display="block";
			  document.getElementById("editeventassposdetails").innerHTML=xmlHttp.responseText;
			  
			}
		}
		
		
		
		
	function viewchecklist(eventid,eventname){
			//alert("hi");
		
			var eventid=eventid;
			var viewchecklistval="yes";
			var eventname=eventname;
			
			
			

			var myRandom=parseInt(Math.random()*99999999);  // cache buster
			xmlHttp=GetXmlHttpObject(handleHttpResponse8);
			xmlHttp.open("GET","ajax.php?eventid="+eventid+"&viewchecklistval="+viewchecklistval+"&eventname="+eventname);
			xmlHttp.send(null);
		}
		
		function handleHttpResponse8() {
			if (xmlHttp.readyState == 4) {
			//alert(xmlHttp.responseText);
				document.getElementById("viewchecklistdiv").style.display="block";
			  document.getElementById("viewchecklistdiv").innerHTML=xmlHttp.responseText;
			  
			}
		}
			
		
		
		
		function searcheventfunc(searcheve){
			//alert("hi");
		
			var searcheve=searcheve;
			var myRandom=parseInt(Math.random()*99999999);  // cache buster
			xmlHttp=GetXmlHttpObject(handleHttpResponse9);
			xmlHttp.open("GET","ajax.php?searcheve="+searcheve);
			xmlHttp.send(null);
		}
		
		function handleHttpResponse9() {
			if (xmlHttp.readyState == 4) {
			//alert(xmlHttp.responseText);
				document.getElementById("searcheventdiv").style.display="block";
			  document.getElementById("searcheventdiv").innerHTML=xmlHttp.responseText;
			  
			}
		}
			
		function showpaymentdetails(eventid,showpaymentdetails12){
			var eventid = eventid;
			
			var showpaymentdetails12=showpaymentdetails12;
		
			
			var myRandom=parseInt(Math.random()*99999999);  // cache buster
			xmlHttp=GetXmlHttpObject(handleHttpResponsedetails33);
			xmlHttp.open("GET","ajax.php?eventid="+eventid+"&showpaymentdetails12="+showpaymentdetails12);
			xmlHttp.send(null);
		}
		
		function handleHttpResponsedetails33() {
			if (xmlHttp.readyState == 4) {
			//	alert(xmlHttp.responseText);
			  document.getElementById("paymentdetails").style.display="block";
			  document.getElementById("paymentdetails").innerHTML=xmlHttp.responseText;
			  
			}
		}
	
		function editleadtypedef(id,editltydef){
			var id = id;
			var editltydef=editltydef;
			
			
			var myRandom=parseInt(Math.random()*99999999);  // cache buster
			xmlHttp=GetXmlHttpObject(handleHttpResponse22);
			xmlHttp.open("GET","ajax.php?id="+id+"&editltydef="+editltydef);
			xmlHttp.send(null);
		}
		
		function handleHttpResponse22() {
			if (xmlHttp.readyState == 4) {
			//alert(xmlHttp.responseText);
				document.getElementById("editltypedef").style.display="block";
			  document.getElementById("editltypedef").innerHTML=xmlHttp.responseText;
			  
			}
		}
		
		
		
		
			function assignedinfofun(assignedtime,assignhrs,assigneddayid){
			var assignedtime = assignedtime;
			var assignhrs=assignhrs;
			var assigneddayid=assigneddayid;
			
			
			var myRandom=parseInt(Math.random()*99999999);  // cache buster
			xmlHttp=GetXmlHttpObject(handleHttpResponse23);
			xmlHttp.open("GET","ajax.php?assignedtime="+assignedtime+"&assignhrs="+assignhrs+"&assigneddayid="+assigneddayid);
			xmlHttp.send(null);
		}
		
		function handleHttpResponse23() {
			if (xmlHttp.readyState == 4) {
			//alert(xmlHttp.responseText);
				document.getElementById("assignedinfodiv").style.display="block";
			  document.getElementById("assignedinfodiv").innerHTML=xmlHttp.responseText;
			  
			}
		}
		
		
		function chk(nm,val,userid){
			
			
			var myRandom=parseInt(Math.random()*99999999);  // cache buster
			xmlHttp=GetXmlHttpObject(handleHttpResponse24);
			
					xmlHttp.open("GET","ajax2.php?assuid=yes&assignedchk=yes&userid="+userid);
			xmlHttp.send(null);	
			
				
		}
		function handleHttpResponse24() {
			if (xmlHttp.readyState == 4) {
				var rs=xmlHttp.responseText;
				//alert(rs);
				var rs1=rs.split("&");
				
				if(rs1[1]=="yes"){
				alert(rs1[0]);
				window.location.reload(true);	
				}
				
				
			//  document.getElementById("showmsg").innerHTML=xmlHttp.responseText;
			  
			}
		}
		function createvenue(createvenue){
			
			
			var createvenue=createvenue;

			var myRandom=parseInt(Math.random()*99999999);  // cache buster
			xmlHttp=GetXmlHttpObject(handleHttpResponsecreate43);
			xmlHttp.open("GET","ajax.php?createvenue="+createvenue);
			xmlHttp.send(null);
		}
		
		function handleHttpResponsecreate43() {
			if (xmlHttp.readyState == 4) {
			//alert(xmlHttp.responseText);
				document.getElementById("createvenuediv").style.display="block";
			  document.getElementById("createvenuediv").innerHTML=xmlHttp.responseText;
			  
			}
		}
		
		
		function editvenue(val,editvenue){
			
			//alert(val);
			var editvenue=editvenue;

			var myRandom=parseInt(Math.random()*99999999);  // cache buster
			xmlHttp=GetXmlHttpObject(handleHttpResponsecreate44);
			xmlHttp.open("GET","ajax.php?editvenue="+editvenue+"&val="+val);
			xmlHttp.send(null);
		}
		
		function handleHttpResponsecreate44() {
			if (xmlHttp.readyState == 4) {
			//(xmlHttp.responseText);
				document.getElementById("editvenuediv").style.display="block";
			  document.getElementById("editvenuediv").innerHTML=xmlHttp.responseText;
			  
			}
		}
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		var url = "ajax.php"; 

function venuedetails(val) 
	{
		//alert(val);
		/*var  category= document.getElementById("txtNewCategory").value;*/
		
		
		var params = 'task=venue_details&venueid='+val;
		//alert(params)
		//alert(url)
		xmlHttp=GetXmlHttpObject(handleHttpResponse45);
		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 = handleHttpResponse2;
		xmlHttp.send(params);
		//alert(params);
	}
   function handleHttpResponse45() 
   {      
		if (xmlHttp.readyState == 4) 
		{    
			  if(xmlHttp.status==200) 
			  {   
				  var results=xmlHttp.responseText;
				//alert(results);
				  var id = new Array();
				  var catid = new Array(); 
				  var addnewproduct = new Array();
				
				  id=results.split("&");
				 st=id[4];
					//alert('http://localhost/qlico/pics/images/'+id[5]);
					// "02&".$venuename."&".$venueaddress1."&".$venueaddress2."&".$venuecity."&".$venuestate."&".$venuezip."&".$venuecontact."&";
				  if(id[0]==02)
				  {
					  // document.getElementById('schedule_product_cost').value =id[1];
					   //document.getElementById('image_thumb').innerHTML = "<IMG SRC='http://qlico/pics/images/'+id[2]+>";
					 //  document.createschedule.imgthumb.src='http://localhost/qlico/pics/images/'+id[2];
					   document.getElementById('venueaddress1').value = id[2];
					   document.getElementById('venueaddress2').value = id[3];
					   document.getElementById('venuecity').value = id[4];
					  //document.getElementById('state').options.value[st].selected  = true;
					   document.getElementById('venuezip').value =id[6];
					    document.getElementById('venuecontact').value =id[7];
					      document.getElementById('vstatesel').innerHTML = id[8];
				  }
			  }
		  }
		}


function calculatedis(organizationid,coursecost){
			
			//alert(val);
			var editvenue=editvenue;

			var myRandom=parseInt(Math.random()*99999999);  // cache buster
			xmlHttp=GetXmlHttpObject(handleHttpResponsecreate44);
			xmlHttp.open("GET","caldis.php?organizationid="+organizationid+"&coursecost="+coursecost);
			xmlHttp.send(null);
		}
		
		function handleHttpResponsecreate44() {
			if (xmlHttp.readyState == 4) {
			//alert(xmlHttp.responseText);
			var results=xmlHttp.responseText;
			 var id = new Array();
			  id=results.split("##");
			document.getElementById('discount').value = id[0];
			document.getElementById('totalamount').value = id[1];
			
			
				
			  
			}
		}
		function showiputarray(val){
			
			//alert(val);
			var val=val;

			var myRandom=parseInt(Math.random()*99999999);  // cache buster
			xmlHttp=GetXmlHttpObject(handleHttpResponsecreate45);
			xmlHttp.open("GET","showinput.php?val="+val);
			xmlHttp.send(null);
		}
		
		function handleHttpResponsecreate45() {
			if (xmlHttp.readyState == 4) {
			//alert(xmlHttp.responseText);
			var results=xmlHttp.responseText;
			document.getElementById("showinputdiv").style.display="block";
			document.getElementById('showinputdiv').innerHTML = results;
			
			
			
				
			  
			}
		}
		
		
		
		
		
		function chkproduct(nm,val,productid){
			var myRandom=parseInt(Math.random()*99999999);  // cache buster
			xmlHttp=GetXmlHttpObject(handleHttpResponse46);
				if(nm.checked==true){
					xmlHttp.open("GET","ajax2.php?assuid=yes&assignedchk=yes&productid="+productid);
			xmlHttp.send(null);	
				}
				if(nm.checked==false){
					xmlHttp.open("GET","ajax2.php?assuid=yes&assignedchk=no&productid="+productid);
			xmlHttp.send(null);		
				}
		}
		function handleHttpResponse46() {
			if (xmlHttp.readyState == 4) {
				var rs=xmlHttp.responseText;
				var rs1=rs.split("&");
				//alert(rs);
			
					alert("Updated Successfully.");
					window.location.reload(true);	
			
				
				
			//  document.getElementById("showmsg").innerHTML=xmlHttp.responseText;
			  
			}
		}
		
		
		
		
		
		
		
		
