﻿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 showMeSystemMessageNotify()
{
    //
}

function HelloAvi(){
    document.getElementById('bgCenter').style.height='100px';
}


//Interetch: remove script form master to JS for MarkUp validation
function addFFStyles()
{
    //check if IE or FF
    if (!document.all)
    {
        document.write('<link rel="Stylesheet" type="text/css" href="Css/Firefox-Specific.css"/>');
    }
}


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)
            showMeSystemMessageNotify()						
			//alert("Please wait until document has fully loaded then click again")
		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)
			showMeSystemMessageNotify()
			//alert("Please wait until document has fully loaded then click again")
		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)
		showMeSystemMessageNotify()
		//alert("Please wait until document has fully loaded then click again")
	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") {
        if (document.getElementById('myMoreButton')) {
            document.getElementById('myMoreButton').style.display = '';
        }
    }
    else {
        document.getElementById('myMoreButton').style.display = 'none';
    }
    
}

function DocumentWrite(sHtml)
{
    //alert(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;' 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='allowFullScreen' value='true' />";
	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' allowFullScreen='true' allowScriptAccess='sameDomain' swLiveConnect=true ID='bg' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />";
	sObj = sObj+"</object>";
	
	DocumentWrite(sObj);
	
}
function intro()
{
    document.getElementById('topBar_Default').style.visibility='visible';
}
function Search()
{
   var term = document.getElementById('txtSrchTerm').value;
   var termControl = document.getElementById('txtSrchTerm');
   if(term=='')
   {
        termControl.value='חובה להכניס טקסט';
   }
   else
   {
        window.location = 'SearchResults.aspx?SearchTerm='+ escape(term);
   }
}

function AAA(fontSize) {

    document.body.style.fontSize = fontSize + 'px';
    //Do Fix
    switch (fontSize) {
        case "12":
            FixSmallFont();
            break;
        case "14":
            FixMediumFont();
            break;
        case "16":
            FixBigFont();
            break;
        default:
            break;
            
    }
    
    if(document.getElementById('MainContentPage'))
    {
        CheckBackground();
    }
    highlightAAALink('12', false);
    highlightAAALink('14', false);   
    highlightAAALink('16', false);
    if(document.getElementById('aLink_' + fontSize))
    {
        highlightAAALink(fontSize, true);
    }
    setCookieAAA('AAAsize', fontSize, 365);
}

function highlightAAALink(fontSize, bHighLight)
{
    if(document.getElementById('aLink_' + fontSize))
    {
        if(bHighLight)
        {
            document.getElementById('aLink_' + fontSize).className = 'aaaHigh';
        }else{
            document.getElementById('aLink_' + fontSize).className = 'aaaLow';
        }
    }
}



function CheckBackground()
{
    if(document.getElementById('innerMainBAckgroundDiv') && document.getElementById('MainContentPage') && document.getElementById('bgCenter'))
    {
        var myHeight = document.getElementById('MainContentPage').offsetHeight;
        document.getElementById('innerMainBAckgroundDiv').style.height = myHeight + 90 +'px';
        if(Math.round(Number(myHeight) - 350) > 0)
        {
            document.getElementById('bgCenter').style.height = myHeight - 350 + 'px';
        }else{
	       document.getElementById('bgCenter').style.height = 130 + 'px';
		}
    }else{
        return null;
    }
}

function showLargeImage(imgID)
{
    document.getElementById('LargeImage').style.display='';
    document.getElementById('LargeImageContainer').style.display='';
    document.getElementById('LargeImageFile').src = document.getElementById('imageBig_' + imgID).value;
    document.getElementById('currentShownImage').value = imgID;
    document.getElementById('imageText').innerHTML = document.getElementById('imageBigText_' + imgID).value;
    var mImgID = Math.round(imgID);
    document.getElementById('previousImage').href = 'javascript:showLargeImage(' + (mImgID - 1) + ')';
    document.getElementById('nextImage').href = 'javascript:showLargeImage(' + (mImgID + 1) + ')';
}

function closeImage()
{
    document.getElementById('LargeImage').style.display='none';
    document.getElementById('LargeImageContainer').style.display='none';
}

function showGlobalActivityTab(tabID)
{
    var i = 0;
    for (i=1;i<=4;i++)
    {
        document.getElementById('Global_0'+i+'_Tab').style.display='none';
        document.getElementById('GlobalContent_0'+i).style.display='none';
    }
    document.getElementById('Global_'+tabID+'_Tab').style.display='';
    document.getElementById('GlobalContent_'+tabID).style.display='';
	document.getElementById('globaltab-'+tabID).focus();
}

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 showAboutDefaultContent()
{
    setTimeout('showAboutDefaultContentOnDemand()', 1000);
}

function showAboutDefaultContentOnDemand()
{
    document.getElementById('aboutcontent').style.display='';
    document.getElementById('aboutMoreContent').style.display='none';  
}

function showFoundationMoreContent(fID)
{
    document.getElementById('FoundationMoreContent_0').style.display='none';
    document.getElementById('FoundationMoreContent_1').style.display='';
}

function showKayamutMoreContent(kID)
{
    for(var i=0; i < 4; i++)
    {
        if(document.getElementById('KayamutMorecontent_' + i))
        {
            document.getElementById('KayamutMorecontent_' + i).style.display='none';
        }
    }
    document.getElementById('KayamutMorecontent_' + kID).style.display='';
}

/*
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.className == 'listItem_TopBar2' || oObj.className == 'listItem_TopBar3') {
            oObj.style.display = 'none';
        }
    }
}
*/
//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');
//        closeAllLis('languageUL');    
//    }
//    if(elementID=='Group')
//    {
//        elemID_UL = 'groupUL';    
//        
//        closeAllLis('aboutUL');
//        closeAllLis('languageUL');
//        closeAllLis('kayamutUL');
//    }
// 
//    if(elementID=='Kayamut')
//    {
//        elemID_UL = 'kayamutUL';    
//        
//        closeAllLis('aboutUL');
//        closeAllLis('groupUL');
//        closeAllLis('languageUL');
//    }
// 
//    if(elementID=='Language')
//    {
//        elemID_UL = 'languageUL';
//        
//        closeAllLis('aboutUL');
//        closeAllLis('groupUL');
//        closeAllLis('kayamutUL');
//    }
// 
//    if(elementID=='Search')
//    {
//        closeAllLis('aboutUL');
//        closeAllLis('groupUL');
//        closeAllLis('kayamutUL');
//        closeAllLis('languageUL');    
//    }
//    
//    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 focusList(e, elementID) {

    // var b3Level = false;
    // var elemID_UL = '';
        
    // if(elementID=='About')
    // {
        // elemID_UL = 'aboutUL';
        
        // closeAllLis('groupUL');
        // closeAllLis('kayamutUL');
        // closeAllLis('languageUL');
        // closeAllLis('bussPhilantropyUL');
        // closeAllLis('awarenessUL');
        // closeAllLis('communicationUL');               
    // }
    // if(elementID=='Group')
    // {
        // elemID_UL = 'groupUL';    
        
        // closeAllLis('aboutUL');
        // closeAllLis('languageUL');
        // closeAllLis('kayamutUL');
        // closeAllLis('awarenessUL');
        // closeAllLis('communicationUL');           
    // }
 
    // if(elementID=='Kayamut')
    // {
        // elemID_UL = 'kayamutUL';    
        
        // closeAllLis('aboutUL');
        // closeAllLis('groupUL');
        // closeAllLis('languageUL');
        // closeAllLis('bussPhilantropyUL');
        // closeAllLis('awarenessUL');
        // closeAllLis('communicationUL');          
    // }
 
    // if(elementID=='Language')
    // {
        // elemID_UL = 'languageUL';
        
        // closeAllLis('aboutUL');
        // closeAllLis('groupUL');
        // closeAllLis('kayamutUL');
        // closeAllLis('bussPhilantropyUL');      
    // }
 
    // if(elementID=='Search')
    // {
        // closeAllLis('aboutUL');
        // closeAllLis('groupUL');
        // closeAllLis('kayamutUL');
        // closeAllLis('languageUL');
        // closeAllLis('bussPhilantropyUL');
        // closeAllLis('awarenessUL');
        // closeAllLis('communicationUL');      
    // }

    // if (elementID == 'BussPhilantropy') {
        // elemID_UL = 'bussPhilantropyUL';
        // b3Level = true;
    // }

    // if (elementID == 'Awareness') {
        // elemID_UL = 'awarenessUL';
        // b3Level = true;
        // closeAllLis('communicationUL');
    // }

    // if (elementID == 'Communication') {
        // elemID_UL = 'communicationUL';
        // b3Level = true;
        // closeAllLis('awarenessUL');
        // closeAllLis('sustainabilityUL');
    // }


    // if (elementID == 'Sustainability') {
        // elemID_UL = 'sustainabilityUL';
        // b3Level = true;
        // closeAllLis('communicationUL');
    // }
    
    
    
    // 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.className == 'listItem_TopBar2' )
            // {
                // oObj.style.display='block';
            // }
            
            // if (b3Level &&  oObj.className == 'listItem_TopBar3')
            // {
                // oObj.style.display = 'block';
            // }
        // }    
    // }
// }


function doSearch()
{
    if(document.getElementById('txtSearch'))
    {
        var srch=document.getElementById('txtSearch').value;
        //intertech: popup alert dialog
        //if(srch!='' && srch != 'חובה להכניס מילת חיפוש')
        if(srch!='')
        {
            window.location='SearchResults.aspx?SearchTerm='+escape(srch);
        }else{
            //document.getElementById('txtSearch').value='חובה להכניס מילת חיפוש';
            alert("Search text is required"); 
        }
    }
}

function globalIE6Fix()
{
    var version = 999; // we assume a sane browser    
    if (navigator.appVersion.indexOf("MSIE") != -1)
    {
        version = parseFloat(navigator.appVersion.split("MSIE")[1]);    
        if(version < 7)
        {
            if(document.getElementById('globalImageLower'))
				document.getElementById('globalImageLower').style.right='13px';
			if(document.getElementById('globalHeaderLower'))
	            document.getElementById('globalHeaderLower').style.right='10px';
			if(document.getElementById('mainContentLoweTab'))
	            document.getElementById('mainContentLoweTab').style.right='25px';
        }
	}
	if(document.getElementById('GlobalActivities_Aspx') && document.getElementById('GlobalActivitiesLoweTab'))
	{
		var height1 = document.getElementById('GlobalActivities_Aspx').offsetHeight;
		var height2 = document.getElementById('GlobalActivitiesLoweTab').offsetHeight;
		
		document.getElementById('bgCenter').style.height=Number(height1)+Number(height2)-420+'px';
		
	}
}

function setEnter(e, elementID)
{
    if(e.keyCode == 13)
    {
        var s = document.getElementById(elementID).value;
        doSearch();
        return false;
    }
}
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);
    }
    else
    {
        AAA("12");
    }
}
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);
    }
}


//Intertech: Added missing code from hebrew site
function HighlightSearch(bHighlight) 
{
    var obj = document.getElementById("imgSearch");
    if (obj != null) {

        if (bHighlight) {
            obj.src = "images/magnify_RollOver.jpg";
        } else {
        obj.src = "images/magnify.jpg";   
        }
        
    }

}


function checkSidebarDivs()
{
    var oObj = document.getElementById('SideBarContainer');
    if(oObj)
    {
        var items = oObj.getElementsByTagName('div');
        for(var i=0; i<items.length;i++)
        {
            var itemID = items[i].id;
            if(itemID != null)
            {
                if(itemID.indexOf('pageTitle_') > -1)
                {
                    var oPageTitleDiv = document.getElementById(itemID);
                    if(oPageTitleDiv)
                    {
                        var itemPageDescID = itemID.substring(itemID.indexOf('_'), itemID.length);
                        if(itemPageDescID)
                        {
                            var oPageDesc = document.getElementById(itemPageDescID);
                            if(oPageDesc)
                            {
                                
                            }
                        }
                    }
                }            
            }
        }
    }
}


function FixBigFont() {

    // Fix 2nd Level Menus

    var subMenu = document.getElementById("bussPhilantropyUL");
    if (subMenu != null) {
        subMenu.style.top = "196px";

    }

    subMenu = document.getElementById("awarenessUL");
    if (subMenu != null) {
        subMenu.style.top = "18px";

    }

    subMenu = document.getElementById("communicationUL");
    if (subMenu != null) {
        subMenu.style.top = "49px";

    }

    subMenu = document.getElementById("sustainabilityUL");
    if (subMenu != null) {
        subMenu.style.top = "80px";

    }


    ///

    
    //General Fix
    
    var objs = ["chromemenu","moreLinks", "financeTab", "nadlanTab", "waterTab", "otherTab"];
    for (var i = 0; i < objs.length; i++) {
       var obj =  document.getElementById(objs[i]);
       if (obj != null) {
           obj.style.fontSize = "15px";
       }
   }

   objs = [];
   for (var i = 0; i < objs.length; i++) {
       var obj = document.getElementById(objs[i]);
       if (obj != null) {
           obj.style.fontSize = "14px";
       }
   }
   
   
   //Fix Sidebar
   
    var pageName = document.getElementById("SidePageName_0");
    if (pageName != null) {

        // ---------------------

        if (pageName.innerHTML.indexOf("Group Profile") != -1) {
            obj = document.getElementById("SideRow_3");
            if (obj != null) {
                obj.className = "RowAlt2";
            }
        }

        // ---------------------


        if (pageName.innerHTML.indexOf("Philanthropy in the Business") != -1) {
            obj = document.getElementById("SideRow_0");
            if (obj != null) {
                obj.className = "RowReg2";
            }
            obj = document.getElementById("SideRow_3");
            if (obj != null) {
                obj.className = "RowAlt2";
            }
        }

        // ---------------------

        
        if (pageName.innerHTML.indexOf("The Ted Arison") != -1) {
            obj = document.getElementById("SideRow_0");
            if (obj != null) {
                obj.className = "RowReg2";
            }
        }

        // ---------------------

        if (pageName.innerHTML.indexOf("Awareness") != -1) {
            obj = document.getElementById("SideRow_4");
            if (obj != null) {
                obj.className = "RowReg2";
            }
        }

        // ---------------------

        if (pageName.innerHTML.indexOf("Communication") != -1) {
            obj = document.getElementById("SideRow_1");
            if (obj != null) {
                obj.className = "RowAlt2";
            }
            obj = document.getElementById("SideRow_2");
            if (obj != null) {
                obj.className = "RowReg2";
            }
        }

        // ---------------------

        if (pageName.innerHTML.indexOf("Arison Investments Profile") != -1) {
         
            obj = document.getElementById("SideRow_4");
            if (obj != null) {
                obj.className = "RowReg2";
            }
        }

        // ---------------------

        if (pageName.innerHTML.indexOf("Sustainability") != -1) {
            obj = document.getElementById("SideRow_1");
            if (obj != null) {
                obj.className = "RowAlt2";
            }
            obj = document.getElementById("SideRow_3");
            if (obj != null) {
                obj.className = "RowAlt2";
            }
            obj = document.getElementById("SideRow_4");
            if (obj != null) {
                obj.className = "RowReg2";
            }
            obj = document.getElementById("SideRow_2");
            if (obj != null) {
                obj.className = "RowReg2";
                obj.style.fontSize = "15px";
            }
        }
		
		if (pageName.innerHTML.indexOf("Birth – When the Spiritual and the Material Come Together") != -1) {
            obj = document.getElementById("SideRow_0");
            if (obj != null) {
                obj.className = "RowReg2";
            }
        }   
		
    }


     
    
    // Fix Content fonts

    var pageInnerContent = document.getElementById("pageInnerContent");
    if ((window.location.href.indexOf("Terms+Of+Use") != -1) && (pageInnerContent != null)) {
        pageInnerContent.style.fontSize = "15px";
        pageInnerContent.style.width = "460px";
    }

    
    

   
}



function FixMediumFont() {


    // Fix 2nd Level Menus

    var subMenu = document.getElementById("bussPhilantropyUL");
    if (subMenu != null) {
        subMenu.style.top = "180px";

    }

    subMenu = document.getElementById("awarenessUL");
    if (subMenu != null) {
        subMenu.style.top = "16px";

    }

    subMenu = document.getElementById("communicationUL");
    if (subMenu != null) {
        subMenu.style.top = "45px";

    }

    subMenu = document.getElementById("sustainabilityUL");
    if (subMenu != null) {
        subMenu.style.top = "74px";

    }


    ///

    

    var objs = ["chromemenu", "moreLinks", "financeTab", "nadlanTab", "waterTab", "otherTab"];
    for (var i = 0; i < objs.length; i++) {
        var obj = document.getElementById(objs[i]);
        if (obj != null) {
            obj.style.fontSize = "14px";
        }
    }

    var pageName = document.getElementById("SidePageName_0");
    if (pageName != null) {
    
        // --------------------------
        if (pageName.innerHTML.indexOf("Group Profile") != -1) {
            obj = document.getElementById("SideRow_3");
            if (obj != null) {
                obj.className = "RowAlt";
            }
        }
        
        // ---------------------------
        if (pageName.innerHTML.indexOf("Philanthropy in the Business") != -1) {
            obj = document.getElementById("SideRow_0");
            if (obj != null) {
                obj.className = "RowReg2";
            }
            obj = document.getElementById("SideRow_3");
            if (obj != null) {
                obj.className = "RowAlt2";
            }


        }

        // ---------------------

        if (pageName.innerHTML.indexOf("Arison Investments Profile") != -1) {

            obj = document.getElementById("SideRow_4");
            if (obj != null) {
                obj.className = "RowReg2";
            }
        }

        
        // ----------------------
        
        if (pageName.innerHTML.indexOf("The Ted Arison") != -1) {
            obj = document.getElementById("SideRow_0");
            if (obj != null) {
                obj.className = "RowReg";
            }
        }

        // ---------------------

        if (pageName.innerHTML.indexOf("Awareness") != -1) {
            obj = document.getElementById("SideRow_4");
            if (obj != null) {
                obj.className = "RowReg2";
            }
        }

        // ---------------------

        if (pageName.innerHTML.indexOf("Communication") != -1) {
            obj = document.getElementById("SideRow_1");
            if (obj != null) {
                obj.className = "RowAlt2";
            }
            obj = document.getElementById("SideRow_2");
            if (obj != null) {
                obj.className = "RowReg2";
            }
        }

        // ---------------------

        if (pageName.innerHTML.indexOf("Sustainability") != -1) {
            obj = document.getElementById("SideRow_1");
            if (obj != null) {
                obj.className = "RowAlt";
            }
            obj = document.getElementById("SideRow_3");
            if (obj != null) {
                obj.className = "RowAlt2";
            }
            obj = document.getElementById("SideRow_4");
            if (obj != null) {
                obj.className = "RowReg2";
            }
            obj = document.getElementById("SideRow_2");
            if (obj != null) {
                obj.className = "RowReg2";
                obj.style.fontSize = "14px";
            }
        }

    }

    var pageInnerContent = document.getElementById("pageInnerContent");
    if ((window.location.href.indexOf("Terms+Of+Use") != -1) && (pageInnerContent != null)) {
        pageInnerContent.style.fontSize = "14px";
        pageInnerContent.style.width = "450px";
    }
}

function FixSmallFont() {


    // Fix 2nd Level Menus

    var subMenu = document.getElementById("bussPhilantropyUL");
    if (subMenu != null) {
        subMenu.style.top = "156px";

    }

    subMenu = document.getElementById("awarenessUL");
    if (subMenu != null) {
        subMenu.style.top = "15px";

    }

    subMenu = document.getElementById("communicationUL");
    if (subMenu != null) {
        subMenu.style.top = "43px";

    }

    subMenu = document.getElementById("sustainabilityUL");
    if (subMenu != null) {
        subMenu.style.top = "71px";

    }


    ///

    

    var objs = ["chromemenu", "moreLinks", "financeTab", "nadlanTab", "waterTab", "otherTab"];
    for (var i = 0; i < objs.length; i++) {
        var obj = document.getElementById(objs[i]);
        if (obj != null) {
            obj.style.fontSize = "12px";
        }
    }

    var obj = document.getElementById("SidePageName_0");
    if (obj != null) {
    
         // -------------------
        if (obj.innerHTML.indexOf("Group Profile") != -1) {
            obj = document.getElementById("SideRow_3");
            if (obj != null) {
                obj.className = "RowAlt";
            }
        }
        // ---------------------
        if (obj.innerHTML.indexOf("Philanthropy in the Business") != -1) {
            obj = document.getElementById("SideRow_0");
            if (obj != null) {
                obj.className = "RowReg";
            }
            obj = document.getElementById("SideRow_3");
            if (obj != null) {
                obj.className = "RowAlt";
            }
        }
        // ----------------------
        if (obj.innerHTML.indexOf("The Ted Arison") != -1) {
            obj = document.getElementById("SideRow_0");
            if (obj != null) {
                obj.className = "RowReg";
            }
        }

        // ---------------------

        if (obj.innerHTML.indexOf("Awareness") != -1) {
            obj = document.getElementById("SideRow_4");
            if (obj != null) {
                obj.className = "RowReg";
            }
        }

        // ---------------------

        if (obj.innerHTML.indexOf("Arison Investments Profile") != -1) {

            obj = document.getElementById("SideRow_4");
            if (obj != null) {
                obj.className = "RowReg";
            }
        }


        // ---------------------

        if (obj.innerHTML.indexOf("Communication") != -1) {
            obj = document.getElementById("SideRow_1");
            if (obj != null) {
                obj.className = "RowAlt";
            }
            obj = document.getElementById("SideRow_2");
            if (obj != null) {
                obj.className = "RowReg";
            }
        }


        // ---------------------

        if (obj.innerHTML.indexOf("Sustainability") != -1) {
            obj = document.getElementById("SideRow_1");
            if (obj != null) {
                obj.className = "RowAlt";
            }
            obj = document.getElementById("SideRow_3");
            if (obj != null) {
                obj.className = "RowAlt2";
            }
            obj = document.getElementById("SideRow_4");
            if (obj != null) {
                obj.className = "RowReg2";
            }
            obj = document.getElementById("SideRow_2");
            if (obj != null) {
                obj.className = "RowReg2";
                obj.style.fontSize = "12px";
            }
        }

		if (obj.innerHTML.indexOf("Birth – When the Spiritual and the Material Come Together") != -1) {
            obj = document.getElementById("SideRow_0");
            if (obj != null) {
                obj.className = "RowReg2";
            }
        }
		
		if (obj.innerHTML.indexOf("Freedom comes from within") != -1) {
            obj = document.getElementById("SideRow_2");
            if (obj != null) {
                obj.className = "RowReg2";
            }
        }
    }

    var pageInnerContent = document.getElementById("pageInnerContent");
    if ((window.location.href.indexOf("Terms+Of+Use") != -1) && (pageInnerContent != null)) {
        pageInnerContent.style.fontSize = "12px";
        pageInnerContent.style.width = "450px";
    }


  
}
function AAACheck(fontSize) {

    alert("AAACheck" + " Location = " + window.location + "\r\nReload = " + IsPostbackPage(window.location))  
    if (IsPostbackPage(window.location)) {
        setCookieAAA('AAAsize', fontSize, 365);
        window.location = window.location;
    } else {
    AAA(fontSize);
    }
    
    
}


function IsPostbackPage(url) {

    if (url.toString().indexOf("Philanthropy+in+the+Business") != -1) {
        return true;
    }

    if (url.toString().indexOf("Poalim+in+the+Community") != -1) {
        return true;
    }

    if (url.toString().indexOf("For+a+Greener+Environment") != -1) {
        return true;
    }

    if (url.toString().indexOf("Industry+with+Social+Responsibility") != -1) {
        return true;
    }
    
//    if (url.toString().indexOf("Essence+of+Life.") != -1) {
//        return true;
//    }


    if (url.toString().indexOf("Communication") != -1) {
        return true;
    }

    if (url.toString().indexOf("Sustainability") != -1) {
        return true;
    }
    
    if (url.toString().indexOf("Awareness") != -1) {
        return true;
    }

    if ((url.toString().indexOf("Environmental+Policy") != -1) && (url.toString().indexOf("Global+Business") == -1)) {
        return true;
    }

    if (url.toString().indexOf("All+One.") != -1) {
        return true;
    }



    return false;
}

function really_out(src) {
    if (!window.event)
        return true;
    var event = window.event;
    var from = event.fromElement;
    var to = event.toElement;
    if (to.className == "topMenuDiv2") {
        return false;
    }
  
    if (to.src) {
        if ((to.src.indexOf("transparent") != -1) && (!clickedOutsideElement('bussPhilantropyUL'))) return false;
    }

    return (src == from || src.contains(from)) && !src.contains(to) && src != to;
}


