        function getHTML( target, url, pars ) {
            if (!pars) pars = "x=" + Math.floor(Math.random()*1001);
            else pars.rand = Math.floor(Math.random()*1001)
            var myUpdater = new Ajax.Updater(
            target,
            url,
            {
                method: "post",
                parameters: pars,
                evalScripts: true,
                onComplete: function(transport){;}
            });
        }

        function sendAjaxFormRequest(frm, callback) {
            var url = frm.url.value;
            var callBack = callback;
            var parms = Form.serialize(frm);
            var myAjax = new Ajax.Request(
            url,
            {
				method: 'post',
				parameters: parms,
				onComplete: function(transport){callBack(transport)},
				onFailure: function(transport){alert( transport.responseText);}
            });
        }
        
    function sendAjaxRequest(pars, callBack){
    		//alert(pars.url);

            var url = pars.url;
            pars.txn = String(new Date().getTime());
            var parms = $H(pars).toQueryString();
            var callBack = callBack;
            var myAjax = new Ajax.Request(
                    url,
                    {
                            method: 'post',
                            parameters: parms,
                            onComplete: function(transport){callBack(transport);},
                            onFailure: function(transport){alert( transport.responseText);}
                    });
    }
    
    //varibles used in doLayout();
    var headerHeight = 142; // actual top of content div calculated at end of init()
    var heightFudge = 29; //fudge factor - padding/borders etc not incl in body.clientHeight??
  
  
   var home = null;
   var signup = null;
   var contact = null;
   var actionTarget;
   var queryParameters = location.search.parseQuery();
   
		function init() {

		    setStyleMethods( "b", "body");

			//window.onresize = doLayout;
			//doLayout();
			
			//( text, action, container, payload, canSelect, cssClass )
			// Menu Bar
			home = new Action( "Home", contentLoader, "menuBarCompartment", "home.html", true, null);         
			var about = new Action( "About Alizabeth", contentLoader, "menuBarCompartment", "aboutalizabeth.php", true, null);         
			var blog = new Action( "Alizabeth's Blog", openBlog, "menuBarCompartment", "http://alizabethcalder.com/blog", false, null);         
			var newsletter = new Action( "Newsletter", contentLoader, "menuBarCompartment", "NLViewer.jsp", true, null);         
			var buy = new Action( "Buy my Book", buyTheBook, "menuBarCompartment", "aboutalizabeth.php", false, null);         
			contact = new Action( "Contact Me", contentLoader, "menuBarCompartment", "contactForm.html", true, null);
			//var privacy = new Action( "Privacy", contentLoader, "menuBarCompartment", "aboutalizabeth.php", true, null);         
			
			var about1 = new Action( $("about1Text").innerHTML, contentLoader, "rightSideBar", "aboutalizabeth.php", true, "about1Action");         
			signup = new Action( $("optInText").innerHTML, contentLoader, "rightSideBar", "ACOptin.jsp", true, "newsletterOptInAction");
			var tellme = new Action( $("tellMeText").innerHTML, contentLoader, "rightSideBar", "tellMeForm.html", true, "tellMeAction");
			var copyright = new Action( $("copyrightText").innerHTML, "", "rightSideBar", "", false, "copyright");

			var changeagent = new Action( "Change Agent", "", "ACHeaderMiddleInner", "", true, "ACHeaderMiddleInnerAction");         
				changeagent.mouseOver = rollIn;
				changeagent.mouseOut = rollOut;
				changeagent.floaterText="understands the change you need, and makes it happen !";
				
			
			var testimonials = new Action( "Respected Leader", "", "ACHeaderMiddleInner", "", true, "ACHeaderMiddleInnerAction");         
				testimonials.mouseOver = rollIn;
				testimonials.mouseOut = rollOut;
				testimonials.floaterText="people gravitate to her energy and actively seek her coaching";

			var videoclips = new Action( "Entertaining Speaker", "", "ACHeaderMiddleInner", "", true, "ACHeaderMiddleInnerAction");         
				videoclips.mouseOver = rollIn;
				videoclips.mouseOut = rollOut;
				videoclips.floaterText="compelling thinking she brings to life with a dynamic style";

			
			
			
				sustain= new Action( "The Sustainable Growth<br />Challenge", contentLoader, "leftSideBarCompartment", "SustainableGrowthChallenge.html", true, "leftTopMenuAction");         
	maturity = new Action( "The Maturity Model", contentLoader, "leftSideBarCompartment", "The_Maturity_Model.html", true, "leftTopMenuAction");         
	crawling = new Action( "Crawling to Walking", contentLoader, "leftSideBarCompartment", "CrawingToWalking.html", true, "leftTopMenuAction");         
	age = new Action( "The Age of Reason", contentLoader, "leftSideBarCompartment", "TheAgeOfReason.html", true, "leftTopMenuAction");         
	autobahn = new Action( "Driving the Autobahn", contentLoader, "leftSideBarCompartment", "DrivingTheAutobahn.html", true, "leftTopMenuAction");         
	everything = new Action( "Everything I need to<br />Know I Learned at IBM", contentLoader, "leftSideBarCompartment", "EverythingINeedToKnow.html", true, "leftTopMenuAction");         

	

			
			 selectOnLoad = selectOnLoad.toLowerCase();
				
			try {
			  actionTarget= eval(selectOnLoad);
			  }
			catch(err)
			  {
			  actionTarget=home;
			  }	
				
			 if (queryParameters.cid) {
                getHTML( "content", "confirm.jsp", queryParameters );
			}
			else {
			     setTimeout("actionTarget.doAction()",100);
			}
			
			fetchNewsletterText();
			
			headerHeight = findPos($("content"))[1];
			

			

			
		}


		function rollIn(action){
		  $("floater").innerHTML=action.floaterText;
		}
		function rollOut(action){
		  $("floater").innerHTML="";
		}  
		
		
		
		function newslettertLoader(action) {
			var container=action.container;
			if (prevAction==null) prevAction=action;
			if (container!=prevAction.container) prevAction.clearSelection();
			prevAction = action;
		    var parms = new Object();
		    parms.idx = action.payload;
			getHTML("content", "NLViewer.jsp", parms)
		}
		
		function fetchNewsletterText() {
		var parms = new Object();
		parms.url = "newsletterList.jsp";
			sendAjaxRequest(parms, updateNLText);
		}
		
		
		function updateNLText(transport) {

			var names = eval(transport.responseText.strip());
			new Action( names[0], newslettertLoader, "newsletterItemCompartment", "0", true, "newsletterItemAction");         
			new Action( names[1], newslettertLoader, "newsletterItemCompartment", "1", true, "newsletterItemAction");         
			new Action( "View All Newsletters", contentLoader, "newsletterItemCompartment", "NLViewer.jsp", true, "newsletterItemAction");         

		}
		
		
		
		
		
		
		var prevAction = null;
		
		
		function loadImageManager(){
			$("image-manager").style.display="block";
			//popup_show("image-manager", "image-manager-header", "image-manager-exit", "screen-center");
	
			if ($("image-manager-search").innerHTML.length==0){
				var width = $("image-manager").clientWidth;
				$( "image-manager-header" ).style.width = width+ "px";
				$("image-manager-results" ).style.width = width+ "px";
				//getHTML( "image-manager-edit", "imageEditor.html", null );
	
				getHTML( "image-manager-results", "imageSearchResults.html", null );
				$("image-manager").style.left = "40px";
				$("image-manager").style.top  = "40px";
				//getHTML( "image-manager-search", "imageSearch.html", null );
			}
			var width = $("image-manager").clientWidth;
			$( "image-manager-header" ).style.width = width+ "px";
			var height = $("image-manager").clientHeight-60; //40
			$( "image-manager-content" ).style.height = height+ "px";
	
		}
	
	
		function buyTheBook(action) {
			window.open ("http://mmpubs.com/catalog/Calder--Alizabeth-m-98.html","","status=1,scrollbars=1"); 	
		}
		
		function openBlog(action) {
			window.open ("http://alizabethcalder.com/blog"); 	
		}
		
		function contentLoader(action){
			//doLayout();
			
			var container=action.container;
			if (prevAction==null) prevAction=action;
			if (container!=prevAction.container) prevAction.clearSelection();
			prevAction = action;
			
			var url=action.payload
			//$("content").innerHTML="";
			getHTML('content',url);
		}



         function doLayout(){
         		//$("magic").style.height=document.body.clientHeight +"px";
               var wrapper = document.getElementById( "app-wrapper");
               var content = document.getElementById( "content-wrapper");
               var left = document.getElementById( "left-wrapper");
               var right = document.getElementById( "right-wrapper");
               var header =  document.getElementById( "header-wrapper");
               var rightWidth = right.clientWidth;
               var leftWidth = left.clientWidth;
               var scrollbarAllowance = 20;
               var headerHeight =  header.clientHeight;
               var contentWidth = wrapper.clientWidth - leftWidth - rightWidth - scrollbarAllowance;
              //alert(contentWidth);
               var contentHeight = wrapper.clientHeight - headerHeight;
               content.style.width = contentWidth + "px";
               //content.style.height = contentHeight + "px";
               //$(content).style.height = contentHeight + "px";
            }
   




