
		function GetXmlHttpObject()
		{
			var xmlHttp=null;
			try
			{
				// Firefox, Opera 8.0+, Safari
				xmlHttp=new XMLHttpRequest();
			}
			catch (e)
			{
				// Internet Explorer
				try
				{
					xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
				}
				catch (e)
				{
					xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
				}
			}
			return xmlHttp;
		}
		
		///////////////////////////////////////////////////////////////////////////////////////// general ajx function
		
		
		
		function OtherCtntMe(phppage,qrylst,divid)
		{
			//alert(qrylst);
			xmlHttp=GetXmlHttpObject();
			
			if (xmlHttp==null)
			{
				alert ("Your browser does not support AJAX!");
				return;
			}
			
			var url=phppage;
			url=url+"?"+qrylst;
			//alert(url);
			//url=url+"&sid="+Math.random();
			
			xmlHttp.open('GET',url,true);

			xmlHttp.onreadystatechange=function(){ onstateChanged7(divid); }

			xmlHttp.send(null);
		}
		
		function onstateChanged7(ctrlname) 
		{ 
			//alert(ctrlname);
			if(xmlHttp.readyState==4)
			{ 
				var rslt = xmlHttp.responseText;
				//alert(rslt);
				document.getElementById(ctrlname).innerHTML = rslt;
			}
		
		}
		
		function UserAcco(phppage,qrylst,divid)
		{
			//alert(qrylst);
			xmlHttp=GetXmlHttpObject();
			
			if (xmlHttp==null)
			{
				alert ("Your browser does not support AJAX!");
				return;
			}
			
			var utp=document.getElementById('user_type').value;
			if(utp != "")
			{
				utp="&usertype=" + utp;
			}
			else
			{
				utp="";	
			}
			
			var url=phppage;
			url=url+"?"+qrylst+utp;
			//alert(url);
			//url=url+"&sid="+Math.random();
			
			xmlHttp.open('GET',url,true);

			xmlHttp.onreadystatechange=function(){ onstateChangedUAC(divid); }

			xmlHttp.send(null);
		}
		
		function onstateChangedUAC(ctrlname) 
		{ 
			//alert(ctrlname);
			if(xmlHttp.readyState==4)
			{ 
				var rslt = xmlHttp.responseText;
				//alert(rslt);
				document.getElementById(ctrlname).innerHTML = rslt;
			}
		
		}
		
		function ChangeAcco(phppage,qrylst,divid)
		{
			document.getElementById('loading').style.display = "inline";
			//alert(qrylst);
			xmlHttp=GetXmlHttpObject();
			
			if (xmlHttp==null)
			{
				alert ("Your browser does not support AJAX!");
				return;
			}
			
			var booktype1=document.getElementById('booktype1').value;
			if(booktype1 != "")
			{
				bt="&actid=" + booktype1;
			}
			else
			{
				bt="";	
			}
			
			var url=phppage;
			url=url+"?"+qrylst+bt;
			//alert(url);
			//url=url+"&sid="+Math.random();
			
			xmlHttp.open('GET',url,true);

			xmlHttp.onreadystatechange=function(){ onstateChangeAcco(divid); }

			xmlHttp.send(null);
		}
		
		function onstateChangeAcco(ctrlname) 
		{ 
			//alert(ctrlname);
			if(xmlHttp.readyState==4)
			{ 
				var rslt = xmlHttp.responseText;
				document.getElementById('loading').style.display = "none";
				//alert(rslt);
				document.getElementById(ctrlname).innerHTML = rslt;
			}
		
		}
		
		function ChangeTr(phppage,qrylst,divid)
		{
			//alert(qrylst);
			document.getElementById('loading').style.display = "inline";
			xmlHttp=GetXmlHttpObject();
			
			if (xmlHttp==null)
			{
				alert ("Your browser does not support AJAX!");
				return;
			}
			
			var booktype2=document.getElementById('booktype2').value;
			if(booktype2 != "")
			{
				bt="&trtid=" + booktype2;
			}
			else
			{
				bt="";	
			}
			
			var url=phppage;
			url=url+"?"+qrylst+bt;
			//alert(url);
			//url=url+"&sid="+Math.random();
			
			xmlHttp.open('GET',url,true);

			xmlHttp.onreadystatechange=function(){ onstateChangeTr(divid); }

			xmlHttp.send(null);
		}
		
		function onstateChangeTr(ctrlname) 
		{ 
			//alert(ctrlname);
			if(xmlHttp.readyState==4)
			{ 
				var rslt = xmlHttp.responseText;
				document.getElementById('loading').style.display = "none";
				//alert(rslt);
				document.getElementById(ctrlname).innerHTML = rslt;
			}
		
		}
		
		
		//desing contest details page
		function CheckDate(phppage,qrylst,divid)
		{
			//alert(qrylst);
			document.getElementById(divid).style.display = "none";
			document.getElementById('loading').style.display = "inline";
			var day=document.getElementById('day').value;
			var month=document.getElementById('month').value;
			var year=document.getElementById('year').value;
			//alert(day);
			//alert(month);
			//alert(year);
			
			if(day != "")
			{
				day="&day=" + day;
			}
			else
			{
				day="";	
			}
			
			if(month != "")
			{
				month="&month=" + month;
			}
			else
			{
				month="";	
			}
			
			if(year != "")
			{
				year="&year=" + year;
			}
			else
			{
				year="";	
			}
			
			xmlHttp=GetXmlHttpObject();
			
			if (xmlHttp==null)
			{
				alert ("Your browser does not support AJAX!");
				return;
			}
			
			var url=phppage;
			url=url+"?"+qrylst+day+month+year;
			//alert(url);
			//url=url+"&sid="+Math.random();
			
			xmlHttp.open('GET',url,true);

			xmlHttp.onreadystatechange=function(){ onstateChangedDT(divid); }

			xmlHttp.send(null);
		}
		
		function onstateChangedDT(ctrlname) 
		{ 
			//alert(ctrlname);
			if(xmlHttp.readyState==4)
			{ 
				 var rslt = xmlHttp.responseText;
				
				//alert(rslt);
				document.getElementById(ctrlname).style.display = "inline";
				document.getElementById('loading').style.display = "none";
				document.getElementById(ctrlname).innerHTML = rslt;
			}
		}
		
		//desing contest details page
		function CheckDate2(phppage,qrylst,divid)
		{
			//alert(qrylst);
			document.getElementById(divid).style.display = "none";
			document.getElementById('loading').style.display = "inline";
			var month=document.getElementById('CardExpiryMM').value;
			var year=document.getElementById('CardExpiryYY').value;
			//alert(day);
			//alert(month);
			//alert(year);
			
			
			if(month != "")
			{
				month="month=" + month;
			}
			else
			{
				month="";	
			}
			
			if(year != "")
			{
				year="&year=" + year;
			}
			else
			{
				year="";	
			}
			
			xmlHttp=GetXmlHttpObject();
			
			if (xmlHttp==null)
			{
				alert ("Your browser does not support AJAX!");
				return;
			}
			
			var url=phppage;
			url=url+"?"+qrylst+month+year;
			//alert(url);
			//url=url+"&sid="+Math.random();
			
			xmlHttp.open('GET',url,true);

			xmlHttp.onreadystatechange=function(){ onstateChangedDT2(divid); }

			xmlHttp.send(null);
		}
		
		function onstateChangedDT2(ctrlname) 
		{ 
			//alert(ctrlname);
			if(xmlHttp.readyState==4)
			{ 
				 var rslt = xmlHttp.responseText;
				
				//alert(rslt);
				document.getElementById(ctrlname).style.display = "inline";
				document.getElementById('loading').style.display = "none";
				document.getElementById(ctrlname).innerHTML = rslt;
			}
		}
		
				
		function ChangeTour(phppage,qrylst,divid)
		{
			//alert(qrylst);
			//return false;
			var brdsts;
			var bt1sts;
			var bt1sts2;
			var bookrad=document.getElementById('bookingrad').value;
			var booktype1=document.getElementById('booktype1').value;
			var booktype1ac=document.getElementById('booktype1ac').value;
			var day=document.getElementById('day').value;
			var month=document.getElementById('month').value;
			var year=document.getElementById('year').value;
			
			if(bookrad != "")
			{
				brdsts="bookingrad=" + bookrad;
			}
			else
			{
				brdsts="";	
			}
			if(booktype1 != "")
			{
				bt1sts="booktype=" + booktype1;
			}
			else
			{
				bt1sts="";	
			}
			if(booktype1ac != "")
			{
				bt1stsac="booktype1ac=" + booktype1ac;
			}
			else
			{
				bt1stsac="";	
			}
			if(day != "")
			{
				day="day=" + day;
			}
			else
			{
				day="";	
			}
			if(month != "")
			{
				month="month=" + month;
			}
			else
			{
				month="";	
			}
			if(year != "")
			{
				year="year=" + year;
			}
			else
			{
				year="";	
			}
			
			/*if(booktype2 != "")
			{
				bt1sts2="booktype2=" + booktype2;
			}
			else
			{
				bt1sts2="";	
			}*/
			
			//alert(pid);
			//document.getElementById(divid).style.display = "none";
			document.getElementById('loading').style.display = "inline";
			xmlHttp=GetXmlHttpObject();
			
			if (xmlHttp==null)
			{
				alert ("Your browser does not support AJAX!");
				return;
			}
			
			var url=phppage;
			url=url+"?"+qrylst+"&"+brdsts+"&"+bt1sts+"&"+bt1stsac+"&"+day+"&"+month+"&"+year;
			//alert(url);
			//url=url+"&sid="+Math.random();
			
			xmlHttp.open('GET',url,true);

			xmlHttp.onreadystatechange=function(){ onstateChanged(divid); }

			xmlHttp.send(null);
		}
		
		function onstateChanged(ctrlname) 
		{ 
			//alert(ctrlname);
			if(xmlHttp.readyState==4)
			{ 
				 var rslt = xmlHttp.responseText;
				
				//alert(rslt);
				//document.getElementById(ctrlname).style.display = "inline";
				document.getElementById('loading').style.display = "none";
				document.getElementById(ctrlname).innerHTML = rslt;
				
				$(function(){
				// Datepicker
				$('#datepicker').datepicker({
					beforeShow: readSelected, 
					onSelect: updateSelected, 
					minDate: new Date(2010, 1 - 1, 1), maxDate: new Date(2015, 12 - 1, 31),
					beforeShowDay: nationalDays, 
					inline: true
				});
				
				//hover states on the static widgets
				$('#dialog_link, ul#icons li').hover(
					function() { $(this).addClass('ui-state-hover'); }, 
					function() { $(this).removeClass('ui-state-hover'); }
				);
				
			});
			}
		
		}
		
		function ChangeTourTr(phppage,qrylst,divid)
		{
			//alert(qrylst);
			//return false;
			var brdsts;
			var bt1sts;
			var bt1sts2;
			var bookrad=document.getElementById('bookingrad').value;
			var booktype2=document.getElementById('booktype2').value;
			var booktype1tr=document.getElementById('booktype1tr').value;
			
			var day=document.getElementById('day').value;
			var month=document.getElementById('month').value;
			var year=document.getElementById('year').value;
			
			//alert(booktype1tr);
			
			if(bookrad != "")
			{
				brdsts="bookingrad=" + bookrad;
			}
			else
			{
				brdsts="";	
			}
			if(booktype2 != "")
			{
				bt1sts="booktype=" + booktype2;
			}
			else
			{
				bt1sts="";	
			}
			if(booktype1tr != "")
			{
				bt1stsac="booktype1tr=" + booktype1tr;
			}
			else
			{
				bt1stsac="";	
			}
			if(day != "")
			{
				day="day=" + day;
			}
			else
			{
				day="";	
			}
			if(month != "")
			{
				month="month=" + month;
			}
			else
			{
				month="";	
			}
			if(year != "")
			{
				year="year=" + year;
			}
			else
			{
				year="";	
			}
			
			/*if(booktype2 != "")
			{
				bt1sts2="booktype2=" + booktype2;
			}
			else
			{
				bt1sts2="";	
			}*/
			
			//alert(pid);
			//document.getElementById(divid).style.display = "none";
			document.getElementById('loading').style.display = "inline";
			xmlHttp=GetXmlHttpObject();
			
			if (xmlHttp==null)
			{
				alert ("Your browser does not support AJAX!");
				return;
			}
			
			var url=phppage;
			url=url+"?"+qrylst+"&"+brdsts+"&"+bt1sts+"&"+bt1stsac+"&"+day+"&"+month+"&"+year;
			//alert(url);
			//url=url+"&sid="+Math.random();
			
			xmlHttp.open('GET',url,true);

			xmlHttp.onreadystatechange=function(){ onstateChangedTr(divid); }

			xmlHttp.send(null);
		}
		
		function onstateChangedTr(ctrlname) 
		{ 
			//alert(ctrlname);
			if(xmlHttp.readyState==4)
			{ 
				 var rslt = xmlHttp.responseText;
				
				//alert(rslt);
				//document.getElementById(ctrlname).style.display = "inline";
				document.getElementById('loading').style.display = "none";
				document.getElementById(ctrlname).innerHTML = rslt;
				
				$(function(){

				// Datepicker
				$('#datepicker').datepicker({
					beforeShow: readSelected, 
					onSelect: updateSelected, 
					minDate: new Date(2010, 1 - 1, 1), maxDate: new Date(2015, 12 - 1, 31),
					beforeShowDay: nationalDays, 
					inline: true
				});
				
				//hover states on the static widgets
				$('#dialog_link, ul#icons li').hover(
					function() { $(this).addClass('ui-state-hover'); }, 
					function() { $(this).removeClass('ui-state-hover'); }
				);
				
			});
			}
		
		}
		
		////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		
		
		function GetSelectedItem()
		{

		var len = document.form1.bloglist.length
		var i = 0
		var chosen = ""
		
			for (i = 0; i < len; i++)
			{
				if (document.form1.bloglist[i].selected)
				{
				chosen = chosen + ", " + document.form1.bloglist[i].value;
				}
			}
		chosen = chosen.substring(1);
		
		ajaxContMe(chosen,document.getElementById('userlist').value)
		
		}
		
		////////////////////////////////////FOR SELECT ALL VALUE OF MULTIPLE SELECT //////////////////////////////////
		
		function selectAllOptions(th,obj)
		{
			if(th.checked==true)
			{
				for (var i=0; i<obj.options.length; i++) 
				{
					obj.options[i].selected = true;
				}
			}
		}
		
		function testalert(phppage)
		{
			alert("This js is working" + phppage);
			return false;
		}
	
		
	
	function multiple_checkbox(theForm)
	{
		var z = 0,ischk = 0, DeleteItms = '0';
	 	for(z=0; z<theForm.length;z++)
		{
			  //alert(theForm[z].name);
			  if(theForm[z].type == 'checkbox' && theForm[z].name == 'deleterecord[]' && (!theForm[z].disabled) && (theForm[z].checked))
				{
					ischk = 1;
					DeleteItms = DeleteItms + ',' + theForm[z].value;
					//alert(DeleteItms);
				}
		}
		
		 if(ischk == 0)
		 {
			 alert("Select atleast 1 Item !");
			 return false;
		 }
		return DeleteItms.substr(2);
	}
		
		function DelMulti_cart_items(theForm,thpage)
		{	
			var delitem1 = multiple_checkbox(theForm);
			if(delitem1!=false)
			document.location.href='remove_cart_items.php?ids='+delitem1;
		}
		
		function DelMulti(thpage,theForm,divid,qrystr)
		{	
			
			var delitem = multiple_checkbox(theForm);
			if (delitem != "") 
			{
				if (confirm('Are you sure you wish to remove this crowd?')) 
				{
					OtherCtntMe(thpage,qrystr+'&del=1&delrec='+delitem,divid);
				}
			}
		}
		
		function ActiveMulti(path,theForm,thpage)
		{
			var activeitem = multiple_checkbox(theForm);
			ajaxCtntMe(path + 'admin/general/statechange.php','pag='+thpage+'&act=7&ids='+activeitem,'righttd');
		}
		
		function inActiveMulti(path,theForm,thpage)
		{
			
			var inactiveitem = multiple_checkbox(theForm);
			ajaxCtntMe(path + 'admin/general/statechange.php','pag='+thpage+'&act=8&ids='+inactiveitem,'righttd');
		}
		function fr(path,theForm,thpage)
		{
			
			var featured = multiple_checkbox(theForm);
			ajaxCtntMe(path + 'admin/general/statechange.php','pag='+thpage+'&act=9&ids='+featured,'righttd');
		}
		function wee(path,theForm,thpage)
		{
			var week = multiple_checkbox(theForm);
			ajaxCtntMe(path + 'admin/general/statechange.php','pag='+thpage+'&act=10&ids='+week,'righttd');
		}
		
		function mo(path,theForm,thpage)
		{
			var month = multiple_checkbox(theForm);
			ajaxCtntMe(path + 'admin/general/statechange.php','pag='+thpage+'&act=11&ids='+month,'righttd');
		}
		function ho(path,theForm,thpage)
		{
			var hot = multiple_checkbox(theForm);
			ajaxCtntMe(path + 'admin/general/statechange.php','pag='+thpage+'&act=12&ids='+hot,'righttd');
		}
		
				function checkUncheckAll(theElement) {
     var theForm = theElement.form, z = 0;
	 for(z=0; z<theForm.length;z++){
      if(theForm[z].type == 'checkbox' && theForm[z].name != 'checkall'){
	  theForm[z].checked = theElement.checked;
	  }
     }
    }