<!--
/*
function SetCookie(cookieName,cookieValue,nDays) {
 var today = new Date();
 var expire = new Date();
 if (nDays==null || nDays==0) nDays=1;
 expire.setTime(today.getTime() + 3600000*24*nDays);
 document.cookie = cookieName+"="+escape(cookieValue)
                 + ";expires="+expire.toGMTString();
}
*/
function SetCookie(cookieName,cookieValue) {
	document.cookie = cookieName+"="+escape(cookieValue) + ";path=/;";
}


function ReadCookie(cookieName) {
 var theCookie=""+document.cookie;
 var ind=theCookie.indexOf(cookieName);
 if (ind==-1 || cookieName=="") return ""; 
 var ind1=theCookie.indexOf(';',ind);
 if (ind1==-1) ind1=theCookie.length; 
 return unescape(theCookie.substring(ind+cookieName.length+1,ind1));
}

// generate the feedback
function generateFeedback( ) {
	
	location = "mailto:hcommunications@hines.com?subject=Web site feedback about " + location.href + "&body=To provide feedback on this page, please enter your message below: ";

}


function do_search( searchVal )
{
	location.href = 'http://www.hines.com/search/search.aspx?omit=false&col=Entire_Site&within=text&search='+searchVal;
	return true;
}

function do_press_search( searchVal )
{
	location.href = 'http://www.hines.com/search/search.aspx?omit=false&col=Press_Releases_Only&within=text&search='+searchVal;
	return false;
}


function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images && preloadFlag == false) {
		
		// load init state images
		logo01 = newImage("http://www.hines.com/common/images/head/logo01.gif");
		logo02 = newImage("http://www.hines.com/common/images/head/logo02.gif");
		about_hines = newImage("http://www.hines.com/common/images/head/about-hines.gif");
		property_search_ = newImage("http://www.hines.com/common/images/head/property-search.gif");
		press_room = newImage("http://www.hines.com/common/images/head/press-room.gif");
		careers= newImage("http://www.hines.com/common/images/head/careers.gif");
		investment = newImage("http://www.hines.com/common/images/head/investment.gif");
		development = newImage("http://www.hines.com/common/images/head/development.gif");
		management = newImage("http://www.hines.com/common/images/head/management.gif");
		feedback = newImage("http://www.hines.com/common/images/feedback.gif");		
		terms = newImage("http://www.hines.com/common/images/terms.gif");		
		privacy_policy = newImage("http://www.hines.com/common/images/footer/privacy-policy-.gif");
		site_index = newImage("http://www.hines.com/common/images/footer/site-index.gif");
		contact = newImage("http://www.hines.com/common/images/head/contact.gif");	
		
		// load rollover images
		about_hines_over = newImage("http://www.hines.com/common/images/head/about-hines-over.gif");
		property_search_over = newImage("http://www.hines.com/common/images/head/property-search-over.gif");
		press_room_over = newImage("http://www.hines.com/common/images/head/press-room-over.gif");
		careers_over = newImage("http://www.hines.com/common/images/head/careers-over.gif");
		investment_over = newImage("http://www.hines.com/common/images/head/investment-over.gif");
		development_over = newImage("http://www.hines.com/common/images/head/development-over.gif");
		management_over = newImage("http://www.hines.com/common/images/head/management-over.gif");
		feedback_over = newImage("http://www.hines.com/common/images/feedback-over.gif");		
		terms_over = newImage("http://www.hines.com/common/images/terms-over.gif");		
		privacy_policy_over = newImage("http://www.hines.com/common/images/footer/privacy-policy-over.gif");
		site_index_over = newImage("http://www.hines.com/common/images/footer/site-index-over.gif");
		contact_over = newImage("http://www.hines.com/common/images/head/contact-over.gif");	
		
		// load bg images.
		bkgd2 = newImage("http://www.hines.com/common/images/bkgd/bkgd_02.gif");
		bkgd4 = newImage("http://www.hines.com/common/images/bkgd/bkgd_04.gif");
		bkgd5 = newImage("http://www.hines.com/common/images/bkgd/bkgd_05.gif");
		bkgd6 = newImage("http://www.hines.com/common/images/bkgd/bkgd_06.gif");
		bkgd7 = newImage("http://www.hines.com/common/images/bkgd/bkgd_07.gif");
		
		preloadFlag = true;
	}
}

/*
	Fetches the path portion of a URL, e.g.
				
		input = http://localhost/about.us/board.of.trustees/trustee.profiles.shtml
		output = http://localhost/about.us/board.of.trustees/

*/
function getPathFromURL( url ) {

	return url.substr( 0, url.lastIndexOf( "/" )+1 );
}


/*
	Fetches the path portion of a URL, e.g.
				
		input = http://localhost/about.us/board.of.trustees/trustee.profiles.shtml
		output = http://localhost/about.us/board.of.trustees/

*/
function getStripParamFromURL( url ) {

	if( url.substr( 0, url.lastIndexOf( "?" ) ) != '' )
		return url.substr( 0, url.lastIndexOf( "?" ) );
	else
		return url;
}

/*
	The following is an override variable for the highlightMenuLink() function. To force
	 a menu item to be highlighted, set 'highlightMenuLinkOverride' equal to the EXACT
	 URL specified in the menu's <a href=> tag, e.g.:
	 
	 <script language='javascript'>highlightMenuLinkOverride = 'http://localhost/about.us/board.of.trustees/index.shtml';</script>
		
	 This SHOULD NOT BE DONE HERE -- place the override command anywhere in an editable region.
*/
var highlightMenuLinkOverride = null;

/*
	This function highlights a menu item using three different methods:
	
		1) If highlightMenuLinkOverride has been set to the exact URL (see above), this is used.
		2) An exact URL match is attempted (index pages MUST be named 'index.shtml')
		3) A directory name match is attempted
*/
function highlightMenuLink() {

	// make an alternate 'document.URL' that contains the default page name 'index.shtml'
	//  to make URL matching easier
	if( document.URL.lastIndexOf( '/' ) == document.URL.length-1 ) {
		var documentURL = document.URL.toLowerCase() + 'default.aspx';
	} else {
		var documentURL = document.URL.toLowerCase();
	}

	//
	// Pass #1: check for the override
	//
	if( highlightMenuLinkOverride != null ) {

		// loop through the links in the document
		for( var i=document.links.length-1; i >= 0; i-- ) {
			if( highlightMenuLinkOverride.toLowerCase() == document.links[i].href.toLowerCase() ) {
				document.links[i].className = 'mmhide_secondaryNav mmhide_secondaryNavOn';
				break;
			}
		}				
		return;
	}

	//
	// Pass #2: loop through the links in the document, looking for an EXACT match
	//
	
	// strip the parameters
	docUrl = getStripParamFromURL( documentURL ).toLowerCase();
	
	for( var i = 0; i < document.links.length; i++ ) {
		
		// is this a 'menuLink' class link?
		if( document.links[i].className == 'mmhide_secondaryNav' ) {
		
			// if the end of the href ends in a '#', skip it -- it's probably a test link that goes nowhere
			if( document.links[i].href.lastIndexOf( '#' ) == document.links[i].href.length-1 )
				continue;
		
			// append 'default.aspx' if the <a href=> ends in '/'
			if( document.links[i].href.lastIndexOf( '/' ) == document.links[i].href.length-1 ) {
				if( docUrl.toLowerCase() == document.links[i].href.toLowerCase() + 'default.aspx' ) {
					document.links[i].className = 'mmhide_secondaryNav mmhide_secondaryNavOn';
					return;			
				}
			// otherwise, just compare em'			
			} else {
				if( docUrl.toLowerCase() == document.links[i].href.toLowerCase() ) {
					document.links[i].className = 'mmhide_secondaryNav mmhide_secondaryNavOn';
					return;			
				}
			}
		}
	}
	
	//
	// Pass #3: if an exact match was not found, loop through and look for a directory match
	//
	
		// fetch the directory only
	docUrl = getPathFromURL( documentURL ).toLowerCase();

	for( var i=document.links.length-1; i >= 0; i-- ) {
		
		// if the end of the href ends in a '#', skip it -- it's probably a test link that goes nowhere
		if( document.links[i].href.lastIndexOf( '#' ) == document.links[i].href.length-1 )
				continue;
		
		// is this a 'menuLink' class link?
		if( document.links[i].className == 'mmhide_secondaryNav' ) {
						
			s = getPathFromURL( document.links[i].href ).toLowerCase();		// strip the file
		
			if( s == docUrl ) {						// a match?			
				document.links[i].className = 'mmhide_secondaryNav mmhide_secondaryNavOn';
				return;
			}
		}
	}
}


// Mapping functions
function ShowMap(URL) {
    var id = 'Map';
    var Settings = 'scrollbars=yes, resizable=no, width=655, height=540, left=50, top=20';
    newWin = window.open(URL, id, Settings);
    newWin.focus();
}

function ShowMapFile(URL) {
    var id = 'Map';
    var Settings = 'toolbar=no,menubar=yes,location=no,directories=no,status=no,scrollbars=yes,resizable=no,width=640,height=450,top=40,left=40';
    var newWin = window.open(URL,id,Settings)
    newWin.focus();
}

//Macromedia functions

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

preloadImages();
// -->