function Banner(refreshTime, width, height, altText, start, random){
	this.objName = "bannerAd" + (Banner.count++);
	eval(this.objName + "=this");
	if (!refreshTime) this.refreshTime = 100; else this.refreshTime = refreshTime*1000;
	if (!width) this.width = 468; else this.width = width;
	if (!height) this.height = 60; 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(){
		if (this.mySize > 1){
		
			if (this.currentAd == null) this.randomAd();
			
			
			var str = ""
			str = str + '<span name="'+this.objName+'" '
			str = str + 'id="'+this.objName+'" ';
			str = str + 'class="m_banner_hide" ';
			str = str + 'bgcolor="#FFFCDA" ';	// CHANGE BANNER COLOR HERE
			str = str + 'align="center" ';
			str = str + 'valign="top" >\n';

			//str = str + '<a href="javascript:'+this.ads[this.currentAd]+'.link();"'">';

			str = str + '<a href="'+this.ads[this.currentAd].href+'">';

			str = str + '<OBJECT '
				str = str + 'classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '
				str = str + 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" '
				str = str + 'WIDTH="'+this.width+'" '
				str = str + 'HEIGHT="'+this.height+'" '
				str = str + 'id="bnr_'+this.objName+'" '
				str = str + 'ALIGN="" '
				str = str + 'VIEWASTEXT>'
				str = str + '<PARAM NAME=movie VALUE="'+ this.ads[this.currentAd].src + '">'
				str = str + '<PARAM NAME=quality VALUE=high>'
				str = str + '<PARAM NAME=bgcolor VALUE=#FFFCDA>'
				str = str + '<EMBED ';
				str = str + 'src="'+this.ads[this.currentAd].src+'" '
				str = str + 'quality=high '
		//			str = str + 'bgcolor=#FFFCDA '
				str = str + 'WIDTH="'+this.width+'" '
				str = str + 'HEIGHT="'+this.height+'" '
				str = str + 'NAME="bnr_'+this.objName+'" '
				str = str + 'ALIGN="center" '
				str = str + 'TYPE="application/x-shockwave-flash" '
				str = str + 'PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">'
				str = str + '</EMBED>'
				str = str + '</OBJECT>'
			
			str = str + '</a>';
		
		str += '</span>';

		document.write(str);
		
		this.nextAd();
		
		
		
		
		
		
		
			// 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 showbanner() {


	myAd = new Banner( 2, 468, 60, "Personal Touch", 1, 0 );
	myAd.Ad( "http://www.nursinghomeapparel.com/personaltouch.swf", "http://www.nursinghomeapparel.com/", "_self", "Incontinence Bedpads" );
	myAd.Ad( "http://www.nursinghomeapparel.com/personaltouch.swf", "http://www.nursinghomeapparel.com/", "_self", "We Support Our Troops" );
	
	myAd.output();

}

function showbannerhg() {

	showbanner();

}