
		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);
			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;
			//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).style.display = "inline";
				document.getElementById('loading').style.display = "none";
				document.getElementById(ctrlname).innerHTML = rslt;
			}
			
			dropdowncontent.init("contentlink", "left-top", 300, "mouseover");
			window.onload = initSlideShow();
		}
		
		
		function SearchMe(phppage,qrylst,divid)
		{
			//alert(qrylst);
			//return false;
			var st;
			var st=document.getElementById('st').value;
			
			
			if(st != "")
			{
				var stdtx="st=" + st  ;	
			}
			else
			{
				var stdtx="st=";	
			}
			//alert(stdtx);
			
			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+"?"+stdtx;
			//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 AddComment(phppage,qrylst,divid)
		{
			//alert(qrylst);
			//return false;
			var st;
			var st=document.getElementById('com_txt').value;
			
			
			if(st != "")
			{
				var stdtx="st=" + st  ;	
			}
			else
			{
				alert("Please enter comment");
				document.getElementById('com_txt').focus();
				return false;
				var stdtx="st=0";	
			}
			//alert(stdtx);
			
			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+"?"+stdtx+"&"+qrylst;
			//alert(url);
			//url=url+"&sid="+Math.random();
			
			xmlHttp.open('GET',url,true);

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

			xmlHttp.send(null);
		}
		
		function onstateChangedCom(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 AddCommentMod(phppage,qrylst,divid)
		{
			//alert(qrylst);
			//return false;
			var st,nm,em;
			var st=document.getElementById('com_txt').value;
			var nm=document.getElementById('name').value;
			var em=document.getElementById('email').value;
			
			if(nm != "")
			{
				var nmtx="nm=" + nm;	
			}
			else
			{
				alert("Please enter name");
				document.getElementById('name').focus();
				return false;
				var nmtx="nm=0";	
			}
			
			if(em != "")
			{
				var emtx="em=" + em;	
			}
			else
			{
				alert("Please enter email");
				document.getElementById('email').focus();
				return false;
				var emtx="em=0";	
			}
			
			if(st != "")
			{
				var stdtx="st=" + st;	
			}
			else
			{
				alert("Please enter comment");
				document.getElementById('com_txt').focus();
				return false;
				var stdtx="st=0";	
			}
			
			//alert(stdtx);
			
			document.getElementById(divid).style.display = "none";
			document.getElementById('loading2').style.display = "inline";
			xmlHttp=GetXmlHttpObject();
			
			if (xmlHttp==null)
			{
				alert ("Your browser does not support AJAX!");
				return;
			}
			
			var url=phppage;
			url=url+"?"+stdtx+"&"+nmtx+"&"+emtx+"&"+qrylst;
			//alert(url);
			//url=url+"&sid="+Math.random();
			
			xmlHttp.open('GET',url,true);

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

			xmlHttp.send(null);
		}
		
		function onstateChangedComMod(ctrlname) 
		{ 
			//alert(ctrlname);
			if(xmlHttp.readyState==4)
			{ 
				 var rslt = xmlHttp.responseText;
				
				//alert(rslt);
				document.getElementById(ctrlname).style.display = "inline";
				document.getElementById('loading2').style.display = "none";
				document.getElementById(ctrlname).innerHTML = rslt;
				
			}
		
		}
		
		
		////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		
		
		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;
	  }
     }
    }
	