// Set up the image files to be used.
// This script is used to randomly choose an image and quote
// There are two arrays that contain the full path to the image
// located on the server defined by the variable baseurl.
//
// The length of both arrays must be the same, since
// there must be a random image for each quote image
//
// A random integer is generated in the range of
// the length of the random image and quote image
// arrays.  If the length of both arrays are not
// the same, the random integer is set to zero.
//
// When a random integer is picked,
// the function showQuote embeds an HREF
// corresponding to the defined variable
// that holds the URL.
// This URL typically will contain
// the link to customer stories.
//
// When a new customer story rand image and quote image
// are added, theImages and theQ must be updated and
// the showQuote switch statement must be updated.

var theImages = new Array() // do not change this
var theQ = new Array() // do not change this

//var baseurl = 'http://www.penteledata.net/images/quotes/';
var baseurl = 'http://www.penteledata.net/images/banners/';

// This is the random image array for customer quotes
//theImages[0] =  baseurl + 'randimage1.gif'     //http://www.penteledata.net/customerstories/ntioga.shtml
//theImages[1] =  baseurl + 'randimage2.gif'     //http://www.penteledata.net/elearning/elearning.shtml
//theImages[2] =  baseurl + 'randimage3.gif'     //http://www.penteledata.net/customerstories/ephratahospital.shtml
//theImages[3] =  baseurl + 'randimage4.gif'     //http://www.penteledata.net/customerstories/bucknell.shtml
//theImages[4] =  baseurl + 'randimage5.gif'     //http://www.penteledata.net/customerstories/targetselect.shtml
//theImages[5] =  baseurl + 'randimage6.gif'     //http://www.penteledata.net/customerstories/moravian.shtml
//theImages[6] =  baseurl + 'randimage7.gif'     //http://www.penteledata.net/customerstories/pburg.shtml
//theImages[7] =  baseurl + 'randimage8.gif'     //http://www.penteledata.net/customerstories/palmertonhospital.shtml
//theImages[8] =  baseurl + 'randimage9.gif'     //http://www.penteledata.net/customerstories/sedacog.shtml

// This is the random image quote array for customer quotes
//theQ[0] =  baseurl + 'quote1.gif'              //http://www.penteledata.net/customerstories/ntioga.shtml
//theQ[1] =  baseurl + 'quote2.gif'              //http://www.penteledata.net/elearning/elearning.shtml
//theQ[2] =  baseurl + 'quote3.gif'              //http://www.penteledata.net/customerstories/ephratahospital.shtml
//theQ[3] =  baseurl + 'quote4.gif'              //http://www.penteledata.net/customerstories/bucknell.shtml
//theQ[4] =  baseurl + 'quote5.gif'              //http://www.penteledata.net/customerstories/targetselect.shtml
//theQ[5] =  baseurl + 'quote6.gif'              //http://www.penteledata.net/customerstories/moravian.shtml
//theQ[6] =  baseurl + 'quote7.gif'              //http://www.penteledata.net/customerstories/pburg.shtml
//theQ[7] =  baseurl + 'quote8.gif'              //http://www.penteledata.net/customerstories/palmertonhospital.shtml
//theQ[8] =  baseurl + 'quote9.gif'              //http://www.penteledata.net/customerstories/sedacog.shtml


// This is for the random banner image array
//theImages[0] = baseurl + 'wediditfirst_4-08.gif';
//theImages[1] = baseurl + 'fiberincommunity_4-08.jpg';
//theImages[2] = baseurl + '6Mbps_4-08.jpg';
theImages[0] = baseurl + 'we_are_penteledata_net.jpg';


// do not edit anything below this line

var NumOfImgs = theImages.length;
var NumOfQuotes = theQ.length;
var preBuffer = new Array()
var preBuf = new Array()

//if (NumOfImgs == NumOfQuotes)
//{
	for (i = 0; i < NumOfImgs; i++)
	{
   		preBuffer[i] = new Image()
    	preBuffer[i].src = theImages[i]
    
    	//preBuf[i] = new Image()
    	//preBuf[i].src = theQ[i]
	}
	
	var whichImage = Math.round(Math.random()*(NumOfImgs-1));
//}
//else
//{
//	whichImage = 0;
//}

function showBanner()
{
	switch(whichImage)
	{
		//case 0 :
		//	document.write('<A HREF="http://www.penteledata.net/broadband/broadband.shtml"><IMG SRC="'+theImages[whichImage]+'" BORDER=0></A>');
		//	break;
	    //case 1 :
		//	document.write('<A HREF="http://www.penteledata.net/aboutpenteledata/partners.shtml"><IMG SRC="'+theImages[whichImage]+'" BORDER=0></A>');
		//	break;
		//case 2 :
		//	document.write('<A HREF="http://www.penteledata.net/broadband/cableaccess.shtml"><IMG SRC="'+theImages[whichImage]+'" BORDER=0></A>');
		//	break;
		case 0 :
			document.write('<A HREF="http://www.wearepenteledata.net/"><IMG SRC="'+theImages[whichImage]+'" BORDER=0></A>');
			break;
		default :
			document.write('<IMG SRC="'+theImages[whichImage]+'">');
	}
}

function showGraphic()
{
   document.write('<IMG SRC="'+theImages[whichImage]+'" BORDER=0>');
}

function showQuote()
{
	switch(whichImage)
	{
		case 0 :
			document.write('<A HREF="http://www.penteledata.net/customerstories/ntioga.shtml"><IMG CLASS="mainquote" SRC="'+theQ[whichImage]+'" BORDER=0></A>');
			break;
		case 1 :
			document.write('<A HREF="http://www.penteledata.net/elearning/elearning.shtml"><IMG CLASS="mainquote" SRC="'+theQ[whichImage]+'" BORDER=0></A>');
			break;
		case 2 :
			document.write('<A HREF="http://www.penteledata.net/customerstories/ephratahospital.shtml"><IMG CLASS="mainquote" SRC="'+theQ[whichImage]+'" BORDER=0></A>');
			break;
		case 3 :
			document.write('<A HREF="http://www.penteledata.net/customerstories/bucknell.shtml"><IMG CLASS="mainquote" SRC="'+theQ[whichImage]+'" BORDER=0></A>');
			break;
		case 4 :
			document.write('<A HREF="http://www.penteledata.net/customerstories/targetselect.shtml"><IMG CLASS="mainquote" SRC="'+theQ[whichImage]+'" BORDER=0></A>');
			break;
		case 5 :
			document.write('<A HREF="http://www.penteledata.net/customerstories/moravian.shtml"><IMG CLASS="mainquote" SRC="'+theQ[whichImage]+'" BORDER=0></A>');
			break;
		case 6 :
			document.write('<A HREF="http://www.penteledata.net/customerstories/pburg.shtml"><IMG CLASS="mainquote" SRC="'+theQ[whichImage]+'" BORDER=0></A>');
			break;
		case 7 :
			document.write('<A HREF="http://www.penteledata.net/customerstories/palmertonhospital.shtml"><IMG CLASS="mainquote" SRC="'+theQ[whichImage]+'" BORDER=0></A>');
			break;
		case 8 :
			document.write('<A HREF="http://www.penteledata.net/customerstories/sedacog.shtml"><IMG CLASS="mainquote" SRC="'+theQ[whichImage]+'" BORDER=0></A>');
			break;
		default :
			document.write('<IMG CLASS="mainquote" SRC="'+theQ[whichImage]+'">');
	}
}	



function showCStoriesImage()
{
	var csURL;
	
	switch(whichImage)
	{
		case 0 :
		    csURL = 'http://www.penteledata.net/customerstories/ntioga.shtml';
			break;
		case 1 :
			csURL = 'http://www.penteledata.net/customerstories/cstories.shtml';
			break;
		case 2 :
			csURL = 'http://www.penteledata.net/customerstories/ephratahospital.shtml';
			break;
		case 3 :
			csURL = 'http://www.penteledata.net/customerstories/bucknell.shtml';
			break;
		case 4 :
			csURL = 'http://www.penteledata.net/customerstories/targetselect.shtml';
			break;
		case 5 :
			csURL = 'http://www.penteledata.net/customerstories/moravian.shtml';
			break;
		case 6 :
			csURL = 'http://www.penteledata.net/customerstories/pburg.shtml';
			break;
		case 7 :
			csURL = 'http://www.penteledata.net/customerstories/palmertonhospital.shtml';
			break;
		case 8 :
		    csURL = 'http://www.penteledata.net/customerstories/sedacog.shtml';
		    break;
		default :
			csURL = '';
	}
	
	var csImageLink = '<IMG CLASS="cstories" SRC="http://www.penteledata.net/images/mainpage/customerstories.gif" BORDER=0>';
	
	document.write('<A HREF="'+csURL+'">'+csImageLink+'</A>');
	
	
}