/*Home Page*/

var theImages = new Array()

theImages[0] = 'pages/images/testimonials_4.gif'
theImages[1] = 'pages/images/testimonials_2.gif'
theImages[2] = 'pages/images/testimonials_3.gif'
theImages[3] = 'pages/images/testimonials_1.gif'
theImages[4] = 'pages/images/testimonials_5.gif'
//theImages[5] = 'images/testimonials_6.jpg'
//theImages[6] = 'images/testimonials_7.jpg'

var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
	preBuffer[i] = new Image()
	preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));

function showImage(){
	document.write('<img src="'+theImages[whichImage]+'" width=150 height=65 border=0 alt="quality, first-class service">');

}

var whichImage = Math.round(Math.random()*(p-1));

function showImage(){
	document.write('<img src="'+theImages[whichImage]+'" width=150 height=65 border=0 alt="quality, first-class service">');

}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);


adImages = new Array("pages/images/photo_gifts_pic3.jpg","pages/images/photo_gifts_pic.jpg","pages/images/photo_gifts_pic2.jpg")
	adURL = new Array("bonusprint.com/canada/pages/prices.htm","bonusprint.com/canada/pages/photo_gifts.htm")
	thisAd = 0
	imgCt = adImages.length

	function rotate() {
		if (document.images) {
			if (document.adBanner.complete) {
				thisAd++
				if (thisAd == imgCt) {
					thisAd = 0
				}
				document.adBanner.src=adImages[thisAd]
			}
		  	setTimeout("rotate()", 5 * 1000)
	  	}
	}
	
	function newLocation() {
		document.location.href = "http://www." + adURL[thisAd]
	}


/*END Home Page*/


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function MM_openBrWindow4() { //v2.0
  window.open("nominate.htm","","toolbar=no,scrollbars=no,resizable=no,width=600,height=520");
}
function MM_openBrWindow5() {  
	window.open("legal.htm","","toolbar=no,scrollbars=yes,resizable=no,width=600,height=530");
}
function MM_openBrWindow6() {  
	window.open("privacy.htm","","toolbar=no,scrollbars=yes,resizable=no,width=600,height=530");
}

function ordergreetingcards() {
		var x = (screen.availHeight - 490)/2;
		var y = (screen.availWidth - 660)/2;
		window.open( 'http://webalbum.bonusprint.com/cagc01/main.aspx', null, "top="+x+",left="+y+",height=490,width=660,status=0,scrollbars=0,resizable=0,toolbar=0,menubar=0,titlebar=0;location=0");
	}

function openWin(URL,aName,wName,Scroll,W,H,T,L) { //v2.0
	window.name = aName; aWindow = window.open(URL,wName,"toolbar=no,location=no,directories=no,status=no,scrollbars="+ Scroll +",width="+ W +",height="+ H +",top="+ T +",left="+ L +",resizable=no,menubar=no");
}

function getCookieValue()
{
	var dc = document.cookie;
	var prefix = "refer=";
	var begin = dc.indexOf("; " + prefix);
	if (begin == -1) {
    	begin = dc.indexOf(prefix);
    		if (begin != 0) return "empty";
  			} else
    		begin += 2;
  		var end = document.cookie.indexOf(";", begin);
  		if (end == -1)
    	end = dc.length;
		return unescape(dc.substring(begin + prefix.length, end));
}

//Browser upload Generic
function htmlUpload(productgroup) {
ref = getCookieValue();
var link="http://webalbum.bonusprint.com/caipc01/default.aspx?level=0&sub=0&refer=" + ref; 
if(productgroup != null){
link += "&productgroup="+ productgroup;
}

window.location = link;
}
//End Browser upload Generic//

//Browser upload by product
function htmlUploadProduct(productID) {
ref = getCookieValue();
var link="http://webalbum.bonusprint.com/caipc01/default.aspx?level=0&sub=0&refer=" + ref; 
if(productID != null){
link += "&productID="+ productID+ "&productType=REORD";
}
window.location = link;
}  
//End Browser upload by product//