// JavaScript Document
//This function gets the number string from the url. It uses the numbers after the "?" sign in the url i.e. res.html?12
//This number (gNum) is fed to the next function to indicate which subscreen is hilited.
var numT = "0";

function getNumFromString(str)
{
	
var nextToLastChar = str.charAt(str.length -2);
var lastChar = str.charAt(str.length -1);
//alert("nextToLastChar "+nextToLastChar+" lastChar  "+lastChar);

	if (isNaN(lastChar)){
		return (0);
	}
	else
	{
		if (isNaN(nextToLastChar)){
		numT = lastChar;
		//alert("numT  "+numT);
		return(numT);
		}
		else
		{
		numT = nextToLastChar + lastChar;
		//alert("numT 2nd time "+numT);
		return(numT);
		}
	}
	
}

//This function is called from the body tag of the res.html file. The default is the same as case 1. If the page is called from the credits page a variable gNum is passed to it tell the Portfolio page which subpage to open.
function subPortfolio(gNum){
	x = Number(gNum);
switch (x) {
	case 1:
	setPortHilite(x)
	//alert("subPortfolio(gNum)  " +subPortfolio(gNum));
	break;
	
	case 2:
	setPortHilite(x)
	break;
	
	case 3:
	setPortHilite(x)
	break;
	
	case 4:
	setPortHilite(x)
	break;
	
	case 5:
	setPortHilite(x)
	break;
	
	case 6:
	setPortHilite(x)
	break;
	
	case 7:
	setPortHilite(x)
	break;
	
	case 8:
	setPortHilite(x)
	break;
	
	case 9:
	setPortHilite(x)
	break;
	
	case 10:
	setPortHilite(x)
	break;
	
	case 11:
	setPortHilite(x)
	break;
	
	case 12:
	setPortHilite(x)
	break;
	
	case 13:
	setPortHilite(x)
	break;

	default:
	setPortHilite(1)
	break;
	}
}		

function subOBPortfolio(gNum){
	//alert("gNum  "+gNum);
	x = Number(gNum);
	//alert("x  " +x);
	switch (x) {
	case 1:
	setPortOBHilite(x)
	break;
	
	case 2:
	setPortOBHilite(x)
	break;
	
	case 3:
	setPortOBHilite(x)
	break;
	
	case 4:
	setPortOBHilite(x)
	break;

	default:
	setPortOBHilite(1)
	break;
	}
}			
	
//setPortHilite is called from the Portfolio page and some of the items are called from the Credits page "VIEW...PHOTO GALLERY" button	
			 
function setPortHilite(num){
boxToTurnOff="bbut1";
switch (num) {
	case 1:
	checkPortHilite(num);
	fadeIt('event','hillsideslot.html');
	break;
	
	case 2:
	checkPortHilite(num);
	fadeIt('event','belvlagslot.html');
	break;
	
	case 3:
	checkPortHilite(num);
	fadeIt('event','BHslot.html');
	break;
	
	
	case 4:
	checkPortHilite(num);
	fadeIt('event','privslot.html');
	break;
	
	case 5:
	checkPortHilite(num);
	fadeIt('event','sfmarinaslot.html');
	break;
	
	case 6:
	checkPortHilite(num);
	fadeIt('event','marinslot.html');
	break;
	
	case 7:
	checkPortHilite(num);
	fadeIt('event','kauaislot.html');
	break;
	
	case 8:
	checkPortHilite(num);
	fadeIt('event','wyboyslot.html');
	break;
	
	case 9:
	checkPortHilite(num);
	fadeIt('event','alderslot.html'); 
	break;
	
	case 10:
	checkPortHilite(num);
	fadeIt('event','belvresslot.html'); 
	break;
	
	case 11:
	checkPortHilite(num);
	fadeIt('event','atherslot.html'); 
	break;
	
	case 12:
	checkPortHilite(num);
	fadeIt('event','resslot.html');
	break;
	
	case 13:
	checkPortHilite(num);
	fadeIt('event','mvslot.html');
	break;
	
	default:
	checkPortHilite(1);
	alert("setPortHilit default  ");
	checkBoxHilite(1)
	fadeIt('event','resslot.html');
	break;
	}
}			

function subCredit(gNum){
	x = Number(gNum);
	
switch (x) {
	case 1:
	checkCrHilite(x);
	fadeIt("infoWrapper","creditsInfo/beachRd_cd.html");
	fadeIt("creditImageWrapper","images/gallery/credits_image/beachRoad_cdImage.html");
	break;
	
	case 2:
	checkCrHilite(x);
	fadeIt("infoWrapper","creditsInfo/atherton_cd.html");
 	fadeIt("creditImageWrapper","images/gallery/credits_image/atherton_cdImage.html");
	break;
	
	case 3:
	checkCrHilite(x);
	fadeIt("infoWrapper","creditsInfo/berkeleyHills_cd.html");
	fadeIt("creditImageWrapper","images/gallery/credits_image/berkeleyHills_cdImage.html");
	break;
	
	
	case 4:
	checkCrHilite(x);
	fadeIt("infoWrapper","creditsInfo/alderSprings_cd.html");
	fadeIt("creditImageWrapper","images/gallery/credits_image/alderSprings_cdImage.html");
	break;
	
	case 5:
	checkCrHilite(x);
	fadeIt("infoWrapper","creditsInfo/belvedereLagoon_cd.html");
	fadeIt("creditImageWrapper","images/gallery/credits_image/belvedereLagoon_cdImage.html");
	break;
	
	case 6:
	checkCrHilite(x);
	fadeIt("infoWrapper","creditsInfo/wyBoy_cd.html");
	fadeIt("creditImageWrapper","images/gallery/credits_image/wyBoy_cdImage.html");
	break;
	
	case 7:
	checkCrHilite(x);
	fadeIt("infoWrapper","creditsInfo/marinRes_cd.html");
	fadeIt("creditImageWrapper","images/gallery/credits_image/marinRes_cdImage.html");
	break;
	
	case 8:
	checkCrHilite(x);
	fadeIt("infoWrapper","creditsInfo/belvedereRes_cd.html");
	fadeIt("creditImageWrapper","images/gallery/credits_image/belvedereRes_cdImage.html");
	break;
	
	case 9:
	checkCrHilite(x);
	fadeIt("infoWrapper","creditsInfo/hillSide_cd.html");
	fadeIt("creditImageWrapper","images/gallery/credits_image/hillSide_cdImage.html");
	break;
	
	case 10:
	checkCrHilite(x);
	fadeIt("infoWrapper","creditsInfo/privateRes_cd.html");
	fadeIt("creditImageWrapper","images/gallery/credits_image/privateRes_cdImage.html");
	break;
	
	case 11:
	checkCrHilite(x);
	fadeIt("infoWrapper","creditsInfo/kauai_cd.html");
	fadeIt("creditImageWrapper","images/gallery/credits_image/kauai_cdImage.html");
	break;
	
	case 12:
	checkCrHilite(x);
	fadeIt("infoWrapper","creditsInfo/jarvisCon_cd.html");
	fadeIt("creditImageWrapper","images/gallery/credits_image/jarvisCon_cdImage.html");
	break;
	
	case 13:
	checkCrHilite(x);
	fadeIt("infoWrapper","creditsInfo/millValley_cd.html");
	fadeIt("creditImageWrapper","images/gallery/credits_image/millValley_cdImage.html");
	break;
	
	case 14:
	checkCrHilite(x);
	fadeIt("infoWrapper","creditsInfo/sanfranciscomarina_cd.html");
	fadeIt("creditImageWrapper","images/gallery/credits_image/sfmarina_cdImage.html");
	break;
	
	default:
	checkCrHilite(1);
	fadeIt("infoWrapper","creditsInfo/beachRd_cd.html");
	fadeIt("creditImageWrapper","images/gallery/credits_image/beachRoad_cdImage.html");
	break;
	}
}		
		
	//This function is call on the On the Boards Page.	
function setPortOBHilite(num){
switch (num) {
	case 1:
	checkOBtHilite(num);
	fadeIt('event','jackholeslot.html');
	break;
	
	case 2:
	checkOBtHilite(num);
	fadeIt('event','stluciahacslot.html');
	break;
	
	case 3:
	checkOBtHilite(num);
	fadeIt('event','stluciaranslot.html');
	break;
	
	case 4:
	checkOBtHilite(num);
	fadeIt('event','terraceresslot.html');
	break;
	
	default:
	checkOBtHilite(1);
	fadeIt('event','jackholeslot.html');
	break;
	
	}
}			
	
function setPortBox(num,box){
	//alert("setPortBox  num  "+num+"  box   "+box);
switch (num) {
	case 1:
		switch (box) {
			case 1:
			//alert("box  "+box);
			checkBoxHilite(box);
			fadeIt('portfolioImage','beachroad1.html');
			break;
			
			case 2:
			checkBoxHilite(box);
			fadeIt('portfolioImage','beachroad2.html');
			break;
		
			case 3:
			checkBoxHilite(box);
			fadeIt('portfolioImage','beachroad3.html');
			break;
		
			case 4:
			checkBoxHilite(box);
			fadeIt('portfolioImage','beachroad4.html');
			break;
			
			case 5:
			checkBoxHilite(box);
			fadeIt('portfolioImage','beachroad5.html');
			break;
			
			case 6:
			checkBoxHilite(box);
			fadeIt('portfolioImage','beachroad6.html');
			break;
		}
	break;
	
	case 2:
	switch (box) {
			case 1:
			checkBoxHilite(box);
			fadeIt('portfolioImage','atherton1.html');
			break;
			
			case 2:
			checkBoxHilite(box);
			fadeIt('portfolioImage','atherton2.html');
			break;
		
			case 3:
			checkBoxHilite(box);
			fadeIt('portfolioImage','atherton3.html');
			break;
		
			case 4:
			checkBoxHilite(box);
			fadeIt('portfolioImage','atherton4.html');
			break;
			
			case 5:
			checkBoxHilite(box);
			fadeIt('portfolioImage','atherton5.html');
			break;
			
			case 6:
			checkBoxHilite(box);
			fadeIt('portfolioImage','atherton6.html');
			break;
		}
	
	break;
	
	case 3:
	switch (box) {
			case 1:
			checkBoxHilite(box);
			fadeIt('portfolioImage','berkhills1.html');
			break;
			
			case 2:
			checkBoxHilite(box);
			fadeIt('portfolioImage','berkhills2.html');
			break;
		
			case 3:
			checkBoxHilite(box);
			fadeIt('portfolioImage','berkhills3.html');
			break;
		
			case 4:
			checkBoxHilite(box);
			fadeIt('portfolioImage','berkhills4.html');
			break;
			
			case 5:
			checkBoxHilite(box);
			fadeIt('portfolioImage','berkhills5.html');
			break;
			
			case 6:
			checkBoxHilite(box);
			fadeIt('portfolioImage','berkhills6.html');
			break;
		}
	
	break;
	
	case 4:
	switch (box) {
			case 1:
			checkBoxHilite(box);
			fadeIt('portfolioImage','alder1.html');
			break;
			
			case 2:
			checkBoxHilite(box);
			fadeIt('portfolioImage','alder2.html');
			break;
		
			case 3:
			checkBoxHilite(box);
			fadeIt('portfolioImage','alder3.html');
			break;
		
			case 4:
			checkBoxHilite(box);
			fadeIt('portfolioImage','alder4.html');
			break;
			
			case 5:
			checkBoxHilite(box);
			fadeIt('portfolioImage','alder5.html');
			break;
			
			case 6:
			checkBoxHilite(box);
			fadeIt('portfolioImage','alder6.html');
			break;
			
			case 7:
			checkBoxHilite(box);
			fadeIt('portfolioImage','alder7.html');
			break;
		}
	
	break;
	case 5:
	switch (box) {
			case 1:
			checkBoxHilite(box);
			fadeIt('portfolioImage','belvlagoon1.html');
			break;
			
			case 2:
			checkBoxHilite(box);
			fadeIt('portfolioImage','belvlagoon2.html');
			break;
		
			case 3:
			checkBoxHilite(box);
			fadeIt('portfolioImage','belvlagoon3.html');
			break;
		
			case 4:
			checkBoxHilite(box);
			fadeIt('portfolioImage','belvlagoon4.html');
			break;
			
			case 5:
			checkBoxHilite(box);
			fadeIt('portfolioImage','belvlagoon5.html');
			break;
			
			case 6:
			checkBoxHilite(box);
			fadeIt('portfolioImage','belvlagoon6.html');
			break;
			
			case 7:
			checkBoxHilite(box);
			fadeIt('portfolioImage','belvlagoon7.html');
			break;
			
			case 8:
			checkBoxHilite(box);
			fadeIt('portfolioImage','belvlagoon8.html');
			break;
			
			case 9:
			checkBoxHilite(box);
			fadeIt('portfolioImage','belvlagoon9.html');
			break;
			
			case 10:
			checkBoxHilite(box);
			fadeIt('portfolioImage','belvlagoon10.html');
			break;
		}
	
	break;
	case 6:
	switch (box) {
			case 1:
			checkBoxHilite(box);
			fadeIt('portfolioImage','wyboy1.html');
			break;
			
			case 2:
			checkBoxHilite(box);
			fadeIt('portfolioImage','wyboy2.html');
			break;
		
			case 3:
			checkBoxHilite(box);
			fadeIt('portfolioImage','wyboy3.html');
			break;
		
			case 4:
			checkBoxHilite(box);
			fadeIt('portfolioImage','wyboy4.html');
			break;
			
			case 5:
			checkBoxHilite(box);
			fadeIt('portfolioImage','wyboy5.html');
			break;
			
			case 6:
			checkBoxHilite(box);
			fadeIt('portfolioImage','wyboy6.html');
			break;
			
			case 7:
			checkBoxHilite(box);
			fadeIt('portfolioImage','wyboy7.html');
			break;
		}
	
	break;
	
	case 7:
	switch (box) {
			case 1:
			checkBoxHilite(box);
			fadeIt('portfolioImage','marinres1.html');
			break;
			
			case 2:
			checkBoxHilite(box);
			fadeIt('portfolioImage','marinres2.html');
			break;
		
			case 3:
			checkBoxHilite(box);
			fadeIt('portfolioImage','marinres3.html');
			break;
		
			case 4:
			checkBoxHilite(box);
			fadeIt('portfolioImage','marinres4.html');
			break;
			
			case 5:
			checkBoxHilite(box);
			fadeIt('portfolioImage','marinres5.html');
			break;
			
			case 6:
			checkBoxHilite(box);
			fadeIt('portfolioImage','marinres6.html');
			break;
			
			case 7:
			checkBoxHilite(box);
			fadeIt('portfolioImage','marinres7.html');
			break;
		}
	
	break;
	
	case 8:
	switch (box) {
			case 1:
			checkBoxHilite(box);
			fadeIt('portfolioImage','belvres1.html');
			break;
			
			case 2:
			checkBoxHilite(box);
			fadeIt('portfolioImage','belvres2.html');
			break;
			
			case 3:
			checkBoxHilite(box);
			fadeIt('portfolioImage','belvres3.html');
			break;
			
			case 4:
			checkBoxHilite(box);
			fadeIt('portfolioImage','belvres4.html');
			break;
			
			case 5:
			checkBoxHilite(box);
			fadeIt('portfolioImage','belvres5.html');
			break;
			
			case 6:
			checkBoxHilite(box);
			fadeIt('portfolioImage','belvres6.html');
			break;
			
			case 7:
			checkBoxHilite(box);
			fadeIt('portfolioImage','belvres7.html');
			break;
		
		
		}
	
	break;
	
	case 9:
	switch (box) {
			case 1:
			checkBoxHilite(box);
			fadeIt('portfolioImage','hillside1.html');
			break;
			
			case 2:
			checkBoxHilite(box);
			fadeIt('portfolioImage','hillside2.html');
			break;
		
			case 3:
			checkBoxHilite(box);
			fadeIt('portfolioImage','hillside3.html');
			break;
		
			case 4:
			checkBoxHilite(box);
			fadeIt('portfolioImage','hillside4.html');
			break;
			
			case 5:
			checkBoxHilite(box);
			fadeIt('portfolioImage','hillside5.html');
			break;
			
			case 6:
			checkBoxHilite(box);
			fadeIt('portfolioImage','hillside6.html');
			break;
			
			case 7:
			checkBoxHilite(box);
			fadeIt('portfolioImage','hillside7.html');
			break;
			
			case 8:
			checkBoxHilite(box);
			fadeIt('portfolioImage','hillside8.html');
			break;
			
			case 9:
			checkBoxHilite(box);
			fadeIt('portfolioImage','hillside9.html');
			break;
			
			case 10:
			checkBoxHilite(box);
			fadeIt('portfolioImage','hillside10.html');
			break;
		}
	
	break;
	
	case 10:
	switch (box) {
			case 1:
			checkBoxHilite(box);
			fadeIt('portfolioImage','private1.html');
			break;
			
			case 2:
			checkBoxHilite(box);
			fadeIt('portfolioImage','private2.html');
			break;
		
			case 3:
			checkBoxHilite(box);
			fadeIt('portfolioImage','private3.html');
			break;
		
			case 4:
			checkBoxHilite(box);
			fadeIt('portfolioImage','private4.html');
			break;
			
			case 5:
			checkBoxHilite(box);
			fadeIt('portfolioImage','private5.html');
			break;
			
			case 6:
			checkBoxHilite(box);
			fadeIt('portfolioImage','private6.html');
			break;
			
			case 7:
			checkBoxHilite(box);
			fadeIt('portfolioImage','private7.html');
			break;
		}
	
	break;
	
		case 11:
	switch (box) {
			case 1:
			checkBoxHilite(box);
			fadeIt('portfolioImage','kauai1.html');
			break;
			
			case 2:
			checkBoxHilite(box);
			fadeIt('portfolioImage','kauai2.html');
			break;
		
			case 3:
			checkBoxHilite(box);
			fadeIt('portfolioImage','kauai3.html');
			break;
		
			case 4:
			checkBoxHilite(box);
			fadeIt('portfolioImage','kauai4.html');
			break;
			
			case 5:
			checkBoxHilite(box);
			fadeIt('portfolioImage','kauai5.html');
			break;
			
			case 6:
			checkBoxHilite(box);
			fadeIt('portfolioImage','kauai6.html');
			break;
			
			case 7:
			checkBoxHilite(box);
			fadeIt('portfolioImage','kauai7.html');
			break;
		}
	
	break;
	
		case 12:
	switch (box) {
			case 1:
			checkBoxHilite(box);
			fadeIt('portfolioImage','millvalley1.html');
			break;
			
			case 2:
			checkBoxHilite(box);
			fadeIt('portfolioImage','millvalley2.html');
			break;
		 
		 	case 3:
			checkBoxHilite(box);
			fadeIt('portfolioImage','millvalley3.html');
			break;
			
			case 4:
			checkBoxHilite(box);
			fadeIt('portfolioImage','millvalley4.html');
			break;
		}
	
	break;
	
	case 13:
	switch (box) {
			case 1:
			checkBoxHilite(box);
			fadeIt('portfolioImage','sfmarina1.html');
			break;
			
			case 2:
			checkBoxHilite(box);
			fadeIt('portfolioImage','sfmarina2.html');
			break;
		
			case 3:
			checkBoxHilite(box);
			fadeIt('portfolioImage','sfmarina3.html');
			break;
		
			case 4:
			checkBoxHilite(box);
			fadeIt('portfolioImage','sfmarina4.html');
			break;
			
			case 5:
			checkBoxHilite(box);
			fadeIt('portfolioImage','sfmarina5.html');
			break;
			
			case 6:
			checkBoxHilite(box);
			fadeIt('portfolioImage','sfmarina6.html');
			break;
			
			case 7:
			checkBoxHilite(box);
			fadeIt('portfolioImage','sfmarina7.html');
			break;
			
			case 8:
			checkBoxHilite(box);
			fadeIt('portfolioImage','sfmarina8.html');
			break;
			
			case 9:
			checkBoxHilite(box);
			fadeIt('portfolioImage','sfmarina9.html');
			break;
			
			case 10:
			checkBoxHilite(box);
			fadeIt('portfolioImage','sfmarina10.html');
			break;
			
			case 11:
			checkBoxHilite(box);
			fadeIt('portfolioImage','sfmarina11.html');
			break;
			
			case 12:
			checkBoxHilite(box);
			fadeIt('portfolioImage','sfmarina12.html');
			break;
		}
	
	break;
	
	default:
	
	break;
	
	}
}

function setOBBox(num,box){
	//alert("setPortBox  num  "+num+"  box   "+box);
switch (num) {
	case 1:
		switch (box) {
			case 1:
			//alert("box  "+box);
			checkBoxHilite(box);
			fadeIt('portfolioImage','ontheboards/jhole1.html');
			break;
			
			case 2:
			checkBoxHilite(box);
			fadeIt('portfolioImage','ontheboards/jhole2.html');
			break;
		
			case 3:
			checkBoxHilite(box);
			fadeIt('portfolioImage','ontheboards/jhole3.html');
			break;
		
			case 4:
			checkBoxHilite(box);
			fadeIt('portfolioImage','ontheboards/jhole4.html');
			break;
			
			case 5:
			checkBoxHilite(box);
			fadeIt('portfolioImage','ontheboards/jhole5.html');
			break;
			
			case 6:
			checkBoxHilite(box);
			fadeIt('portfolioImage','ontheboards/jhole6.html');
			break;
			
			case 7:
			checkBoxHilite(box);
			fadeIt('portfolioImage','ontheboards/jhole7.html');
			break;
			
			case 8:
			checkBoxHilite(box);
			fadeIt('portfolioImage','ontheboards/jhole8.html');
			break;
		}
	break;
	
	case 2:
	switch (box) {
			case 1:
			checkBoxHilite(box);
			fadeIt('portfolioImage','ontheboards/stluciahac1.html');
			break;
			
			case 2:
			checkBoxHilite(box);
			fadeIt('portfolioImage','ontheboards/stluciahac2.html');
			break;
		
			case 3:
			checkBoxHilite(box);
			fadeIt('portfolioImage','ontheboards/stluciahac3.html');
			break;
		
		}
	
	break;
	
	case 3:
	switch (box) {
			case 1:
			checkBoxHilite(box);
			fadeIt('portfolioImage','ontheboards/stluciaranch1.html');
			break;
			
			case 2:
			checkBoxHilite(box);
			fadeIt('portfolioImage','ontheboards/stluciaranch2.html');
			break;
		
			case 3:
			checkBoxHilite(box);
			fadeIt('portfolioImage','ontheboards/stluciaranch3.html');
			break;
			
			case 4:
			checkBoxHilite(box);
			fadeIt('portfolioImage','ontheboards/stluciaranch4.html');
			break;
			
			case 5:
			checkBoxHilite(box);
			fadeIt('portfolioImage','ontheboards/stluciaranch5.html');
			break;
		}
	
	break;
	
	case 4:
	switch (box) {
			case 1:
			checkBoxHilite(box);
			fadeIt('portfolioImage','ontheboards/terraceres1.html');
			break;
			
			case 2:
			checkBoxHilite(box);
			fadeIt('portfolioImage','ontheboards/terraceres2.html');
			break;
		
			case 3:
			checkBoxHilite(box);
			fadeIt('portfolioImage','ontheboards/terraceres3.html');
			break;
			
			case 4:
			checkBoxHilite(box);
			fadeIt('portfolioImage','ontheboards/terraceres4.html');
			break;
			
			case 5:
			checkBoxHilite(box);
			fadeIt('portfolioImage','ontheboards/terraceres5.html');
			break;
			
			case 6:
			checkBoxHilite(box);
			fadeIt('portfolioImage','ontheboards/terraceres6.html');
			break;
		
		}
	
	break;
	
	
	default:
	
	break;
	
	}
}

function setNRBox(num,box){
	//alert("setPortBox  num  "+num+"  box   "+box);
switch (num) {
	case 1:
		switch (box) {
			case 1:
			//alert("box  "+box);
			checkBoxHilite(box);
			fadeIt('portfolioImage','nonres/jarvis1.html');
			break;
			
			case 2:
			//alert("box  "+box);
			checkBoxHilite(box);
			fadeIt('portfolioImage','nonres/jarvis2.html');
			break;
		
			case 3:
			checkBoxHilite(box);
			fadeIt('portfolioImage','nonres/jarvis3.html');
			break;
		
			case 4:
			checkBoxHilite(box);
			fadeIt('portfolioImage','nonres/jarvis4.html');
			break;
			
			case 5:
			checkBoxHilite(box);
			fadeIt('portfolioImage','nonres/jarvis5.html');
			break;
			
			case 6:
			checkBoxHilite(box);
			fadeIt('portfolioImage','nonres/jarvis6.html');
			break;
			
		}
	break;
	
	case 2:
		switch (box) {
		}
	break;
	
	default:
	checkBoxHilite(box);
	fadeIt('portfolioImage','nonres/jarvis1.html');
	break;
	
	}
}
