/******************************************************************************/
// 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 = 800;
 imageHeight = 60;
 imageBorder = 0;

 imageSrcSet[0] = "http://www.piquasports.com/catalog/images/ads/craycon_homes.gif";
 urlSet[0] = "javascript:openPopup('http://www.crayconhomes.com','main_window',740,500,1)";
 altTagSet[0] = "Craycon Homes";

 imageSrcSet[1] = "http://www.piquasports.com/catalog/images/ads/craycon_homes.gif";
 urlSet[1] = "javascript:openPopup('http://www.crayconhomes.com','main_window',740,500,1)";
 altTagSet[1] = "Craycon Homes";

 imageSrcSet[2] = "http://www.piquasports.com/catalog/images/ads/craycon_homes.gif";
 urlSet[2] = "javascript:openPopup('http://www.crayconhomes.com','main_window',740,500,1)";
 altTagSet[2] = "Craycon Homes";

 imageSrcSet[3] = "http://www.piquasports.com/catalog/images/ads/craycon_homes.gif";
 urlSet[3] = "javascript:openPopup('http://www.crayconhomes.com','main_window',740,500,1)";
 altTagSet[3] = "Craycon Homes";

 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/zone_pics.gif";
     urlSet[0] = "http://www.zonecoverage.com/in_the_zone/index.php";
altTagSet[0] = "ZonePics";

 imageSrcSet[1] = "../catalog/includes/ads/vcreative.gif";
 urlSet[1] = "javascript:openPopup('../catalog/includes/ads/vcreative.gif','main_window',251,251,1)";
 altTagSet[1] = "V Creative Group";

 imageSrcSet[2] = "../catalog/includes/ads/posters_ad.gif";
  urlSet[2] = "http://www.zonecoverage.com/in_the_zone/posters.php";
 altTagSet[2] = "ZonePics Posters";

 imageSrcSet[3] = "../catalog/includes/ads/odonnell.gif";
   urlSet[3] = "javascript:openPopup('../catalog/includes/ads/odonnell.gif','main_window',251,251,1)";
 altTagSet[3] = "Jim Odonnell";

 imageSrcSet[4] = "../catalog/includes/ads/incipio.gif";
 urlSet[4] = "javascript:openPopup('http://www.incipio.ws/','main_window',800,600,1)";
 altTagSet[4] = "Incipio Web Services";

 imageSrcSet[5] = "../catalog/includes/ads/zone_pics.gif";
    urlSet[5] = "http://www.zonecoverage.com/in_the_zone/index.php";
 altTagSet[5] = "ZonePics";
 
imageSrcSet[6] = "../catalog/includes/ads/vcreative.gif";
    urlSet[6] = "javascript:openPopup('../catalog/includes/ads/vcreative.gif','main_window',251,251,1)";
 altTagSet[6] = "V Creative Group";
  
   imageSrcSet[7] = "../catalog/includes/ads/posters_ad.gif";
   urlSet[7] = "http://www.zonecoverage.com/in_the_zone/posters.php";
 altTagSet[7] = "ZonePics Posters";
 
    imageSrcSet[8] = "../catalog/includes/ads/odonnell.gif";
        urlSet[8] = "javascript:openPopup('../catalog/includes/ads/odonnell.gif','main_window',251,251,1)";
 altTagSet[8] = "Jim Odonnell";
    
 imageSrcSet[9] = "../catalog/includes/ads/incipio.gif";
 urlSet[9] = "javascript:openPopup('http://www.incipio.ws/','main_window',800,600,1)";
 altTagSet[9] = "Incipio Web Services";
 
 imageSrcSet[10] = "../catalog/includes/ads/zone_pics.gif";
         urlSet[10] = "http://www.zonecoverage.com/in_the_zone/index.php";
 altTagSet[10] = "ZonePics";
 
  imageSrcSet[11] = "../catalog/includes/ads/posters_ad.gif";
  urlSet[11] = "http://www.zonecoverage.com/in_the_zone/posters.php";
 altTagSet[11] = "ZonePics Posters";
 
 imageSrcSet[12] = "../catalog/includes/ads/incipio.gif";
  urlSet[12] = "javascript:openPopup('http://www.incipio.ws/','main_window',800,600,1)";
 altTagSet[12] = "Incipio Web Service";

 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>");
}


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