var bnrAdsCat=new Array();
var bnrAdsRos=new Array();
var fbrPages=new Array();
//
// Place required Banner text in the following array entries
// The banners will be displayed in a time based rotation
// Any category specific banner definitions must follow this file
//
//$$bnrAdsRos[0]="";$$//
bnrAdsRos[0]="";
bnrAdsRos[1]="";
bnrAdsRos[2]="";
bnrAdsRos[3]="";
bnrAdsRos[4]="";
bnrAdsRos[5]="";
bnrAdsRos[6]="";
bnrAdsRos[7]="";
bnrAdsRos[8]="";
bnrAdsRos[9]="";
//$$bnrAdsRos[0]="";$$//
//
// List of Pages to show regular FaceBook Icon (Not the 'Like' Icon)
//
//$$fbrPages[0]="";$$//
fbrPages[0]="Link0040.html";
//$$fbrPages[0]="";$$//
//
// Do not make changes below this line
//
var adsInstance=0;
var adsCatDisp=0;
var adsRosDisp=0;
var adsGglDisp=0;
function bnrDisplay(){
	var time=new Date();
	var secs=time.getTime();
	var bnr="";
	if(bnrAdsCat.length>0 && adsCatDisp==0)bnr=bnrAdsCat[(Math.floor(Math.random() * bnrAdsCat.length))];
	if(bnr=="" || bnr==null){
		if(bnrAdsRos.length>0 && adsRosDisp==0)bnr=bnrAdsRos[(secs % bnrAdsRos.length)];
		if(bnr!="")adsRosDisp++;
	}else{
		adsCatDisp++;
	}
	if((bnr=="" || bnr==null) && adsGglDisp<3){
		adsGglDisp++;
		google_ad_client = "pub-9665591883320014";
		google_ad_width = 728;
		google_ad_height = 90;
		google_ad_format = "728x90_as";
		google_ad_type = "text_image";
		google_color_border = "E2DAD3";
		google_color_bg = "E2DAD3";
		google_color_link = "0000FF";
		google_color_url = "008800";
		google_color_text = "000000";
		google_ad_channel ="";
		google_alternate_ad_url = "http://www.aroundwestchester.com/rsContext/rscontext.php?imagesize=small&imageposition=left&width=" + (google_ad_width) + "&height=" + (google_ad_height) + "&rows=1&cols=2&title=48&length=70&border=" + google_color_border + "&back=" + google_color_bg + "&link=" + google_color_link + "&text=" + google_color_text + "&url=" + google_color_url + "&keyword=&usnode=172282&uknode=560798&usmode=electronics&ukmode=electronics-uk&amazonus=&amazonuk=&country=us&center=yes&alt=";
		document.writeln("<scr" + "ipt type=\"text/javascript\" src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\"></scr" + "ipt>");

	}else{
		document.writeln(bnr);
	}
	adsInstance++;
}

function bnrHRV(){
bnrSharePage();
bnrFacebook();
}

function bnrSharePage(){
	var sPathPfx=sPathPfxGet() + 'img/btn/SendPage.png';
	document.writeln("<a href=\"mailto:?subject=Check this out&body=Click for page: " + location + " \" target=\"_blank\"><img src=\"" + sPathPfx + "\" alt=\"Share this page\"></a>");
}

function bnrFacebook(){
	var sPathPfx=sPathPfxGet();

	var sPathIconFU=sPathPfx + 'img/btn/LikeUs.gif';
	document.writeln("<img src=\"" + sPathIconFU + "\" id=\"LikeUs\" alt=\"Like us\">");

//	var LikeIcon=1;
//	var iIx=location.pathname.lastIndexOf('/');
//	if(iIx==0)iIx=location.pathname.lastIndexOf('\\');
//	var filename=location.pathname.substr(iIx+1);
//	for(iIx=0;iIx<fbrPages.length;iIx++){
//		if(filename==fbrPages[iIx])LikeIcon=0;
//		break;
//	}
//	if(LikeIcon==1){
// Not using the 'Like Icon', for now ...
//		document.writeln("<scr" + "ipt src=\"http://connect.facebook.net/en_US/all.js#xfbml=1\"></scr" + "ipt><fb:like href=\"\" layout=\"button_count\" show_faces=\"false\" width=\"90\" font=\"verdana\"></fb:like>");
//	}else{
		var sPathIconFB=sPathPfx + 'img/btn/favicon_facebook.gif';
		document.writeln("<a href=\"http://www.facebook.com/pages/WestchesterTownscom/129734723721554/\" target=\"_blank\"><img src=\"" + sPathIconFB + "\" id=\"facebook\" alt=\"Like us on FaceBook\"></a>");
//	}
	var sPathIconTW=sPathPfx + 'img/btn/favicon_twitter.gif';
	document.writeln("<a href=\"http://www.twitter.com/AboutWT/\" target=\"_blank\"><img src=\"" + sPathIconTW + "\" id=\"twitter\" alt=\"Follow us on Twitter\"></a>");
}

function bnrSearch(){
	var sPathPfx=sPathPfxGet() + 'img/btn/GoogleBeige.gif';
	document.writeln("<input type=\"image\" src=\"" + sPathPfx + "\" border=\"0\" name=\"sa\" value=\"Search\"></input>");
	document.writeln("<input type=\"hidden\" name=\"sitesearch\" value=\"\"></input>");
	document.writeln("<input type=\"hidden\" name=\"sitesearch\" value=\"WestchesterTowns.com\" checked=\"checked\"></input>");
	document.writeln("<input type=\"hidden\" name=\"client\" value=\"pub-9665591883320014\"></input>");
	document.writeln("<input type=\"hidden\" name=\"forid\" value=\"1\"></input>");
	document.writeln("<input type=\"hidden\" name=\"ie\" value=\"ISO-8859-1\"></input>");
	document.writeln("<input type=\"hidden\" name=\"oe\" value=\"ISO-8859-1\"></input>");
	document.writeln("<input type=\"hidden\" name=\"cof\" value=\"GALT:#008800;GL:1;DIV:#CEC3B7;VLC:993366;AH:center;BGC:F3ECE4;LBGC:F3ECE4;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;FORID:1;\"></input>");
	document.writeln("<input type=\"hidden\" name=\"hl\" value=\"en\"></input>");
}

function sPathPfxGet(){
	var iDepth=0;
	var iIx=location.pathname.indexOf("htm");
	if(iIx>0){
		if(location.pathname.substr(iIx-1,1)=='.')iIx=-1;
	}
	if(iIx<0) iIx=location.pathname.indexOf("php");
	if(iIx>0){
		if(location.pathname.substr(iIx-1,1)=='.')iIx=-1;
	}
	if(iIx<0){
		iIx=location.pathname.indexOf("js");
		iIx=iIx+2;
	}else{ 
		iIx=iIx+3;
	}
	var dlm=location.pathname.substr(iIx,1);
	for(iIx=iIx+1;iIx<location.pathname.length;iIx++){
		if(location.pathname.substr(iIx,1)==dlm)iDepth++;
	}
	var sPathPfx='';
	for(iIx=0;iIx<=iDepth;iIx++)sPathPfx=sPathPfx + '..' + dlm;
	return sPathPfx;
}

