function swapImages(img_name, img_src){
	document[img_name].src = img_src;
}
function imgOvr(name, imgLoc){
	swapImages(name, imgLoc);
	menuOver();
}
function imgUp(name, imgLoc){
	swapImages(name, imgLoc);
	if (window.menuobj) {
		if (menuobj.style.visibility=="hidden") menuRevert();
	}
}
function openPopup(name, height, width){
	//var winl = (screen.width - width) / 2;
	//var wint = (screen.height - height) / 2;
	var winl = 200;
	var wint = 200;
	var windowName = name.slice(name.indexOf('-')+1, 50);
	//var windowLoc = 'http://www.strategichotels.com/properties/'+name+'.html';
	var windowLoc = name+'.html';
	var winProps = 'toolbar=no,statusbar=no,location=no,scrollbars=no,resizable=yes,width='+width+',height='+height+',top='+wint+',left='+winl;
	window.open(windowLoc, windowName, winProps);
	//window.open('http://www.strategichotels.com/properties/info-halfMoon.html', windowName, winProps);
}
function CapitalProject(hotel, project, dir, imgnum, numimgs){
	var winl = 200;
	var wint = 200;
	var height = 500;
	var width = 620;
	var windowName = dir;
	var windowLoc = 'capitalproject.asp?hotel='+hotel+'&project='+project+'&dir='+dir+'&imgnum='+imgnum+'&numimgs='+numimgs;
	var winProps = 'toolbar=no,statusbar=no,location=no,scrollbars=no,resizable=yes,width='+width+',height='+height+',top='+wint+',left='+winl;
	window.open(windowLoc, windowName, winProps);
	//window.open('http://www.strategichotels.com/portfolio/info-halfMoon.html', windowName, winProps);
}
function ViewImages(project){
	var winl = 200;
	var wint = 200;
	var height = 500;
	var width = 620;
	var windowName = project;
	var windowLoc = 'http://www.strategichotels.com/images.asp?h='+project+'&i=1';
	var winProps = 'toolbar=no,statusbar=no,location=no,scrollbars=no,resizable=yes,width='+width+',height='+height+',top='+wint+',left='+winl;
	window.open(windowLoc, windowName, winProps);
	//window.open('http://www.strategichotels.com/portfolio/info-halfMoon.html', windowName, winProps);
}
function MediaProject(mediaLink){
	var Mwinl = 200;
	var Mwint = 200;
	var Mheight = 369;
	var Mwidth = 780;
	var MwindowName = "";
	var MwindowLoc = mediaLink;
	var MwinProps = 'toolbar=no,statusbar=no,location=no,scrollbars=no,resizable=yes,width='+Mwidth+',height='+Mheight+',top='+Mwint+',left='+Mwinl;
	window.open(MwindowLoc, MwindowName, MwinProps);
}
function checkEnter(e, value){ //e is event object passed from function invocation
	var characterCode //literal character code will be stored in this variable

	if(e && e.which){ //if which property of event object is supported (NN4)
		e = e;
		characterCode = e.which; //character code is contained in NN4's which property
	}else{
		e = event;
		characterCode = e.keyCode; //character code is contained in IE's keyCode property
	}
	if(characterCode == 13 && value!=''){ //if generated character code is equal to ascii 13 (if enter key)
		window.location='http://www.strategichotels.com/KSRsearch.aspx?search_text='+value;
		return false;
	}else{
		return true; 
	}
}
/**********************************************************************
 section 1 - below preloads navigation rollovers
 **********************************************************************/
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}
var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		submit_btn_ov = newImage('http://www.strategichotels.com/images/submit_btn_ov.gif');
		pre_makeReservation_ov = newImage('http://www.strategichotels.com/images/makeReservation_ov.gif');
		pre_specs_ov = newImage('http://www.strategichotels.com/images/specs_ov.gif');
		pre_overview_mission_ov = newImage('http://www.strategichotels.com/images/overviewNav/overview-mission_ov.gif');
		pre_overview_people_ov = newImage('http://www.strategichotels.com/images/overviewNav/overview-people_ov.gif');
		pre_overview_peop_lg_ov = newImage('http://www.strategichotels.com/images/overviewNav/overview-peop-lg_ov.gif');
		pre_overview_peop_jm_ov = newImage('http://www.strategichotels.com/images/overviewNav/overview-peop-jm_ov.gif');
		pre_overview_peop_mh_ov = newImage('http://www.strategichotels.com/images/overviewNav/overview-peop-mh_ov.gif');
		pre_overview_peop_pm_ov = newImage('http://www.strategichotels.com/images/overviewNav/overview-peop-pm_ov.gif');
		pre_overview_peop_rm_ov = newImage('http://www.strategichotels.com/images/overviewNav/overview-peop-rm_ov.gif');
		pre_overview_peop_jc_ov = newImage('http://www.strategichotels.com/images/overviewNav/overview-peop-jc_ov.gif');
		pre_overview_peop_sm_ov = newImage('http://www.strategichotels.com/images/overviewNav/overview-peop-sm_ov.gif');
		pre_inv_ov_overview_ov = newImage('http://www.strategichotels.com/images/investorNav/inv-ov-overview_ov.gif');
		pre_inv_ov_profile_ov = newImage('http://www.strategichotels.com/images/investorNav/inv-ov-profile_ov.gif');
		pre_inv_gov_officers_ov = newImage('http://www.strategichotels.com/images/investorNav/inv-gov-officers_ov.gif');
		pre_inv_gov_brdDir_ov = newImage('http://www.strategichotels.com/images/investorNav/inv-gov-brdDir_ov.gif');
		pre_inv_gov_brdCom_ov = newImage('http://www.strategichotels.com/images/investorNav/inv-gov-brdCom_ov.gif');
		pre_inv_gov_guide_ov = newImage('http://www.strategichotels.com/images/investorNav/inv-gov-guide_ov.gif');
		pre_inv_gov_code_ov = newImage('http://www.strategichotels.com/images/investorNav/inv-gov-code_ov.gif');
		pre_inv_gov_contact_ov = newImage('http://www.strategichotels.com/images/investorNav/inv-gov-contact_ov.gif');
		pre_inv_overview_ov = newImage('http://www.strategichotels.com/images/investorNav/inv-overview_ov.gif');
		pre_inv_govern_ov = newImage('http://www.strategichotels.com/images/investorNav/inv-govern_ov.gif');
		pre_inv_stock_ov = newImage('http://www.strategichotels.com/images/investorNav/inv-stock_ov.gif');
		pre_inv_financal_ov = newImage('http://www.strategichotels.com/images/investorNav/inv-financal_ov.gif');
		pre_inv_news_ov = newImage('http://www.strategichotels.com/images/investorNav/inv-news_ov.gif');
		pre_inv_stock_chart_ov = newImage('http://www.strategichotels.com/images/investorNav/inv-stock-chart_ov.gif');
		pre_inv_stock_quote_ov = newImage('http://www.strategichotels.com/images/investorNav/inv-stock-quote_ov.gif');
		pre_inv_stock_divid_ov = newImage('http://www.strategichotels.com/images/investorNav/inv-stock-divid_ov.gif');
		pre_inv_fin_quote_ov = newImage('http://www.strategichotels.com/images/investorNav/inv-fin-quote_ov.gif');
		pre_inv_fin_AR_ov = newImage('http://www.strategichotels.com/images/investorNav/inv-fin-AR_ov.gif');
		pre_inv_fin_present_ov = newImage('http://www.strategichotels.com/images/investorNav/inv-fin-present_ov.gif');
		pre_inv_fin_sec_ov = newImage('http://www.strategichotels.com/images/investorNav/inv-fin-sec_ov.gif');
		pre_inv_fin_supp_ov = newImage('http://www.strategichotels.com/images/investorNav/inv-fin-supp_ov.gif');
		pre_inv_reqst_info_ov = newImage('http://www.strategichotels.com/images/investorNav/inv-reqst-info_ov.gif');
		pre_inv_reqst_email_ov = newImage('http://www.strategichotels.com/images/investorNav/inv-reqst-email_ov.gif');
		pre_inv_reqst_contct_ov = newImage('http://www.strategichotels.com/images/investorNav/inv-reqst-contct_ov.gif');
		pre_inv_reqInfo_ov = newImage('http://www.strategichotels.com/images/investorNav/inv-reqInfo_ov.gif');
		pre_inv_supp_ov = newImage('http://www.strategichotels.com/images/investorNav/inv-supp_ov.gif');
		pre_overview_ov = newImage('http://www.strategichotels.com/images/overview_ov.gif');
		pre_portfolio_ov = newImage('http://www.strategichotels.com/images/portfolio_ov.gif');
		pre_investor_rel_ov = newImage('http://www.strategichotels.com/images/investor_rel_ov.gif');
		pre_contact_ov = newImage('http://www.strategichotels.com/images/contact_ov.gif');
		pre_loc_MarrRancho_ov = newImage('http://www.strategichotels.com/images/propertyNav/loc-MarrRancho_ov.gif');
		pre_loc_FairmontChic_ov = newImage('http://www.strategichotels.com/images/propertyNav/loc-FairmontChic_ov.gif');
		pre_loc_HyattLaJolla_ov = newImage('http://www.strategichotels.com/images/propertyNav/loc-HyattLaJolla_ov.gif');
		pre_loc_HyattNwOrleans_ov = newImage('http://www.strategichotels.com/images/propertyNav/loc-HyattNwOrleans_ov.gif');
		pre_loc_HiltonBurbnk_ov = newImage('http://www.strategichotels.com/images/propertyNav/loc-HiltonBurbnk_ov.gif');
		pre_loc_MarrLincln_ov = newImage('http://www.strategichotels.com/images/propertyNav/loc-MarrLincln_ov.gif');
		pre_loc_MarrHamburg_ov = newImage('http://www.strategichotels.com/images/propertyNav/loc-MarrHamburg_ov.gif');
		pre_loc_InterMiami_ov = newImage('http://www.strategichotels.com/images/propertyNav/loc-InterMiami_ov.gif');
		pre_loc_LoewsSantaMon_ov = newImage('http://www.strategichotels.com/images/propertyNav/loc-LoewsSantaMon_ov.gif');
		pre_loc_RitzHlfMoon_ov = newImage('http://www.strategichotels.com/images/propertyNav/loc-RitzHlfMoon_ov.gif');
		pre_loc_HyattPhoenx_ov = newImage('http://www.strategichotels.com/images/propertyNav/loc-HyattPhoenx_ov.gif');
		pre_loc_EmbassyBuena_ov = newImage('http://www.strategichotels.com/images/propertyNav/loc-EmbassyBuena_ov.gif');
		pre_loc_fourSePunta_ov = newImage('http://www.strategichotels.com/images/propertyNav/loc-fourSePunta_ov.gif');
		pre_loc_MarrParis_ov = newImage('http://www.strategichotels.com/images/propertyNav/loc-MarrParis_ov.gif');
		pre_loc_fourSeMex_ov = newImage('http://www.strategichotels.com/images/propertyNav/loc-fourSeMex_ov.gif');
		pre_loc_interChic_ov = newImage('http://www.strategichotels.com/images/propertyNav/loc-interChic_ov.gif');
		pre_loc_interPra_ov = newImage('http://www.strategichotels.com/images/propertyNav/loc-interPra_ov.gif');
		preloadFlag = true;
	}
}

/**********************************************************************
 section 2 - below shows and hides navigation layers
 **********************************************************************/
function show(id){
	if(id!="portfolioDIV"){
		document.getElementById("portfolioDIV").style.visibility = 'hidden';
		document.getElementById("propertiesPhotosDIV").style.visibility = 'hidden';
	}else{
		if(siteSection=='home'){
			document.getElementById("flashintro").style.visibility = 'hidden';
			document.getElementById("homelogo").style.visibility = 'visible';
			if(document.layers){            
				//thisbrowser="NN4";             
				document.layers["portfolioDIV"].bgColor='transparent';         
			}         
			if(document.all){ 
				//thisbrowser="ie"          
					document.all.portfolioDIV.style.backgroundColor='transparent';  
			}        
			if(!document.all && document.getElementById){        
				//thisbrowser="NN6";          
				document.getElementById("portfolioDIV").style.backgroundColor='transparent';
			}
		}
		document.getElementById("portfolioDIV").style.visibility = 'visible';
	}
	if(id!="overviewDIV"){
		document.getElementById("overviewDIV").style.visibility = 'hidden';
		document.getElementById("overviewPeopDIV").style.visibility = 'hidden';
	}else{
		document.getElementById("overviewDIV").style.visibility = 'visible';
	}
	if(id!="qtrDIV"){
		//document.getElementById("qtrDIV").style.visibility = 'hidden';
	}else{
		//document.getElementById("qtrDIV").style.visibility = 'visible';
	}
	if(id!="contactDIV"){
		document.getElementById("contactDIV").style.visibility = 'hidden';
	}else{
		document.getElementById("contactDIV").style.visibility = 'visible';
	}
	if(id!="investorDIV"){
		document.getElementById("investorDIV").style.visibility = 'hidden';
		document.getElementById("investorOvDIV").style.visibility = 'hidden';
		document.getElementById("investorGovDIV").style.visibility = 'hidden';
		document.getElementById("investorStockDIV").style.visibility = 'hidden';
		document.getElementById("investorFinancDIV").style.visibility = 'hidden';
		document.getElementById("investorNewsDIV").style.visibility = 'hidden';
		//document.getElementById("investorReqstDIV").style.visibility = 'hidden';
	}else{
		document.getElementById("investorDIV").style.visibility = 'visible';
	}
}
function hideAll(){
	document.getElementById("portfolioDIV").style.visibility = (siteSection=='property')?'visible':'hidden';
	document.getElementById("propertiesPhotosDIV").style.visibility = 'hidden';
	document.getElementById("overviewDIV").style.visibility = (siteSection.indexOf('overview')!=-1)?'visible':'hidden';
	document.getElementById("overviewPeopDIV").style.visibility = (siteSection=='overviewPeople')?'visible':'hidden';
	document.getElementById("investorDIV").style.visibility = (siteSection.indexOf('investor')!=-1)?'visible':'hidden';
	document.getElementById("investorOvDIV").style.visibility = (siteSection=='investorOverview')?'visible':'hidden';
	document.getElementById("investorGovDIV").style.visibility = (siteSection=='investorGovern')?'visible':'hidden';
	document.getElementById("investorStockDIV").style.visibility = (siteSection=='investorStock')?'visible':'hidden';
	document.getElementById("investorFinancDIV").style.visibility = (siteSection=='investorFinanc')?'visible':'hidden';
	document.getElementById("investorNewsDIV").style.visibility = (siteSection=='investorNews')?'visible':'hidden';
	document.getElementById("contactDIV").style.visibility = (siteSection=='contact')?'visible':'hidden';
	document.getElementById("qtrDIV").style.visibility = (siteSection=='qtr')?'visible':'hidden';
	if(window.clearNav)window.clearTimeout(clearNav);
}
function showSub(id){
	document.getElementById("overviewPeopDIV").style.visibility = (id!="overviewPeopDIV")?'hidden':'visible';
	document.getElementById("investorOvDIV").style.visibility = (id!="investorOvDIV")?'hidden':'visible';
	document.getElementById("investorGovDIV").style.visibility = (id!="investorGovDIV")?'hidden':'visible';
	document.getElementById("investorStockDIV").style.visibility = (id!="investorStockDIV")?'hidden':'visible';
	document.getElementById("investorFinancDIV").style.visibility = (id!="investorFinancDIV")?'hidden':'visible';
	document.getElementById("investorNewsDIV").style.visibility = (id!="investorNewsDIV")?'hidden':'visible';
}
function showPic(id){
	if(siteSection=='home'){
		if(document.layers){            
			//thisbrowser="NN4";             
			document.layers["propertiesPhotosDIV"].bgColor='transparent';         
		}         
		if(document.all){ 
			//thisbrowser="ie"          
				document.all.propertiesPhotosDIV.style.backgroundColor='transparent';  
		}        
		if(!document.all && document.getElementById){        
			//thisbrowser="NN6";          
			document.getElementById("propertiesPhotosDIV").style.backgroundColor='transparent';
		}
    }
	document.getElementById("propertiesPhotosDIV").style.visibility = 'visible';
	if(id=='blank'){
		document.getElementById("propPic").src='http://www.strategichotels.com/images/spacer.gif';
	}else{
		document.getElementById("propPic").src='http://www.strategichotels.com/images/properties-large/'+id+'.jpg';
	}
}
function menuOver(){
	if(window.clearNav)window.clearTimeout(clearNav);
}
function menuRevert(){
	clearNav = window.setTimeout("hideAll()" , 300);
}
/**********************************************************************
 section 3 - below is the layer styling
 **********************************************************************/
function writeDivStyles(){
document.write ('<LINK REL="SHORTCUT ICON" HREF="http://www.strategichotels.com/favicon.ico"><style><!--'
+'	#content {position: absolute;}'
+'	#overviewDIV { visibility: hidden; position: absolute; width: 200px; height: 113px; z-index: 20; }'
+'	#overviewPeopDIV { visibility: hidden; position: absolute; width: 110px; height: 75p; z-index: 999;x }'
+'	#investorOvDIV { visibility: hidden; position: absolute; width: 110px; height: 113px; z-index: 998; }'
+'	#investorGovDIV { visibility: hidden; position: absolute; width: 110px; height: 113px; z-index: 997; }'
+'	#investorStockDIV { visibility: hidden; position: absolute; width: 110px; height: 113px; z-index: 996; }'
+'	#investorFinancDIV { visibility: hidden; position: absolute; width: 110px; height: 113px; z-index: 995; }'
+'	#investorNewsDIV { visibility: hidden; position: absolute; width: 110px; height: 113px; z-index: 994; }'
+'	#investorDIV { visibility: hidden; position: absolute; width: 200px; height: 113px; z-index: 10; }'
+'	#qtrDIV { visibility: hidden; position: absolute; width: 145px; height: 113px; z-index: 35; }'
+'	#contactDIV { visibility: hidden; position: absolute; width: 145px; height: 113px; z-index: 45; }'
+'	#htmlLayer { visibility: visible; position: absolute; width: 100%; height: 100%; z-index: 0; overflow: auto;}'
+'	#portfolioDIV { background-color: #ebeae5; visibility: hidden; position: absolute; width: 230px; height: 362px; z-index: 5;}'
+'	#propertiesPhotosDIV  { background-color: #ebeae5; visibility: hidden; position: absolute; width: 446px; height: 362px; z-index: 5000;}'
+'	//--></style>');
}
/**********************************************************************
 section 4 - below is for the scrollable div (content area)
 **********************************************************************/

// Made by geeeet@ghtml.com
// Keep these two lines and you're free to use this code
if(!window.noScroll){
// Change these variables
var upH = 1; // Height of up-arrow
var upW = 15; // Width of up-arrow
var downH = 1; // Height of down-arrow
var downW = 15; // Width of down-arrow
var dragH = 30; // Height of scrollbar
var dragW = 15; // Width of scrollbar
var speed = 4; // Scroll speed
var wheelRollSpeed = 3; //Mouse Wheel speed

// Browser detection
var dom = document.getElementById ? true:false;
var nn4 = document.layers ? true:false;
var ie4 = document.all ? true:false;

var mouseY; // Mouse Y position onclick
var mouseX; // Mouse X position onclick

var clickUp = false; // If click on up-arrow
var clickDown = false; // If click on down-arrow
var clickDrag = false; // If click on scrollbar
var clickAbove = false; // If click above scrollbar
var clickBelow = false; // If click below scrollbar
var wheelRoll = 1; // If wheel has been rolled

var timer = setTimeout("",500); // Repeat variable
var upL; // Up-arrow X
var upT; // Up-arrow Y
var downL; // Down-arrow X
var downT; // Down-arrow Y
var dragL; // Scrollbar X
var dragT; // Scrollbar Y
var rulerL; // Ruler X
var rulerT; // Ruler Y
var contentT; // Content layer Y;
var contentH; // Content height
var contentClipH; // Content clip height
var scrollLength; // Number of pixels scrollbar should move
var startY; // Keeps track of offset between mouse and span
}
// Mousedown
function down(e){
	if((document.layers && e.which!=1) || (document.all && event.button!=1)) return true; // Enables the right mousebutton
	getMouse(e);
	startY = (mouseY - dragT);
	
	// If click on up-arrow
	if(mouseX >= upL && (mouseX <= (upL + upW)) && mouseY >= upT && (mouseY <= (upT + upH))){
		clickUp = true;
		return scrollUp();
	}	
	// Else if click on down-arrow
	else if(mouseX >= downL && (mouseX <= (downL + downW)) && mouseY >= downT && (mouseY <= (downT + downH))){
		clickDown = true;
		return scrollDown();
	}
	// Else if click on scrollbar
	else if(mouseX >= dragL && (mouseX <= (dragL + dragW)) && mouseY >= dragT && (mouseY <= (dragT + dragH))){
		clickDrag = true;
		return false;
	}
	else if(mouseX >= dragL && (mouseX <= (dragL + dragW)) && mouseY >= rulerT && (mouseY <= (rulerT + scrollH))){
		// If click above drag
		if(mouseY < dragT){
			clickAbove = true;
			clickUp = true;
			return scrollUp();
		}
		// Else click below drag
		else{
			clickBelow = true;
			clickDown = true;
			return scrollDown();
		}
	}
	// If no scrolling is to take place
	else{
		return true;
	}
}
function wheelScroll(){
	//change_layercontent('delta:'+event.wheelDelta)
	wheelRoll = wheelRollSpeed;
	if (event.wheelDelta >= 120){
		scrollUp();
 	}else if (event.wheelDelta <= -120){
		scrollDown();
	}
}
var msglayer;
function change_layercontent(msgstring){
	if(document.layers){
		//thisbrowser="NN4";
		msglayer = document.layers["msgDIV"];
		msglayer.document.open();
		msglayer.document.write(msgstring);
		msglayer.document.close();
	}
	if(document.all){
		//thisbrowser="ie"
		msglayer = document.all["msgDIV"];
		msglayer.innerHTML=msgstring;
	}
	if(!document.all && document.getElementById){
		//thisbrowser="NN6";
		msglayer = document.getElementById("msgDIV");
		msglayer.innerHTML=msgstring;
	}
}
// Drag function
function move(e){
	if(clickDrag && contentH > contentClipH){
		getMouse(e);
		dragT = (mouseY - startY);
		
		if(dragT < (rulerT))
			dragT = rulerT;		
		if(dragT > (rulerT + scrollH - dragH))
			dragT = (rulerT + scrollH - dragH);
		
		contentT = ((dragT - rulerT)*(1/scrollLength));
		contentT = eval('-' + contentT);

		moveTo();
		
		// So ie-pc doesn't select gifs
		if(ie4)
			return false;
	}
}

function up(){
	clearTimeout(timer);
	// Resetting variables
	clickUp = false;
	clickDown = false;
	clickDrag = false;
	clickAbove = false;
	clickBelow = false;
	wheelRoll = 1;
	return true;
}

// Reads content layer top
function getT(){
	if(ie4)
		contentT = document.all.content.style.pixelTop;
	else if(nn4)
		contentT = document.contentClip.document.content.top;
	else if(dom)
		contentT = parseInt(document.getElementById("content").style.top);
}

// Reads mouse X and Y coordinates
function getMouse(e){
	if(ie4){
		mouseY = event.clientY + document.body.scrollTop-document.getElementById("contentClip").offsetTop;
		mouseX = event.clientX + document.body.scrollLeft - document.getElementById("contentClip").offsetLeft;
	}
	else if(nn4 || dom){
		mouseY = e.pageY-document.getElementById("contentClip").offsetTop;
		mouseX = e.pageX-document.getElementById("contentClip").offsetLeft;
		//mouseX = e.pageX-document.getElementById("vertBar").offsetLeft+145;
	}
	//change_layercontent('mouseX:'+mouseX+'   mouseY:'+mouseY+'   x offset:'+document.getElementById("contentClip").offsetLeft)
}
// Moves the layer
function moveTo(){
	if(ie4){
		document.all.content.style.top = contentT;
		document.all.ruler.style.top = dragT;
		document.all.drag.style.top = dragT;
	}
	else if(nn4){
		document.contentClip.document.content.top = contentT;
		document.ruler.top = dragT;
		document.drag.top = dragT;
	}
	else if(dom){
		document.getElementById("content").style.top = contentT + "px";
		document.getElementById("drag").style.top = dragT + "px";
		document.getElementById("ruler").style.top = dragT + "px";
	}
}

// Scrolls up
function scrollUp(){
	getT();
	if(clickAbove){
		if(dragT <= (mouseY-(dragH/2)))
			return up();
	}
	if(clickUp || wheelRoll==wheelRollSpeed){
		if(contentT < 0){		
			dragT = dragT - (speed*scrollLength*wheelRoll);
			
			if(dragT < (rulerT))
				dragT = rulerT;
				
			contentT = contentT + (speed*wheelRoll);
			if(contentT > 0)
				contentT = 0;
			
			moveTo();
			timer = setTimeout("scrollUp()",25);
		}
		wheelRoll=1;
	}
	return false;
}

// Scrolls down
function scrollDown(){
	getT();
	if(clickBelow){
		if(dragT >= (mouseY-(dragH/2)))
			return up();
	}
	if(clickDown || wheelRoll==wheelRollSpeed){
		if(contentT > -(contentH - contentClipH)){			
			dragT = dragT + (speed*scrollLength*wheelRoll);
			if(dragT > (rulerT + scrollH - dragH))
				dragT = (rulerT + scrollH - dragH);
			
			contentT = contentT -(speed*wheelRoll);
			if(contentT < -(contentH - contentClipH))
				contentT = -(contentH - contentClipH);
			
			moveTo();
			timer = setTimeout("scrollDown()",25);
		}
		wheelRoll=1;
	}
	return false;
}

// reloads page to position the layers again
function reloadPage(){
	location.reload();
}

// Preload
function scrollSetup(){
	if(ie4){
		// Up-arrow X and Y variables
		upL = document.all.up.style.pixelLeft;
		upT = document.all.up.style.pixelTop;		
		// Down-arrow X and Y variables
		downL = document.all.down.style.pixelLeft;
		downT = document.all.down.style.pixelTop;
		// Scrollbar X and Y variables
		dragL = document.all.drag.style.pixelLeft;
		dragT = document.all.drag.style.pixelTop;		
		// Ruler Y variable
		rulerT = document.all.ruler.style.pixelTop;		
		// Height of content layer and clip layer
		contentH = parseInt(document.all.content.scrollHeight);
		contentClipH = parseInt(document.all.contentClip.style.height);
	}
	else if(nn4){
		// Up-arrow X and Y variables
		upL = document.up.left;
		upT = document.up.top;		
		// Down-arrow X and Y variables
		downL = document.down.left;
		downT = document.down.top;		
		// Scrollbar X and Y variables
		dragL = document.drag.left;
		dragT = document.drag.top;		
		// Ruler Y variable
		rulerT = document.ruler.top;
		// Height of content layer and clip layer
		contentH = document.contentClip.document.content.clip.bottom;
		contentClipH = document.contentClip.clip.bottom;
	}
	else if(dom){
		// Up-arrow X and Y variables
		upL = parseInt(document.getElementById("up").style.left);
		upT = parseInt(document.getElementById("up").style.top);
		// Down-arrow X and Y variables
		downL = parseInt(document.getElementById("down").style.left);
		downT = parseInt(document.getElementById("down").style.top);
		// Scrollbar X and Y variables
		dragL = parseInt(document.getElementById("drag").style.left);
		dragT = parseInt(document.getElementById("drag").style.top);
		// Ruler Y variable
		rulerT = parseInt(document.getElementById("ruler").style.top);
		// Height of content layer and clip layer
		contentH = parseInt(document.getElementById("content").offsetHeight);
		contentClipH = parseInt(document.getElementById("contentClip").offsetHeight);
		document.getElementById("content").style.top = 0 + "px";
		
	}
	// Number of pixels scrollbar should move
	scrollLength = ((scrollH-dragH)/(contentH-contentClipH));
	// Initializes event capturing
	if(scrollLength<0){
		document.getElementById("drag").style.visibility = 'hidden';
		document.getElementById("vertBar").style.visibility = 'hidden';
	}else{
		document.getElementById("scrollBar").style.visibility = 'visible';
	}
	if(nn4){
		document.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE | Event.MOUSEUP);
		window.onresize = reloadPage;
	}
	document.onmousedown = down;
	document.onmousemove = move;
	document.onmouseup = up;
}
/**********************************************************************
 section 5 - below are the functions called on page load (content area)
 **********************************************************************/
function init() {
	intiatialized=true;
	if(!window.noScroll){scrollSetup();}
	menuRevert();
	preloadImages();
}
/**********************************************************************
 section 6 - Univeral method for javascript->flash setvariable
 **********************************************************************/
/* -----------------------------------------------------------
----------Supporting Browsers----------
PC:
IE 5 and higher
Netscape 6 and higher
Moz/Firebird all
Opera 7 and higher

Mac OSX:
IE 5.2
Safari all
Netscape 6 and higher
Moz/Firebird/Camino all
Opera 6 and higher

Linux:
Konqueror assumed
----------------------------------------------------------- */

// -----------------------------------------------------------
// Detection snippet from http://www.dithered.com/javascript/browser_detect/index.html
// -----------------------------------------------------------
var ua        = navigator.userAgent.toLowerCase(); 
var is_pc_ie  = ( (ua.indexOf('msie') != -1 ) && ( ua.indexOf('win') != -1 ) && ( ua.indexOf('opera') == -1 ) && ( ua.indexOf('webtv') == -1 ) );


/* -----------------------------------------------------------
function setFlashVariables(movieid, flashquery)

movieid: id of object tag, name of movieid passed in through FlashVars
flashquery: querystring of values to set. example( var1=foo&var2=bar )
----------------------------------------------------------- */
function setFlashVariables(movieid, flashquery){
	var i,values;
	if(is_pc_ie){
		var chunk = flashquery.split("&");
		for(i in chunk){
			values = chunk[i].split("=");
			document[movieid].SetVariable(values[0],values[1]);
		}
	}else{
		var divcontainer = "flash_setvariables_"+movieid;
		if(!document.getElementById(divcontainer)){
			var divholder = document.createElement("div");
			divholder.id = divcontainer;
			document.body.appendChild(divholder);
		}
		document.getElementById(divcontainer).innerHTML = "";
		var divinfo = "<embed src='gateway.swf' FlashVars='lc="+movieid+"&fq="+escape(flashquery)+"' width='0' height='0' type='application/x-shockwave-flash'></embed>";
		document.getElementById(divcontainer).innerHTML = divinfo;
	}
}
/**********************************************************************
 section 7 - Embed flash external to bypass IE ActiveX restrictions
 **********************************************************************/
 function HomeFlash(){
	document.write ('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="100%" height="100%" id="intro" align="middle">'
	+'<param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="intro.swf" /><param name="quality" value="high" />'
	+'<PARAM NAME="wmode" VALUE="transparent"><param name="scale" value="noscale" /><param name="bgcolor" value="#999892" />'
	+'<embed src="intro.swf" wmode="transparent" quality="high" scale="noscale" bgcolor="#999892" width="100%" height="100%" name="intro" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>')
}
/**********************************************************************
 section 8 - window resizer
 **********************************************************************/
 function resizeWinToTable(tableName){
 	var extraHspace = (checkIt('win')) ? 10:0;
 	var extraVspace = (checkIt('win')) ? 25:-10;
	 if (screen.height>document.getElementById(tableName).offsetHeight){
			window.resizeTo(document.getElementById(tableName).offsetWidth+40+extraHspace,document.getElementById(tableName).offsetHeight+75+extraVspace);
	}else{
			window.resizeTo(screen.width-75,screen.height-75);
	}
}
function checkIt(string)
{
	place = navigator.userAgent.toLowerCase().indexOf(string) + 1;
	return place;
}
/**********************************************************************
 insert flash
 **********************************************************************/
var nocache=new Date().getTime();
var randNum=Math.ceil(Math.random()*98);
function includeFlash(movieName, width, height, vars){
//includeFlash('flash/mymovie', '765', '363', 'image1');
	if(vars){
		urlvars=("?select="+vars+"&nc="+nocache+"&rn="+randNum);
	}else{
		urlvars=("?nc="+nocache+"&rn="+randNum);
	}
	document.write ('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '
		+'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="'+width+'" HEIGHT="'+height+'" id='+movieName+' ALIGN="">'
		+'<PARAM NAME=movie VALUE="'+movieName+'.swf'+urlvars+'"><PARAM NAME=FlashVars VALUE="movieid='+nocache+'" /><param name="allowScriptAccess" value="always" />'
		+'<PARAM NAME=salign VALUE="LT"><PARAM NAME=quality VALUE=high><PARAM NAME=scale VALUE=noscale><PARAM NAME=wmode VALUE=transparent>'
		+'<EMBED src="'+movieName+'.swf'+urlvars+'" ' 
		+'FlashVars="movieid='+nocache+'" quality=high scale=noscale wmode=transparent  WIDTH="'+width+'" HEIGHT="'+height+'" NAME='+movieName+' SALIGN="LT"'
		+'TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" allowScriptAccess="always"></EMBED></OBJECT>')
}
/**********************************************************************
 popup property nav
 **********************************************************************/
 
/***********************************************
* Pop-it menu- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var defaultMenuWidth="150px" //set default menu width.

var ie5=document.all && !window.opera
var ns6=document.getElementById

if (ie5||ns6)
document.write('<div id="popitmenu" onMouseover="clearhidemenu();" onMouseout="dynamichide(event)"></div>')

function iecompattest(){
return (document.compatMode && document.compatMode.indexOf("CSS")!=-1)? document.documentElement : document.body
}

function showmenu(e, siteLink, imageCode, optWidth){
if (!document.all&&!document.getElementById)
return
clearhidemenu()
menuobj=ie5? document.all.popitmenu : document.getElementById("popitmenu")
menuobj.innerHTML="<a href='"+siteLink+"' onclick='hidemenu()' target='_blank'>Visit website</a><a href='javascript:ViewImages(\""+imageCode+"\")' onclick='hidemenu()'>View images</a>";
menuobj.style.width=(typeof optWidth!="undefined")? optWidth : defaultMenuWidth
menuobj.contentwidth=menuobj.offsetWidth
menuobj.contentheight=menuobj.offsetHeight
eventX=ie5? event.clientX : e.clientX
eventY=ie5? event.clientY : e.clientY
eventY -= 10;
eventX -= 5;
//Find out how close the mouse is to the corner of the window
var rightedge=ie5? iecompattest().clientWidth-eventX : window.innerWidth-eventX
var bottomedge=ie5? iecompattest().clientHeight-eventY : window.innerHeight-eventY
//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<menuobj.contentwidth)
//move the horizontal position of the menu to the left by it's width
menuobj.style.left=ie5? iecompattest().scrollLeft+eventX-menuobj.contentwidth+"px" : window.pageXOffset+eventX-menuobj.contentwidth+"px"
else
//position the horizontal position of the menu where the mouse was clicked
menuobj.style.left=ie5? iecompattest().scrollLeft+eventX+"px" : window.pageXOffset+eventX+"px"
//same concept with the vertical position
if (bottomedge<menuobj.contentheight)
menuobj.style.top=ie5? iecompattest().scrollTop+eventY-menuobj.contentheight+"px" : window.pageYOffset+eventY-menuobj.contentheight+"px"
else
menuobj.style.top=ie5? iecompattest().scrollTop+event.clientY+"px" : window.pageYOffset+eventY+"px"
menuobj.style.visibility="visible"
return false
}

function contains_ns6(a, b) {
//Determines if 1 element in contained in another- by Brainjar.com
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function hidemenu(){
if (window.menuobj)
menuobj.style.visibility="hidden"
}

function dynamichide(e){
if (ie5&&!menuobj.contains(e.toElement))
hidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
hidemenu()
}

function delayhidemenu(){
delayhide=setTimeout("hidemenu()",500)
}

function clearhidemenu(){
if (window.delayhide)
clearTimeout(delayhide)
}

/*if (ie5||ns6)
document.onclick=hidemenu*/