/******************************************************************************/
// Open Pop Up Window
function openPopup(pageToLoad, winName, width, height, center, location,menubar,resizable,scrollbars,status,titlebar,toolbar,hotkeys) {
	SDxposition=0; SDyposition=0;
	if ((parseInt(navigator.appVersion) >= 4 ) && (center)) {
		SDxposition = (screen.width - width) / 2;
		SDyposition = (screen.height - height) / 2;
	}
	SDlocation   = location   || 0;
	SDmenubar    = menubar    || 0;
	SDresizable  = resizable  || 1;
	SDscrollbars = scrollbars || 1;
	SDstatus     = status     || 0;
	SDtitlebar   = titlebar   || 0;
	SDtoolbar    = toolbar    || 0;
	SDhotkeys    = hotkeys    || 0;

	args = "width="      + width        + "," // param 3
	     + "height="     + height       + "," // param 4
	     + "location="   + SDlocation   + "," // param 6
	     + "menubar="    + SDmenubar    + "," // param 7
	     + "resizable="  + SDresizable  + "," // param 8
	     + "scrollbars=" + SDscrollbars + "," // param 9
	     + "status="     + SDstatus     + "," // param 10
	     + "titlebar="   + SDtitlebar   + "," // param 11
	     + "toolbar="    + SDtoolbar    + "," // param 12
	     + "hotkeys="    + SDhotkeys    + "," // param 13
	     + "screenx="    + SDxposition  + "," // NN Only
	     + "screeny="    + SDyposition  + "," // NN Only
	     + "left="       + SDxposition  + "," // IE Only
	     + "top="        + SDyposition;       // IE Only
	var win = window.open(pageToLoad, winName, args );
	win.focus();
}

/******************************************************************************/
//-->

/******************************************************************************/
// Random ad generator for home page

function randomNumber(arrayLength)
{
 randomIndex = Math.floor(Math.random()*arrayLength);
 return randomIndex;
}

function loadRandomAd()
{
 imageSrcSet = new Array();
 urlSet = new Array();
 altTagSet = new Array();
 imageWidth = 750;
 imageHeight = 60;
 imageBorder = 0;

 imageSrcSet[0] = "http://www.zonecoverage.com/catalog/includes/ads/banner_ad1.gif";
 urlSet[0] = "http://www.zonecoverage.com/in_the_zone/index.php";
 altTagSet[0] = "ZoneCoverage.com - Message Board";

 imageSrcSet[1] = "http://www.zonecoverage.com/catalog/includes/ads/banner_ad2.gif";
 urlSet[1] = "";
 altTagSet[1] = "ZoneCoverage.com - Message Board";

 imageSrcSet[2] = "http://www.zonecoverage.com/catalog/includes/ads/banner_ad3.gif";
 urlSet[2] = "";
 altTagSet[2] = "ZoneCoverage.com - Message Board";

 imageSrcSet[3] = "http://www.zonecoverage.com/catalog/includes/ads/banner_ad4.gif";
 urlSet[3] = "javascript:openPopup('http://www.colorgreenphoto.com','main_window',740,500,1)";
 altTagSet[3] = "ZoneCoverage.com - Message Board";

 randomIndex = randomNumber(imageSrcSet.length);

 document.writeln("<a href=" +urlSet[randomIndex] +">");
 document.write("<img src=" +imageSrcSet[randomIndex]);
 document.write(" width=" +imageWidth);
 document.write(" height=" +imageHeight);
 document.write(" border=" +imageBorder);
 document.writeln(" alt=" +altTagSet[randomIndex] +"></a>");
}


/******************************************************************************/


/******************************************************************************/
// Random ad generator for home page

function randomNumber(arrayLength)
{
 randomIndex = Math.floor(Math.random()*arrayLength);
 return randomIndex;
}

function loadRandomImage()
{
 imageSrcSet = new Array();
 urlSet = new Array();
 altTagSet = new Array();
 imageWidth = 250;
 imageHeight = 250;
 imageBorder = 0;

 imageSrcSet[0] = "../catalog/includes/ads/feature1.gif";
 urlSet[0] = "../message_board/index.php";
 altTagSet[0] = "ZoneCoverage.com - Message Board";

 imageSrcSet[1] = "../catalog/includes/ads/feature2.gif";
 urlSet[1] = "../message_board/index.php";
 altTagSet[1] = "ZoneCoverage.com - Message Board";

 imageSrcSet[2] = "../catalog/includes/ads/feature3.gif";
 urlSet[2] = "../message_board/index.php";
 altTagSet[2] = "ZoneCoverage.com - Message Board";

 imageSrcSet[3] = "../catalog/includes/ads/feature4.gif";
 urlSet[3] = "../message_board/index.php";
 altTagSet[3] = "ZoneCoverage.com - Message Board";

 imageSrcSet[4] = "../catalog/includes/ads/feature5.gif";
 urlSet[4] = "../message_board/index.php";
 altTagSet[4] = "ZoneCoverage.com - Message Board";

 randomIndex = randomNumber(imageSrcSet.length);

 document.writeln("<a href=" +urlSet[randomIndex] +">");
 document.write("<img src=" +imageSrcSet[randomIndex]);
 document.write(" width=" +imageWidth);
 document.write(" height=" +imageHeight);
 document.write(" border=" +imageBorder);
 document.writeln(" alt=" +altTagSet[randomIndex] +"></a>");
}


/******************************************************************************/