function addrows(max,inputid,name){ 
var num = Number(document.getElementById(inputid).value) + 1
document.getElementById(inputid).value = num
if(num <=max)
  {
	 text = name + num;
	document.getElementById(text).style.display='block';
  }
}
function textboxStyle(){
	var inputs = document.getElementsByTagName('input');
	for(var i=0;i<inputs.length;i++){
		if((inputs[i].type.toLowerCase()== 'text') || (inputs[i].type.toLowerCase()== 'password') || (inputs[i].type.toLowerCase()== 'file')){
			inputs[i].className+='inputs';
		}
	}
	var select = document.getElementsByTagName('select');
	for(var i=0;i<select.length;i++){
		//if((inputs[i].type.toLowerCase()== 'text') || (inputs[i].type.toLowerCase()== 'password') || (inputs[i].type.toLowerCase()== 'file')){
			select[i].className+='select';
		//}
	}
} 
function CheckAll(fmobj) {
  fmobj=eval(fmobj);
  for (var i=0;i<fmobj.elements.length;i++) {
    var e = fmobj.elements[i];
    if ( (e.type=='checkbox') && (!e.disabled) ) {
      fmobj.elements[i].checked=true;
    }
  }
}

function UnCheckAll(fmobj) {
  fmobj=eval(fmobj);
  for (var i=0;i<fmobj.elements.length;i++) {
    var e = fmobj.elements[i];
    if ( (e.type=='checkbox') && (!e.disabled) ) {
      fmobj.elements[i].checked=false;
    }
  }
}
function validate_holiday(form)
{
	if(form.htype.value=="")
	{
	  alert("Please specify Holiday Type.");
	  return false;
	 }
	/*else if(form.hicon.value=="")
	{
	   alert("Please upload icon for holiday.");
	   return false;
	}
	*/
}

function edit_holiday(form)
{
	if(form.htype.value=="")
	{
	  alert("Please specify Holiday Type.");
	  return false;
	 }
	 /*else if(form.ictype.value=="1"){
		if(form.hicon.value=="")
		{
		   alert("Please upload icon for holiday.");
		   return false;
		}
	}
	*/
}
function changeIcon(){
	document.getElementById("aid").style.display='none';
	document.getElementById("rid").style.display="";
	document.hform.ictype.value='1';
}

function changeFile(){
	document.getElementById("aid").style.display='none';
	document.getElementById("rid").style.display="";
	document.hform.ictype.value='1';
	document.hform.btype.disabled=false;
	document.hform.size.disabled=false;
}

function changeCategory(val){
	if(val=="")
		document.getElementById("ctd").style.display="";
	else if(val=="I")
		document.getElementById("ctd").style.display="";
	else
		document.getElementById("ctd").style.display='none';
}

function changeBanner(val){
	if(val=="")
		document.getElementById("upid").value="Manish";
	else if(val=="flash")
		document.getElementById("upid").value="flash";
	else if(val=="gif")
		document.getElementById("upid").value="gif";
	else
		document.getElementById("upid").value="jpeg";
}

function validate_search(form){
	if(form.keywordsearch.value==""){
	  alert("Please Enter the Search Word.");
	  return false;
	 }
}


function initialize(){ 
	document.getElementById("lblCount").value ="0";
	document.getElementById("videoCount").value ="0";
   
   // var map = new google.maps.Map2(document.getElementById("map"));
    //map.setCenter(new google.maps.LatLng(37.4419, -122.1419), 13);

}
 

/*function initialize() {
	document.getElementById("lblCount").value ="0";
	document.getElementById("videoCount").value ="0";
	//var map = new google.maps.Map2(document.getElementById("map"));
    //map.setCenter(new google.maps.LatLng(37.4419, -122.1419), 13);
  } */
 

function popUp(linkpage,wname,w, h,scroll){
	LeftPosition=(screen.width)?(screen.width-w)/2:100;
	TopPosition=(screen.height)?(screen.height-h)/2:100;
	w=w+18;
	//h=h+18;
	win=window.open(linkpage, wname, 'toolbars=0, scrollbars=' + scroll + ', location=0, statusbars=0, menubars=0, resizable=0, width='+w+', height='+h+', left = '+LeftPosition+', top = '+TopPosition+'');
	if(win.focus){
		win.focus();
	}
}


function rate(value,id) {
	 	
		 new Ajax.Updater( 'rating', 'ratediary.php?id='+ id +'&v='+value );
}


function addcomment()
{ 
  new Ajax.Updater('comments','addcomment.php',
  {
    method: 'post',
    parameters: $('cform').serialize(),
    onSuccess: function() {
       $('comment_text').value = '';
    }
  } );
 
}



function viewcomment()
{
	document.getElementById('commentid').style.display="block";
}

function send_url(url)
{
	document.location.href="login.php?"+url;
}
function daysBetween(date1, date2){
   if (date1.indexOf("-") != -1) { date1 = date1.split("-"); } else if (date1.indexOf("/") != -1) { date1 = date1.split("/"); } else { return 0; }
   if (date2.indexOf("-") != -1) { date2 = date2.split("-"); } else if (date2.indexOf("/") != -1) { date2 = date2.split("/"); } else { return 0; }
   if (parseInt(date1[0], 10) >= 1000) {
       var sDate = new Date(date1[0]+"/"+date1[1]+"/"+date1[2]);
   } else if (parseInt(date1[2], 10) >= 1000) {
       var sDate = new Date(date1[2]+"/"+date1[0]+"/"+date1[1]);
   } else {
       return 0;
   }
   if (parseInt(date2[0], 10) >= 1000) {
       var eDate = new Date(date2[0]+"/"+date2[1]+"/"+date2[2]);
   } else if (parseInt(date2[2], 10) >= 1000) {
       var eDate = new Date(date2[2]+"/"+date2[0]+"/"+date2[1]);
   } else {
       return 0;
   }
   var one_day = 1000*60*60*24;
   var daysApart = Math.ceil((sDate.getTime()-eDate.getTime())/one_day);
   return daysApart;
} 
function actionAd(form,action,id){
	form.id.value=id;
	form.action=action;
}

function stateChanged()
{ 
	if(xmlHttp.readyState==4)
	{
		//if(xmlHttp.responseText.length>0)
		{
			
			document.getElementById("txtHintfilter").innerHTML=xmlHttp.responseText;
		}
		//else
		//document.getElementById("txtHint").innerHTML='';
		//document.getElementById('ser1').style.display='none';
		  	//document.getElementById('ser1').style.display='inline';
		
	}
}

function countryChanged(){ 
	if(xmlHttp.readyState==4){ 
		document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
	}
}

function cityChanged(){ 
	if(xmlHttp.readyState==4){ 
		document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
	}
}

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;
}


function adv_delete(form)
{
	document.dform.submit();
}
function displ(id)
{
	if(document.getElementById(id).style.display=='block')
		document.getElementById(id).style.display='none';
	else
		document.getElementById(id).style.display='block';
}

function category_select(value,url){
	if(value==""){
		alert("Sorry, you have selected a group title or empty item. Please choose the correct category!");
		document.getElementById("catid").selectedIndex=0;
	}
	else
		document.location.href=url + "submitads.php?id="+value;
}


function maincategory(value){
	if(value==""){
		alert("Sorry, you have selected a  empty item. Please choose the correct category!");
		document.getElementById("catid").selectedIndex=0;
	}
	else
		document.location.href=pathurl + "submitads.php?id="+value;
}


function maincategory_select(value,url){
	if(value==""){
		alert("Sorry, you have selected a empty item. Please choose the correct category!");
		document.getElementById("catid").disabled=true;
		return false;
	}
	else{
		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
		  {
		  alert ("Your browser does not support AJAX!");
		  return;
		  } 
		var url="maincategory.php";
		url=url+"?id="+value;
		url=url+"&sid="+Math.random();
		xmlHttp.onreadystatechange=maincategorychanged;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);	
	}
}

function maincategorychanged(){ 
	if(xmlHttp.readyState==4){ 
		document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
	}
}


function maincategory_selectadvsearch(value,url){
	if(value==""){
		alert("Sorry, you have selected a empty item. Please choose the correct category!");
		document.getElementById("catid").disabled=true;
		return false;
	}
	else{
		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
		  {
		  alert ("Your browser does not support AJAX!");
		  return;
		  } 
		var url="maincategoryadvsearch.php";
		url=url+"?id="+value;
		url=url+"&sid="+Math.random();
		xmlHttp.onreadystatechange=maincategorychangedadvsearch;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);	
	}
}


function maincategorychangedadvsearch(){ 
	if(xmlHttp.readyState==4){ 
		document.getElementById("txtCat").innerHTML=xmlHttp.responseText;
	}
}

function state_adsearch_city(value)
{
		if(value!="")
		{
		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
		  {
		  alert ("Your browser does not support AJAX!");
		  return;
		  } 
		var url="server_state_search.php";
		url=url+"?id="+value;
		url=url+"&sid="+Math.random();
		xmlHttp.onreadystatechange=adsearchcityChanged;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);	
		}
}

function adsearchcityChanged(){ 
	if(xmlHttp.readyState==4){ 
		document.getElementById("txtHint2").innerHTML=xmlHttp.responseText;
	}
}

function state_search_city(value)
{
		if(value!="")
		{
		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
		  {
		  alert ("Your browser does not support AJAX!");
		  return;
		  } 
		var url="server_state_search.php";
		url=url+"?id="+value;
		url=url+"&sid="+Math.random();
		xmlHttp.onreadystatechange=searchcityChanged;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);	
		}
}

function country_select(value){

		if(value!="")
		{
		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
		  {
		  alert ("Your browser does not support AJAX!");
		  return;
		  } 
		var url="server_city.php";
		url=url+"?id="+value;
		url=url+"&sid="+Math.random();
		xmlHttp.onreadystatechange=countryChanged;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);	
		}
}

function select_city_state(value)
{
		cityid=document.getElementById('city').value;
		if(value!="")
		{
		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
		  {
		  alert ("Your browser does not support AJAX!");
		  return;
		  }
		var url="server_state.php";
		url=url+"?id="+value+"&cityid="+cityid;
		url=url+"&sid="+Math.random();
		xmlHttp.onreadystatechange=searchcityChanged;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);	
		}
}

function searchcityChanged(){ 
	if(xmlHttp.readyState==4){ 
		document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
	}
}

function select_state(value,id){
    if(value!=""){
	document.getElementById(id).value=value;
	select_city_state(value);
	return true;
	}
}



function select_country(value)
{
		if(value!="")
		{
		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
		  {
		  alert ("Your browser does not support AJAX!");
		  return;
		  } 
		var url="ajax_city.php";
		url=url+"?id="+value;
		url=url+"&sid="+Math.random();
		xmlHttp.onreadystatechange=cityChanged;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);	
		}
}

function select_city(country){
	document.getElementById('city').value=country;
	document.getElementById('set').value=1;

}



function showcheck(form,fieldname)
{
   var j=0;
   var l=0;
   var str;
   var str1;
   var total= 0;
   var count = 0;
   if(ads.checkbox1.length>0)
		count=ads.checkbox1.length;
   if(count == 0) {
     if(eval("document.ads.checkbox1.checked") == true) {
	   str = document.ads.checkbox1.value 
	   total += 1;
	   j=1;
	  }
	}
    else {
		for(var i=0;i<count; i++) {
		  if(document.ads.checkbox1[i].checked == 1){
		      if(l=="0")
			  str = document.ads.checkbox1[i].value;
			  else
			  str = str +","+ document.ads.checkbox1[i].value;
			  l++;
			  j=1;
			}
		}
	}
	if(j==1){
		 document.getElementById(fieldname).value=str;
	}
	else
		 document.getElementById(fieldname).value="";
}

function showlayer(nlayer)
{
 
if (document.layers)
document.layers[nlayer].visibility='show';
else 
document.all[nlayer].style.visibility='visible';
} 

function hidelayer(nlayer)
{
if (document.layers)
document.layers[nlayer].visibility='hide';
else 
document.all[nlayer].style.visibility='hidden';
} 
function delUser(form){
	var conf=confirm("Are you sure to Delete Users?");
	if(conf){
		form.act.value='Delete';
		return true;
	}
	else return false;
}


function category_search(value,url)
{
	if(value!="" && value!="%")
	{
		
		document.getElementById('txtHintfilter').innerHTML='';
		xmlHttp=GetXmlHttpObject();
		if(xmlHttp==null)
		{
			alert("Your browser does not support AJAX!");
			return;
		} 
		var url = url + "/subcategory.php";
		url=url+"?id="+value;
		url=url+"&sid="+Math.random();
		xmlHttp.onreadystatechange=stateChanged;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);	
	}
	else if(value=="%"){
		//document.getElementById('testvalue').value="0";
		//document.getElementById('ser1').style.display='';
		document.getElementById('txtHint').innerHTML='';
	}
	else {
		//document.getElementById('testvalue').value="0";
		alert("Sorry, you have selected a group title or empty item. Please choose the correct category!");
		document.getElementById('txtHintfilter').innerHTML='';
	}
	
}

function alphanumeric(alphane)
{
	var numaric = alphane;
	for(var j=0; j<numaric.length; j++)
		{
		  var alphaa = numaric.charAt(j);
		  var hh = alphaa.charCodeAt(0);
		  if((hh > 47 && hh<58) || (hh > 64 && hh<91) || (hh > 96 && hh<123))
		  {
		  }
		else	{
			 return false;
		  }
		}
 return true;
}


function usercheck(path){
 username=document.getElementById('txtuser').value;
 if(username==""){
	 alert("Enter Username");
	 return false;
 }
 
 if(!alphanumeric(username)){
	 alert("String is not valid");
	 return false;
 }
 xmlHttp=GetXmlHttpObject()
if (xmlHttp==null){
   alert ("Browser does not support HTTP Request")
   return
 }
var url=path+"/server.php"
url=url+"?user="+username
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=usercheckajax 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function usercheckajax() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
	 document.getElementById('usercheck').innerHTML=xmlHttp.responseText 
 } 
}


function admincountry(value,path)
{
		if(value!="")
		{
		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
		  {
		  alert ("Your browser does not support AJAX!");
		  return;
		  } 
		var url=path +"/"+"adminajax_state.php";
		url=url+"?id="+value;
		url=url+"&sid="+Math.random();
		xmlHttp.onreadystatechange=adminstateChanged;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);	
		}
}

function adminstateChanged(){ 
	if(xmlHttp.readyState==4){ 
		document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
	}
}

function admincity(value,path)
{
		if(value!="")
		{
		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
		  {
		  alert ("Your browser does not support AJAX!");
		  return;
		  } 
		var url=path +"/"+"adminajax_city.php";
		url=url+"?id="+value;
		url=url+"&sid="+Math.random();
		xmlHttp.onreadystatechange=admincityChanged;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);	
		document.getElementById("ct").disabled=false;
		document.getElementById("go").disabled=false;
		}
}

function admincityChanged(){ 
	if(xmlHttp.readyState==4){ 
		document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
	}
}

function adminstate(value)
{
	document.getElementById('state').value=value;	
}

function select_reg_state(value,path){
	document.getElementById('txtcity1').value='';
	if(value!="") {
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	var url=path + "server_regstate_search.php";
	url=url+"?id="+value;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=regstate;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);	
	}

}

function reg_state(value,path){
	document.getElementById('txtcity1').value='';
	if(value!="") {
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	var url=path + "regstate_search.php";
	url=url+"?id="+value;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=regstate;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);	
	}

}


function regstate(){
		if(xmlHttp.readyState==4){ 
		document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
	}
}

function reg_city(txt){
	document.getElementById('txtcity1').value=txt;
}

function validate_city(form){
	cityvalue=document.getElementById('ct').value;
	if(cityvalue==''){
		alert("Please Select City");
		return false;
	}
	else
		return true;
}

function listItemTask( id, task ) {
    var f = document.vForm;
    cb = eval( 'f.' + id );
    if (cb) 
		var cid=cb.value;
        submitbutton(cid,task);
    return false;
}
function submitbutton(id,pressbutton) {
	submitform(id,pressbutton);
}
function submitform(id,pressbutton){
	document.vForm.cid.value=id;
	document.vForm.task.value=pressbutton;
	try {
		document.vForm.onsubmit();
		}
	catch(e){}
	document.vForm.submit();
}
function setBulkOrder(){
	document.vForm.bulktask.value="bulk";
	try {
		document.vForm.onsubmit();
		}
	catch(e){}
	document.vForm.submit();
}

function checkdelete(form,content){
   var j=0;
   var l=0;
   var str;
   var total= 0;
   var count = 0;
   if(form.pid.length>0)
		count=form.pid.length;
   if(count == 0) {
     if(eval("form.pid.checked") == true) {
	   str = form.pid.value 
	   total += 1;
	   j=1;
	  }
	}
    else {
		for(var i=0;i<count; i++) {
		  if(form.pid[i].checked == 1){
		      if(l=="0")
			  str = form.pid[i].value;
			  else
			  str = str +","+ form.pid[i].value;
			  l++;
			  j=1;
			}
		}
	}
	if(j==1){
		 if(content=="Delete"){
			 conf=confirm("Do you sure want to delete");
			 if(conf){
			 form.act.value=content;
			 form.selectvalue.value=str;
		     form.submit();
			 }
			 else
			 return false;
		 }
		 else{
			 form.act.value=content;
			 form.selectvalue.value=str;
		     form.submit();
		 }

	}
	else
		 alert("Please Select Checkbox");
	return false;
}

function checkuserdelete(form,content){
   var j=0;
   var l=0;
   var str;
   var total= 0;
   var count = 0;
   if(form.user.length>0)
		count=form.user.length;
   if(count == 0) {
     if(eval("form.user.checked") == true) {
	   str = form.user.value 
	   total += 1;
	   j=1;
	  }
	}
    else {
		for(var i=0;i<count; i++) {
		  if(form.user[i].checked == 1){
		      if(l=="0")
			  str = form.user[i].value;
			  else
			  str = str +","+ form.user[i].value;
			  l++;
			  j=1;
			}
		}
	}
	if(j==1){
		 if(content=="Delete"){
			 conf=confirm("Do you sure want to delete");
			 if(conf){
			 form.act.value=content;
			 form.selectvalue.value=str;
		     form.submit();
			 }
			 else
			 return false;
		 }
		 else{
			 form.act.value=content;
			 form.selectvalue.value=str;
		     form.submit();
		 }

	}
	else
		 alert("Please select atleast one User");
	return false;
}



/* This Function is Used To Initialize Page Nubmer to Hidden Text
While The User Click on the Page Numbers */

function AssignPageNumber(val)
{
	var CurrentPage = document.getElementById('CurrentPage').value;
	if(val=='Next')
	{
		CurrentPage++;
		document.getElementById('CurrentPage').value=CurrentPage;
	}
	else if(val=="Prev")
	{
		CurrentPage--;
		document.getElementById('CurrentPage').value=CurrentPage;
	}
	else
	{
		document.getElementById('CurrentPage').value=val;
	}
	document.advSearch.submit();
}




/* This Function is Used to Display the hidhen TD*/
function ShowTD(id)
{
	
	var ImageBox = document.getElementById(id);
	ImageBox.style.display = "inline";
	alert(id);
}

/* This Function Used to Update the result pages */
function UpdateSearchResult(urlPath)
{
	var textbox="<table align=\"center\"><tr align=\"center\"><td align=\"center\"><img src=\"../images/loading.gif\" width=\"500\" height=\"300\"/></td></tr></table>";
	document.getElementById("txtHint").innerHTML=textbox;
	var catList ="";
	var countcatList=0;
	var type = "";
	var minprice="";
	var maxprice="";
	var age = "";
	var minheight = "";
	var maxheight = "";
	var minsalary= "";
	var maxsalary= "";
	var brief_key = "";
	var categorysearch ="";
	var fromdate ="";
	var todate = "";
	if(document.forms["advSearch"].elements["type"])
	{
		var typelst = document.forms["advSearch"].elements["type"];
		var count = typelst.length;
		if(typelst)
		{
			
			for(var i = 0; i < count; i++)
			{
				if(typelst[i].checked == true)
				{
					type = type+typelst[i].value+",";
				}
			}
		}
	}
	
	if(document.getElementById("fromdate"))
	{
		fromdate=document.getElementById("fromdate").value;
	}
	if(document.getElementById("todate"))
	{
		todate=document.getElementById("todate").value;
	}
	
	
	if(document.getElementById("categorysearch"))
	{
		categorysearch=document.getElementById("categorysearch").value;
	}
	
	if(document.getElementById("minprice"))
	{
		minprice=document.getElementById("minprice").value;
	}
	if(document.getElementById("maxprice"))
	{
		maxprice=document.getElementById("maxprice").value;
	}
	if(document.forms["advSearch"].elements["age"])
	{
		var el = document.forms["advSearch"].elements["age"];
		var count = el.length;
		for(var i =0; i< count ; i++)
		{
			if(el[i].checked == true)
			age=el[i].value;
		}
	}
	if(document.getElementById("brief_key"))
	{
		brief_key = document.getElementById("brief_key").value;
	}
	if(document.getElementById("minheight"))
	{
		minheight = document.getElementById("minheight").value;
	}
	if(document.getElementById("maxheight"))
	{
		maxheight = document.getElementById("maxheight").value;
	}
	if(document.getElementById("minsalary"))
	{
		minsalary = document.getElementById("minsalary").value;
	}
	if(document.getElementById("maxsalary"))
	{
		maxsalary = document.getElementById("maxsalary").value;
	}
	
	if(document.forms["advSearch"].elements["CategoriesId"])
	{
		catList =document.forms["advSearch"].elements["CategoriesId"];
		countcatList = catList.length;
	}
	var objonlywithphoto = document.getElementById("onlywithphoto");	
	var before = document.getElementById("before").value;
	var onlywithphoto="";
	if(objonlywithphoto.checked == true)		
	{	
    onlywithphoto = "yes";
    objonlywithphoto.value = "yes";
    }
	if(catList)
	{
		var txtcatList = document.getElementById("txtcatList");
		txtcatList.value = '';
		for(var i = 0; i < countcatList; i++)
		{
			if(catList[i].checked == true)
			{
			txtcatList.value = txtcatList.value+catList[i].value+","; 
			}
			else
			{
				document.getElementById("CategoriesIdAll").checked = false;
			}
		}
		if(txtcatList.value == '')
		{
			txtcatList.value ="0,";
		}
	}
XmlHttp=GetXmlHttpObject();
if(XmlHttp==null)
{
	alert("Your browser does not support AJAX!");
	return;
} 
var url = urlPath+"ajaxadvsearch.php";
var countrysearch = document.getElementById("countrysearch").value;
var statesearch = document.getElementById("statesearch").value;
var citysearch = document.getElementById("citysearch").value;
var txtcatList = document.getElementById("txtcatList").value;
url=url+"?txtcatList="+txtcatList;
url=url+"&onlywithphoto="+onlywithphoto;
//url=url+"?countrysearch="+countrysearch;
url=url+"&statesearch="+statesearch;
url=url+"&citysearch="+citysearch;
url=url+"&type="+type;
url=url+"&minprice="+minprice;
url=url+"&maxprice="+maxprice;
url=url+"&age="+age;
url=url+"&minheight="+minheight;
url=url+"&maxheight="+maxheight;
url=url+"&minsalary="+minsalary;
url=url+"&maxsalary="+maxsalary;
url=url+"&before="+before;
url=url+"&brief_key="+brief_key;
url=url+"&todate="+todate;
url=url+"&fromdate="+fromdate;
url=url+"&categorysearch="+categorysearch;
XmlHttp.onreadystatechange=UpdateSearch;
XmlHttp.open("GET",url,true);
XmlHttp.send(null);	
}


function UpdateSearch()
{
	if(XmlHttp.readyState==4)
	{ 
		document.getElementById("txtHint").innerHTML=XmlHttp.responseText;
	}
}

/* Function to Uncheck/check Categories */
function Check_Uncheck(path,id,targetid)
{
	var curId = document.getElementById(id);
	var trid = document.forms["advSearch"].elements["CategoriesId"];
	var countcatList = trid.length;
	if(curId.checked == true)
	{
		for(var i =0; i < countcatList; i++)
		{
			trid[i].checked = true;
		}
		UpdateSearchResult(path);
	}
	else
	{
		for(var i =0; i < countcatList; i++)
		{
			trid[i].checked = false;
		}
		UpdateSearchResult(path);
	}
}

/*Update City List*/
function refreshCitiesList(sid,urlPath)
{
	XmlHttp=GetXmlHttpObject();
	if(XmlHttp==null)
	{
		alert("Your browser does not support AJAX!");
		return;
	} 
	var url = urlPath+"ajaxcity.php?sid="+sid;
	XmlHttp.onreadystatechange=UpdateCity;
	XmlHttp.open("GET",url,true);
	XmlHttp.send(null);	
}
function UpdateCity()
{
	if(XmlHttp.readyState==4)
	{ 
		document.getElementById("cityHint").innerHTML=XmlHttp.responseText;
	}
}
function domianredirect(ctid)
{
	XmlHttp=GetXmlHttpObject();
	if(XmlHttp==null)
	{
		alert("Your browser does not support AJAX!");
		return;
	} 
	var url = urlPath+"ajaxdomaintransfer.php";
	url=url+"?ctid="+ctid;
	
	XmlHttp.onreadystatechange=UpdateSearch;
	XmlHttp.open("GET",url,true);
	XmlHttp.send(null);	

}

function catSearch(urlPath)
{
	var catList = document.forms["advSearch"].elements["CategoriesId"];
	var countcatList = catList.length;
	var flag = 0;
	var txtcatList="";
	var onlywithphoto="";
	var onlywithresume="";
	var type = "";
	var minprice="";
	var maxprice="";
	var age = "";
	var minheight = "";
	var maxheight = "";
	var minsalary= "";
	var maxsalary= "";
	var before="";
	var brief_key="";
	if(catList)
	{
		txtcatList = document.getElementById("txtcatList");
		txtcatList.value = '';
		for(var i = 0; i < countcatList; i++)
		{
			if(catList[i].checked == true)
			{
			txtcatList.value = txtcatList.value+catList[i].value+",";
			}
			else
			{
				flag=1;
			}
		}
	}
	if(document.getElementById("onlywithresume"))
	{
		if(document.getElementById("onlywithresume").checked==true)
		{
			
			onlywithresume="Y";
		}
	}
	if(document.getElementById("onlywithphoto"))
	{
		if(document.getElementById("onlywithphoto").checked==true){
			
			onlywithphoto="Y";
		}
	}
	
	
	if(document.getElementById("before"))
	{
		before=document.getElementById("before").value;
	}
	if(document.getElementById("brief_key"))
	{
		brief_key = document.getElementById("brief_key").value;
	}
	
	
	if(document.forms["advSearch"].elements["type"])
	{
		var typelst = document.forms["advSearch"].elements["type"];
		var count = typelst.length;
		if(typelst)
		{
			
			for(var i = 0; i < count; i++)
			{
				if(typelst[i].checked == true)
				{
					type = type+typelst[i].value+",";
				}
			}
		}
	}
	if(document.getElementById("minprice"))
	{
		minprice=document.getElementById("minprice").value;
	}
	if(document.getElementById("maxprice"))
	{
		maxprice=document.getElementById("maxprice").value;
	}
	if(document.forms["advSearch"].elements["age"])
	{
		var el = document.forms["advSearch"].elements["age"];
		var count = el.length;
		for(var i =0; i< count ; i++)
		{
			if(el[i].checked == true)
			age=el[i].value;
		}
	}
	if(document.getElementById("minheight"))
	{
		minheight = document.getElementById("minheight").value;
	}
	if(document.getElementById("maxheight"))
	{
		maxheight = document.getElementById("maxheight").value;
	}
	if(document.getElementById("minsalary"))
	{
		minsalary = document.getElementById("minsalary").value;
	}
	if(document.getElementById("maxsalary"))
	{
		maxsalary = document.getElementById("maxsalary").value;
	}
	XmlHttp=GetXmlHttpObject();
	if(XmlHttp==null)
	{
		alert("Your browser does not support AJAX!");
		return;
	} 
	if(flag)
	{
		document.getElementById("catAll").checked = false;
	}
	else
	{
		document.getElementById("catAll").checked = true;
	}
	var url = urlPath+"ajaxcatads.php";
	url=url+"?txtcatList="+txtcatList.value;
	url=url+"&onlywithphoto="+onlywithphoto;
	url=url+"&onlywithresume="+onlywithresume;
	url=url+"&type="+type;
	url=url+"&minprice="+minprice;
	url=url+"&maxprice="+maxprice;
	url=url+"&age="+age;
	url=url+"&minheight="+minheight;
	url=url+"&maxheight="+maxheight;
	url=url+"&minsalary="+minsalary;
	url=url+"&maxsalary="+maxsalary;
	url=url+"&before="+before;
	url=url+"&brief_key="+brief_key;
	XmlHttp.onreadystatechange=updateCatSearch;
	XmlHttp.open("GET",url,true);
	XmlHttp.send(null);
}
function updateCatSearch()
{
	var divid = document.getElementById("txtHint");
	var imgsrc = '<table width="750" height="400"><tr><td align="center" valign="middle"><img src="http://www.citiesads.com/images/loading.gif"></td></tr></table>';
	divid.innerHTML = imgsrc;
	if(XmlHttp.readyState==4)
	{ 
		divid.innerHTML=XmlHttp.responseText;
	}
}
function catCheckAll(urlPath,caseid)
{
	switch(caseid)
	{
	 case "1":
	 	var chkid = document.getElementById("catAll");
		var catList = document.forms["advSearch"].elements["CategoriesId"];
		var countcatList = catList.length;
		if(chkid.checked == true)
		{
			for(var i = 0; i < countcatList; i++)
			{
				catList[i].checked = true;
			}
		}
		else
		{
			for(var i = 0; i < countcatList; i++)
			{
				catList[i].checked = false;
			}
		}
		catSearch(urlPath)
		break;
	}
}


/* To send News Letter*/
function sendNewsLetter(path, task)
{
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
		alert ("Your browser does not support AJAX!");
		return;
	}
	
	var url= path+ "ajaxdetailspage.php?task="+task;
	if(task == "newsLetter")
	{
		var nlemail = document.getElementById("nlemail").value;
		url = url+"&email="+nlemail;
	}
	xmlHttp.onreadystatechange=newsLeterUpdate;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);	
}
function newsLeterUpdate()
{
	if(xmlHttp.readyState==4)
	{ 
		var newsltrdiv = document.getElementById("newsLetterDiv");
		newsltrdiv.innerHTML =xmlHttp.responseText;
	}
}

//Contact post Ad

function contactPostAd(email, task, pid, path)
{
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
		alert ("Your browser does not support AJAX!");
		return;
	}
	var subject = document.getElementById("subject").value;
	var message = document.getElementById("message").value;
	var fromemail = document.getElementById("fromemail").value;
	var txtverification = document.getElementById("txtverification").value;
	var url= path+ "ajaxdetailspage.php";
	url = url + "?task="+task;
	url = url + "&email="+email;
	url = url + "&subject="+subject;
	url = url + "&pid="+pid;
	url = url + "&message="+message;
	url = url + "&fromemail="+fromemail;
	url = url + "&txtverification="+txtverification;
	xmlHttp.onreadystatechange=contactPostAdResult;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);	
}

function contactPostAdResult()
{
	var newsltrdiv = document.getElementById("contactmail");
	if(xmlHttp.readyState==4)
	{ 
	 	if(xmlHttp.responseText == "err2")
	 	{
			newsltrdiv.innerHTML ="Wrong email id";
		}
		else if(xmlHttp.responseText == "err1")
		{
			newsltrdiv.innerHTML ="Wrong verification code";
		}
		else if(xmlHttp.responseText == "try")
		{
			newsltrdiv.innerHTML ="Try again";
		}
		else if(xmlHttp.responseText == "yes")
		{
			newsltrdiv.innerHTML ="Email send";
		}
	}
}

//Report generation
function ReportSpam(path ,id, task, pid)
{ 
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
		alert ("Your browser does not support AJAX!");
		return;
	}
	var url= path+ "ajaxdetailspage.php";
	
	url = url + "?task="+task;
	url = url + "&id="+id;
	url = url + "&pid="+pid;
	xmlHttp.onreadystatechange=spamPostResult;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);	
}
function spamPostResult()
{
	var newsltrdiv = document.getElementById("divreport");
	newsltrdiv.innerHTML ="Please wait...";
	if(xmlHttp.readyState==4)
	{ 
	newsltrdiv.innerHTML =xmlHttp.responseText;
	}
}
/* This Function is Used To Change the Main Image 
While select any other Images */

function ChangeImage(urlImage, ImageBoxId)
{
	var ImageBox = document.getElementById(ImageBoxId);
	var MainImage = document.getElementById("zooming");
	ImageBox.src = urlImage;
	MainImage.href = urlImage;
}
function CallCounter(urlPath, pid)
{
	XmlHttp=GetXmlHttpObject();
	if(XmlHttp==null)
	{
		alert("Your browser does not support AJAX! Please Choose Another Browser");
		return;
	} 
	var url = urlPath+"ajaxtopads.php";
	url=url+"?pid="+pid;
	
	XmlHttp.onreadystatechange=UpdateSearch;
	XmlHttp.open("GET",url,true);
	XmlHttp.send(null);	

}
/* Function Tell A Friend */
function TellAFriend(path)
{
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
		alert ("Your browser does not support AJAX!");
		return;
	}
	
	var yemail = document.getElementById("yemail").value;
	var femail = document.getElementById("femail").value;
	var url = path+"tellfriend.php";
	url = url + "?yemail=" +yemail;
	url = url + "&femail=" +femail;
	xmlHttp.onreadystatechange=TellAFriendUpdate;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);	
}
function TellAFriendUpdate()
{
	var tellafrienddiv = document.getElementById("tellafrienddiv");
	tellafrienddiv.innerHTML = "Please Wait...";
	if(xmlHttp.readyState==4)
	{ 
		if(xmlHttp.responseText == "err1")
		{
			tellafrienddiv.innerHTML = "Please enter Email id...";
		}
		else if(xmlHttp.responseText == "err2")
		{
			tellafrienddiv.innerHTML = "Invalid email id...";
		}
		else if(xmlHttp.responseText == "noerror")
		{
			tellafrienddiv.innerHTML = "Mail sent, Thank you...";
			document.getElementById("yemail").value="Your Email Id";
			document.getElementById("femail").value="Your Friend Email Id";
		}
		else
		{
			tellafrienddiv.innerHTML = "Please try again...";
		}
	}
}
/* function City Search */
function citysearch(path)
{
	var url = path + "ajaxcitysearcg.php";
	var city = document.getElementById("searchcity").value;
	url = url + "?city=" +city;
	if(city == "Enter a city" || city == "")
	{
	return;
	}
	XmlHttp=GetXmlHttpObject();
	if(XmlHttp==null)
	{
		alert("Your browser does not support AJAX! Please Choose Another Browser");
		return;
	} 
	XmlHttp.onreadystatechange=citysearchUpdate;
	XmlHttp.open("GET",url,true);
	XmlHttp.send(null);
}

/* function City Search */
function statecitysearch(path)
{
	var val = document.getElementById("cityname").value;
	if(val !== "")
	{
		//window.location.href = "";
		path.action = val;
		path.submit();
		return false;
		//return "window.location='"+val+"';return false";
	}
	else
	{
		var sitysearchdiv = document.getElementById("citysearchdivnew");
		sitysearchdiv.innerHTML = "Please Select City!";
	}
}

/*function cityStatesearchUpdate()
{
	var sitysearchdiv = document.getElementById("citysearchdivnew");
	sitysearchdiv.innerHTML = "Please Wait...";
	if(XmlHttp.readyState==4)
	{ 
		if(XmlHttp.responseText == "no")
		{
				sitysearchdiv.innerHTML = "City not found!";
		}
		else
		{
			var str = new Array;
	 		str = XmlHttp.responseText.split("|");
			if(str[0] == "yes")
			{
				window.location=str[1];
			}
		}
	}
}*/
function citysearchUpdate()
{
	var sitysearchdiv = document.getElementById("sitysearchdiv");
	sitysearchdiv.innerHTML = "Please Wait...";
	if(XmlHttp.readyState==4)
	{ 
		if(XmlHttp.responseText == "no")
		{
				sitysearchdiv.innerHTML = "City not found!";
		}
		else
		{
			var str = new Array;
	 		str = XmlHttp.responseText.split("|");
			if(str[0] == "yes")
			{
				window.location=str[1];
			}
		}
	}
}

/* Function for Rating */
function votethisAd(path, pid, rate)
{
	url = path+"ajaxrateads.php?pid="+pid;
	url = url+"&voterate="+rate
	XmlHttp=GetXmlHttpObject();
	if(XmlHttp==null)
	{
		alert("Your browser does not support AJAX! Please Choose Another Browser");
		return;
	} 
	XmlHttp.onreadystatechange=updatevotethisAd;
	XmlHttp.open("GET",url,true);
	XmlHttp.send(null);
}
function updatevotethisAd()
{
	var divRate = document.getElementById("divRate");

	if(XmlHttp.readyState==4)
	{ 
	if(XmlHttp.responseText == 1)
	{
		var starCount = document.forms["detalspage"].elements["rateStar"];
		var starSrc="../../images/rattingfull.gif";
		for(var i=0; i<starCount.length; i++)
		{
			starCount[i].src = starSrc;
			if(starCount[i].disabled == true)
			{
				starSrc = "../../images/ratingnull.gif";
			}
		}
		divRate.innerHTML = "Thanks for Rating!";
	}
	else if(XmlHttp.responseText == 2)
	{
		var starCount = document.forms["detalspage"].elements["rateStar"];
		var starSrc = "../../images/ratingnull.gif";
		for(var i=0; i<starCount.length; i++)
		{
			starCount[i].src = starSrc;
		}
		divRate.innerHTML = "Already rated!";
	}
	else
		divRate.innerHTML = "Try again!";
	}
}

/* Function to Clear this Field*/
function clearField(id, val)
{
	var textval = document.getElementById(id).value;
	if(textval == val)
	document.getElementById(id).value='';
}
/* Function to Fill this Field*/
function FillField(id, val)
{
	var textval = document.getElementById(id).value;
	if(textval == '')
	{
		document.getElementById(id).value = val;
	}
}

/* function Search By Id */
function searchbyAdId(path)
{
	txt_adid = document.getElementById("txt_adid").value;
	XmlHttp=GetXmlHttpObject();
	if(XmlHttp==null)
	{
		alert("Your browser does not support AJAX! Please Choose Another Browser");
		return;
	} 
	url = path+"ajaxsearchbyadid.php?pid="+txt_adid;
	XmlHttp.onreadystatechange=updateearchbyAdId;
	XmlHttp.open("GET",url,true);
	XmlHttp.send(null);
}
function updateearchbyAdId()
{
	document.getElementById("div_msg_adid").innerHTML = "Please Wait...";
	if(XmlHttp.readyState==4)
	{ 
		if(XmlHttp.responseText=="No")
		{
			document.getElementById("div_msg_adid").innerHTML="No AD Found!!!";
		}
		else if(XmlHttp.responseText=="id?")
		{
			document.getElementById("div_msg_adid").innerHTML="Please Enter AD ID!!!";
		}
		else
		{
			document.location.href = XmlHttp.responseText;
		}
	}
}

/*function ChangeDateSearch(val)
{
	if(val==2){
		document.getElementById("BYDATE").style.display="none";
		document.getElementById("range").style.display="";
	}
	else{
		document.getElementById("BYDATE").style.display="";
		document.getElementById("range").style.display="none";
	}
}

*/


function OtherAds(urlPath,pid)
{
	var catList = document.forms["advSearch"].elements["CategoriesId"];
	var countcatList = catList.length;
	var txtcatList="";
	var onlywithphoto="";
	var before="";
	var brief_key="";
	var flag="";
	if(catList)
	{
		txtcatList = document.getElementById("txtcatList");
		txtcatList.value = '';
		if(countcatList>0)
		{
			for(var i = 0; i < countcatList; i++)
			{
				if(catList[i].checked == true)
				{
					txtcatList.value = txtcatList.value+catList[i].value+",";
				}
				else
				{
					flag=1;
				}
			}
		}
		else
		{
			var CategoriesId  = document.getElementById("CategoriesId").value;
			txtcatList.value = CategoriesId+",";
		}
	}
	
	if(document.getElementById("onlywithphoto"))
	{
		if(document.getElementById("onlywithphoto").checked==true){
			onlywithphoto="Y";
		}
	}
	
	if(document.getElementById("before"))
	{
		before=document.getElementById("before").value;
	}
	if(document.getElementById("brief_key"))
	{
		brief_key = document.getElementById("brief_key").value;
	}
	XmlHttp=GetXmlHttpObject();
	if(XmlHttp==null)
	{
		alert("Your browser does not support AJAX!");
		return;
	} 
	if(flag)
	{
		document.getElementById("catAll").checked = false;
	}
	else
	{
		document.getElementById("catAll").checked = true;
	}
	var url = urlPath+"ajaxotherads.php";
	url=url+"?txtcatList="+txtcatList.value;
	url=url+"&onlywithphoto="+onlywithphoto;
	url=url+"&before="+before;
	url=url+"&brief_key="+brief_key;
	url=url+"&pid="+pid;
	XmlHttp.onreadystatechange=updateOtherAds;
	XmlHttp.open("GET",url,true);
	XmlHttp.send(null);
}
function updateOtherAds()
{
	var divid = document.getElementById("txtHint");
	var imgsrc = '<table width="750" height="400"><tr><td align="center" valign="middle"><img src="http://www.citiesads.com/images/loading.gif"></td></tr></table>';
	divid.innerHTML = imgsrc;
	if(XmlHttp.readyState==4)
	{ 
		divid.innerHTML=XmlHttp.responseText;
	}
}
function OtherCheckAll(urlPath,caseid,pid)
{
	switch(caseid)
	{
	 case "1":
	 	var chkid = document.getElementById("catAll");
		var catList = document.forms["advSearch"].elements["CategoriesId"];
		var countcatList = catList.length;
		if(chkid.checked == true)
		{
			for(var i = 0; i < countcatList; i++)
			{
				catList[i].checked = true;
			}
		}
		else
		{
			for(var i = 0; i < countcatList; i++)
			{
				catList[i].checked = false;
			}
		}
		OtherAds(urlPath,pid)
		break;
	}
}

function MyAds(urlPath,pid)
{
	var catList = document.forms["advSearch"].elements["CategoriesId"];
	var countcatList = catList.length;
	var txtcatList="";
	var onlywithphoto="";
	var before="";
	var brief_key="";
	var flag="";
	if(catList)
	{
		txtcatList = document.getElementById("txtcatList");
		txtcatList.value = '';
		for(var i = 0; i < countcatList; i++)
		{
			if(catList[i].checked == true)
			{
			txtcatList.value = txtcatList.value+catList[i].value+",";
			}
			else
			{
				flag=1;
			}
		}
	}
	if(document.getElementById("onlywithphoto"))
	{
		if(document.getElementById("onlywithphoto").checked==true){
			onlywithphoto="Y";
		}
	}
	
	if(document.getElementById("before"))
	{
		before=document.getElementById("before").value;
	}
	if(document.getElementById("brief_key"))
	{
		brief_key = document.getElementById("brief_key").value;
	}
	XmlHttp=GetXmlHttpObject();
	if(XmlHttp==null)
	{
		alert("Your browser does not support AJAX!");
		return;
	} 
	if(flag)
	{
		document.getElementById("catAll").checked = false;
	}
	else
	{
		document.getElementById("catAll").checked = true;
	}
	var url = urlPath+"ajaxmyads.php";
	url=url+"?txtcatList="+txtcatList.value;
	url=url+"&onlywithphoto="+onlywithphoto;
	url=url+"&before="+before;
	url=url+"&brief_key="+brief_key;
	url=url+"&pid="+pid;
	XmlHttp.onreadystatechange=updateMyAds;
	XmlHttp.open("GET",url,true);
	XmlHttp.send(null);
}
function updateMyAds()
{
	var divid = document.getElementById("txtHint");
	var imgsrc = '<table width="750" height="400"><tr><td align="center" valign="middle"><img src="http://www.citiesads.com/images/loading.gif"></td></tr></table>';
	divid.innerHTML = imgsrc;
	if(XmlHttp.readyState==4)
	{ 
		divid.innerHTML=XmlHttp.responseText;
	}
}
function MyAdCheckAll(urlPath,caseid,pid)
{
	switch(caseid)
	{
	 case "1":
	 	var chkid = document.getElementById("catAll");
		var catList = document.forms["advSearch"].elements["CategoriesId"];
		var countcatList = catList.length;
		if(chkid.checked == true)
		{
			for(var i = 0; i < countcatList; i++)
			{
				catList[i].checked = true;
			}
		}
		else
		{
			for(var i = 0; i < countcatList; i++)
			{
				catList[i].checked = false;
			}
		}
		MyAds(urlPath,pid)
		break;
	}
}

function lightboxCitySearch(urlPath)
{
	var state_id=document.getElementById("sttid").value;
	var url = urlPath+"ajax_city.php";
	url=url+"?state_id="+state_id;
	XmlHttp=GetXmlHttpObject();
	if(XmlHttp==null)
	{
		alert("Your browser does not support AJAX!");
		return;
	} 
	XmlHttp.onreadystatechange=updatelightboxCitySearch;
	XmlHttp.open("GET",url,true);
	XmlHttp.send(null);
}
function updatelightboxCitySearch()
{
	var divid = document.getElementById("txtHint");
	var imgsrc = '<img src="http://www.citiesads.com/images/loading.gif" height="15" width="15">';
	divid.innerHTML = imgsrc;
	if(XmlHttp.readyState==4)
	{ 
		divid.innerHTML=XmlHttp.responseText;
	}
}
function AdVisitoManagement(path , pid)
{
	var url = "../../ajaxadvisitor.php?pid="+pid;
	XmlHttp=GetXmlHttpObject();
	if(XmlHttp==null)
	{
		alert("Your browser does not support AJAX!");
		return;
	} 
	XmlHttp.onreadystatechange=updateAdVisitoManagement;
	XmlHttp.open("GET",url,true);
	XmlHttp.send(null);
}
function updateAdVisitoManagement()
{
	if(XmlHttp.readyState==4)
	{
		//alert(XmlHttp.responseText)
	}
}