﻿var t;
var BlID=1;
var Blog =new Array;
var LastBlID=0;	
var blognum=0;
var TtlBlogs=2;
var timer_is_on=1;
var FullID=0;
function GetXmlHttpObject()
		{
		if (window.XMLHttpRequest)
		  {
		  // code for IE7+, Firefox, Chrome, Opera, Safari
		  return new XMLHttpRequest();
		  }
		if (window.ActiveXObject)
		  {
		  // code for IE6, IE5
		  return new ActiveXObject("Microsoft.XMLHTTP");
		  }
		return null;
		}	

function stateChangedForCBlogs()
	{
	if (xmlhttp.readyState==4)
		{
		var xmlDoc=xmlhttp.responseXML.documentElement;
		var BlogEntryID;
		var BlogEntryText;
		var BlogEntryTitle;
		var Email;
	 	var OnHold;
	 	var SendAlert;
	 	var BlogEntryDate;
		var BlogCategoryID;
		var BlogCategoryName;
		var CategoryName="";
		var BlogImage;
		var AllowComments;
		var BlogCount;
		var TotalBlogs;
		var Editor;
		var LoggedON;
	 	var BlogEntryTitle ="";
	 	var Comments;
	 	var Logged;
	 	var Edtor;
	 	var FromDate;
	 	var SndAlrt;
	 	var counter= 0;
	 	var CommunityCounter=1;
	 	var displaynumHTML="";
	 	var colourcount=0;
	 	while (colourcount < LastBlID)
		 	{colourcount=colourcount+1;
		 	document.getElementById("BlogControl"+colourcount).style.color='#000088';
			document.getElementById("BlogControl"+colourcount).style.borderColor='#F2EFDE';
			}
	 	//CatLoop=setTimeout("FindCommunityBlogs("+Blog[BlID]+","+blognum+")",5000);
		
		
 	 		while (BlogEntryTitle != "undefined")
				{
			 	BlogEntryID=xmlDoc.getElementsByTagName("BlogEntryID")[counter].childNodes[0].nodeValue;
				BlogCategoryID=xmlDoc.getElementsByTagName("BlogCategoryID")[counter].childNodes[0].nodeValue;
				BlogCategoryName=String(xmlDoc.getElementsByTagName("BlogCategoryName")[counter].childNodes[0].nodeValue);
				BlogEntryDate=String(xmlDoc.getElementsByTagName("BlogEntryDate")[counter].childNodes[0].nodeValue);
				BlogEntryText=String(xmlDoc.getElementsByTagName("BlogEntryText")[counter].childNodes[0].nodeValue);
				BlogEntryTitle=String(xmlDoc.getElementsByTagName("BlogEntryTitle")[counter].childNodes[0].nodeValue);
				Email=String(xmlDoc.getElementsByTagName("Email")[counter].childNodes[0].nodeValue);
			 	OnHold=xmlDoc.getElementsByTagName("OnHold")[counter].childNodes[0].nodeValue;
			 	AllowComments=xmlDoc.getElementsByTagName("AllowComments")[counter].childNodes[0].nodeValue;
			 	SendAlert=xmlDoc.getElementsByTagName("SendAlert")[counter].childNodes[0].nodeValue;
			 	LoggedON=xmlDoc.getElementsByTagName("LoggedON")[counter].childNodes[0].nodeValue;
			 	Editor=xmlDoc.getElementsByTagName("Editor")[counter].childNodes[0].nodeValue;
			 	BlogImage=String(xmlDoc.getElementsByTagName("BlogImage")[counter].childNodes[0].nodeValue);
			 	BlogCount=xmlDoc.getElementsByTagName("BlogCount")[counter].childNodes[0].nodeValue;
			 	TotalBlogs=xmlDoc.getElementsByTagName("TotalBlogs")[counter].childNodes[0].nodeValue;
			 	FromDate=xmlDoc.getElementsByTagName("FromDate")[counter].childNodes[0].nodeValue;
			 	counter=counter+1;
			 	//CommunityCounter=CommunityCounter+1;
				 	
			 	if (BlogEntryTitle != "undefined")
			 		{
			 		BlogEntryText=BlogEntryText.replace("’", "'");
			 		BlogEntryTitle=BlogEntryTitle.replace("’", "'");
			 		Comments="";
			 		Logged="";
			 		Edtor="";
			 		SndAlrt="";
			 		if (SendAlert == "True")
			 			{SndAlrt="<font size='2' color='red'><strong>Send as Alert</strong></font>";}
			 		if ( Editor == "True")	
			 			{Edtor="<a href='editor/article-entry.asp?Id="+BlogEntryID+"' target='_blank'><img src='Images/RichText.gif' alt='Rich Text Editor - Click here....' border='0'></a>"}
			 		if ( AllowComments == "True")
			 			{Comments=" | <font size='1'><a href='Blogger.asp?BlogCategoryID="+BlogCategoryID+"&amp;ShowEntryID="+BlogEntryID+"#Frum"+BlogEntryID+"'><font size='1' color='#b22222'>Comments</a> ("+BlogCount+")</font>";}
			 		//if (LoggedON == "True")	
			 		//	{Logged="&nbsp;<a title='Add Comment' onclick="+"window.open('asp/add-Commentv2.asp?BlogEntryID="+BlogEntryID+"','','scrollbars=no,height=275,width=650');"+"><font size='1'><font color='#b22222'>[+]</font></a>";}
			 		if(document.getElementById("Title"+CommunityCounter))
			 			{document.getElementById("Link"+CommunityCounter).innerHTML="<font size='1' color='#b22222'>"+BlogEntryDate+"</font> | <a href='TellAFriend.asp?path_id="+BlogEntryID+"&path_type=Blog'><font size='1' color='#b22222'>Tell a Friend</font></a>"+Comments+Logged;
			 			document.getElementById("Text"+CommunityCounter).innerHTML="<font align='left'><strong>"+BlogEntryText+"<!-- --></strong></font>";
			 			document.getElementById("More"+CommunityCounter).innerHTML="<a href='Blogger.asp?BlogCategoryID="+BlogCategoryID+"&amp;ShowEntryID="+BlogEntryID+"#Frum"+BlogEntryID+"'><font size='2'><strong>Full Story</strong></font></a>";
			 			document.getElementById("Title"+CommunityCounter).innerHTML="<a href='Blogger.asp?BlogCategoryID="+BlogCategoryID+"&amp;ShowEntryID="+BlogEntryID+"#Frum"+BlogEntryID+"'><font style='color: #2a5faa; font-family: tahoma, Arial, helvetica; font-size: 12pt; font-weight: bolder;' >"+BlogEntryTitle+"</font></a>";
			 			document.getElementById("Image"+CommunityCounter).innerHTML="<a href='Blogger.asp?BlogCategoryID="+BlogCategoryID+"&amp;ShowEntryID="+BlogEntryID+"#Frum"+BlogEntryID+"'><img src='Local/blogimages/"+BlogImage+"' alt='Blog Image: "+BlogImage+"' width='96' height='70' border='0' /></a>";
			 			document.getElementById("Alert"+CommunityCounter).innerHTML=SndAlrt;
			 			
					 	document.getElementById("Editor"+CommunityCounter).innerHTML=Edtor;
					 	document.getElementById("ViewAll").innerHTML="<a href='Blogger.asp?BlogCategoryID="+BlogCategoryID+"'><font size='4' color='#b22222'>View Archives</font></a>"
					 	document.getElementById("Header").innerHTML="<a href='Blogger.asp?BlogCategoryID="+BlogCategoryID+"'><font size='4' color='#b22222'>"+BlogCategoryName+"</font></a> ";
						CategoryName=BlogCategoryName;
						}
			 		document.getElementById("BlogControl"+BlID).style.color='green';
					document.getElementById("BlogControl"+BlID).style.borderColor='green';
					 	
					}
				 else
				 { TtlBlogs=TotalBlogs;
				if (TotalBlogs >0)
				 		{document.getElementById("Totals").innerHTML="<font size='3'><strong>"+blognum+"/"+TotalBlogs+"</strong></font><font size='1'><strong> "+CategoryName+" since "+FromDate+"</strong></font>";
				 		}
				 	else
				 		{document.getElementById("Totals").innerHTML="<font size='1'><strong>Articles will be updated shortly.</strong></font>";
				 		}
				 	}
				 }
		}
	}
	
function FindCommunityBlogs(BlogID)
	{
	blognum=Number(blognum);
	BlogID=Number(BlogID);
	xmlhttp=GetXmlHttpObject();
	if (xmlhttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  }
	var url="Asp/GetCommunityBlog_xml.asp";
	url=url+"?BlogCategoryID="+BlogID;
	url=url+"&Counter="+blognum;
	url=url+"&sid="+Math.random();
	xmlhttp.onreadystatechange=stateChangedForCBlogs;
	xmlhttp.open("GET",url,true);
	xmlhttp.send(null);
	}
var timer=10000;
function timedCount()
	{
	if (blognum < TtlBlogs)
		{blognum=blognum+1;}
	else
		{blognum=1;
		BlID=BlID+1;
		if (BlID == (LastBlID+1))
			{BlID=1;}
		}		
	FindCommunityBlogs(Blog[BlID])
	 timert=setTimeout("timedCount()",timer);
	 timer=10000;
	 
	}
function timedBack()
	{
	if (blognum > 1 )
		{blognum=blognum-1;}
	else
		{blognum=1;
		BlID=BlID-1;
		if (BlID == 0)
			{BlID=LastBlID;}
		}		
	FindCommunityBlogs(Blog[BlID])
	 timert=setTimeout("timedCount()",timer);
	 timer=10000;
	}	


function stopTimer()
{
clearTimeout(timert);
timer_is_on=0;
document.getElementById("Paused").innerHTML="<font size='3'><strong></strong></font>";
}
function timeResume	()
{
	timer=10000;
	if (!timer_is_on)
		{
		timer_is_on=1;
		timert=setTimeout("timedCount()",timer);
  document.getElementById("Paused").innerHTML="";
  }
	
	}
function stateChangedForClassified()
	{
	if (xmlhttp.readyState==4)
		{
		var xmlDoc=xmlhttp.responseXML.documentElement;
	
		var CCount;
		var ClassifiedTitle;
		var ClassifiedDetails;
		var Email;
	 	var OnHold;
	 	var StartDate;
	 	var EndDate;
		var ClassifiedPicture;
		var CategoryName;
		var ClassifiedID;
		var ShowOnHold;
	 	var counter= 0;
	 	var ClassifiedCounter=1;
	 	var displaynumHTML="";
	 	var AdText="";
	 	var FirstClassID=""; 
	 	var CheckedValue="";
	 	HeaderDisplay="<table border='0' cellpadding='0' cellspacing='0' width='740' class='Heading2'><tr height='10' ><td width='140'></td><td width='475'></td><td width='30'></td><td width='30'></td><td width='10'></td><td width='55'></td></tr><tr valign='middle' height='21' align='left' ><td align='left'>Category</td><td >Title</td><td></td><td align='center'>Save</td><td></td><td align='left'>Date</td></tr></table>";
	 	TitlesDisplay="<table border='0' cellpadding='0' cellspacing='0' width='740'>";
 		while (ClassifiedTitle != "undefined")
			{
		 	ClassifiedID=xmlDoc.getElementsByTagName("ClassifiedID")[counter].childNodes[0].nodeValue;
			CCount=xmlDoc.getElementsByTagName("CCount")[counter].childNodes[0].nodeValue;
			ClassifiedTitle=String(xmlDoc.getElementsByTagName("ClassifiedTitle")[counter].childNodes[0].nodeValue);
			ClassifiedDetails=String(xmlDoc.getElementsByTagName("ClassifiedDetails")[counter].childNodes[0].nodeValue);
			Email=String(xmlDoc.getElementsByTagName("Email")[counter].childNodes[0].nodeValue);
		 	OnHold=xmlDoc.getElementsByTagName("OnHold")[counter].childNodes[0].nodeValue;
		 	StartDate=String(xmlDoc.getElementsByTagName("StartDate")[counter].childNodes[0].nodeValue);
		 	EndDate=String(xmlDoc.getElementsByTagName("EndDate")[counter].childNodes[0].nodeValue);
		 	ClassifiedPicture=String(xmlDoc.getElementsByTagName("ClassifiedPicture")[counter].childNodes[0].nodeValue);
		 	CategoryName=String(xmlDoc.getElementsByTagName("CategoryName")[counter].childNodes[0].nodeValue);
		 	ShowOnHold=xmlDoc.getElementsByTagName("ShowOnHold")[counter].childNodes[0].nodeValue;
		 	CheckedValue=String(xmlDoc.getElementsByTagName("CheckedValue")[counter].childNodes[0].nodeValue);
		 	
		 	/*if (document.cookie.length>0)
			  {
			  c_start=document.cookie.indexOf(c_name + "=");
			  if (c_start!=-1)
			    {
			    c_start=c_start + c_name.length+1;
			    c_end=document.cookie.indexOf(";",c_start);
			    if (c_end==-1) c_end=document.cookie.length;
			    return unescape(document.cookie.substring(c_start,c_end));
			    }
			  }*/
		 	if (CheckedValue=="Checked")
		 		{CheckedValue="Checked='Checked'";}
		 	//ClassifiedDetails=ClassifiedDetails.replace(" ", "&nbsp;");
		 	//while( ClassifiedDetails.indexOf(" ")>0)
		 	//{ClassifiedDetails=ClassifiedDetails.replace(" ", "&nbsp;");}
		 	AdText=ClassifiedDetails;
		 	counter=counter+1;
		 	ClassifiedCounter=ClassifiedCounter+1;
			 	
		 	if (ClassifiedTitle != "undefined" && ShowOnHold=="Tru"  )
		 		{
		 		if (FirstClassID=="")
		 			{FirstClassID=document.getElementById("FirstClassID").value;}
		 		if (FirstClassID==0)
		 			{FirstClassID=ClassifiedID;}
		 		Comments="";
		 		Logged="";
		 		Edtor="";
		 		SndAlrt="";
		 		TitlesDisplay=TitlesDisplay+"<tr height='2' class='selected'><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr valign='middle' height='21' align='left' onclick="+"populateClassAd('"+ClassifiedID+"');"+" class='ClassifiedButton'><td  align='left'>"+CategoryName+"</td><td>"+ClassifiedTitle+"</td><td></td><td align='center' width='50'><input name='Check"+ClassifiedID+"' id='Check"+ClassifiedID+"' onclick="+"SaveCookie('"+ClassifiedID+"');"+" type='checkbox' "+CheckedValue+" /></td><td></td><td align='left'>"+StartDate+"</td></tr>";
						
		 		}
			}
			
		TitlesDisplay=TitlesDisplay+"<tr height='2' class='selected'><td width='140'></td><td width='475'></td><td width='30'></td><td width='30'></td><td width='10'></td><td width='55'></td></tr></table>";	
		document.getElementById("Header").innerHTML=HeaderDisplay;
		document.getElementById("Titles").innerHTML=TitlesDisplay;
		if (FirstClassID != "")
			{populateClassAd(FirstClassID);}
		}
	}
	
	
function FindClassifiedTitles(catid)
	{searchtext= document.getElementById("search").value;
	if (searchtext=="Search Text")
		{searchtext="";}
	catid=Number(catid);
	xmlhttp=GetXmlHttpObject();
	if (xmlhttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  }
	var url="Asp/GetClassified_xml.asp";
	url=url+"?CategoryID="+catid;
	url=url+"&SearchID="+searchtext;
	url=url+"&sid="+Math.random();
	xmlhttp.onreadystatechange=stateChangedForClassified;
	xmlhttp.open("GET",url,true);
	xmlhttp.send(null);
	}		
function SearchClassifiedTitles()
	{searchtext= document.getElementById("search").value;
	if (searchtext=="Search Text")
		{searchtext="";}
	if (searchtext.length > 0)
	{
	xmlhttp=GetXmlHttpObject();
	if (xmlhttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  }
	var url="Asp/GetClassified_xml.asp";
	url=url+"?SearchID="+searchtext;
	url=url+"&sid="+Math.random();
	xmlhttp.onreadystatechange=stateChangedForClassified;
	xmlhttp.open("GET",url,true);
	xmlhttp.send(null);
	}
	}	


function stateChangedForClassAd()
	{
	if (xmlhttp.readyState==4)
		{
		var xmlDoc=xmlhttp.responseXML.documentElement;
	
		var CCount;
		var ClassifiedTitle;
		var ClassifiedDetails;
		var Email;
		var Editor;
	 	var OnHold;
	 	var StartDate;
	 	var EndDate;
		var ClassifiedPicture;
		var CategoryName;
		var ClassifiedID;
		var ShowOnHold;
	 	var counter= 0;
	 	var ClassifiedCounter=1;
	 	var displaynumHTML="";
	 	var AdText="";
	 	while (ClassifiedTitle != "undefined")
			{
		 	ClassifiedID=xmlDoc.getElementsByTagName("ClassifiedID")[counter].childNodes[0].nodeValue;
			CCount=xmlDoc.getElementsByTagName("CCount")[counter].childNodes[0].nodeValue;
			ClassifiedTitle=String(xmlDoc.getElementsByTagName("ClassifiedTitle")[counter].childNodes[0].nodeValue);
			ClassifiedDetails=String(xmlDoc.getElementsByTagName("ClassifiedDetails")[counter].childNodes[0].nodeValue);
			Email=String(xmlDoc.getElementsByTagName("Email")[counter].childNodes[0].nodeValue);
		 	OnHold=xmlDoc.getElementsByTagName("OnHold")[counter].childNodes[0].nodeValue;
		 	ClassifiedUser=xmlDoc.getElementsByTagName("ClassifiedUser")[counter].childNodes[0].nodeValue;
		 	StartDate=String(xmlDoc.getElementsByTagName("StartDate")[counter].childNodes[0].nodeValue);
		 	EndDate=String(xmlDoc.getElementsByTagName("EndDate")[counter].childNodes[0].nodeValue);
		 	ClassifiedPicture=String(xmlDoc.getElementsByTagName("ClassifiedPicture")[counter].childNodes[0].nodeValue);
		 	CategoryName=String(xmlDoc.getElementsByTagName("CategoryName")[counter].childNodes[0].nodeValue);
		 	ShowOnHold=xmlDoc.getElementsByTagName("ShowOnHold")[counter].childNodes[0].nodeValue;
		 	Editor=xmlDoc.getElementsByTagName("Editor")[counter].childNodes[0].nodeValue;
		 	
		 	counter=counter+1;
		 	ClassifiedCounter=ClassifiedCounter+1;
			 	
		 	if (ClassifiedTitle != "undefined" )
		 		{
		 		Comments="";
		 		Logged="";
		 		Edtor="";
		 		document.getElementById('TellAFriend').innerHTML="<table border='0' cellpadding='0' cellspacing='0' ><tr><td class='LinkButton' onclick="+"window.open('TellAFriend.asp?path_id="+ClassifiedID+"&amp;path_type=Classified','_parent')"+"><img src='Images/email.gif' alt='Email This Event To a Friend' title='Email This Event To a Friend'  border='0' height='15' /><font size ='2'> Tell-A-Friend</font></td></tr></table>";
				if (Editor=="Tru")
		 			{document.getElementById('EditClass').innerHTML="<table border='0' cellpadding='0' cellspacing='0' ><tr><td class='LinkButton' onclick="+"window.open('Classified_EditE.asp?mode=edit&amp;id="+ClassifiedID+"','_parent')"+"><img src='Images/16x_edit.gif' alt='Edit' title='Edit' border='0' height='15' /><font size ='2'> Edit</font></td></tr></table>";}
		 		else
		 			{
		 			if ( ClassifiedUser == "Tru")
		 				{document.getElementById('EditClass').innerHTML="<table border='0' cellpadding='0' cellspacing='0' ><tr><td class='LinkButton'><img src='Images/16x_edit.gif' alt='Edit restricted' title='Edit restricted' border='0' height='15' /><font color='grey'><font size ='2'> Logon to Edit </font></td></tr></table>";
		 				}
		 			}
		 		if ( ClassifiedUser == "Tru")	
		 			{document.getElementById('Response').innerHTML="<table border='0' cellpadding='0' cellspacing='0' ><tr><td class='LinkButton' onclick="+"window.open('Response_EditE.asp?mode=Add&amp;id="+ClassifiedID+"','_parent')"+"><img src='Images/v5_mail_t.gif' alt='Respond' title='Respond' border='0' height='15' /><font size ='2'> Respond</font></td></tr></table>";
					}
				else
		 			{document.getElementById('Response').innerHTML="<table border='0' cellpadding='0' cellspacing='0' ><tr><td class='LinkButton' onclick="+"window.open('LogonPage.asp?Calsub=tru&amp;Url=Classified','_parent')"+"><img src='Images/16x_users.gif' alt='Log on to respond' title='Log on to respond' border='0' height='15' /><strong><font size ='2' color='Red'> Log on to respond.</font></strong></td></tr></table>";
		 			}
														
		 				
		 		document.getElementById('SrtDate').innerHTML=StartDate;	 		
		 		document.getElementById('ClassifiedTitle').innerHTML=ClassifiedTitle;		
		 		document.getElementById('ClassifiedText').innerHTML=ClassifiedDetails;
		 		document.getElementById('ClassifiedPicture').innerHTML="<img src='Local/Classifiedimages/"+ClassifiedPicture+"' width='100' />";		
		 		}
			}
			var ShowResponse="";
			var ResponseDate;
			var ResponseText ="";
			var ResponseCount=0;
			var RespText="";
			var RespTxt="";
			counter=counter-1;
		 	
		 	while (ResponseText != "undefined")
			{
		 	Email=String(xmlDoc.getElementsByTagName("Email")[counter].childNodes[0].nodeValue);
		 	ShowResponse=xmlDoc.getElementsByTagName("ShowResponse")[counter].childNodes[0].nodeValue;
		 	OnHold=xmlDoc.getElementsByTagName("OnHold")[counter].childNodes[0].nodeValue;
		 	ResponseDate=xmlDoc.getElementsByTagName("ResponseDate")[counter].childNodes[0].nodeValue;
		 	ResponseText=String(xmlDoc.getElementsByTagName("ResponseText")[counter].childNodes[0].nodeValue);
		 	ResponseCount=xmlDoc.getElementsByTagName("ResponseCount")[counter].childNodes[0].nodeValue;
		 	ResponseID=xmlDoc.getElementsByTagName("ResponseID")[counter].childNodes[0].nodeValue;
		 	
		 	counter=counter+1;
		 		
		 	
		 	if (ShowResponse == "Tru" )
		 		{
				RespTxt=RespTxt+"<br /><font color='black' size = '2'>"+ResponseCount+")&nbsp;</font><a href='Response_EditE.asp?mode=edit&amp;id="+ResponseID+"'><font color ='#2a5faa' size = '2'>"+ResponseText+"</font></a>&nbsp;&nbsp;&nbsp;<font color = 'Black' size = '2'>"+ResponseDate+"</font>";
		 		}
		 	}
			if (ResponseCount ==0)
		 		{RespText="";} 
			if (ResponseCount >1)
		 		{RespText=ResponseCount+" Responses Received.<br />";} 
			if (ResponseCount ==1)
		 		{RespText=ResponseCount+" Response Received.<br />";} 
			
			document.getElementById('Responses').innerHTML=RespText+RespTxt;		
		 				
		}
	}

function populateClassAd(classid)
	{document.getElementById('ClassifiedTitle').innerHTML="";		
	document.getElementById('ClassifiedText').innerHTML="<table cellpadding='0' cellspacing='0' border='0' bgcolor=''><tr><td width='628'></td></tr></table>";		
		 		
	searchtext= document.getElementById("search").value;
	if (searchtext=="Search Text")
		{searchtext="";}
	classid=Number(classid);
	xmlhttp=GetXmlHttpObject();
	if (xmlhttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  }
	var url="Asp/GetClassified_xml.asp";
	url=url+"?ID="+classid;
	url=url+"&SearchID="+searchtext;
	url=url+"&sid="+Math.random();
	xmlhttp.onreadystatechange=stateChangedForClassAd;
	xmlhttp.open("GET",url,true);
	xmlhttp.send(null);
	}	
function SaveCookie(classid)
	{var exdate=new Date();
		exdate.setDate(exdate.getDate()+30);
	if (document.getElementById("Check"+classid).checked ==1)
		{
		document.cookie="Classid23" + String(classid)+ String(classid*5)+ "=" +escape("Checked")+ ";expires="+exdate.toGMTString();
		}
	else
		{document.cookie="Classid23" + String(classid)+ String(classid*5)+ "=" +escape("unchecked")+ ";expires="+exdate.toGMTString();}
	}
var SearchID="";	
var SearchDisplay="";
function stateChangedForDirectory()
	{
	if (xmlhttp.readyState==4)
		{
		var xmlDoc=xmlhttp.responseXML.documentElement;
	
		var Active;
		var AffiliatedDate;
		var AccountID;
		var ShowListing;
		var Bloguser;
	 	var OnHold;
	 	var Trusted;
	 	var HostingID;
		var EndDate;
		var BaseID;
		var Banner;
		var ShowOnHold;
		var counter= 0;
	 	
	 	var displaynumHTML="<table width='600' border='0' cellpadding='0' cellspacing='0'>";
	 	
	 	while (AccountID != "undefined")
			{
			ID=xmlDoc.getElementsByTagName("ID")[counter].childNodes[0].nodeValue;
			Active=xmlDoc.getElementsByTagName("Active")[counter].childNodes[0].nodeValue;
			AffiliatedDate=String(xmlDoc.getElementsByTagName("AffiliatedDate")[counter].childNodes[0].nodeValue);
			AccountID=xmlDoc.getElementsByTagName("AccountID")[counter].childNodes[0].nodeValue;
			ShowListing=xmlDoc.getElementsByTagName("ShowListing")[counter].childNodes[0].nodeValue;
			Bloguser=xmlDoc.getElementsByTagName("Bloguser")[counter].childNodes[0].nodeValue;
			Trusted=xmlDoc.getElementsByTagName("Trusted")[counter].childNodes[0].nodeValue;
			ClassifiedUser=xmlDoc.getElementsByTagName("ClassifiedUser")[counter].childNodes[0].nodeValue;
			HostingID=xmlDoc.getElementsByTagName("HostingID")[counter].childNodes[0].nodeValue;
			EndDate=String(xmlDoc.getElementsByTagName("EndDate")[counter].childNodes[0].nodeValue);
			BaseID=xmlDoc.getElementsByTagName("BaseID")[counter].childNodes[0].nodeValue;
			Banner=String(xmlDoc.getElementsByTagName("Banner")[counter].childNodes[0].nodeValue);
			Tag1=xmlDoc.getElementsByTagName("Tag1")[counter].childNodes[0].nodeValue;
			Tag2=xmlDoc.getElementsByTagName("Tag2")[counter].childNodes[0].nodeValue;
			Tag3=xmlDoc.getElementsByTagName("Tag3")[counter].childNodes[0].nodeValue;
			Tag4=xmlDoc.getElementsByTagName("Tag4")[counter].childNodes[0].nodeValue;
			Tag5=xmlDoc.getElementsByTagName("Tag5")[counter].childNodes[0].nodeValue;
			Tag6=xmlDoc.getElementsByTagName("Tag6")[counter].childNodes[0].nodeValue;
			Tag7=xmlDoc.getElementsByTagName("Tag7")[counter].childNodes[0].nodeValue;
			Tag8=xmlDoc.getElementsByTagName("Tag8")[counter].childNodes[0].nodeValue;
			Tag9=xmlDoc.getElementsByTagName("Tag9")[counter].childNodes[0].nodeValue;
			Tag10=xmlDoc.getElementsByTagName("Tag10")[counter].childNodes[0].nodeValue;
			Tag11=xmlDoc.getElementsByTagName("Tag11")[counter].childNodes[0].nodeValue;
			CategoryID1=xmlDoc.getElementsByTagName("CategoryID1")[counter].childNodes[0].nodeValue;
			CategoryID2=xmlDoc.getElementsByTagName("CategoryID2")[counter].childNodes[0].nodeValue;
			CategoryID3=xmlDoc.getElementsByTagName("CategoryID3")[counter].childNodes[0].nodeValue;
			CategoryID4=xmlDoc.getElementsByTagName("CategoryID4")[counter].childNodes[0].nodeValue;
			CategoryID5=xmlDoc.getElementsByTagName("CategoryID5")[counter].childNodes[0].nodeValue;
			CategoryID6=xmlDoc.getElementsByTagName("CategoryID6")[counter].childNodes[0].nodeValue;
			Company=String(xmlDoc.getElementsByTagName("Company")[counter].childNodes[0].nodeValue);
			Slogan=String(xmlDoc.getElementsByTagName("Slogan")[counter].childNodes[0].nodeValue);
			DDescription=String(xmlDoc.getElementsByTagName("DDescription")[counter].childNodes[0].nodeValue);
			CharShown=String(xmlDoc.getElementsByTagName("CharShown")[counter].childNodes[0].nodeValue);
			Address=String(xmlDoc.getElementsByTagName("Address")[counter].childNodes[0].nodeValue);
			Unit=String(xmlDoc.getElementsByTagName("Unit")[counter].childNodes[0].nodeValue);
			Address2=String(xmlDoc.getElementsByTagName("Address2")[counter].childNodes[0].nodeValue);
			Streetno=String(xmlDoc.getElementsByTagName("Streetno")[counter].childNodes[0].nodeValue);
			Locality=String(xmlDoc.getElementsByTagName("Locality")[counter].childNodes[0].nodeValue);
			Building=String(xmlDoc.getElementsByTagName("Building")[counter].childNodes[0].nodeValue);
			Parade=String(xmlDoc.getElementsByTagName("Parade")[counter].childNodes[0].nodeValue);
			City=String(xmlDoc.getElementsByTagName("City")[counter].childNodes[0].nodeValue);
			Province=String(xmlDoc.getElementsByTagName("Province")[counter].childNodes[0].nodeValue);
			PostalCode=String(xmlDoc.getElementsByTagName("PostalCode")[counter].childNodes[0].nodeValue);
			Country=String(xmlDoc.getElementsByTagName("Country")[counter].childNodes[0].nodeValue);
			PhoneNumber=String(xmlDoc.getElementsByTagName("PhoneNumber")[counter].childNodes[0].nodeValue);
			Ext=String(xmlDoc.getElementsByTagName("Ext")[counter].childNodes[0].nodeValue);
			PhoneNumber2=String(xmlDoc.getElementsByTagName("PhoneNumber2")[counter].childNodes[0].nodeValue);
			FaxNumber=String(xmlDoc.getElementsByTagName("FaxNumber")[counter].childNodes[0].nodeValue);
			CellNumber=String(xmlDoc.getElementsByTagName("CellNumber")[counter].childNodes[0].nodeValue);
			WebUrl=String(xmlDoc.getElementsByTagName("WebUrl")[counter].childNodes[0].nodeValue);
			Email=String(xmlDoc.getElementsByTagName("Email")[counter].childNodes[0].nodeValue);
			Password=String(xmlDoc.getElementsByTagName("Password")[counter].childNodes[0].nodeValue);
			ContactName=String(xmlDoc.getElementsByTagName("ContactName")[counter].childNodes[0].nodeValue);
			Keywords=String(xmlDoc.getElementsByTagName("Keywords")[counter].childNodes[0].nodeValue);
			LocationID=xmlDoc.getElementsByTagName("LocationID")[counter].childNodes[0].nodeValue;
			Comments=String(xmlDoc.getElementsByTagName("Comments")[counter].childNodes[0].nodeValue);
			counter=counter+1;
		 	if (AccountID == "undefined" && counter>1)
		 		{
		 		displaynumHTML=displaynumHTML+"</table>";
		 		document.getElementById(SearchDisplay).innerHTML=displaynumHTML;	 		
		 		}
		 	if (Address=="-")
		 		{Address="";}
		 	else
		 		{Address=Address+" ";}
		 	if (DDescription=="-")
		 		{DDescription="Best Company";}			
		 	TagDisplay="";
		 	if (Tag1=="Tru")
		 		{TagDisplay=TagDisplay+ document.getElementById("Tag1").value
		 		}
		 	if (Tag2=="Tru")
		 		{TagDisplay=TagDisplay+ document.getElementById("Tag1").value
		 		}
		 	if (Tag3=="Tru")
		 		{TagDisplay=TagDisplay+ document.getElementById("Tag1").value
		 		}
		 	if (Tag4=="Tru")
		 		{TagDisplay=TagDisplay+ document.getElementById("Tag1").value
		 		}
		 	if (Tag5=="Tru")
		 		{TagDisplay=TagDisplay+ document.getElementById("Tag1").value
		 		}	
		 	if (AccountID==SearchDisplay && isNaN(SearchID)==true)
		 		{displaynumHTML=displaynumHTML+"<tr height='100'><td align='left' valign='top'><spam id='"+AccountID+"'><a class='LinkHeading1' onclick="+"populateDirectory(id,"+ID+",'"+AccountID+"')"+">"+Company+"</a><br /><font color='black'>"+Address+PhoneNumber+"</font><br /><br /><font color='black'>"+DDescription+"</font><br />"+TagDisplay+"<br /><span></td></tr>";	
				}
			else
				{displaynumHTML=displaynumHTML+"<tr height='35'><td align='left'  valign='top'><spam id='"+AccountID+"'><a class='LinkHeading1' onclick="+"populateDirectory(id,'"+AccountID+"','"+AccountID+"')"+">"+Company+"</a><br /><font color='black'>"+Address+PhoneNumber+"</font><br /><span></td></tr>";	
				}
			}
		}
	}

function populateDirectory(classid,Search,SearchResults)
	{SearchDisplay=	SearchResults
	 SearchID=Search;	
	searchtext=Search;
	if (isNaN(Search)==true)
		{if (document.getElementById(Search).value)
			{searchtext= document.getElementById(Search).value;}
		}
	if (searchtext=="Search Text")
		{searchtext="";}
	if (searchtext.length<3 && isNaN(searchtext)==true || searchtext.length==0  )
	{document.getElementById(SearchResults).innerHTML='';}
	
	
	xmlhttp=GetXmlHttpObject();
	if (xmlhttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  }
	var url="Asp/GetDirectory_xml.asp";
	url=url+"?StringText="+searchtext;
	url=url+"&sid="+Math.random();
	xmlhttp.onreadystatechange=stateChangedForDirectory;
	xmlhttp.open("GET",url,true);
	xmlhttp.send(null);
	}

var searchtext="";
function stateChangedForShortDirectory()
	{
	if (xmlhttp.readyState==4)
		{
		var xmlDoc=xmlhttp.responseXML.documentElement;
	
		var ID;
		var Company;
		var counter= 0;
	 	var AccountID;
	 	var displaynumHTML="<table width='178' border='0' cellpadding='2' cellspacing='0'><tr height='5'><td></td></tr>";
	 	CountryCode= document.getElementById("ShortCountryCode").value;
		City= document.getElementById("ShortCity").value;
		Locality= document.getElementById("ShortLocality").value;
	 	while (AccountID != "undefined" )
			{
			ID=xmlDoc.getElementsByTagName("ID")[counter].childNodes[0].nodeValue;
			AccountID=xmlDoc.getElementsByTagName("AccountID")[counter].childNodes[0].nodeValue;
			Company=String(xmlDoc.getElementsByTagName("Company")[counter].childNodes[0].nodeValue);
			counter=counter+1;
		 	if (AccountID == "undefined" && counter>1)
		 		{
		 		displaynumHTML=displaynumHTML+"</table>";
		 		document.getElementById('SearchResults').innerHTML=displaynumHTML;	 		
		 		}
		 	if (AccountID == "Category")
	 			{
	 			//ID=Company;
	 			//ID=ID.replace(" ", "%20");
	 			//ID=ID.replace(" ", "%20");
	 			//ID=ID.replace(" ", "%20");
	 			displaynumHTML=displaynumHTML+"<tr><td align='left' width='180'><a href="+"DirectoryListing.asp?City="+City+"&Locality="+Locality+"&CountryCode="+CountryCode+"&CategoryID="+ID+""+">"+Company.slice(0,80)+"</a></td></tr>";	
				}
	 		else
	 			{	
		 		displaynumHTML=displaynumHTML+"<tr><td align='left' width='180'><a href="+"DirectoryListing.asp?City="+City+"&Locality="+Locality+"&CountryCode="+CountryCode+"&searchID="+ID+""+">"+Company.slice(0,80)+"</a></td></tr>";	
				}
			}
		}
	}

function populateShortDirectory(classid)
	{//document.getElementById('SearchResults').innerHTML="";		
	CountryCode= document.getElementById("ShortCountryCode").value;
	City= document.getElementById("ShortCity").value;
	Locality= document.getElementById("ShortLocality").value;
	
	 		
	searchtext= document.getElementById("Search").value;
	if (searchtext=="Search Text")
		{searchtext="";}
	if (searchtext.length<3 && isNaN(searchtext)==true || searchtext.length==0  )
	{document.getElementById('SearchResults').innerHTML='';}
	
	xmlhttp=GetXmlHttpObject();
	if (xmlhttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  }
	var url="Asp/GetShortDirectory_xml.asp";
	url=url+"?StringText="+searchtext+"&CountryCode="+CountryCode+"&City="+City+"&Locality="+Locality;
	url=url+"&sid="+Math.random();
	xmlhttp.onreadystatechange=stateChangedForShortDirectory;
	xmlhttp.open("GET",url,true);
	xmlhttp.send(null);
	}

function populateAdvanceDirectory(classid)
	{//document.getElementById('SearchResults').innerHTML="";		
		 		
	searchtext= document.getElementById("AdvancedSearch").value;
	if (searchtext=="Search Text")
		{searchtext="";}
	if (searchtext.length<3 && isNaN(searchtext)==true || searchtext.length==0  )
	{document.getElementById('SearchResults').innerHTML='';}
	
	xmlhttp=GetXmlHttpObject();
	if (xmlhttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  }
	var url="Asp/GetShortDirectory_xml.asp";
	url=url+"?StringText="+searchtext;
	url=url+"&sid="+Math.random();
	xmlhttp.onreadystatechange=stateChangedForShortDirectory;
	xmlhttp.open("GET",url,true);
	xmlhttp.send(null);
	}					
function stateChangedForFilter()
	{
	if (xmlhttp.readyState==4)
		{
		var xmlDoc=xmlhttp.responseXML.documentElement;
	
		var City="";
		var Locality="";
		var CategoryID="";
		var CategoryName="";
		var counter= 0;
	 	var Trigger="";
	 	var CityOptions="<select name='City' id='City'><option value='---'>All Cities</option>";
	 	var LocalityOptions="<select name='Locality' id='Locality'><option value='---'>All Localities</option>";
		var CategoryIDOptions="<select name='CategoryID' id='CategoryID'>";
	 	
	 	var WebCity = document.getElementById("ASWebCity").value;
	 	if (WebCity=="London")
	 		{CityOptions="<select name='City' id='City' onchange="+"document.FilteredSearch.Destination.value='Locality';populateFilter();"+"><option value='---'>All Cities</option>";}
	 	
		while (City != "undefined" && Locality != "undefined" && CategoryID != "undefined" && CategoryName != "undefined"  )
			{
			Locality=String(xmlDoc.getElementsByTagName("Locality")[counter].childNodes[0].nodeValue);
			City=String(xmlDoc.getElementsByTagName("City")[counter].childNodes[0].nodeValue);
			CategoryID=String(xmlDoc.getElementsByTagName("CategoryID")[counter].childNodes[0].nodeValue);
			CategoryName=String(xmlDoc.getElementsByTagName("CategoryName")[counter].childNodes[0].nodeValue);
			Destination=String(xmlDoc.getElementsByTagName("Destination")[counter].childNodes[0].nodeValue);
			counter=counter+1;
		 	if (City != "undefined" && Locality != "undefined" && CategoryID != "undefined" && CategoryName != "undefined"  )
			 	{if (Destination == "City")
			 		{CityOptions=CityOptions+"<option value='"+City+"'>"+City+"</option>";}
			 	
			 	if (Destination == "Locality")
			 		{LocalityOptions=LocalityOptions+"<option value='"+Locality+"'>"+Locality+"</option>";}
			 	
			 	if (Destination == "CategoryID")
			 		{
			 		CategoryIDOptions=CategoryIDOptions+"<option value='"+CategoryID+"'>"+CategoryName+"</option>";}
			 	}
		 	}
		if (Destination=="City" || Destination=="All")
			{document.getElementById('CityDropDown').innerHTML=CityOptions+"</select>";
			if (document.getElementById("CountryC"))
				{document.getElementById("CountryC").checked=0; }
			if (document.getElementById("CityC"))
				{document.getElementById("CityC").checked=0; }
			if (document.getElementById("LocalityC"))
				{document.getElementById("LocalityC").checked=0; }
			}
		if ((Destination=="Locality"  || Destination=="All")  && WebCity=="London" || (Destination=="City"  || Destination=="All")  && WebCity=="London")
			{document.getElementById('LocalityDropDown').innerHTML=LocalityOptions+"</select>";
			if (document.getElementById("CityC"))
				{document.getElementById("CityC").checked=0;}
			if (document.getElementById("LocalityC"))
				{document.getElementById("LocalityC").checked=0; }
			}
		if (Destination=="CategoryID"  || Destination=="All")
			{document.getElementById('CategoryIDDropDown').innerHTML=CategoryIDOptions+"</select>";}
		}
	}

function populateFilter(classid)
	{		
	var CountryCode="";
	var City="";
	var Section="";
	var Destination = document.getElementById("Destination").value;
	for (var i = 0; i < document.FilteredSearch.CountryCode.length; i++) {
			if (document.FilteredSearch.CountryCode.options[i].selected == true ) {
				CountryCode=document.FilteredSearch.CountryCode.options[i].value;
				}
			}
	for (var i = 0; i < document.FilteredSearch.City.length; i++) {
			if (document.FilteredSearch.City.options[i].selected == true ) {
				City=document.FilteredSearch.City.options[i].value;
				}
			}
	if (document.FilteredSearch.Section)
		{for (var i = 0; i < document.FilteredSearch.Section.length; i++) {
			if (document.FilteredSearch.Section.options[i].selected == true ) {
				Section=document.FilteredSearch.Section.options[i].value;
				}
			}		
		}
	
	xmlhttp=GetXmlHttpObject();
	if (xmlhttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  }
	var url="Asp/GetAdvancedFilter_xml.asp";
	url=url+"?CountryCode="+CountryCode+"&City="+City+"&Section="+Section+"&Destination="+Destination;
	url=url+"&sid="+Math.random();
	xmlhttp.onreadystatechange=stateChangedForFilter;
	xmlhttp.open("GET",url,true);
	xmlhttp.send(null);
	}
	
function statechangedforOnHoldList()
	{
	if (xmlhttp.readyState==4)
		{
		var xmlDoc=xmlhttp.responseXML.documentElement;
		var link="";
		var Section="";
		var SectionCounter=0;
		var counter=0;
		while (Section != "undefined" )
			{
			Section=String(xmlDoc.getElementsByTagName("Section")[counter].childNodes[0].nodeValue);
			SectionCounter=xmlDoc.getElementsByTagName("SectionCounter")[counter].childNodes[0].nodeValue;
		 	counter=counter+1;
		 	if (Section != "undefined" )
		 		{link=link+"<a href='OnHoldManager.asp'>"+Section+" ("+SectionCounter+")</a><br />";
		 		}
			}
		if (link !="")
			{link="<table cellpadding='0' cellspacing='0' border='0'><tr style='color:black;background:yellow'><td  width='170' align='left'><a href='OnHoldManager.asp' target ='_self'>Items On Hold</a><br />"+link;
			//link= link+"</td><td width='2'></td><td valign='top'><a href='OnHoldManager.asp' target ='_self'><img src='Images/!.gif' alt='Events and Shiurim on hold' title='Events and Shiurim on hold' height='16' width='16' border='0'></a>";		
			link= link+"</td></tr></table>";		
			}
		if (document.getElementById('SpnOnHold')) 
			{
			document.getElementById('SpnOnHold').innerHTML=link;
			}
		}
	}
function OnHoldList(classid)
	{		
	
	xmlhttp=GetXmlHttpObject();
	if (xmlhttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  }
	var url="Asp/GetOnHold_xml.asp";
	url=url+"?sid="+Math.random();
	xmlhttp.onreadystatechange=statechangedforOnHoldList;
	xmlhttp.open("GET",url,true);
	xmlhttp.send(null);
	}
var ohtimer=3000;
function timedonhold()
	{if (ohtimer==100000)
	 OnHoldList('classid');
	 ohtimert=setTimeout("timedonhold()",ohtimer);
	 ohtimer=100000;
	 
	}
function statechangedforAdRotater()
	{
	if (xmlhttp.readyState==4)
		{
		var xmlDoc=xmlhttp.responseXML.documentElement;
		var link="";
		var Section="";
		var SectionCounter=0;
		var counter=0;
		while (Section != "undefined" )
			{
			Section=String(xmlDoc.getElementsByTagName("Section")[counter].childNodes[0].nodeValue);
			SectionCounter=xmlDoc.getElementsByTagName("SectionCounter")[counter].childNodes[0].nodeValue;
		 	counter=counter+1;
		 	if (Section != "undefined" )
		 		{link=link+"<a href='OnHoldManager.asp'>"+Section+" ("+SectionCounter+")</a><br />";
		 		//if AdLocation=1 then
				//	AdsDisplayed=1
				//	AdHeight=100
				//	AdWidth=590
				//end if
				//if AdLocation=2 then
				//	AdsDisplayed=20
				//	AdHeight=100
				//	AdWidth=590
				//end if
				//if AdLocation=3 then
				//	AdsDisplayed=1
				//	AdHeight=80
				//	AdWidth=170
				//end if
				//if AdLocation=4 then
				//	AdsDisplayed=20
				//	AdHeight=80
				//	AdWidth=170
				//end if
				//FirstAd=true
			/*	Do While Counter < MaxAdsDisplayed and AdsDisplayed>0%>
				<% if AdsImage(Counter,AdLocation) <> "" then
					
					AdsDisplayed=AdsDisplayed-1%>
		<%if FirstAd then
			FirstAd=false%>
			<table border='0' cellspacing='1' cellpadding='0'>
				<tr>
					<td bgcolor='<%=tablecolor%>' width='1' height='1'></td>
					<td bgcolor='<%=tablecolor%>' height='1'></td>
					<td bgcolor='<%=tablecolor%>' width='1' height='1'></td>
				</tr>
				<tr>
					<td bgcolor='<%=tablecolor%>' width='1'></td>
					<td class='det_mid'><table border='0' cellspacing='0' cellpadding='0'>
		<%end if%>	
						<tr height='1'><td></td></tr>
						<tr><td>
						<table border='1' cellspacing='0' cellpadding='0' bordercolor='black' <%if AdLocation=3 or AdLocation=4 then%> bgcolor='black'<%end if%> align='center'>
						<tr>
							
						<%
							hrefVal=AdsUrl(Counter,AdLocation)
						%>
						<%tempAdsHeight=AdsHeight(Counter)
						if IsNull(tempAdsHeight) or IsNumeric(tempAdsHeight)=false then
						
						tempAdsHeight=0
						end if
						
						if Right(AdsImage(Counter,AdLocation), 3)="swf" then%>
							<td align='center'><object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' height='<%=AdHeight%>' width='<%=AdWidth%>'>
							<param name='movie'  value='<%=AdsImage(Counter,AdLocation)%>' />
							<param name='quality' value='best' />
							<param name='wmode' value='transparent'/>
							<param name='play' value='true' />
							
							<embed pluginspage='http://www.macromedia.com/go/getflashplayer' src='<%=AdsImage(Counter,AdLocation)%>' type='application/x-shockwave-flash' <%if tempAdsHeight <>0 then%> height='<%=tempAdsHeight%>'<%else%>height='<%=AdHeight%>'<%end if%> width='<%=AdWidth%>' quality='best' wmode='transperent' play='true'></embed>
							</object></td>
						<%else%>
							<td align='center'><a target='_blank' href='<%=hrefVal%>' title='<%=AdText(Counter,AdLocation)%>'><img src='<%=AdsImage(Counter,AdLocation)%>' <%if tempAdsHeight <>0 then%> height='<%=tempAdsHeight%>'<%else%>height='<%=AdHeight%>'<%end if%> width='<%=AdWidth%>' border='0' alt='' /></a></td>
							
						<%end if%>
						
					</tr>
				</table>
				</td></tr>
				<tr height='1'><td></td></tr>
				<tr><td align='center'>
				<a href='<%=hrefVal%>' target='_blank' title='<%=AdText(Counter,AdLocation)%>'><font size='1'><%=AdText(Counter,AdLocation)%></font></a>
				</td></tr>
				<tr height='4'><td></td></tr>
				<%end if%>
				
						<%Counter = Counter + 1	
				Loop%>
		<%if FirstAd=false then%>
				</table>
				</td>
				<td bgcolor='<%=tablecolor%>' width='1'></td>
			</tr>
			<tr>
				<td colspan='3' bgcolor='<%=tablecolor%>' height='1'></td>
			</tr>
		</table><br />
		<%end if%>*/}
			}
		
		if (link !="")
			{link="<table cellpadding='0' cellspacing='0' border='0'><tr style='color:black;background:yellow'><td  width='170' align='left'><a href='OnHoldManager.asp' target ='_self'>Items On Hold</a><br />"+link;
			//link= link+"</td><td width='2'></td><td valign='top'><a href='OnHoldManager.asp' target ='_self'><img src='Images/!.gif' alt='Events and Shiurim on hold' title='Events and Shiurim on hold' height='16' width='16' border='0'></a>";		
			link= link+"</td></tr></table>";		
			}
		if (document.getElementById('SpnOnHold')) 
			{
			document.getElementById('SpnOnHold').innerHTML=link;
			}
		}
	}
function AdRotater(classid)
	{		
	
	xmlhttp=GetXmlHttpObject();
	if (xmlhttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  }
	var url="Asp/Getads_xml.asp";
	url=url+"?sid="+Math.random();
	xmlhttp.onreadystatechange=stateChangedForAdRotater;
	xmlhttp.open("GET",url,true);
	xmlhttp.send(null);
	}
var adtimer=3000;
function timedad()
	{if (adtimer==60000)
	 AdRotater('classid');
	 adtimert=setTimeout("timedad()",adtimer);
	 adtimer=60000;
	 
	}
			
				
	
