// JavaScript Document
var url = document.location.host;
var urlquery = "http://"+url+"/";

web_url=urlquery;
var xmlHttp;
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 nextshow(){
	 xmlHttp=GetXmlHttpObject()
		if (xmlHttp==null)
		 {
			 alert ("Browser does not support HTTP Request")
			 return
		 }	
			  var url="ajax.php";
				xmlHttp.onreadystatechange=stateChangedNew_User;
				xmlHttp.open("GET",url,true);
				xmlHttp.send(null);
		}
		function stateChangedNew_User()
			{ 
				 if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
			 		{ 		
						document.getElementById("DIV_RESP").innerHTML=xmlHttp.responseText;
					}
			}
			
//------------------------fOR THE pREVIOUS AND nEXT--------------
var setcounter ; 
var setorder ;
var setpage ;
var Channelid ;
var previous_imgname ;
var next_imgname ;
var total_Pages ; 
function newsNavigation(page,counter,orderby,previous_img_name,next_img_name,totalPages){ 
	setcounter = counter ; 
	setorder = orderby ; 
	setpage = page ;
	previous_imgname = previous_img_name;
	next_imgname = next_img_name;
	total_Pages = totalPages ; 
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	 {
		 alert ("Browser does not support HTTP Request")
		 return
	 }

 	var url=web_url+"viewcat.php";
	url=url+"?page="+page
	url=url+"&sid="+Math.random();
    xmlHttp.onreadystatechange = handleNewNavigation_left; 
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
	}
	function handleNewNavigation_left(){
		if(xmlHttp.readyState == 4){  
		var response = xmlHttp.responseText;
		var previous_page = (setpage-1) ; 
		var next_page = (setpage+1) ; 
  				if(setpage>1){
				document.getElementById("div_previous").innerHTML = "<a href=\"javascript:newsNavigation("+previous_page+","+setcounter+",'previous','"+previous_imgname+"','"+next_imgname+"',"+total_Pages+")\";><img src="+web_url+"images/"+previous_imgname+" border=0 /></a>";	 
				}else{
				document.getElementById("div_previous").innerHTML="<img src="+web_url+"images/"+previous_imgname+" border=0 />"
				}
				if((total_Pages>setpage)&&(total_Pages != setpage) ){
  			    document.getElementById("div_next").innerHTML = "<a href=\"javascript:newsNavigation("+next_page+","+setcounter+",'next','"+previous_imgname+"','"+next_imgname+"',"+total_Pages+")\";><img src="+web_url+"images/"+next_imgname+" border=0 /></a>";
			}else{
				document.getElementById("div_next").innerHTML="<img src="+web_url+"images/"+next_imgname+" border=0 />"
			}
			if(response!="")
			 document.getElementById("DivNews").innerHTML = response;
		}
 }//functiom




//*******Function for the Popular Searches******************

var topheight;
function viewsubcat(top,cat_id,cat_name){
	topheight=top;	
	document.getElementById("div_"+cat_id).style.top=topheight+'px';
	//alert(document.getElementById("div_"+cat_id).style.top)
	 xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	 {
		 alert ("Browser does not support HTTP Request")
		 return
	 }
	
	var web_url = 'http://www.inthemarket.com/';
	var url=web_url+"viewsubcategories.php";
	url=url+"?cat_id="+cat_id + "&catname="+ cat_name;
	url=url+"&sid="+Math.random();
	//alert(url);
    xmlHttp.onreadystatechange = stateChangedSubcategory; 
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
 function stateChangedSubcategory()
  { 
	 if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 		{ 		
		    
            document.getElementById("mymenu1").style.display='block';		
			document.getElementById("mymenu1").style.top=topheight;
    		document.getElementById("Div_Subcategory").innerHTML=xmlHttp.responseText;
		}
 }
 var category;
 var lastcategory;
 function alertcat(cat_id,catuser_id,cat_last){
	 category=cat_id
	 lastcategory=cat_last

     xmlHttp=GetXmlHttpObject() 
	 if (xmlHttp==null)
	 {
		 alert ("Browser does not support HTTP Request")
		 return
	 }
	var url=web_url+"admin/assingeduser.php";
	url=url+"?cat_id="+cat_id + "&catuser_id="+ catuser_id;
	url=url+"&sid="+Math.random();
    xmlHttp.onreadystatechange = stateAssignCategory; 
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
	 
	 }
 

 function stateAssignCategory()
  { 

	 if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 		{ 
		     alert(xmlHttp.responseText)
		
	        var Response=xmlHttp.responseText;
			 if(lastcategory!=""){
			  if(Response=="This User has been already assigned to some other Category"){
                  var val="ddlcategoryuser_"+category;
				  document.getElementById(val).value=lastcategory
				  }
			 }else{
				
				  if(Response=="This User has been already assigned to some other Category"){
					  var val="ddlcategoryuser_"+category;
				       document.getElementById(val).value='Delete'
				  }
			 }  
				 
		}
 }


var pagename;
function viewmenudiv(page_name){
	
	 pagename=page_name;
     xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	 {
		 alert ("Browser does not support HTTP Request")
		 return
	 }
	var url=web_url+"viewmenu.php";
	url=url+"?page_name="+page_name;
	url=url+"&sid="+Math.random();
    xmlHttp.onreadystatechange = stateChangedPageName; 
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
 function stateChangedPageName()
  { 
	 if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 		{ 		
               document.getElementById("Div_menu").style.display='block';		
			   document.getElementById("home").style.display='none';	
			   document.getElementById("DivNews").style.display='none';
			   document.getElementById("div_down").style.display='none';
			   document.getElementById("div_up").style.display='none';
			   document.getElementById("Div_menu").innerHTML=xmlHttp.responseText;
			
		}
 }
	
//*******************For the Site Maintainace*******************
  var sitevar;
  function sitemaintain(site_val){
	 if(document.getElementById("chkmaintain").checked==true)		
	    sitevalue=1;
	else
		sitevalue=0;
		sitevar=sitevalue;
		xmlHttp=GetXmlHttpObject() 
	 if (xmlHttp==null)
	 {
		 alert ("Browser does not support HTTP Request")
		 return
	 }
	var url=web_url+"sitedown.php?site_id="+sitevalue;
//	alert(url)
	xmlHttp.onreadystatechange = sitemaintainchange; 
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
	 
	 }
 
 function sitemaintainchange()
  { 
        if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 		{ 
		  alert(xmlHttp.responseText)
		  if(sitevar==1){
		     document.getElementById("DIV_Site_Mainthian").innerHTML='<font color="#FF0000">Site is Shut Down for maintenance</font>';
		  }else{
			  document.getElementById("DIV_Site_Mainthian").innerHTML='Shut Down Site for maintenance'; 
		  }
		  
        }
 }
 //*******************For the Display images*******************
  var sitevar;
  function categoryImages(site_val){
	 if(document.getElementById("chkdisplay").checked==true)		
	    sitevalue=1;
	else
		sitevalue=0;
		sitevar=sitevalue;
		xmlHttp=GetXmlHttpObject() 
	 if (xmlHttp==null)
	 {
		 alert ("Browser does not support HTTP Request")
		 return
	 }
	var url=web_url+"showimages.php?display_id="+sitevalue;
//	alert(url)
	xmlHttp.onreadystatechange = maintainCatImages; 
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
	 
	 }
 
 function maintainCatImages()
  { 
        if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 		{ 
		  alert(xmlHttp.responseText)
		  if(sitevar==1){
		     document.getElementById("DIV_CatImages").innerHTML='<font color="#FF0000">Display Category Images</font>';
		  }else{
			  document.getElementById("DIV_CatImages").innerHTML='Display Category Images'; 
		  }
		  
        }
 }
//**************************************************************	
//*******************For the Radio Button*******************
  function view_expire(value){
  	xmlHttp=GetXmlHttpObject() 
	 if (xmlHttp==null)
	 {
		 alert ("Browser does not support HTTP Request")
		 return
	 }

	var url=web_url+"admin/ads_expires.php?ads_time="+value;
	xmlHttp.onreadystatechange = sitechange; 
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
	 
	 }
 
 function sitechange()
  { 
        if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 		{ 
		       alert('Ad expire days has been changed.')
        }
 }
//**************************************************************		
function ShowContents(PageID){
	
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	 {
		 alert ("Browser does not support HTTP Request")
		 return
	 }
	var url=web_url+"Showcontents.php";
	url=url+"?ID="+PageID;
	url=url+"&sid="+Math.random();
    xmlHttp.onreadystatechange = stateChangedShowContents; 
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
	function stateChangedShowContents()
  { 
  		//document.getElementById("DivResp").innerHTML='<img src="'+web_url+'images/wait.gif">Loading please Wait...';
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 		{ 		               
			document.getElementById("DivResp").innerHTML=xmlHttp.responseText;			
			document.getElementById("DivHelp").style.display = 'none';
			document.getElementById("DivResp").style.display = 'block';				
		}
 }	


//==================
function ChangeStatus(HeaderID){
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	 {
		 alert ("Browser does not support HTTP Request")
		 return
	 }
	 if(document.getElementById("status").checked==true)		
	    sitevalue=1;
	else
		sitevalue=0;
		
	var url=web_url+"header_status.php";
	url=url+"?ID="+HeaderID;
	url=url+"&status="+sitevalue;
	url=url+"&sid="+Math.random();
    xmlHttp.onreadystatechange = stateChangedHeader; 
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function stateChangedHeader()
  { 
  		//document.getElementById("DivResp").innerHTML='<img src="'+web_url+'images/wait.gif">Loading please Wait...';
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 		{ 				
			document.getElementById("DivStatus").innerHTML=xmlHttp.responseText;
			alert("Status has been changed");
		}
 }		
	
 //================
 function DelImg(ImgID,Counter){
	 xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	 {
		 alert ("Browser does not support HTTP Request")
		 return
	 }
	if(! confirm("Delete Photo?") ){
		return;	
	}
		
	var url=web_url+"del_images.php";
	url=url+"?ImgID="+ImgID;
	url=url+"&Counter="+Counter;
	url=url+"&sid="+Math.random();

    xmlHttp.onreadystatechange = stateChangedDelImg; 
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
 }
 
 function stateChangedDelImg()
  { 

		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 		{ 				
			 window.document.updateform.action.value='reload';
		     window.document.updateform.submit();
		}
 }	
//=======================
 function ChkCategory(category){
	 xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null){
		 alert ("Browser does not support HTTP Request")
		 return
	 }
	catName=category;
	catName=catName.replace("&", '^');
	var url=web_url+"requests.php?action=chkCategory&category="+catName;
	url=url+"&sid="+Math.random();
    xmlHttp.onreadystatechange = stateChangedChkCategory;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
 } 
 function stateChangedChkCategory(){ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 	
			if(xmlHttp.responseText==1){
				document.getElementById("catavail").value=1;				
			}else{
				document.getElementById("catavail").value=2;
			}
		}
 }	
//=======================
 function ChkEditCategory(category,CatID){
	 xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null){
		 alert ("Browser does not support HTTP Request")
		 return
	 }
	
	catName=category;
	catName=catName.replace("&", '^');
	
	var url=web_url+"requests.php?action=chkEditCategory&category="+catName+"&CatID="+CatID;
	url=url+"&sid="+Math.random();

    xmlHttp.onreadystatechange = stateChangedChkEditCategory;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
 } 
 function stateChangedChkEditCategory(){ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 	
			
			if(xmlHttp.responseText==1){
				document.getElementById("catavail").value=1;				
			}else{
				document.getElementById("catavail").value=2;
			}
		}
 }	
 //=======================
 var box_number;
 subcat=new Array();
 function ChkSubCategory(){
	 xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null){
		 alert ("Browser does not support HTTP Request")
		 return
	 }
	    dml=document.forms['categories'];
        len = dml.elements.length;
		for( i=0 ; i<len ; i++){
			if (dml.elements[i].name=='subcategories[]'){
			 if (dml.elements[i].value!=""){
					subcatName=dml.elements[i].value.replace("&", '^');	
					subcat[i]=subcatName;					
				}
			}
		}
		var url=web_url+"requests.php?action=chkSubCategory&subcategory="+subcat;
		url=url+"&sid="+Math.random();
		xmlHttp.onreadystatechange = stateChangedChkSubCategory;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
 }
 
 function stateChangedChkSubCategory(){ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 		

			if(xmlHttp.responseText!=''){
				alert("Subcategory already exits");
				document.getElementById("subcategories_"+xmlHttp.responseText).focus();
				return;
			}else{
				//document.categories.submit();	
			}		  
		}
}	 
 //=======================
 var CatID;
 function removeSubCategory(subcategory_id,totalAds,categoryID){
	 CatID=categoryID;
		 if(totalAds>0){
			alert("This subcategory contains ads"); 
			return;
		 }
		 if( document.getElementById("totalSubCategories").value==1){
			alert("You cannot delete the last subcategory"); 
			return;
		 }

		if( !confirm("Delete this Subcategory?")){
			return;
		}
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	 {
		 alert ("Browser does not support HTTP Request")
		 return
	 }
	
	var url=web_url+"requests.php?action=deleteSubCategory&subcategory_id="+subcategory_id;
	url=url+"&sid="+Math.random();

    xmlHttp.onreadystatechange = stateChangedremoveSubCategory;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
 }
 
 function stateChangedremoveSubCategory()
  { 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 		{ 	
			document.location.href="admineditcategories.php?cat_id="+CatID;
		}
 }	

  //=======================
 var CatID;
 function removeCategory(categoryID){

	if(!confirm("Delete this Category?"))
		return;

	 xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	 {
		 alert ("Browser does not support HTTP Request")
		 return
	 }
	
	var url=web_url+"requests.php?action=deleteCategory&categoryID="+categoryID;
	url=url+"&sid="+Math.random();

    xmlHttp.onreadystatechange = stateChangedremoveCategory;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
 }
 
 function stateChangedremoveCategory()
  { 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 		{ 	
			document.location.href="adminviewcategories.php";
		}
 }	
 //=======================
 var box_number;
 subcat=new Array();
 function ChkSubCategory(){
	 xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null){
		 alert ("Browser does not support HTTP Request")
		 return
	 }
	    dml=document.forms['categories'];
        len = dml.elements.length;
		for( i=0 ; i<len ; i++){
			if (dml.elements[i].name=='subcategories[]'){
			 if (dml.elements[i].value!=""){
					subcatName=dml.elements[i].value.replace("&", '^');	
					subcat[i]=subcatName;					
				}
			}
		}
		var url=web_url+"requests.php?action=chkSubCategory&subcategory="+subcat;
		url=url+"&sid="+Math.random();
		alert(url);
		xmlHttp.onreadystatechange = stateChangedChkSubCategory;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
 }
 
 function stateChangedChkSubCategory(){ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 		
			alert(xmlHttp.responseText);
			if(xmlHttp.responseText!=''){
				alert("Subcategory already exits");
				document.getElementById("subcategories_"+xmlHttp.responseText).focus();
				return;
			}else{
				document.categories.submit();	
			}		  
		}
}	 
 //=======================
 
 function ChkDuplicateField(SubCategory){
	 	count=0;
	 	dml=document.forms['categories'];
        len = dml.elements.length;
		for( i=0 ; i<len ; i++){
			if (dml.elements[i].name=='subcategories[]'){
				alert(dml.elements[i].id);
				count++;				
			 if (dml.elements[i].value==SubCategory){				 
			 		document.getElementById("DivErrs").innerHTML="You have already entered same Sub-Category";
				 	//alert("You have already entered same Sub-Category");
					element="subcategories_"+count;
					document.getElementById(element).focus();
					break;
					return;			
				}

			}
		} 
 }
/////////////
 ///////////////
var pageNo;
var sortBy;
var orderBy;
function StopDisplayAd(NewStatus, AdID){
	if(!confirm("Do you want to STOP this ad?")){
		return;
	}
  	xmlHttp=GetXmlHttpObject() 
	 if (xmlHttp==null)
	 {
		 alert ("Browser does not support HTTP Request")
		 return
	 }

	var url=web_url+"options.php?ad_id="+AdID;
	url=url+"&action="+NewStatus;
	url=url+"&sid="+Math.random();	
	xmlHttp.onreadystatechange = sitechangeStopDisplayAd; 
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
} 
 function sitechangeStopDisplayAd()
  { 
        if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 		{ 
		    if(xmlHttp.responseText=='ok'){
				window.location.href="view_advertise.php?page="+document.getElementById('page').value+"&order="+document.getElementById('orderby').value+"&sortby="+document.getElementById('sortby').value;	
			}else{
				alert("Failed to STOP this ad.");	
			}
        }
 }
///////
function ActiveDisplayAd(NewStatus, AdID){
	if(!confirm("Do you want to START this ad?")){
		return;
	}
  	xmlHttp=GetXmlHttpObject() 
	 if (xmlHttp==null)
	 {
		 alert ("Browser does not support HTTP Request")
		 return
	 }

	var url=web_url+"options.php?ad_id="+AdID;
	url=url+"&action="+NewStatus;
	url=url+"&sid="+Math.random();	
	xmlHttp.onreadystatechange = sitechangeActiveDisplayAd; 
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
} 
 function sitechangeActiveDisplayAd()
  { 
        if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 		{ 
		    if(xmlHttp.responseText=='ok'){
				window.location.href="view_advertise.php?page="+document.getElementById('page').value+"&order="+document.getElementById('orderby').value+"&sortby="+document.getElementById('sortby').value;	
			}else{
				alert("Failed to START this ad.");	
			}
        }
 }
 ///////////// 
 var Ad_ID;
 function DelAd(AdID,imageName){
	if(!confirm("Do you want to DELETE this ad?")){
		return;
	}
  	xmlHttp=GetXmlHttpObject() 
	 if (xmlHttp==null)
	 {
		 alert ("Browser does not support HTTP Request")
		 return
	 }
	Ad_ID=AdID;
	var url=web_url+"options.php?ad_id="+AdID;
	url=url+"&imageName="+imageName;
	url=url+"&action=DelAd";
	url=url+"&sid="+Math.random();	
	xmlHttp.onreadystatechange = sitechangeDelAd; 
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
} 
 function sitechangeDelAd()
  { 
        if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 		{ 
		    if(xmlHttp.responseText=='ok'){
				document.getElementById('Div_'+Ad_ID).style.display='none';	
			}else{
				alert("Failed to START this ad.");	
			}
        }
 }
 ///////////
 function changeAdDays(chnagedDays, AdID){
	 if(!confirm("Do you want to CHANGE this ad Days?")){
		return;
	}
  	xmlHttp=GetXmlHttpObject() 
	 if (xmlHttp==null)
	 {
		 alert ("Browser does not support HTTP Request")
		 return
	 }
	Ad_ID=AdID;
	var url=web_url+"options.php?ad_id="+AdID;
	url=url+"&chnagedDays="+chnagedDays;
	url=url+"&action=ChangeDays";
	url=url+"&sid="+Math.random();	
	xmlHttp.onreadystatechange = sitechangechangeAdDays; 
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
 }
 function sitechangechangeAdDays()
  { 
        if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 		{ 
		    if(xmlHttp.responseText=='ok'){
				window.location.href="view_advertise.php?page="+document.getElementById('page').value+"&order="+document.getElementById('orderby').value+"&sortby="+document.getElementById('sortby').value;	
			}else{
				alert("Failed to CHANGE this ad Days.");	
			}
        }
 }
  ///////////
 function ResetSiteCounter(){
	 if(!confirm("Are your sure?")){
		return;
	}
  	xmlHttp=GetXmlHttpObject() 
	 if (xmlHttp==null)
	 {
		 alert ("Browser does not support HTTP Request")
		 return
	 }

	var url=web_url+"options.php";
	url=url+"?action=resetCounter";
	url=url+"&sid="+Math.random();	
	xmlHttp.onreadystatechange = sitechangeResetSiteCounter; 
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
 }
 function sitechangeResetSiteCounter()
  { 
        if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 		{ 
		    if(xmlHttp.responseText=='ok'){
				alert("Site Visits Counter has been reset. ");
				document.getElementById('DivCounter').innerHTML='0';	
			}else{
				alert("Failed to RESET site visit counter.");	
			}
        }
 }
//*********************for ad images*****************************************	
var adValue='';
  function adImages(){
	 if(document.getElementById("disallowImage").checked==true)		
	    adValue=0;
	else
		adValue=1;
		
		xmlHttp=GetXmlHttpObject() 
	 if (xmlHttp==null)
	 {
		 alert ("Browser does not support HTTP Request")
		 return
	 }
	var url=web_url+"showadimages.php?display_id="+adValue;
	xmlHttp.onreadystatechange = maintainadImages; 
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
	 
	 }
 
 function maintainadImages()
  { 
        if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 		{ 
		  alert(xmlHttp.responseText)
		  if(adValue==1){
		     document.getElementById("DIV_AdImages").innerHTML='<font color="">Disallow Ad Images</font>';
		  }else{
			  document.getElementById("DIV_AdImages").innerHTML='Disallow Ad Images'; 
		  }
		  
        }
 }
//====================
function userCountDown(){
	 if(document.getElementById("chkcountdown").checked==true)		
	    sitevalue=1;
	else
		sitevalue=0;
		sitevar=sitevalue;
		xmlHttp=GetXmlHttpObject() 
	 if (xmlHttp==null){
		 alert ("Browser does not support HTTP Request")
		 return
	 }
	var url=web_url+"countdown.php?countID="+sitevalue;
	xmlHttp.onreadystatechange = maintainCountDown; 
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);	 
}
 
function maintainCountDown(){ 
  if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
	  alert(xmlHttp.responseText)
	 if(sitevar==1){
	  document.getElementById("DIV_Site_Countdown").innerHTML='<font color="#FF0000">Countdown Feature</font>';
	 }else{
	  document.getElementById("DIV_Site_Countdown").innerHTML='Countdown Feature'; 
	 }		  
  }
}

///-------------------------------------------------------------------------
function viewChange(val){   
    xmlHttp=GetXmlHttpObject()
	
	if (xmlHttp==null)
	{
		 alert ("Browser does not support HTTP Request")
		 return
	}
 	
  	else
 	{
		var url="ajax.php"
		url=url+"?view="+val
		url=url+"&action=viewchange"
		url=url+"&id="+Math.random()
		//alert(url);
		xmlHttp.onreadystatechange=viewtoggle
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
	}
}

function viewtoggle()
  { 
        if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 		{ 
		     document.getElementById("DivCatInd").innerHTML=xmlHttp.responseText;
        }
 }
 
 function delRepFile(fileName){
  	
	xmlHttp=GetXmlHttpObject() 
	var url="ajax.php?fName="+fileName;
	url=url+"&action=delRepFile";
	url=url+"&sid="+Math.random();	

	xmlHttp.open("GET",url,true);
	
	xmlHttp.send(null);
} 
