﻿function OpenRow(rowID){
    var ElementID = "rowData";
    
    for(i=0; i<20; i++){
        if (document.getElementById(ElementID + i)){
            document.getElementById(ElementID + i).className='RowMoreContentHidden';
        }
    }
    
    if (document.getElementById(ElementID + rowID)){
        if (document.getElementById(ElementID + rowID).className=='RowMoreContentHidden'){
            document.getElementById(ElementID + rowID).className='RowMoreContentVisible';
        }
        else
        {
            document.getElementById(ElementID + rowID).className='RowMoreContentHidden';
        }
           
    }
    else
    {
        alert('huston we have a problem');
    }
}

function doNothing() {
    //
}

function HelloAvi(){
    document.getElementById('bgCenter').style.height='100px';
}

var uniquepageid=window.location.href.replace("http://"+window.location.hostname, "").replace(/^\//, "") //get current page path and name, used to uniquely identify this page for persistence feature

function animatedcollapse(divId, animatetime, persistexpand, initstate){
	this.divId=divId
	this.divObj=document.getElementById(divId)
	this.divObj.style.overflow="hidden"
	this.timelength=animatetime
	this.initstate=(typeof initstate!="undefined" && initstate=="block")? "block" : "contract"
	this.isExpanded=animatedcollapse.getCookie(uniquepageid+"-"+divId) //"yes" or "no", based on cookie value
	this.contentheight=parseInt(this.divObj.style.height)
	var thisobj=this
	if (isNaN(this.contentheight)){ //if no CSS "height" attribute explicitly defined, get DIV's height on window.load
		animatedcollapse.dotask(window, function(){thisobj._getheight(persistexpand)}, "load")
		if (!persistexpand && this.initstate=="contract" || persistexpand && this.isExpanded!="yes" && this.isExpanded!="") //Hide DIV (unless div should be expanded by default, OR persistence is enabled and this DIV should be expanded)
			this.divObj.style.visibility="hidden" //hide content (versus collapse) until we can get its height
	}
	else if (!persistexpand && this.initstate=="contract" || persistexpand && this.isExpanded!="yes" && this.isExpanded!="") //Hide DIV (unless div should be expanded by default, OR persistence is enabled and this DIV should be expanded)
		this.divObj.style.height=0 //just collapse content if CSS "height" attribute available
	if (persistexpand)
		animatedcollapse.dotask(window, function(){animatedcollapse.setCookie(uniquepageid+"-"+thisobj.divId, thisobj.isExpanded)}, "unload")
}

animatedcollapse.prototype._getheight=function(persistexpand){
	this.contentheight=this.divObj.offsetHeight
	if (!persistexpand && this.initstate=="contract" || persistexpand && this.isExpanded!="yes"){ //Hide DIV (unless div should be expanded by default, OR persistence is enabled and this DIV should be expanded)
		this.divObj.style.height=0 //collapse content
		this.divObj.style.visibility="visible"
	}
	else //else if persistence is enabled AND this content should be expanded, define its CSS height value so slideup() has something to work with
		this.divObj.style.height=this.contentheight+"px"
}


animatedcollapse.prototype._slideengine=function(direction){
	var elapsed=new Date().getTime()-this.startTime //get time animation has run
	var thisobj=this
	if (elapsed<this.timelength){ //if time run is less than specified length
		var distancepercent=(direction=="down")? animatedcollapse.curveincrement(elapsed/this.timelength) : 1-animatedcollapse.curveincrement(elapsed/this.timelength)
	this.divObj.style.height=distancepercent * this.contentheight +"px"
	this.runtimer=setTimeout(function(){thisobj._slideengine(direction)}, 10)
	}
	else{ //if animation finished
		this.divObj.style.height=(direction=="down")? this.contentheight+"px" : 0
		this.isExpanded=(direction=="down")? "yes" : "no" //remember whether content is expanded or not
		this.runtimer=null
	}
}


animatedcollapse.prototype.slidedown=function(){
	if (typeof this.runtimer=="undefined" || this.runtimer==null){ //if animation isn't already running or has stopped running
		if (isNaN(this.contentheight)) //if content height not available yet (until window.onload)
			doNothing()
		else if (parseInt(this.divObj.style.height)==0){ //if content is collapsed
			this.startTime=new Date().getTime() //Set animation start time
			this._slideengine("down")
		}
	}
}

animatedcollapse.prototype.slideup=function(){
	if (typeof this.runtimer=="undefined" || this.runtimer==null){ //if animation isn't already running or has stopped running
		if (isNaN(this.contentheight)) //if content height not available yet (until window.onload)
			doNothing()
		else if (parseInt(this.divObj.style.height)==this.contentheight){ //if content is expanded
			this.startTime=new Date().getTime()
			this._slideengine("up")
		}
	}
}

animatedcollapse.prototype.slideit=function(){
	if (isNaN(this.contentheight)) //if content height not available yet (until window.onload)
		doNothing()
	else if (parseInt(this.divObj.style.height)==0)
		this.slidedown()
	else if (parseInt(this.divObj.style.height)==this.contentheight)
		this.slideup()
}


animatedcollapse.curveincrement=function(percent){
	return (1-Math.cos(percent*Math.PI)) / 2 //return cos curve based value from a percentage input
}


animatedcollapse.dotask=function(target, functionref, tasktype){ //assign a function to execute to an event handler (ie: onunload)
	var tasktype=(window.addEventListener)? tasktype : "on"+tasktype
	if (target.addEventListener)
		target.addEventListener(tasktype, functionref, false)
	else if (target.attachEvent)
		target.attachEvent(tasktype, functionref)
}

animatedcollapse.getCookie=function(Name){ 
	var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair
	if (document.cookie.match(re)) //if cookie found
		return document.cookie.match(re)[0].split("=")[1] //return its value
	return ""
}

animatedcollapse.setCookie=function(name, value){
		document.cookie = name+"="+value
}

function IncreaseFontSize(FontUnitPixle)
{
    document.body.style.fontSize=FontUnitPixle + 'px'
}

// function showTopBarSection(sectionName)
// {
    // // var d = document.getElementById;
    // document.getElementById('aboutUsGridContainer').className='topBarDivHidden';
    // document.getElementById('investmentsGridContainer').className='topBarDivHidden';
    // document.getElementById('foundationGridContainer').className='topBarDivHidden';
    // document.getElementById('kayamutGridContainer').className='topBarDivHidden';
    // document.getElementById('SearchContainer').className='topBarDivHidden';
    
    // if (document.getElementById(sectionName))
    // {
        // document.getElementById(sectionName).className='topBarDivShow';
    // }

    // if (sectionName == "aboutUsGridContainer") {
        // document.getElementById('myMoreButton').style.display = '';
    // }
    // else {
        // document.getElementById('myMoreButton').style.display = 'none';
    // }
    
// }

function DocumentWrite(sHtml)
{
    //alert(sHtml);
	document.writeln(sHtml);
}

//WriteFlashObjInElement
function DocumentWriteInElement(sHtml, elemID)
{
    if(document.getElementById(elemID))
    {
        document.getElementById(elemID).innerHTML = sHtml;
    }
}

function WriteFlashObjInElement(sSrc,sWidth,sHeight,bTrans,sFlashVars,sID, sElemID)
{
    var sObj = "";
	var sWMode = "";
	var sObjID = sSrc.replace(".swf","");
	var sVars = "";
	var sPrfx = "?";
	if(sFlashVars){
	    sVars = sFlashVars;
	}
	if(sID){
	    sObjID = sID;
	}else{
	    sObjID = sSrc.replace(".swf","");
	}
//    sObj = sObj+'	<embed height="' + sHeight + '" align="middle" width="' + sWidth + '" type="application/x-shockwave-flash" salign="" allowscriptaccess="sameDomain" allowfullscreen="false" menu="true" name="icons_acc" bgcolor="#ffffff" devicefont="false" wmode="window" scale="showall" loop="true" play="true" pluginspage="http://www.macromedia.com/go/getflashplayer" quality="high" src="' + sSrc + '"/>';
//    sObj = sObj+'    <noscript>';
//    sObj = sObj+'    <object style="position:absolute; top:0px; z-index:-10;" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="' + sWidth + '" height="' + sHeight + '" id="' + sID + '" align="middle"> ';
//    sObj = sObj+'    <param name="allowScriptAccess" value="sameDomain" />';
//    sObj = sObj+'    <param name="allowFullScreen" value="false" />';
//    sObj = sObj+'    <param name="movie" value="' + sSrc + '" />';
//    sObj = sObj+'    <param name="quality" value="high" />';
//    sObj = sObj+'    <param name="bgcolor" value="#ffffff" />';
//    sObj = sObj+'    <embed src="' + sSrc + '" quality="high" bgcolor="#ffffff" width="' + sWidth + '" height="' + sHeight + '" name="' + sID + '" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
//    sObj = sObj+'    </object>';
//    sObj = sObj+'    </noscript>';
    
	sObj = sObj+"<object style='position:relative;top:0px;z-index:102' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab' width='"+sWidth+"' height='"+sHeight+"' id='"+sObjID+"' align='middle' VIEWASTEXT>";
	sObj = sObj+"<param name='allowScriptAccess' value='sameDomain' />";
	sObj = sObj+"<param name='movie' value='"+sSrc+"' />";
	sObj = sObj+"<param name='quality' value='high' />";
	sObj = sObj+"<param name='bgcolor' value='#ffffff' />";
	sObj = sObj+"<param name='flashvars' value='"+sVars+"' />";
	if(bTrans == true){
		sObj = sObj+"<PARAM NAME='WMode' VALUE='Transparent'>";
		sWMode = "wmode='transparent'";
	}
	sObj = sObj+"<embed src='"+sSrc+"' flashvars='"+sVars+"' quality='high' bgcolor='#ffffff' "+sWMode+" width='"+sWidth+"' height='"+sHeight+"' ID='"+sObjID+"' NAME='bg' align='middle' allowScriptAccess='sameDomain' swLiveConnect=true ID='bg' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />";
	sObj = sObj+"</object>";
	
	DocumentWriteInElement(sObj, sElemID);
}


function DocumentWrite(sHtml) {
    document.writeln(sHtml);
}
function WriteFlashObj(sSrc, sWidth, sHeight, bTrans, sFlashVars, sID) {
    var sObj = "";
    var sWMode = "";
    var sObjID = sSrc.replace(".swf", "");
    var sVars = "";
    var sPrfx = "?";
    if (sFlashVars) {
        sVars = sFlashVars;
    }
    if (sID) {
        sObjID = sID;
    } else {
        sObjID = sSrc.replace(".swf", "");
    }
    sObj = sObj + "<object style='position:relative;top:0px;z-index:102' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab' width='" + sWidth + "' height='" + sHeight + "' id='" + sObjID + "' align='middle' VIEWASTEXT>";
    sObj = sObj + "<param name='allowScriptAccess' value='sameDomain' />";
    sObj = sObj + "<param name='movie' value='" + sSrc + "' />";
    sObj = sObj + "<param name='quality' value='high' />";
    sObj = sObj + "<param name='bgcolor' value='#ffffff' />";
    sObj = sObj + "<param name='flashvars' value='" + sVars + "' />";
    if (bTrans == true) {
        sObj = sObj + "<PARAM NAME='WMode' VALUE='Transparent'>";
        sWMode = "wmode='transparent'";
    }
    sObj = sObj + "<embed src='" + sSrc + "' flashvars='" + sVars + "' quality='high' bgcolor='#ffffff' " + sWMode + " width='" + sWidth + "' height='" + sHeight + "' ID='" + sObjID + "' NAME='bg' align='middle' allowScriptAccess='sameDomain' swLiveConnect=true ID='bg' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />";
    sObj = sObj + "</object>";
    DocumentWrite(sObj);
}



//function WriteFlashObj(sSrc,sWidth,sHeight,bTrans,sFlashVars,sID)
//{
//    var sObj = "";
//	var sWMode = "";
//	var sObjID = sSrc.replace(".swf","");
//	var sVars = "";
//	var sPrfx = "?";
//	if(sFlashVars){
//	    sVars = sFlashVars;
//	}
//	if(sID){
//	    sObjID = sID;
//	}else{
//	    sObjID = sSrc.replace(".swf","");
//	}
//	sObj = sObj+'	<embed height="' + sHeight + '" align="middle" width="' + sWidth + '" type="application/x-shockwave-flash" salign="" allowscriptaccess="sameDomain" allowfullscreen="false" menu="true" name="icons_acc" bgcolor="#ffffff" devicefont="false" wmode="window" scale="showall" loop="true" play="true" pluginspage="http://www.macromedia.com/go/getflashplayer" quality="high" src="' + sSrc + '"/>';
//    sObj = sObj+'    <noscript>';
//    sObj = sObj+'  <object style="position:absolute; top:0px; z-index:-10;" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="' + sWidth + '" height="' + sHeight + '" id="' + sID + '" align="middle"> ';
//    sObj = sObj+'    <param name="allowScriptAccess" value="sameDomain" />';
//    sObj = sObj+'    <param name="allowFullScreen" value="false" />';
//    sObj = sObj+'    <param name="movie" value="' + sSrc + '" />';
//    sObj = sObj+'    <param name="quality" value="high" />';
//    sObj = sObj+'    <param name="bgcolor" value="#ffffff" />';
//    if(bTrans == true){
//		sObj = sObj+"<PARAM NAME='WMode' VALUE='Transparent'>";
//		sWMode = "wmode='transparent'";
//	}
//    sObj = sObj+'    <embed src="' + sSrc + '" quality="high" bgcolor="#ffffff" width="' + sWidth + '" height="' + sHeight + '" name="' + sID + '" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
//    sObj = sObj+'    </object>';
//    sObj = sObj+'    </noscript>';
//    
//	
//	DocumentWrite(sObj);
//}

function intro()
{
    document.getElementById('topBar_Default').style.visibility='visible';
}

function doSearchPage()
{
   var term = document.getElementById('txtSearchInput').value;
   var termControl = document.getElementById('txtSearchInput');
   if(term=='' || term== 'Please Enter Text')
   {
        termControl.value='Please Enter Text';
        
   }
   else
   {
        window.location = 'SearchResults.aspx?SearchTerm='+ escape(term);
   }
   return false;
}

function focusMocus(elemID)
{
    alert(elemID);
}

function showArisonHomeTab(tabID)
{
    document.getElementById('tashtiotButtonContent').style.display='none';
    document.getElementById('financeButtonContent').style.display='none';
    document.getElementById('WaterButtonContent').style.display='none';
    document.getElementById('OtherButtonContent').style.display='none';
  
    //document.getElementById('tashtiotButton').src = 'Images/Home/Buttons/TashtiotButton_Off.png';
    //document.getElementById('financeButton').src = 'Images/Home/Buttons/FinanceButton_Off.png';
    //document.getElementById('WaterButton').src = 'Images/Home/Buttons/WaterButton_Off.png';
    //document.getElementById('OtherButton').src = 'Images/Home/Buttons/OtherButton_Off.png';
    
    if(document.getElementById(tabID))
    {
        var src = document.getElementById(tabID).src;
        //document.getElementById(tabID).src = src.replace('Off', 'On');
        document.getElementById(tabID + 'Content').style.display = '';
        if (document.getElementById(tabID + '_H4') != null) {
            document.getElementById(tabID + '_H4').style.display = '';
            document.getElementById(tabID + '_H4').focus();
            document.getElementById(tabID + '_H4').className = 'H2Homepage';
        }
      
        //document.getElementById(tabID + '_H4').style.display='none';
    }
    return false;
}

function ShowGlobalTab(tabId)
{
    document.getElementById('Div_01').style.display = 'none';
    document.getElementById('Div_02').style.display = 'none';
    document.getElementById('Div_03').style.display = 'none';
    document.getElementById('Div_04').style.display = 'none';
    
    if(document.getElementById('company_01'))
    {
        document.getElementById('company_01').style.display = 'none';
        document.getElementById('company_02').style.display = 'none';
        document.getElementById('company_03').style.display = 'none';
        document.getElementById('company_04').style.display = 'none';
        document.getElementById('company_' + tabId).style.display = '';
    }
    
    document.getElementById('Div_' + tabId).style.display='';
	document.getElementById('globaltab-' + tabId).focus();
  //  document.getElementById('GlobalTabsMainDiv').style.backgroundImage='url(images/Buttons/btn_' + tabId + '.png)';
    document.getElementById('GlobalTabsMainDiv').style.backgroundImage = 'url(images/bg/bg_' + tabId + '.png)';
 
    if(tabId=='4')
    {
        document.getElementById('company_04').style.display = 'none';
    }
}

function showAboutMoreContent()
{
    if(document.getElementById('aboutcontent').style.display=='none')
    {
        document.getElementById('aboutcontent').style.display='';
        document.getElementById('aboutMoreContent').style.display='none';
    }
    else
    {
        document.getElementById('aboutcontent').style.display='none';
        document.getElementById('aboutMoreContent').style.display='';    
    }
}

function AAA(fontSize, bCheck)
{
    document.body.style.fontSize = fontSize + 'px';

    if (fontSize == 16) {
        FixBigFont();
    }

    if (fontSize == 14) {
        FixMediumFont();
    }

    if (fontSize == 12) {
        FixSmallFont();
    }
    
    
    if(document.getElementById('MainContentPage'))
    {
        CheckBackground();
    }
    highlightAAALink('12', false);
    highlightAAALink('14', false);   
    highlightAAALink('16', false);
    if(document.getElementById('aLink_' + fontSize))
    {
        highlightAAALink(fontSize, true);
    }

    if (document.getElementById('ctl00_aLink_' + fontSize)) {
        highlightAAALink(fontSize, true);
    }
    
    setCookieAAA('AAAsize', fontSize, 365);
//    if (!bCheck) {
//        window.location = window.location;
//    }

    SetTopMenuPosition(fontSize);

}

function FixBigFont() {


    if (window.location.href.indexOf("Business-Environmental+Policy") != -1) {
     
            var obj = document.getElementById("pagePathDiv");
            if (obj != null) {
                obj.style.fontSize = "15px";
            }

            obj = document.getElementById("sideMenuTbl");
            if (obj != null) {
                obj.style.fontSize = "15px";
            }
        }

        if (window.location.href.indexOf("TeamMember=28") != -1) {

         
            var obj = document.getElementById("pagePathDiv");
            if (obj != null) {
                obj.style.fontSize = "15px";
            }

        }

        if (window.location.href.indexOf("TeamMember=27") != -1) {


            var obj = document.getElementById("pagePathDiv");
            if (obj != null) {
                obj.style.fontSize = "15px";
            }

        }


        if (window.location.href.indexOf("Arison+Investments'+Values") != -1) {

            var obj = document.getElementById("pagePathDiv");
            if (obj != null) {
                obj.style.fontSize = "15px";
            }
            
        }
        
        if (window.location.href.toLowerCase().indexOf("invest+in+sustainability") != -1) {
            var obj = document.getElementById("sideMenuTbl");
            if (obj != null) {
                obj.style.fontSize = "15px";
            }
        }

        if (window.location.href.indexOf("Looking+Towards+the+Future") != -1) {
            var obj = document.getElementById("pagePathDiv");
            if (obj != null) {
                obj.style.fontSize = "15px";
            }
        }

        var obj = document.getElementById("chromemenu");
        if (obj != null) {
            obj.style.fontSize = "15px";
        }


    }

    function FixMediumFont() {


        if (window.location.href.indexOf("Business-Environmental+Policy") != -1) {

            var obj = document.getElementById("pagePathDiv");
            if (obj != null) {
                obj.style.fontSize = "14px";
            }

            obj = document.getElementById("sideMenuTbl");
            if (obj != null) {
                obj.style.fontSize = "14px";
            }
        }

        if (window.location.href.indexOf("Arison+Investments'+Values") != -1) {

            var obj = document.getElementById("pagePathDiv");
            if (obj != null) {
                obj.style.fontSize = "14px";
            }

        }

        if (window.location.href.indexOf("TeamMember") != -1) {


            var obj = document.getElementById("pagePathDiv");
            if (obj != null) {
                obj.style.fontSize = "14px";
            }

        }


        if (window.location.href.toLowerCase().indexOf("invest+in+sustainability") != -1) {
            var obj = document.getElementById("sideMenuTbl");
            if (obj != null) {
                obj.style.fontSize = "14px";
            }
        }

        if (window.location.href.indexOf("Looking+Towards+the+Future") != -1) {
            var obj = document.getElementById("pagePathDiv");
            if (obj != null) {
                obj.style.fontSize = "14px";
            }
        }

        var obj = document.getElementById("chromemenu");
        if (obj != null) {
            obj.style.fontSize = "14px";
        }


    }


    function FixSmallFont() {


        if (window.location.href.indexOf("Business-Environmental+Policy") != -1) {

            var obj = document.getElementById("pagePathDiv");
            if (obj != null) {
                obj.style.fontSize = "12px";
            }

            obj = document.getElementById("sideMenuTbl");
            if (obj != null) {
                obj.style.fontSize = "12px";
            }
        }

        if (window.location.href.indexOf("TeamMember=") != -1) {

          
            var obj = document.getElementById("pagePathDiv");
            if (obj != null) {
                obj.style.fontSize = "12px";
            }

        }

        if (window.location.href.indexOf("Arison+Investments'+Values") != -1) {

            var obj = document.getElementById("pagePathDiv");
            if (obj != null) {
                obj.style.fontSize = "12px";
            }

        }

        if (window.location.href.toLowerCase().indexOf("invest+in+sustainability") != -1) {
            var obj = document.getElementById("sideMenuTbl");
            if (obj != null) {
                obj.style.fontSize = "12px";
            }
        }

        if (window.location.href.indexOf("Looking+Towards+the+Future") != -1) {
            var obj = document.getElementById("pagePathDiv");
            if (obj != null) {
                obj.style.fontSize = "12px";
            }
        }

        var obj = document.getElementById("chromemenu");
        if (obj != null) {
            obj.style.fontSize = "12px";
        }


    }

function SetTopMenuPosition(fontSize) {

    var topPosition = 0;

    if (fontSize == 14) {
        topPosition = -1;
    }

    if (fontSize == 16) {
        topPosition = -2;
    }

    for (var i = 1; i<=4 ; i++) {
        var obj = document.getElementById("topMenuDiv" + i);
        if (obj != null) {
            obj.style.top = topPosition + "px";
        }
    }

}


function highlightAAALink(fontSize, bHighLight)
{
    if(document.getElementById('aLink_' + fontSize))
    {
        if(bHighLight)
        {
            document.getElementById('aLink_' + fontSize).className = 'aaaHigh';
        }else{
            document.getElementById('aLink_' + fontSize).className = 'aaaLow';
        }
    }

    if (document.getElementById('ctl00_aLink_' + fontSize)) {

        if (bHighLight) {
            document.getElementById('ctl00_aLink_' + fontSize).className = 'aaaHigh';
        } else {
            document.getElementById('ctl00_aLink_' + fontSize).className = 'aaaLow';
        }
    }
}
function goToHome()
{
    window.location.href='Default.aspx';
}
function positionFooterArisonInvest()
{
    var oFooter = document.getElementById('myPageFooter');
    //oFooter.style.position='relative';
    //oFooter.style.top='100px';
}
function positionFooter()
{
    var oFooter = document.getElementById('myPageFooter');
    oFooter.style.position='absolute';
    oFooter.style.top='650px';
}
function CheckBackgroundHomePage()
{
    var innerHeight = document.getElementById('Home_Aspx').offsetHeight;
    var oFooter = document.getElementById('myPageFooter');
    oFooter.style.position='absolute';
    oFooter.style.top='600px';
}

function CheckBackground()
{
    var sideHeight = document.getElementById('sideBarContainer').offsetHeight;
    var myHeight = document.getElementById('measureHeight').offsetHeight;
    var innerHeight = document.getElementById('MainContentPage').offsetHeight;
    var innerHeight2 = document.getElementById('innerMainBAckgroundDiv').offsetHeight;
    if(innerHeight < 300)
    {
        document.getElementById('innerMainBAckgroundDiv').style.height = (innerHeight + 450) +'px';
    }else{
        document.getElementById('innerMainBAckgroundDiv').style.height = (innerHeight + 50) +'px';
    }
    
    myHeight = document.getElementById('measureHeight').offsetHeight;
    document.getElementById('bgCenter').style.height = myHeight - 50 + 'px';
    var footerTop = document.getElementById('myPageFooter').style.top;
    document.getElementById('myPageFooter').style.top = (innerHeight2 + 250) + 'px'
}

function checkBG()
{
    var sHeight = document.getElementById('measureBgHeight_Div').offsetHeight;
    //document.getElementById('myPageFooter').style.top=sHeight-40+'px';
}

// function showDrop(dropName)
// {
    // switch(dropName)
    // {
    // case 'About':
       // closeAllDrops();
       // document.getElementById('aboutDrop_Div').style.display='';
       // document.getElementById('aboutTable').focus();
      // break;    
    // case 'Group':
      // closeAllDrops();
      // document.getElementById('groupDrop_Div').style.display='';
      // document.getElementById('groupTable').focus();
      // break;
    // case 'Kayamut':
      // closeAllDrops();
      // document.getElementById('kayamutDrop_Div').style.display='';
      // document.getElementById('kayamutTable').focus();
      // break;      
    // default:f
        // return;
        // break;
    // }
// }

function setFocus(elemID)
{
    if(document.getElementById(elemID))
    {
        document.getElementById(elemID).focus();
    }
}

/* //jQuery specific scripts */

function highlightTD(divID, bTrue)
{
    if(bTrue)
    {
        if(document.getElementById(divID))
        {
            document.getElementById(divID).className='linkRowHighligt';
        }    
    }else{
        if(document.getElementById(divID))
        {
            document.getElementById(divID).className='linkRow';
        }        
    }
}

function getTargetElement(evt) {
    var elem
    if (evt.target) {
        elem = (evt.target.nodeType == 3) ? evt.target.parentNode : evt.target
    } else {
        elem = evt.srcElement
    }
    return elem

}

function setFocusIn(e)
{
    var elem = getTargetElement(e);
}

function goToPage(url)
{
    window.location = url;
}

function doFocusOut(elementID)
{
    alert(elementID);
}
function SetEnterSearch(event)
{
    if(event.keyCode == 13)
    {
        doSearchPage();
        return false;
    }else{
        return true;
    }
}
function SetEnter(e,sTargetID)
{
    var oTarget = document.getElementById(sTargetID);
    var iEnter = 13;
    if(oTarget != null){
        switch(e.keyCode){
	        case iEnter: 
	            if(oTarget.name == ""){
	                __doPostBack(oTarget.id.replace(/_/g,"$"), "");
	            }else{
	                runCmdClick(oTarget);
	            }
	            break;
        }
    }
}
function runCmdClick(oCmd){
    
    if (IsMicrosoft())
    {
	    // IE
	    oCmd.click();
    }
    else
    {
	    // FireFox
	    var e = document.createEvent("MouseEvents");
	    e.initEvent("click", true, true);
	    oCmd.dispatchEvent(e);
    }
}

function setCookieAAA(c_name,value,expiredays)
{
    var exdate=new Date();exdate.setDate(exdate.getDate()+expiredays);
    document.cookie=c_name+ "=" +escape(value)+
    ((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

function getCookieAAA(c_name)
{
if (document.cookie.length>0)
  {
    c_start=document.cookie.indexOf(c_name + "=");
    if (c_start!=-1)
    { 
        c_start=c_start + c_name.length+1; 
        c_end=document.cookie.indexOf(";",c_start);
        if (c_end==-1) c_end=document.cookie.length;
        return unescape(document.cookie.substring(c_start,c_end));
    } 
  }
  return "";
} 

function checkCookieAAA()
{
    var fSize = getCookieAAA('AAAsize');
    if(fSize != "")
    {
        AAA(fSize, true);
    }
}

function showME(elemID, bShow)
{
    if(document.getElementById(elemID))
    {
        if(bShow)
        {
            document.getElementById(elemID).style.display='';
        }else{
            document.getElementById(elemID).style.display='none';
        }
    }
}

function bodyKeyDown(e)
{
    if(e.keyCode == 9)
    {
        showME('siteMapLinkShow', true);
        showME('moveToContent', true);
        showME('accessPage', true);
    }
}
// function closeAllLis(elemID)
// {
    // var items = document.getElementById(elemID).getElementsByTagName('li');
        // for(var i=0; i<items.length; i++)
        // {
            // var oObj = document.getElementById(elemID).getElementsByTagName('li')[i];
            // if(oObj.className == 'listItem_TopBar')
            // {
                // oObj.style.display='none';
            // }
        // }      
// }
// function focusList(e, elementID)
// {
    // var elemID_UL = '';
        
    // if(elementID=='About')
    // {
        // elemID_UL = 'aboutUL';
        // closeAllLis('groupUL');
        // closeAllLis('kayamutUL');
    // }
    // if(elementID=='Group')
    // {
        // elemID_UL = 'groupUL';    
        // closeAllLis('aboutUL');
        // closeAllLis('kayamutUL');        
    // }
    // if(elementID=='Kayamut')
    // {
        // elemID_UL = 'kayamutUL';    
        // closeAllLis('aboutUL');
        // closeAllLis('groupUL');             
    // }
    // if(elementID=='Search')
    // {
        // closeAllLis('aboutUL');
        // closeAllLis('groupUL');        
        // closeAllLis('kayamutUL');    
    // }
    
    // if(document.getElementById(elemID_UL))
    // {
        // var items  = document.getElementById(elemID_UL).getElementsByTagName('li');
        // for(var i=0; i<items.length; i++)
        // {
            // var oObj = document.getElementById(elemID_UL).getElementsByTagName('li')[i];
            // if(oObj.className == 'listItem_TopBar')
            // {
                // oObj.style.display='block';
            // }
        // }    
    // }
// }

function placeFooterContact()
{
    var oFooter = document.getElementById('myPageFooter');
    if(document.getElementById('myPageFooter'))
    {
        oFooter.style.position='absolute';
        oFooter.style.top='650px';
    }
}

function showFirstArisonHomeTab()
{
    showArisonHomeTab('financeButton');
}
function goToContentSkipAll()
{
    var oObj = document.getElementById('ContentPageH1');
    if(oObj)
    {
        oObj.focus();
    }else{
        alert('בדף זה לא קיים המנגנון של דילוג לתוכן');
    }
}

function really_out(src) {


  
//    if (isIe6()) {
//       var target = event.target || event.srcElement;

//       if (!target) {
//           return false;
//       } 
//    }
   
 

    if (!window.event) 
    return true;  
    var event = window.event;  
    var from = event.fromElement;
    var to = event.toElement;

    if (to.id == "topMenuDiv1" || to.id == "topMenuDiv2" || to.id == "topMenuDiv3") return false;
   
    return ((src == from || src.contains(from)) && !src.contains(to) && src != to);
}


function AAAHome(fontSize) {

        setCookieAAA('AAAsize', fontSize, 365);
        window.location = window.location;
    
}

function checkSidebarDivs()
{
    var oObj = document.getElementById('SideBarContainer');
    if(oObj)
    {
        var items = oObj.getElementsByTagName('div');
        alert(items.length);
        for(var i =0; i<items.length;i++)
        {
            var itemID = items[i].id;
            if(itemID.indexOf('pageTitle_'))
            {
                var oPageTitleDiv = document.getElementById(itemID);
                alert(oPageTitleDiv.offsetHeight);
                if(oPageTitleDiv)
                {
                    var itemPageDescID = itemID.substring(itemID.indexOf('_'), itemID.length);
                    if(itemPageDescID)
                    {
                        var oPageDesc = document.getElementById(itemPageDescID);
                        if(oPageDesc)
                        {
                            
                        }
                    }
                }
            }
        }
    }
}



    function isFirefox() {
        return navigator.userAgent.indexOf("Firefox") > -1;
    }

    function FixFireFox() {

        if (isFirefox()) {

            var obj = document.getElementById('countriesList');
            if (obj != null) {
                obj.style.left = "40px";
            }
            
        }
    }


    function FixIE6() {

        if (isIe6) {

//            var aboutUL = document.getElementById("aboutUL");
//            if (aboutUL != null) {
//                
//                aboutUL.onmousout = "";
//            }
            
        }

    }


    function isIe6() {
        var bIe6 = false;
        var version = 999; // we assume a sane browser    
        if (navigator.appVersion.indexOf("MSIE") != -1) {
            version = parseFloat(navigator.appVersion.split("MSIE")[1]);
            if (version < 7) {
                bIe6 = true;
            }
        }
        return bIe6
    }

