
/* landopt.js */

/* 

TOC

// addLoadEvent()

// getHost()

// debugColors()

// hideExpiredDate() , hideExpiredDate2()

// matchDivHeight() 

// openClientLogin()

// openSelfServicePortal()

// scrollToTop()

// scrollToTopTeam()

// scrollWin()

// showBoardBiobox()   

// showContentPillars() 

// showContentSuccessbox() 

// showNetworkBiobox() 

// showHideObject()

// showTeamBiobox()  

// swapImage()   


*/

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////
////
////
////		addLoadEvent()
////
////
////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



// to add "body onLoad" type functions due to 
// Dreamweavers template not allowing changes
function addLoadEvent(func) 
{
    var oldonload = window.onload;
    if (typeof window.onload != 'function') {
        window.onload = func;
    } else {
        window.onload = function() {
            if (oldonload) {
                oldonload();
            }
            func();
        }
    }
}

/*
addLoadEvent(function() { 
	//do something
});


*/
// End //////////////
/////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////
////
////
////		getHost()
////
////
////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function getHost()
{
	//document.write("location.hostname = "+window.location.hostname)
	var av = document.getElementById("pallet");
	
	if(window.location.hostname == ""){
		//alert("location.hostname = "+window.location.hostname)
		//var a = document.getElementById("container");
	   //  a.style.backgroundColor = "Blue";
	}else{
		//alert("location.hostname = "+window.location.hostname)
	}
}

// End //////////////
/////////////////////








////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////
////
////
////		debugColors()
////
////
////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



// to add "body onLoad" type functions due to 
// Dreamweavers template not allowing changes
function debugColors() 
{
	var a = document.getElementById("container");
	a.style.backgroundColor = "Blue";
	
	var b = document.getElementById("main");
	b.style.backgroundColor = "Red";
	
	var b = document.getElementById("home_testimonials");
	b.style.backgroundColor = "Orange";
	//b.style.display = "none";
	
	/*var b = document.getElementById("main");
	b.style.backgroundColor = "Red";
	
	var b = document.getElementById("main");
	b.style.backgroundColor = "Red";*/
	
	//alert(a)
}

// End //////////////
/////////////////////









////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////
////
////
////		hideExpiredDate2(), hideExpiredDate()
////
////
////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function hideExpiredDate2(divID,divType){
	//function hideExpiredDate(fMonth,fDay,fYear,divID,divType){
	//hideExpiredDate('we_060911');
	
	fDay = divID.substring(5,7);
	fMonth = divID.substring(3,5);
	fYear = divID.substring(7,9);
	
	var fDay2 = parseFloat(fDay)+0;
	
	// --- added the -1 so you can put in the logical number
	// --- for the date instead of 0 for January, 1 for december
	// --- etc.
	var fMonth2 = parseFloat(fMonth)-1;
	var fYear2 = parseFloat(fYear)+2000;  //turn string into number
	
	//alert("divID= "+divID+"    Month= "+(fMonth2+1)+"    Day= "+fDay2+"    Year= "+fYear2);
	
	// --- setup last day to show
	var finalDay = new Date();
	finalDay.setFullYear(fYear2,fMonth2,fDay2);
	
	// --- setup todays date
	var today = new Date();
	
	//alert("today= "+today+"\r finalDay= "+finalDay)
	
	
	////////////////////////////////
	////  testing future dates  ////
	////////////////////////////////
	
	function testDate(xMonth,xDay,xYear){

		//var today = new Date(); //comment this out if this function is inside of hideExpiredDate()'
		today.setFullYear(xYear,xMonth-1,xDay);
		
		//alert once
		if (xVar == 0){
		//if (xVar <= 5){
			//alert(today)
			xVar++
			//var xVar = 55
		}
		//alert(xVar)
	}
	//testDate(01,01,2013);  //--- uncomment to test / comment out when finished!
	//alert("today= "+today+"    finalDay= "+finalDay)
	
	
	// --- setup item to hide or change
	var dv = document.getElementById(divID);
	//alert("today= "+today+"    finalDay= "+finalDay)
	if (today>finalDay){
		if(divType=='expander_box'){
			dv.style.display="none";
		}else{
			$("#"+divID).find("p").addClass("expired_cal_item");
			$("#"+divID).addClass("expired_cal_item"); // some text is not inside a 'p'
			/*if(divID.substring(0,2) ="we"){
				$("#"+divID).css("border", "2px solid red")
			}*/
		}
		
	}
	  
}

var xVar = 0
function hideExpiredDate(fMonth,fDay,fYear,divID,divType){
	//hideExpiredDate('we_060911');
	
	
	// added the -1 so you can put in the logical number
	// for the date instead of 0 for January, 1 for december
	// etc.
	
	var fMonth2 = fMonth-1
	
	// setup last day to show
	
	var finalDay = new Date();
	finalDay.setFullYear(fYear,fMonth2,fDay);
	
	var today = new Date();
	
	////////////////////////////////
	////  testing future dates  ////
	////////////////////////////////
	
	function testDate(xMonth,xDay,xYear){

		//var today = new Date(); //comment this out if this function is inside of hideExpiredDate()'
		today.setFullYear(xYear,xMonth-1,xDay);
		
		//alert once
		if (xVar == 0){
		//if (xVar <= 5){
			//alert(today)
			xVar++
			//var xVar = 55
		}
		//alert(xVar)
	}
	//testDate(9,15,2011);
	
	
	// setup item to hide or change
	var dv = document.getElementById(divID);
	
	if (today>finalDay){
		if(divType=='expander_box'){
			dv.style.display="none";
		}else{
			$("#"+divID).find("p").addClass("expired_cal_item");
			$("#"+divID).addClass("expired_cal_item"); // some text is not inside a 'p'
		}
		
	}
	  
}






function setTestDate(xMonth,xDay,xYear){

	today = new Date(); // comment out inside of hideExpiredDate()'
	today.setFullYear(xYear,xMonth-1,xDay);
	
	//alert once
	if (xVar == 0){
	//if (xVar <= 5){
		//alert(today)
		xVar++
		//var xVar = 55
	}
	//alert(xVar)
}
// hideExpiredDate(12,23,2009,'divID');

function testDate2(xMonth,xDay,xYear){

	var today = new Date(); // comment out inside of hideExpiredDate()'
	today.setFullYear(xYear,xMonth-1,xDay);
	
	//alert once
	if (xVar != 55){
	//if (xVar <= 5){
		alert(today)
		//xVar++
		var xVar = 55
	}
	//alert(xVar);
	//alert(today);
}




/////////////////////
// SETUP in HTML page
/////////////////////
/*

	Individual dates:
	
	1. Create item:
	
		<span>March 8 - 10, 2010</span>
	
	2. Due to some sort of BUG in IE, individual dates must be setup with
	a parent 'shell' so that they do not affect the whole parent container :
	
		<p class="db_date"> 
			<span>March 8 - 10, 2010</span>  
		</p>
	
	3. The item must be given an id (ce_031010):
	
		<p class="db_date">
			<span id="ce_031010">March 8 - 10, 2010</span>
		</p>

	4. Setup the javascript to target the item:
	
		<script type="text/javascript">
			$(document).ready(function() {
								  
				hideExpiredDate(3,10,2010,'ce_031010');
				
			})
		</script>

*/
// End //////////////
/////////////////////









////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////
////
////
////		matchDivHeight()   
////
////
////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



// used on employ.htm, contact.htm
function matchDivHeight(findHeightdiv, setHeightdiv, correction)
{
	// find the height of this div
	var findHeight = document.getElementById(findHeightdiv).offsetHeight
	
	// gets the div whos height is to be set
	var setHeight = document.getElementById(setHeightdiv);
	
	// correction deals with height difference caused
	// by padding, margins, borders etc.
	var cor = correction;
	
	var isIE6 = false /*@cc_on || @_jscript_version < 5.7 @*/;
	/*if (isIE6 == true){
		//var cor = correction - 20
	}*/

	
	// set height for setHeightdiv
	if((findHeight+cor)< findHeight){
		setHeight.style.height = ((findHeight+cor)+'px')

	}else
	{
		// in case the right column is shorter than the left
		setHeight.style.height = "auto"//(min_height+'px')

	}
	//alert(findHeight+"||"+cor+"   |   "+setHeight.style.height)
	//alert(findHeight+cor);
}



function matchDivHeight333(findHeightdiv, setHeightdiv, correction)
{
	var col_1_parent = document.getElementById("pillbox_col_1").offsetHeight
	
	
	// find the height of this div
	var findHeight = document.getElementById(findHeightdiv).offsetHeight
	
	// gets the div whos height is to be set
	var setHeight = document.getElementById(setHeightdiv);
	
	// correction deals with height difference caused
	// by padding, margins, borders etc.
	var cor = correction;
	
	var isIE6 = false /*@cc_on || @_jscript_version < 5.7 @*/;
	/*if (isIE6 == true){
		//var cor = correction - 20
	}*/

	//matchDivHeight('pillbox_col_2', 'pillbox_btns', -80);
	// set height for setHeightdiv
	//if((findHeight+cor)< findHeight){
		
	// if pillbox_col_2 < col_1_parent	
	if((findHeight)< col_1_parent){
		//setHeight.style.height = ((findHeight+cor)+'px')
		setHeight.style.height = "auto"//(min_height+'px')

	}else
	{
		// in case the right column is shorter than the left
		//setHeight.style.height = "auto"//(min_height+'px')
		setHeight.style.height = ((findHeight+cor)+'px')
	}
	//alert(findHeight+"||"+cor+"   |   "+setHeight.style.height)
	alert(findHeight+cor+" || "+col_1_parent);
}





function matchDivHeight222(col_1, col_2, correction)
{
	
	var c1 = document.getElementById(col_1);
	var c2 = document.getElementById(col_2);
		// find the height of this div
	var c1_height = document.getElementById(col_1).offsetHeight
	var c2_height = document.getElementById(col_2).offsetHeight

	
		// correction deals with height difference caused
		// by padding, margins, borders etc.
	var cor = correction;
	
	var isIE6 = false /*@cc_on || @_jscript_version < 5.7 @*/;
	/*if (isIE6 == true){
		//var cor = correction - 20
	}*/

//	matchDivHeight('pillbox_col_2', 'pillbox_btns', -145);
		// set height for setHeightdiv
		if(c1_height>c2_height){
			c1.style.height ="auto"
			//c2.style.height = c1.style.height
			
		}else{
			
			c1.style.height = c2.style.height
		}
		alert("c1_height = "+c1_height+" || c2_height = "+c2_height)
	/* 
	
	if column_1 > column_2{
		column_1 = auto
		column_2 = column_1
	}else{
		column_1 = column_2
		
	*/	
		
/*	if((findHeight+cor)< findHeight){
		setHeight.style.height = ((findHeight+cor)+'px')
		findHeightdiv.style.height = "500px"

	}else
	{
			// in case the right column is shorter than the left
		setHeight.style.height = "auto"//(min_height+'px')

	}*/
	//alert(findHeight+"||"+cor+"   |   "+setHeight.style.height)
	//alert(findHeight+cor+"   |   "+setHeight.style.height);
}




/*$(document).ready(function() {
	matchDivHeight('all_col_2_525', 'employ_col_1_content', -70);
})*/
// End //////////////
/////////////////////









////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////
////
////
////		openClientLogin()
////
////
////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



// used on client links in footer and header
function openClientLogin(){
	//window.location = "http://landopt.sharepointspace.com/licensee/default.aspx";
	window.open ("http://landopt.sharepointspace.com/licensee/default.aspx","mywindow");
}
// End //////////////
/////////////////////









////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////
////
////
////		openSelfServicePortal()
////
////
////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



// used on client links in footer and header
function openSelfServicePortal(){
	//window.location = "https://na4.salesforce.com/sserv/login.jsp?orgId=00D3000000019wV";
	window.location = "ssportal.htm";
	
	//<a href="https://na4.salesforce.com/sserv/login.jsp?orgId=00D3000000019wV" target="_self">
}
// End //////////////
/////////////////////








////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////
////
////
////		scrollToTop()
////
////
////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



function scrollToTop()
{
	$.scrollTo( '#body_top', 1500, { easing:'easeinout' });
}
// End //////////////
/////////////////////









////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////
////
////
////		scrollToTopTeam()
////
////
////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////





function scrollToTopTeam()
{
	$.scrollTo( '#body_top', 1500, { easing:'easeinout' });
	window.setTimeout(
		function() {
			showTeamBiobox('TS','noscroll');
		}, 1600);
	/*showTeamBio('TS','noscroll');
	window.setTimeout(
		function() {
			$.scrollTo( '#body_top', 1500, { easing:'easeinout' });
		}, 500);*/
			
	//$.scrollTo( '#body_top', 1000, { easing:'easeinout' });
}
// End //////////////
/////////////////////









////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////
////
////
////		scrollWin()
////
////
////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



function scrollWin(divName)
{
	/*$('#toc a').click(function(){//$.scrollTo works EXACTLY the same way, but scrolls the whole screen
		$.scrollTo( this.hash, 1500, { easing:'elasout' });
		$(this.hash).find('span.message').text( this.title );
		return false;
	});*/
	$('#divName').click(function(){//$.scrollTo works EXACTLY the same way, but scrolls the whole screen
		$.scrollTo( this.hash, 1500, { easing:'elasout' });
		$(this.hash).find('span.message').text( this.title );
		return false;
	});
	//$('html, body').animate({scrollTop: $('#'+divName).offset().top}, 1000);
}
// End //////////////
/////////////////////







////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////
////
////
////		showBoardBiobox()   
////
////
////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



// used in team.htm
function showBoardBiobox(member, dontScroll)
{
	// hide all divs first 
	hideBoardBioboxAll(member);
	// setup main styles 
	setBoardBioboxStyle(member);
	// setup inner styles 
	setBoardBioboxStyleInner(member)
	// setup height for the inner and outer BioBox // ***** not in use - height set to 'auto' *****
	//setBoardBioboxHeight();   
	 
	// lineup bio with member
	setBoardBioboxPosition("board2_memberbox_"+member,"board2_biobox_"+member);
	// so it does not scroll when first entering page 
	if(dontScroll!="noscroll"){
		//$.scrollTo( "#board2_memberbox_"+member, 1000, { easing:'easeinout' });
		
		var mbox = "board2_memberbox_"+member
		var mbox2 = (284-20);
		var offset = document.getElementById(mbox).offsetTop;
		var mpos = offset + mbox2
		$.scrollTo( mpos, 1000, { easing:'easeinout' });
		
	}else{
	// Reset all scrollable panes to (0,0)
		//$('div.pane').scrollTo( 0 );
	// Reset the screen to (0,0)
		//$.scrollTo( 0 );
		//gotoTop()
	}
}

/////////////////////////////////////////
//
// child functions of showBoardBiobox
//
/////////////////////////////////////////


// setup div styles 
function setBoardBioboxStyle(member)
{
	var dv = document.getElementById("board2_biobox_"+member);
	dv.style.position = "relative";
	dv.style.zIndex = "99";
	dv.style.display= "block";
	dv.style.margin = "0px 0px 20px 30px";
	dv.style.height = "auto"
	dv.style.width = "450px"
	dv.style.opacity = "1";
	dv.style.filter = "alpha(opacity = 100)";
}
// setup inner styles 
function setBoardBioboxStyleInner(member)
{
	var dv_inner = document.getElementById("board2_biobox_"+member+'_inner');
	dv_inner.style.display = "block";
	dv_inner.style.height = "auto";
	dv_inner.style.width = "auto";
	dv_inner.style.padding = "70px 60px 70px 60px"
}
// sets height of box
function setBoardBioboxHeight()
{
	var height = boxHeight;
	dv.style.height = height + "px";
	dv_inner.style.height = ((height-sizeDiff)+"px");
}
// hides one member
function hideBoardBiobox(member)
{
	var dv = document.getElementById("board2_biobox_"+member);
	//dv.style.position = "absolute";
	dv.style.zIndex = "1";
	dv.style.opacity = "0";
	dv.style.filter = "alpha(opacity = 0)";
	dv.style.display = "none";
	
}
// hides all board members 
function hideBoardBioboxAll()
{ 
	// !!! modify array when adding/subtracting board members
	var boardMembers = ["GF","BK","PM","DS","TS","DE"];
	for (var i = 0; i < boardMembers.length; i++) {
		var boardMember = boardMembers[i];
		hideBoardBiobox(boardMember)
	}
}
//
function setBoardBioboxPosition(findThis,setThis)
{
	var dv1 = document.getElementById(findThis).offsetTop;
	var dv2 = document.getElementById(setThis);
	
	var dvBioCol = document.getElementById("all_col_2_525");//all_col_2_525
	var dvBioCol_inner = document.getElementById("all_col_2_525_inner");

	var bioHeight = document.getElementById(setThis).offsetHeight
	var memberColHeight = document.getElementById("col_1_content").height;
	
	var newHeight = bioHeight + dv1 + 50;
	
	dv2.style.position = "absolute";
	dv2.style.top = (dv1-10)+"px";
	
	dvBioCol.style.height = newHeight+"px"
	//dvBioCol.style.marginLeft = "10px";
	dvBioCol_inner.style.height = ((newHeight-60)+"px")	
}

// End //////////////
/////////////////////
/*$(function () {
  $('img.swap').hover(function () {
    this.src = 'images/sad.jpg';
  }, function () {
    this.src = 'images/happy.jpg';
  });
});*/
$(document).ready(function() {
	/*$("img").hover(function(){
	  //$(this).addClass("hover");
	  this.src = 'images/top_btn_2_over.gif';
	  //this.src = '../landopt_dev12567/images/top_btn_over.gif';
	  //alert("HI");
	},function(){
	  //$(this).removeClass("hover");
	  this.src = 'images/top_btn_2_up.gif';
	 // this.src = '../landopt_dev12567/images/top_btn.gif';
	}); */
	
	/*var navDuration = 150; //time in miliseconds
      var navJumpHeight = "0px";

      $('#top_btn').hover(function() {
          $(this).animate({ top : "-="+navJumpHeight }, navDuration);            
      }, function() {
          $(this).animate({ top : "66px" }, navDuration);
      });*/
	 
	 /*$("#top_btn").hover(function(){
      $("#top_btn").animate({ 
        opacity: 100,
	   bottom: "+=10px",
	   left: "+=50px"
      }, 1000 );
	 
   	 });
	 $("#top_btn").rollout(function(){
      $("#top_btn").animate({ 
        left: "-=50px",
      }, 1500 );
	 
   	 });*/
	 
	 $(function() {
			$('#top_btn .content').hover(function(){
				$(this).find('img').animate({
					top:'0px',
					opacity:1
					//filter:'alpha(opacity=30)';		   
				},{queue:false,duration:100});
			}, function(){
				$(this).find('img').animate({
					top:'-4px',
					opacity:0.5
				},{queue:false,duration:50});
			});
		});
//$(".block").animate({"left": "+=50px"}, "slow");

	 
})
/*$('#top_btn')(function () {
    $('<div class="fader" />').css('opacity', 0).prependTo(this);
  }).hover(function () {
    $('img', this).stop().animate({
      marginLeft : 5
    }, 250);
    
    $('.fader', this).stop().animate({
      opacity : 0.15
    });
    
  }, function () {
    $('img', this).stop().animate({
      marginLeft : 10
    }, 250);
    
    $('.fader', this).stop().animate({
      opacity : 0
    });
  }).find('img').css('marginLeft', 10);*/


// End showBoardBiobox()  //////////////
////////////////////////////////////////





////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////
////
////
////		showContentPillars()   
////
////
////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



// used in pillars.htm 
function showContentPillars(divName2)
{
	
/* 
	hide all divs first 
*/
	hideContentPillarsAll();
	
/* 
	"show" chosen div 
*/
	var dv2 = document.getElementById(divName2);
	dv2.style.position = "absolute";
	dv2.style.left = "0px";
	dv2.style.top = "0px";
	dv2.style.zIndex = "99";
	dv2.style.opacity = "1";
	dv2.style.filter = "alpha(opacity = 100)";
	dv2.style.top = "0";
	dv2.style.left = "0";
	dv2.style.display = "inline";
	dv2.style.padding = "0";
	dv2.style.margin= "30px 0px 0px 30px";
	dv2.style.width = "450px";
	dv2.style.height = "auto";
	
	var dv44 = document.getElementById("pillars_box_2");
	//var dv44 = document.getElementById("font_test");
	dv44.style.fontSize = "12px";
	//dv44.style.fontFamily="Lucida Sans Unicode", "Lucida Grande", "sans-serif"
	dv44.style.fontFamily="Arial, Helvetica, sans-serif"
/*	font-size:14px;
	font-family:  "Lucida Sans Unicode", "Lucida Grande", sans-serif;
	line-height: 22px;
	text-align: left;*/
/* 
	refresh "pillars_col_2"'s width and height - seems to need this 
*/	
	setHeightPillarsCol2(divName2);
	
		function checkIE(){
			var xVersion = checkVersionIE()
			if (xVersion==6){
				//alert("IE6")
				matchDivHeight('pillars_col_2', 'pillars_btns', -88);
			}else
			if (xVersion==7){
				//alert("IE7")
				matchDivHeight('pillars_col_2', 'pillars_btns', -88);
			}else{
				//matchDivHeight('pillars_col_2', 'pillars_btns', -100);
				matchDivHeight('pillars_col_2', 'pillars_btns', -115);
			}

		}
		//alert (cor)
		checkIE();
		/*tr = document.getElementById('pillars_col_2');
		tr.style.width = "525px";
		tr.style.height = "auto";*/

	/*tr2 = document.getElementById('#pillars_col_2 #content');
	tr2.style.width = "485px";
	tr2.style.height = "1050px";	
	tr2.style.backgroundColor = "#186321"*/
	
	/* change bg color (not needed) */
	/*
	if(divName2 == 'box_SAM'){
		tr.style.backgroundColor = "#186321";
	}else if(divName2 == 'box_HRM'){
		 tr.style.backgroundColor = "#0B0049";
	}else if(divName2 == 'box_OM'){
		 tr.style.backgroundColor = "#D6B202";
	}else if(divName2 == 'box_BM'){
		 tr.style.backgroundColor = "#BA151B";
	}
	*/
	
	//return false
}
function setHeightPillarsCol2(findThis)
{
		var dv1 = document.getElementById(findThis).offsetHeight;
		var dv2 = document.getElementById('pillars_col_2');
		var dv3 = document.getElementById('pillars_col_2_content');
		
		dv2.style.height = (dv1+80)+"px";
		//dv2.style.margin = "0px 0px 0px 10px"; //was screwing IE6 UP so gave the margin to pillars_col_1
		dv2.style.margin = "0px 0px 0px 0px";
		
		dv3.style.height = (dv1-10)+"px";
		//dv3.style.margin = "10px";
		dv3.style.padding = "30px 10px 40px 10px";
		
}
function hideContentPillars(divName2)
{
	var dvhide = document.getElementById(divName2);
	
	dvhide.style.position = "absolute";
	dvhide.style.left = "0px";
	dvhide.style.top = "0px";
	dvhide.style.zIndex = "1";
	dvhide.style.opacity = "0";
	dvhide.style.filter = "alpha(opacity = 0)";
	dvhide.style.display = "none";
}
function hideContentPillarsAll()
{
	hideContentPillars('box_INT');
	hideContentPillars('box_SM');
	hideContentPillars('box_HRM');
	hideContentPillars('box_OM');
	hideContentPillars('box_BM');
	//alert("Hide")
}
// End //////////////
/////////////////////








////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////
////
////
////		showContentPillBox()   
////
////
////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



// used in pillars.htm 
function showContentPillBox(divName2,page)
{
	
/* 
	hide all divs first 
*/
	hideContentPillBoxAll();
	
/* 
	"show" chosen div 
*/
	var dv2 = document.getElementById(divName2);
	dv2.style.position = "absolute";
	dv2.style.left = "0px";
	dv2.style.top = "0px";
	dv2.style.zIndex = "99";
	dv2.style.opacity = "1";
	dv2.style.filter = "alpha(opacity = 100)";
	dv2.style.top = "0";
	dv2.style.left = "0";
	dv2.style.display = "inline";
	dv2.style.padding = "0";
	dv2.style.margin= "30px 0px 0px 30px";
	dv2.style.width = "450px";
	dv2.style.height = "auto";
	
	var dv44 = document.getElementById("pillbox_box_2");
	dv44.style.fontSize = "12px";
	dv44.style.fontFamily="Arial, Helvetica, sans-serif"
	
	setHeightPillBoxCol2(divName2);
	
		function checkIE(){
			var xVersion = checkVersionIE()
			if (xVersion==6){
				//alert("IE6")
				matchDivHeight('pillbox_col_2', 'pillbox_btns', -145);
			}else
			if (xVersion==7){
				//alert("IE7")
				matchDivHeight('pillbox_col_2', 'pillbox_btns', -80);
			}else{
				//matchDivHeight('pillbox_col_2', 'pillbox_btns', -100);
				matchDivHeight('pillbox_col_2', 'pillbox_btns', -70);
			}

		}
		//checkIE();
}
function setHeightPillBoxCol2(findThis)
{
		var dv1 = document.getElementById(findThis).offsetHeight;
		var col1_height = document.getElementById("pillbox_col_1").offsetHeight;
		var dv2 = document.getElementById('pillbox_col_2');
		var dv3 = document.getElementById('pillbox_col_2_content');
		
		//dv2.style.height = (dv1+80)+"px";
		dv2.style.margin = "0px 0px 0px 0px";
		
		if ((dv1+80)<=col1_height){
			//dv2.style.height = "585px"
			//dv3.style.height = "495px";
			dv2.style.height = col1_height+"px"
			dv3.style.height = (col1_height - 90)+"px";
			
			//dv2.style.height = (dv1+80)+"px";
			//alert(dv1+80)
			//alert(col1_height)
		}else{
			dv2.style.height = (dv1+80)+"px";
			dv3.style.height = (dv1-10)+"px";
			//alert("else "+dv2.style.height)
		}
		
		dv3.style.padding = "30px 10px 40px 10px";
	
}
function hideContentPillBox(divName2)
{
	var dvhide = document.getElementById(divName2);
	
	dvhide.style.position = "absolute";
	dvhide.style.left = "0px";
	dvhide.style.top = "0px";
	dvhide.style.zIndex = "1";
	dvhide.style.opacity = "0";
	dvhide.style.filter = "alpha(opacity = 0)";
	dvhide.style.display = "none";
}
function hideContentPillBoxAll()
{
	/*hideContentPillBox('box_SC');
	hideContentPillBox('box_SCVC');
	hideContentPillBox('box_R');*/
	//var pillBoxesArray = ["box_SC","box_SCVC","box_R"];
	var pillBoxes = pillBoxesArray //found on HTML page
	for (var i = 0; i < pillBoxes.length; i++) {
		var pillBox = pillBoxes[i];
		hideContentPillBox(pillBox)
	}
	
/*		var boardMembers = ["GF","BK","PM","DS","TS","DE"];
	for (var i = 0; i < boardMembers.length; i++) {
		var boardMember = boardMembers[i];
		hideBoardBiobox(boardMember)
	}*/

	//alert("Hide")
}
// End //////////////
/////////////////////







////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////
////
////
////		showNetworkBiobox()   
////
////
////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



// used in team.htm
function showNetworkBiobox(member, dontScroll)
{
	// hide all divs first 
	hideNetworkBioboxAll(member);
	// setup main styles 
	setNetworkBioboxStyle(member);
	// setup inner styles 
	setNetworkBioboxStyleInner(member)
	// setup height for the inner and outer BioBox // ***** not in use - height set to 'auto' *****
	//setNetworkBioboxHeight();   
	 
	// lineup bio with member
	setNetworkBioboxPosition("memberbox_"+member,"network_biobox_"+member);
	// so it does not scroll when first entering page 
	if(dontScroll!="noscroll"){
		// old
		//$.scrollTo( "#memberbox_"+member, 1000, { easing:'easeinout' });
		
		// new
		
		/*<--- works  */
		
		var mbox = "memberbox_"+member
		var mbox2 = (284-20);
		var offset = document.getElementById(mbox).offsetTop;
		var mpos = offset + mbox2
		$.scrollTo( mpos, 1000, { easing:'easeinout' });
		//alert(offset)
		
		/*  works - end  --->*/
		
		/*var mbox = "memberbox_"+member
		var mbox2 = (284-20);
		var offset = document.getElementById(mbox).offsetTop;
		var offset2 = $(mbox).offset();
		var offset3 = offset2.left
		var mpos = offset
		$.scrollTo( (mpos+mbox2), 1000, { easing:'easeinout' });*/
		//console.log(offset3)
		//var dv1 = document.getElementById(mbox).offsetTop;
	}else{
	// Reset all scrollable panes to (0,0)
		//$('div.pane').scrollTo( 0 );
	// Reset the screen to (0,0)
		//$.scrollTo( 0 );
		//gotoTop()
	}
}
/////////////////////////////////////////
/////////////////////////////////////////
//
// child functions of showNetworkBiobox
//
/////////////////////////////////////////
/////////////////////////////////////////

// setup div styles 
function setNetworkBioboxStyle(member)
{
	var dv = document.getElementById("network_biobox_"+member);
	dv.style.position = "relative";
	dv.style.zIndex = "99";
	dv.style.display= "block";
	dv.style.margin = "0px 0px 20px 30px";
	dv.style.height = "auto"
	dv.style.width = "450px"
	dv.style.opacity = "1";
	dv.style.filter = "alpha(opacity = 100)";
}
// setup inner styles 
function setNetworkBioboxStyleInner(member)
{
	var dv_inner = document.getElementById("network_biobox_"+member+'_inner');
	dv_inner.style.display = "block";
	dv_inner.style.height = "auto";
	dv_inner.style.width = "auto";
	dv_inner.style.padding = "70px 60px 70px 60px"
}
// sets height of box
function setNetworkBioboxHeight()
{
	var height = boxHeight;
	dv.style.height = height + "px";
	dv_inner.style.height = ((height-sizeDiff)+"px");
}
// hides one member
function hideNetworkBiobox(member)
{
	var dv = document.getElementById("network_biobox_"+member);
	//dv.style.position = "absolute";
	dv.style.zIndex = "1";
	dv.style.opacity = "0";
	dv.style.filter = "alpha(opacity = 0)";
	dv.style.display = "none";
	
}
// hides all network members 
function hideNetworkBioboxAll()
{ 
	// !!! modify array when adding/subtracting network members
	var networkMembers = ["EL","BB","SG","GE","NU","MT","TR","CC","ML","TO","CA","PRO","PROS","BT","SS","HHL","WWL","TLL"];
	for (var i = 0; i < networkMembers.length; i++) {
		var networkMember = networkMembers[i];
		hideNetworkBiobox(networkMember)
	}
}
//
function setNetworkBioboxPosition(findThis,setThis)
{
	var dv1 = document.getElementById(findThis).offsetTop;
	var dv2 = document.getElementById(setThis);
	
	var dvBioCol = document.getElementById("all_col_2_525");//all_col_2_525
	var dvBioCol_inner = document.getElementById("all_col_2_525_inner");

	var bioHeight = document.getElementById(setThis).offsetHeight
	var memberColHeight = document.getElementById("col_1_content").height;
	
	var newHeight = bioHeight + dv1 + 50; 
	
	dv2.style.position = "absolute";
	dv2.style.top = (dv1-10)+"px";
	
	dvBioCol.style.height = newHeight+"px"
	//dvBioCol.style.marginLeft = "10px";
	dvBioCol_inner.style.height = ((newHeight-60)+"px")	
}

// End //////////////
/////////////////////

$(document).ready(function() {
	 
	 $(function() {
			$('#top_btn .content').hover(function(){
				$(this).find('img').animate({
					top:'0px',
					opacity:1
					//filter:'alpha(opacity=30)';		   
				},{queue:false,duration:100});
			}, function(){
				$(this).find('img').animate({
					top:'-4px',
					opacity:0.5
				},{queue:false,duration:50});
			});
		});
//$(".block").animate({"left": "+=50px"}, "slow");

	 
})
// End showNetworkBiobox()  //////////////
////////////////////////////////////////




////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////
////
////
////		showHideObject()
////
////
////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



function showHideObject(ob1)
{
	
	var e = document.getElementById(ob1);

	if(e.style.opacity == '1'){
		e.style.opacity  = '0';
		e.style.filter = "alpha(opacity = 0)";
	}else{
		e.style.opacity  = '1';
		e.style.filter = "alpha(opacity = 100)";
	}

		//alert(e.style.display);

}
// End //////////////
/////////////////////






////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////
////
////
////		showTeamBiobox()   
////
////
////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



// used in team.htm
function showTeamBiobox(member, dontScroll)
{
	// hide all divs first 
	hideTeamBioboxAll(member);
	// setup main styles 
	setTeamBioboxStyle(member);
	// setup inner styles 
	setTeamBioboxStyleInner(member)
	// setup height for the inner and outer BioBox // ***** not in use - height set to 'auto' *****
	//setTeamBioboxHeight();   
	 
	// lineup bio with member
	setTeamBioboxPosition("team_memberbox_"+member,"team_biobox_"+member);
	// so it does not scroll when first entering page 
	if(dontScroll!="noscroll"){
		//$.scrollTo( "#team_memberbox_"+member, 1000, { easing:'easeinout' });
		
		
		var mbox = "team_memberbox_"+member
		var mbox2 = (284-20);
		var offset = document.getElementById(mbox).offsetTop;
		var mpos = offset + mbox2
		$.scrollTo( mpos, 1000, { easing:'easeinout' });
		//alert("");
		
		
	}else{
	// Reset all scrollable panes to (0,0)
		//$('div.pane').scrollTo( 0 );
	// Reset the screen to (0,0)
		//$.scrollTo( 0 );
		//gotoTop()
	}
}
/////////////////////////////////////////
/////////////////////////////////////////
//
// child functions of showTeamBiobox
//
/////////////////////////////////////////
/////////////////////////////////////////

// setup div styles 
function setTeamBioboxStyle(member)
{
	var dv = document.getElementById("team_biobox_"+member);
	dv.style.position = "relative";
	dv.style.zIndex = "99";
	dv.style.display= "block";
	dv.style.margin = "0px 0px 20px 30px";
	dv.style.height = "auto"
	dv.style.width = "450px"
	dv.style.opacity = "1";
	dv.style.filter = "alpha(opacity = 100)";
}
// setup inner styles 
function setTeamBioboxStyleInner(member)
{
	var dv_inner = document.getElementById("team_biobox_"+member+'_inner');
	dv_inner.style.display = "block";
	dv_inner.style.height = "auto";
	dv_inner.style.width = "auto";
	dv_inner.style.padding = "70px 60px 70px 60px"
}
// sets height of box
function setTeamBioboxHeight()
{
	var height = boxHeight;
	dv.style.height = height + "px";
	dv_inner.style.height = ((height-sizeDiff)+"px");
}
// hides one member
function hideTeamBiobox(member)
{
	var dv = document.getElementById("team_biobox_"+member);
	//dv.style.position = "absolute";
	dv.style.zIndex = "1";
	dv.style.opacity = "0";
	dv.style.filter = "alpha(opacity = 0)";
	dv.style.display = "none";
	
}
// hides all team members 
function hideTeamBioboxAll()
{ 
	// !!! modify array when adding/subtracting team members
	//var teamMembers = ["TS","NE","NR","MG","DG","SB","RG","JS","RC"];
	var teamMembers = teamMembersArray
	for (var i = 0; i < teamMembers.length; i++) {
		var teamMember = teamMembers[i];
		hideTeamBiobox(teamMember)
	}
}
//
function setTeamBioboxPosition(findThis,setThis)
{
	var dv1 = document.getElementById(findThis).offsetTop;
	var dv2 = document.getElementById(setThis);
	
	var dvBioCol = document.getElementById("all_col_2_525");//all_col_2_525
	var dvBioCol_inner = document.getElementById("all_col_2_525_inner");

	var bioHeight = document.getElementById(setThis).offsetHeight
	var memberColHeight = document.getElementById("col_1_content").height;
	
	var newHeight = bioHeight + dv1 + 50;
	
	dv2.style.position = "absolute";
	dv2.style.top = (dv1-10)+"px";
	
	dvBioCol.style.height = newHeight+"px"
	//dvBioCol.style.marginLeft = "10px";
	dvBioCol_inner.style.height = ((newHeight-60)+"px")	
}

// End //////////////
/////////////////////
/*$(function () {
  $('img.swap').hover(function () {
    this.src = 'images/sad.jpg';
  }, function () {
    this.src = 'images/happy.jpg';
  });
});*/
$(document).ready(function() {
	/*$("img").hover(function(){
	  //$(this).addClass("hover");
	  this.src = 'images/top_btn_2_over.gif';
	  //this.src = '../landopt_dev12567/images/top_btn_over.gif';
	  //alert("HI");
	},function(){
	  //$(this).removeClass("hover");
	  this.src = 'images/top_btn_2_up.gif';
	 // this.src = '../landopt_dev12567/images/top_btn.gif';
	}); */
	
	/*var navDuration = 150; //time in miliseconds
      var navJumpHeight = "0px";

      $('#top_btn').hover(function() {
          $(this).animate({ top : "-="+navJumpHeight }, navDuration);            
      }, function() {
          $(this).animate({ top : "66px" }, navDuration);
      });*/
	 
	 /*$("#top_btn").hover(function(){
      $("#top_btn").animate({ 
        opacity: 100,
	   bottom: "+=10px",
	   left: "+=50px"
      }, 1000 );
	 
   	 });
	 $("#top_btn").rollout(function(){
      $("#top_btn").animate({ 
        left: "-=50px",
      }, 1500 );
	 
   	 });*/
	 
	 $(function() {
			$('#top_btn .content').hover(function(){
				$(this).find('img').animate({
					top:'0px',
					opacity:1
					//filter:'alpha(opacity=30)';		   
				},{queue:false,duration:100});
			}, function(){
				$(this).find('img').animate({
					top:'-4px',
					opacity:0.5
				},{queue:false,duration:50});
			});
		});
//$(".block").animate({"left": "+=50px"}, "slow");

	 
})
/*$('#top_btn')(function () {
    $('<div class="fader" />').css('opacity', 0).prependTo(this);
  }).hover(function () {
    $('img', this).stop().animate({
      marginLeft : 5
    }, 250);
    
    $('.fader', this).stop().animate({
      opacity : 0.15
    });
    
  }, function () {
    $('img', this).stop().animate({
      marginLeft : 10
    }, 250);
    
    $('.fader', this).stop().animate({
      opacity : 0
    });
  }).find('img').css('marginLeft', 10);*/


// End //////////////
/////////////////////







////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////
////
////
////		swapImage()   
////
////
////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



// used in team.htm
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];}
}
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];}}
}
// End //////////////
/////////////////////


function getInternetExplorerVersion()
// Returns the version of Internet Explorer or a -1
// (indicating the use of another browser).
{
  var rv = -1; // Return value assumes failure.
  if (navigator.appName == 'Microsoft Internet Explorer')
  {
    var ua = navigator.userAgent;
    var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
    if (re.exec(ua) != null)
      rv = parseFloat( RegExp.$1 );
  }
  return rv;
}
function checkVersionIE()
{
  var msg = "You're not using Internet Explorer.";
  var ver = getInternetExplorerVersion();

 /* if ( ver > -1 )
  {
    if ( ver == 7 ) {
     // msg = "You're using IE"+versionCheck+".";
	 var version7=true;
  	}else{
      msg = "You should upgrade your copy of Internet Explorer.";
	}
  }*/
 // alert( ver );
  return ver;
}
//getInternetExplorerVersion()
//checkVersionIE()
function isIE7(){
	/*if (x==true){
	 	alert( x );
	}else{
		alert( "not IE7" );
	}*/
	//return x
}
function checkit(){
var yy = isIE7()
	if (yy==true){
	 	alert( yy );
	}else{
		alert( "not IE7" );
	}

}
//checkit()









/*  end landopt.js  */
