/****

* Banner Ad Rotater v3.02

* Anarchos > anarchos3@hotmail.com

* http://anarchos.xs.mw/bannerad.phtml

**/

var user;
var domain;
var suffix;

function jemail(user, domain, suffix){
document.write('<a href="' + 'mailto:' + user + '@' + domain + '.' + suffix + '">' + user + '@' + domain + '.' + suffix + '</a>');
}

function Banner(refreshTime, width, height, altText, start, random){

	this.objName = "bannerAd" + (Banner.count++);

	eval(this.objName + "=this");

	if (!refreshTime) this.refreshTime = 5000; else this.refreshTime = refreshTime*1000;

	if (!width) this.width = 460; else this.width = width;

	if (!height) this.height = 68; else this.height = height;

	if (random == null) this.random = 1; else this.random = random;

	this.altText = altText;

	this.ads = [];

	if (start) this.currentAd = start-1; else start = null;

	this.mySize = 0;



	this.Ad = function(src, href, target, mouseover) {

		var tempImage = new Image();

		tempImage.src = src;

		this.ads[this.mySize] = new Object();

		var ad = this.ads[this.mySize];

		ad.src = src;

		if (typeof(target) == "undefined" || target == null) ad.target = "_self"; else ad.target = target;

		ad.href = href;

		ad.mouseover = mouseover;

		this.mySize++;

	}



	this.link = function(){

		var	ad = this.ads[this.currentAd];

		if (ad.target == "_self"){

			location.href = ad.href;

		}

		else if (ad.target == "_blank" || ad.target == "_new"){

			open(ad.href,this.objName + "Win");

		}

		else top.frames[ad.target].location.href = ad.href;

	}



	this.showStatus = function(){

		var ad = this.ads[this.currentAd];

		if (ad.mouseover) status = ad.mouseover;

		else status = ad.href;

	}



	this.randomAd = function(){

		var n;

		do { n = Math.floor(Math.random() * (this.mySize)); } 

		while(n == this.currentAd);

		this.currentAd = n;

	}



	this.output = function(){

		var tempCode = "";

		if (this.mySize > 1){

			if (this.currentAd == null) this.randomAd();

			if (this.currentAd >= this.mySize) this.currentAd = this.mySize - 1;

			tempCode = '<a href="javascript:'+this.objName+'.link();"';

			tempCode += ' onMouseOver="' + this.objName + '.showStatus(); return true"';

			tempCode += ' onMouseOut="status=\'\';return true">';

			tempCode += '<img src="' + this.ads[this.currentAd].src + '" width="' + this.width;

			tempCode += '" name="' + this.objName + 'Img" height="' + this.height + '" ';

			if (this.altText) tempCode += 'alt="'+this.altText + '" ';

			tempCode += 'border="0" /></a>';

			document.write(tempCode);

			this.nextAd();

		} else document.write("Error: two banners must be defined for the script to work.");

	}



	this.newAd = function(){

		if (!this.random){	

			this.currentAd++;

			if (this.currentAd >= this.mySize)

			   this.currentAd = 0;

		}

		else {

			this.randomAd();

		}

		this.nextAd();

	}



	this.nextAd = function(){

		document.images[this.objName+ 'Img'].src = this.ads[this.currentAd].src;

		setTimeout(this.objName+'.newAd()',this.refreshTime)

	}

}

Banner.count = 0;



function MM_swapImgRestore() { //v3.0

  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
	MM_swapWarnImage();
}



function MM_preloadImages() { //v3.0

  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();

    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)

    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}

	MM_swapWarnImage();

}



function MM_findObj(n, d) { //v4.01

  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];

  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);

  if(!x && d.getElementById) x=d.getElementById(n); return x;

}

function MM_swapImage() { //v3.0

  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)

   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}

}

function MM_swapWarnImage() { //v3.0
if(myBlink==1) {
x=MM_findObj("Image13");
x.src='images/navWarnblink.gif';
}
}

function old_cc_open() {

   window.open('http://www.rehobothweather.com/webcam_pop.html','mycam','width=320,height=240')

}

function cc_open() {

   window.location = 'http://www.rehobothweather.com/webcam.html';

}
