headnum='17';
oldheadnum='01';
var oldobj;

function newhead(headvalue)
	{
	document.cookie='MainPageHead='+headvalue;
	headnum=headvalue.substring(5,7);
		
	//I do this the "long way" so all the images pop at once.
	r1 = new Image();	r1.src = 'images/home/1head-'+headnum+'.jpg';
	r2 = new Image();	r2.src = 'images/home/1text-1head_'+headnum+'.gif';
	r3 = new Image();	r3.src = 'images/home/1shoulders-1head_'+headnum+'.jpg'
	r4 = new Image();	r4.src = 'images/home/1product-1head_'+headnum+'.gif';
	r5 = new Image();
	r6 = new Image();
	
	if (headnum==15 || headnum==17){
		r5.src = 'images/home/0text-1head_15.gif';
		r6.src = 'images/home/0helpsme-1head_15.gif';
		} else 	if (headnum==16){
		r5.src = 'images/home/0text-1head_16.gif';
		r6.src = 'images/home/0helpsme.gif';
		} else{
		r5.src = 'images/home/0text.gif';
		r6.src = 'images/home/0helpsme.gif';
		}
	
	document['head'].src=r1.src;
	document['text'].src=r2.src;
	document['shoulders'].src=r3.src;
	document['product'].src=r4.src;		
	document['0text'].src=r5.src;
	document['0helpsme'].src=r6.src;
	
	oldheadnum=headnum;
	return false;
	}
	
function loadHead()
	{
	dc=document.cookie;
	if(dc.indexOf("MainPageHead=")>-1)
		{
		cookieStart=dc.indexOf("MainPageHead=")+13;
		linkname=dc.substring(cookieStart,cookieStart+7);
		newhead(linkname);
		}
//	else 
//		{
//		randomHead();
//		}
	}

	//fist link is sample, second link is "More Info"
prod_array = new Array('','',
	'sales/streams/english/product/notesr5/ac200000.html','40products/lotus_notes.html',//notesr5
	'sales/streams/english/product/inotes/fa320000.html','40products/lotus_inotes.html',//inotes web
	'sales/streams/english/product/windows2k/da300000.html','40products/microsoft_windows2k.html',//win2k
	'sales/streams/english/product/quickplace/ba150000.html','40products/lotus_quickplace.html',//quickplace
	'sales/streams/english/product/sametime25/db150000.html','40products/lotus_sametime.html',	//sametime
	'sales/streams/english/product/powerpoint2002/ca050000.html','40products/microsoft_ppt2002.html',//powerpoint2k2
	'sales/streams/english/product/powerpoint2002/ca300000.html','40products/products.html',	//officeXP
	'sales/streams/english/product/excel/ea150000.html','40products/products.html',			//office2k
	'sales/streams/english/product/powerpoint/db100000.html','40products/products.html',	//office2k
	'sales/streams/english/product/ie6/ab050000.html','40products/products.html',			//internet
	'sales/streams/english/product/outlook2002/gc200000.html','40products/products.html',	//officeXP
	'sales/streams/english/product/ie6/db050000.html','40products/products.html',			//internet
	'sales/streams/english/product/ie6/ab050000.html','40products/products.html',			//internet
	'sales/streams/english/product/windowsxp/dc100000.html','40products/microsoft_windowsxp.html',//winxp
	'sales/streams/english/product/notes6/ab200000.html','40products/lotus_notes6.html',		//notes 6
	'40products/prerollout.html','40products/prerollout.html',		//PRC
	'30custom/educustomers.html','60news/2003-11-24.html'		//AOL 9.0
	);

function goprod(head,linknum)
	{	
	if (linknum==0 || linknum==1)
		{
		linkIndex=(2*head)+linknum;
		document.location=prod_array[linkIndex];
		return false; //don't use href
		}
	if (linknum==2){
		if(head=='15' || head=='16')
			return false; //don't use href
		else
		 	return true;//normal link; use href
		}
	if (linknum==3)	{
		if(head=='25')
			{
			document.location='specials/index.html';
			return false;
			}
			return true;		//normal link; use href
		}
		
	return false;// don't use href
	}

function textClick()
		{// used for the link on head 17 (ISP)
		if(headnum=='17')
			document.location='http://www.thementorshop.com/cgi-bin/merchant2/merchant.mv';
		return false;
		}

function openPopUp(swfURL)
			{   // use these to set the height and width of the window
				if (openPopUp.arguments[1]) popWidth=openPopUp.arguments[1];
					else popWidth  = 680;
				if (openPopUp.arguments[2]) popHeight=openPopUp.arguments[2];
					else popHeight = 385;
				if (openPopUp.arguments[3]) popName=openPopUp.arguments[3];
					else popName = "myPopUp";
			
			     // see if we've got a mac
			    if (navigator.userAgent.indexOf("Mac") >= 0 ||
			        navigator.userAgent.indexOf("PPC") >= 0)
			    {   menuVar = 'yes';
			    }
			    else
			    {   menuVar = 'no';
			    }
			
			     // set up the parameters
			    theParameters  = "outerwidth=" + popWidth + ",outerheight=" + popHeight;
			    theParameters += ",width=" + popWidth + ",height=" + popHeight;
			    theParameters += ",toolbar=no,location=no,directories=no,status=no";
			    theParameters += ",menubar=" + menuVar + ",scrollbars=yes,resizable=no";
			
			     // make the call to create the new window
			    myNewPopUp = open(swfURL,popName,theParameters);
			    if (myNewPopUp.opener == null) myNewPopUp.opener = window;
			    myNewPopUp.opener.name = "origPopUp";
				
				myNewPopUp.focus();
			    return false;
			}

//array format is grapic, link, link
rightArray = new Array(
	'rightcol.gif','sales/streams/english/product/notes6/da250000.html','40products/lotus_notes6.html',//notes6
	'rightcol.gif','sales/streams/english/product/notes6/da250000.html','40products/lotus_notes6.html',//notes6
	'rightcol-st.gif','sales/streams/english/product/sametime30/bc070000.html','40products/lotus_sametime_30.html',//sametime
	'rightcol-st.gif','sales/streams/english/product/sametime30/bc070000.html','40products/lotus_sametime_30.html',//sametime
	'rightcol-qp.gif','sales/streams/english/product/quickplace3/cb100000.html','40products/lotus_quickplace_30.html',//quickplace
	'rightcol-offxp.gif','sales/streams/english/product/word2002/ce050000.html','http://thementorshop.com/cgi-bin/merchant2/merchant.mv?Screen=PROD&Store_Code=TMS&Product_Code=off22-b000',//officeXP
	'rightcol-offxp.gif','sales/streams/english/product/excel2002/bd050000.html','http://thementorshop.com/cgi-bin/merchant2/merchant.mv?Screen=PROD&Store_Code=TMS&Product_Code=off22-b000',//officeXP
	'rightcol-word2k2.gif','sales/streams/english/product/word2002/ce050000.html','40products/microsoft_word2002.html',//word2002
	'rightcol-excel2k2.gif','sales/streams/english/product/excel2002/bd050000.html','40products/microsoft_excel2002.html',//excel2002
	'rightcol-ppt2k2.gif','sales/streams/english/product/powerpoint2002/ca050000.html','40products/microsoft_ppt2002.html',//powerpoint2k2
	'rightcol-out2k2.gif','sales/streams/english/product/outlook2002/gc200000.html','40products/microsoft_outlook2002.html',//outlook2k2
	'rightcol-inotes6.gif','sales/streams/english/product/inotes/fa320000.html','40products/lotus_inotes.html'//inotes web
 );

 
function loadRight()
	{	
	dc=document.cookie;
	if(dc.indexOf("MainPageRight=")>-1)
		{
		cookieStart=dc.indexOf("MainPageRight=")+14;
		right= parseInt(dc.substring(cookieStart,cookieStart+2));
		}
	else
		{		
		//random turned off right now:
		//right= Math.floor(Math.random()* rightArray.length /3);
		right = 6;
		}
		

	r1 = new Image();	r1.src = 'images/rc/'+rightArray[right*3];	
	document['rightAd'].src=r1.src;
	
	document.cookie='MainPageRight='+right;
	}	

function clickRight(whichLink)
	{	
	if (whichLink==0)
		document.location=rightArray[(right*3)+1];
	if (whichLink==1)
		document.location=rightArray[(right*3) +2];
	if (whichLink==2)
		document.location='http://thementorshop.com/cgi-bin/merchant2/merchant.mv';
	else
		document.location=rightArray[(right*3) +whichLink+1];
	return false;
	}
			
adGraphics = new Array ('images/home/ad1b.gif','images/home/ad1d.gif','images/home/01-BP-ad.gif','images/home/01-Notes65-ad.gif');
adLinks = new Array ('60news/2002-09-12.html','60news/2002-08-02.html','specials/index.html','40products/lotus_notes65.html');
adNum=0;
function adRotate()
	{
	adNum++; if (adNum>adGraphics.length-1) adNum=0;
	document['adLeft'].src=adGraphics[adNum];
	adTimer=setTimeout('adRotate();', 8*1000);
	}
function adLaunch()
	{
	document.location=adLinks[adNum];
	return false;
	}
function adPause()
	{
	if (self.adTimer)
		clearTimeout(adTimer);
	}
	function adResume()
	{
	adNum--;
	adRotate();
	}