/******************************************************/
/*	Description :	Main Site Routines	               /
/*	Version		:	6.0								   /
/*	Date Stamp  :	7/05/08 - SN				   /
/******************************************************/

//-----------------------------------------------------Drop Down Setups ->>

function mmLoadMenus() {
  if (window.mm_menu_0614182400_0) return;
          window.mm_menu_0614182400_0 = new Menu("root",160,28,"",12,"#FFFFFF","#FFFFFF","#98b2d1","#00355f","left","middle",5,0,500,-5,7,true,false,true,0,false,true);
   mm_menu_0614182400_0.addMenuItem("Offices","location='#'"); 
   mm_menu_0614182400_0.addMenuItem("Office Leasing","location='#'"); 
   mm_menu_0614182400_0.addMenuItem("Shops","location='#'");
   mm_menu_0614182400_0.hideOnMouseOut=true;
   mm_menu_0614182400_0.bgColor='#555555';
   mm_menu_0614182400_0.menuBorder=0;
   mm_menu_0614182400_0.menuLiteBgColor='';
   mm_menu_0614182400_0.menuBorderBgColor='#FF9900';

window.mm_menu_0614215224_0 = new Menu("root",160,28,"",12,"#FFFFFF","#FFFFFF","#98b2d1","#00355f","left","middle",5,0,500,-5,7,true,false,true,0,false,true);
  mm_menu_0614215224_0.addMenuItem("Hospitality&nbsp;Center","location='subpage.php?catagory=main&page=hospitality'");
  mm_menu_0614215224_0.addMenuItem("Parking","location='subpage.php?catagory=main&page=parking'");
  mm_menu_0614215224_0.addMenuItem("Email&nbsp;Registration","location='subpage.php?catagory=main&page=gift_card'");
  mm_menu_0614215224_0.addMenuItem("Store&nbsp;Hours","location='subpage.php?catagory=main&page=hours'");
  mm_menu_0614215224_0.addMenuItem("Contact&nbsp;Us","location='subpage.php?catagory=main&page=contact'");
   mm_menu_0614215224_0.hideOnMouseOut=true;
   mm_menu_0614215224_0.bgColor='#555555';
   mm_menu_0614215224_0.menuBorder=0;
   mm_menu_0614215224_0.menuLiteBgColor='';
   mm_menu_0614215224_0.menuBorderBgColor='#FF9900';

  window.mm_menu_0614221113_0 = new Menu("root",160,28,"",12,"#FFFFFF","#FFFFFF","#98b2d1","#00355f","left","middle",5,0,500,-5,7,true,false,true,0,false,true);
  mm_menu_0614221113_0.addMenuItem("Alphabetical&nbsp;Listing","location='search.php?catagory=main&page=shopping&action=shopping'");
  mm_menu_0614221113_0.addMenuItem("Category&nbsp;Listing","location='search.php?catagory=main&page=shopping&action=category'");
  mm_menu_0614221113_0.addMenuItem("Store&nbsp;Promotions","location='events.php?catagory=event_tags&page=events'");
  mm_menu_0614221113_0.addMenuItem("Directory&nbsp;Map","location='subpage.php?catagory=main&page=directory'");
   mm_menu_0614221113_0.hideOnMouseOut=true;
   mm_menu_0614221113_0.bgColor='#555555';
   mm_menu_0614221113_0.menuBorder=0;
   mm_menu_0614221113_0.menuLiteBgColor='#FFFFFF';
   mm_menu_0614221113_0.menuBorderBgColor='#FF9900';

  window.mm_menu_0614221825_0 = new Menu("root",160,28,"",12,"#FFFFFF","#FFFFFF","#98b2d1","#00355f","left","middle",5,0,500,-5,7,true,false,true,0,false,true);
  mm_menu_0614221825_0.addMenuItem("Alphabetical&nbsp;Listing","location='search.php?catagory=main&page=dining&action=dining'");
  mm_menu_0614221825_0.addMenuItem("Category&nbsp;Listing","location='search.php?catagory=main&page=dining&action=category'");
  mm_menu_0614221825_0.addMenuItem("Store&nbsp;Promotions","location='events.php?catagory=event_tags&page=events'");
  mm_menu_0614221825_0.addMenuItem("Directory&nbsp;Map","location='subpage.php?catagory=main&page=directory'");
   mm_menu_0614221825_0.hideOnMouseOut=true;
   mm_menu_0614221825_0.bgColor='#555555';
   mm_menu_0614221825_0.menuBorder=0;
   mm_menu_0614221825_0.menuLiteBgColor='#FFFFFF';
   mm_menu_0614221825_0.menuBorderBgColor='#FF9900';

  window.mm_menu_0614221999_0 = new Menu("root",160,28,"",12,"#FFFFFF","#FFFFFF","#98b2d1","#00355f","left","middle",5,0,500,-5,7,true,false,true,0,false,true);
  mm_menu_0614221999_0.addMenuItem("Alphabetical&nbsp;Listing","location='search.php?catagory=main&page=lifestyle&action=lifestyle'");
  mm_menu_0614221999_0.addMenuItem("Category&nbsp;Listing","location='search.php?catagory=main&page=lifestyle&action=category'");
  mm_menu_0614221999_0.addMenuItem("Store&nbsp;Promotions","location='events.php?catagory=event_tags&page=events'");
  mm_menu_0614221999_0.addMenuItem("Directory&nbsp;Map","location='subpage.php?catagory=main&page=directory'");
   mm_menu_0614221999_0.hideOnMouseOut=true;
   mm_menu_0614221999_0.bgColor='#555555';
   mm_menu_0614221999_0.menuBorder=0;
   mm_menu_0614221999_0.menuLiteBgColor='#FFFFFF';
   mm_menu_0614221999_0.menuBorderBgColor='#FF9900';

  window.mm_menu_0614221888_0 = new Menu("root",160,28,"",12,"#FFFFFF","#FFFFFF","#98b2d1","#00355f","left","middle",5,0,500,-5,7,true,false,true,0,false,true);
  mm_menu_0614221888_0.addMenuItem("Alphabetical&nbsp;Listing","location='search.php?catagory=main&page=market_plaza&action=market'");
  mm_menu_0614221888_0.addMenuItem("Category&nbsp;Listing","location='search.php?catagory=main&page=market_plaza&action=category'");
  mm_menu_0614221888_0.addMenuItem("Store&nbsp;Promotions","location='events.php?catagory=event_tags&page=events'");
  mm_menu_0614221888_0.addMenuItem("Directory&nbsp;Map","location='subpage.php?catagory=main&page=directory'");
   mm_menu_0614221888_0.hideOnMouseOut=true;
   mm_menu_0614221888_0.bgColor='#555555';
   mm_menu_0614221888_0.menuBorder=0;
   mm_menu_0614221888_0.menuLiteBgColor='#FFFFFF';
   mm_menu_0614221888_0.menuBorderBgColor='#FF9900';

  window.mm_menu_0614222136_0 = new Menu("root",160,28,"",12,"#FFFFFF","#FFFFFF","#98b2d1","#00355f1","left","middle",5,0,500,-5,7,true,false,true,0,false,true);
  mm_menu_0614222136_0.addMenuItem("Retail","window.open('http://www.atlasparkleasing.com/index.php?catagory=main&page=retail', '_blank');");
  mm_menu_0614222136_0.addMenuItem("Office","window.open('http://www.atlasparkleasing.com/index.php?catagory=main&page=offices', '_blank');");
  //mm_menu_0614222136_0.addMenuItem("Specialty&nbsp;Leasing","window.open('http://www.atlasparkleasing.com/', '_blank');");
  //mm_menu_0614222136_0.addMenuItem("Fact&nbsp;Sheet","window.open('http://www.atlasparkleasing.com/', '_blank');");
   mm_menu_0614222136_0.hideOnMouseOut=true;
   mm_menu_0614222136_0.bgColor='#555555';
   mm_menu_0614222136_0.menuBorder=0;
   mm_menu_0614222136_0.menuLiteBgColor='#FFFFFF';
   mm_menu_0614222136_0.menuBorderBgColor='#FF9900';

  window.mm_menu_0614222529_0 = new Menu("root",160,28,"",12,"#FFFFFF","#FFFFFF","#98b2d1","#00355f","left","middle",5,0,500,-5,7,true,false,true,0,false,true);
  //mm_menu_0614222529_0.addMenuItem("My&nbsp;Atlas&nbsp;Season","window.open('#', '_blank');");
   mm_menu_0614222529_0.addMenuItem("Directory","location='subpage.php?catagory=main&page=directory'");
   mm_menu_0614222529_0.addMenuItem("Directions","location='subpage.php?catagory=main&page=directions'");
   mm_menu_0614222529_0.addMenuItem("Events","location='events.php?catagory=main&page=events'");
   mm_menu_0614222529_0.addMenuItem("Gallery","location='gallery.php'");
   mm_menu_0614222529_0.addMenuItem("Park&nbsp;Hours","location='subpage.php?catagory=main&page=hours'");
   mm_menu_0614222529_0.hideOnMouseOut=true;
   mm_menu_0614222529_0.bgColor='#555555';
   mm_menu_0614222529_0.menuBorder=0;
   mm_menu_0614222529_0.menuLiteBgColor='#FFFFFF';
   mm_menu_0614222529_0.menuBorderBgColor='#FF9900';

mm_menu_0614222529_0.writeMenus();
} 

// mmLoadMenus()

// place after id in market plaza image for drop downs
//onmouseover="MM_showMenu(window.mm_menu_0614182400_0,0,50,null,'market_button')" onmouseout="MM_startTimeout();"


//-----------------------------------------------------Stock Macromedia Rollover Code->>

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_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_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];}
}


//	Opens a window that is centered on the screen
function openCenteredWindow(url, name, width, height) {

	// Compute the window's top and left positions so that it is centered
	var windowWidth 	= width;
	var windowHeight 	= height;
	var screenWidth 	= screen.availWidth;
	var screenHeight 	= screen.availHeight;
	var left 			= screenWidth  / 2 - windowWidth  / 2;
	var top 			= screenHeight / 2 - windowHeight / 2;
	var properties		= "resizable=yes,left=" + left + ",top=" + top + ",width=" + 
		windowWidth + ",height=" + windowHeight;

	window.open(url, name, properties);
}

//	Trims a string
function trimString(str) {
	//	Remove leading whitespaces
	while (str.charAt(0) == ' '  || str.charAt(0) == '\t' ||
		   str.charAt(0) == '\r' || str.charAt(0) == '\n') {
		str = str.substring(1,str.length);
	}
	
	//	Remove trailing whitespaces
	while (str.charAt(str.length - 1) == ' '  || str.charAt(str.length - 1) == '\t' ||
		   str.charAt(str.length - 1) == '\r' || str.charAt(str.length - 1) == '\n') {
    	str = str.substring(0, str.length - 1);
	}
	
	return str;
}

//	Netscape 4.x bug fix - reloads the page when the browser is resized
function MM_reloadPage(init) {  
	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();
	}
}

//---------------------------------------------------------------------------Div Toggle Ctrls->>
// Vs. 2.8

//	divToggle (...) [USAGE]
//		Creates explorer style collapsable divs
//		@Params:
	//		[0] ->	id  		-> Div ID
	//		[1]	->	useImgs		-> using +/- images (optional, default: true)
//		#Notes:
	//		-	name the controlling image-link the same ID as the div with "Ctrl" at the end !important
	//		-	ie: div ID = "div", image ID = "divCtrl"
	//		-	plus/minus images MUST be in the same folder
	//		-	plus/minus images can be any extension (gif|jpg|etc)

function divToggle()
{
	var a=divToggle.arguments;
	var id=a[0];
	var useImgs=(a[1]!=null)?a[1]:false;
	elem=document.getElementById(id);
	elem.style.display=(elem.style.display=="none" || elem.style.display=="")?"block":"none";
	
	if(useImgs){
		// toggle (path)/(plus|minus).(gif|jpg)
		img=document.getElementById(id+"Ctrl");
		lS=img.src.lastIndexOf("/") + 1;	// last slash
		path=img.src.substr(0,lS);			// read path
		pm=img.src.substr(lS);				// read img name
		ext=pm.substr(pm.lastIndexOf("."));	// get img extension
		img.src=path + ((pm=="minus"+ext)?"plus"+ext:"minus"+ext);
	}
}


//----------------------------------------------------------------------------------Bookmark Page->>
// v1.0 [IE][RH]

//	bookmark_init (...) [USAGE]
//		Creates bookmark link for IE browsers only
//		@Params:
	//		[0] ->	string1  	-> Link Template
	//		[1]	->	string2		-> Non-Compliant Output
		// 	[EXAMPLE]	[bookmark_init("[ :Bookmark Us: ]","");]
		//		string1 = "[ :Bookmark Us: ]"
		//		string2 = ''
		//			on  IE: a link that says 'Bookmark Us'
		//			not IE: nothing output
		
function bookmark_init(string1,string2){
	if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)){
		s1p=string1.split(/:/);
		outStr=s1p[0] + '<a href="javascript:bookmark();" class="A_mini">' +s1p[1]+ '</a>' + s1p[2];
	}else
		outStr=string2;
	document.write(outStr);
}

function bookmark()
{
	url=location.href;
	title=document.title;
	window.external.AddFavorite(url,title)
}