
//************************** FONT INCREASE DECREASE CODE BEGINS *************************************//
var min=11;
var max=18;

document.getElementsByClassName = function(clsName){
    var retVal = new Array();
    var elements = document.getElementsByTagName("*");
    for(var i = 0;i < elements.length;i++){
        if(elements[i].className.indexOf(" ") >= 0){
            var classes = elements[i].className.split(" ");
            for(var j = 0;j < classes.length;j++){
                if(classes[j] == clsName)
                    retVal.push(elements[i]);
            }
        }
        else if(elements[i].className == clsName)
            retVal.push(elements[i]);
    }
    return retVal;
}


function increaseFontSize() {
   var p = document.getElementsByClassName('daynamicMaxMinFont');
   var szName = getCookie("fontSize");
  
   for(i=0;i<p.length;i++) {
     if(szName){
       var s = parseInt(szName);
      
     }
      else if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=max) {
         s += 1;
      }
      p[i].style.fontSize = s+"px"
      if(navigator.appName!='Netscape'){
           setCookie("fontSize", s,'/');
      }
      else
           setCookieFF("fontSize", s);

   }
}

function decreaseFontSize() {
   var p = document.getElementsByClassName('daynamicMaxMinFont');
   var szName = getCookie("fontSize");
   for(i=0;i<p.length;i++) {
      if(szName){
          var s = parseInt(szName);
       }
       else if(p[i].style.fontSize) {
               var s = parseInt(p[i].style.fontSize.replace("px",""));
             } else {
                  var s = 12;
             }
      if(s!=min) {
         s -= 1;
      }
      p[i].style.fontSize = s+"px";
      if(navigator.appName!='Netscape'){
      setCookie("fontSize", s,'/');
       }
       else
       setCookieFF("fontSize", s);
       }
}


function setCookie(szName, szValue,path)
{
 
 
  
var expiration_date = new Date ();
	expiration_date . setYear (expiration_date . getYear () + 1);
	expiration_date = expiration_date . toGMTString ();
	

 	var szCookieText = 	   escape(szName) + '=' + escape(szValue)+
		"; expires=" + expiration_date;
		
	if (path != null)
		szCookieText += "; path=" + path;
	
	document.cookie = szCookieText;
	
}





function setCookieFF(szName, szValue)
{
      deleteCookie(szName);
      var path = '/';
 	var szCookieText = 	   escape(szName) + '=' + escape(szValue);
	szCookieText += "; path=" + path;
	document.cookie = szCookieText;
}




function getCookie(szName)
{
 	var szValue =	  null;
	if(document.cookie)	   //only if exists
	{
       	var arr = 		  document.cookie.split((escape(szName) + '=')); 
       	if(2 <= arr.length)
       	{
           	var arr2 = 	   arr[1].split(';');
       		szValue  = 	   unescape(arr2[0]);
       	}
	}
	return szValue;
}


function deleteCookie(szName)
{
 	var tmp = 	  			 	 getCookie(szName);
	if(tmp) 
	{ setCookie(szName,tmp,(new Date(1))); }
}

function setFontSize(){
 var szName = getCookie("fontSize");
 var p = document.getElementsByClassName('daynamicMaxMinFont');
 for(i=0;i<p.length;i++) {

if(szName !=null){

	p[i].style.fontSize = szName+"px"
	
}
else{
   p[i].style.fontSize = "12px"

  
}
}  

}

//************************** FONT INCREASE DECREASE CODE ENDS *************************************//




//************************** SWAPPING TABS BEGINS *****************************//
//*************************** DIV SWAPPING BEGINS *****************************//
var homeDivs = ["paneFamilyServicesDivContent","paneEstateDivContent","paneTaxPlanningDivContent","panePhilanthropicDivContent","paneExpenseDivContent","paneInvestmentDivContent","paneFamilyEducationDivContent","paneRiskDivContent"];
var aboutusDivs = ["ourObective","ourIntegration","ourTechnology"];
var solutionDivs = ["typeFamily","integrated"];

function showDiv(page,divId){
      var divArray = findDivArray(page);

      for(var i=0;i<divArray.length;i++){

        if(divId == divArray[i]){
        	document.getElementById(divArray[i]).style.display = 'block';
        }
        else{
            document.getElementById(divArray[i]).style.display = 'none';
        }
      }
}


function showDefaultDiv(page){
	var divArray = findDivArray(page);
      for(var i=0;i<divArray.length;i++){

        if(i == 0){
        	document.getElementById(divArray[i]).style.display = 'block';
        }
        else{
            document.getElementById(divArray[i]).style.display = 'none';
        }
      }

}

function findDivArray(page){
	var divArray = new Array();
	if(page == "home"){
           divArray = homeDivs ;  
      }
      else if(page == "aboutus"){

        divArray = aboutusDivs ;
      }
      else if(page == "solution")
      {
        divArray = solutionDivs;
      }
return divArray;

}



function displayChosenDiv(arrDivIds, chosenDivId) {
	var chosenDiv = document.getElementById(chosenDivId);
	if(chosenDiv == null) {
		return;
	}
	chosenDiv.style.display = 'block';
	for(var i=0;i < arrDivIds.length;i++){
		if(arrDivIds[i] != chosenDivId) {
			var arrDivElement = document.getElementById(arrDivIds[i]);
			if(arrDivElement != null) {
				arrDivElement.style.display = 'none';
			}
		} 
	}	
}

//************************** DIV SWAPPING CODE ENDS *************************//
//************************** IMAGE SWAPPING BEGINS **************************//
var solutionImages = ["cfo_types_family_office","cfo_integrated_vs_non"];
var solutionImageIds = ["cfo_types1","cfo_integrated1"];

var aboutusImages = ["cfo_ourobjectivity","cfo_ourintegration","cfo_outtechnology"];
var aboutUsImageIds= ["cfo_ourobjectivity3","cfo_ourintegration1","cfo_outtechnology1"];

var homeImages = ["cfo_investment_adv_services","cfo_estate_trust","cfo_taxplanning","cfo_philanthropic_planning","cfo_expense_management","cfo_familyoffice_services","cfo_family_education","cfo_riskmanagement_insurance"];
var homeImageIds = ["invest8","cfo_estate1","cfo_taxplaning1","cfo_philanthropic1","cfo_expense1","cfo_familyoffice1","cfo_family1","cfo_riskmanagement1"];

function changeImage(img,tab){

  var menuImageIds = new Array();
  var menuImages = new Array();

  if(tab == "solutions"){
    menuImageIds = solutionImageIds ;
    menuImages = solutionImages ;

}
 else if(tab == "aboutus"){
	 menuImageIds = aboutUsImageIds;
    menuImages = aboutusImages ;

}

else if(tab == "home"){
menuImageIds = homeImageIds ;
    menuImages = homeImages ;

}

  
  for(var i=0;i<menuImageIds.length;i++){
    var menuImage = document.getElementById(menuImageIds[i]);
    
    if(img == menuImage.name){
      
      if(tab == "home"){
        menuImage.oSrc="../vgn/cfo/images/"+menuImages[i]+"_active.gif";
        menuImage.src="../vgn/cfo/images/"+menuImages[i]+"_active.gif";
	}
	else{
  		menuImage.oSrc="../vgn/cfo/images/"+menuImages[i]+"_active.gif";
            menuImage.src="../vgn/cfo/images/"+menuImages[i]+"_active.gif";

	}
         
   }
   else{
 	if(tab== "home"){
    		menuImage.oSrc="../vgn/cfo/images/"+menuImages[i]+"_over.gif";
   		 menuImage.src="../vgn/cfo/images/"+menuImages[i]+"_over.gif";
	}
	else{
		menuImage.oSrc="../vgn/cfo/images/"+menuImages[i]+"_over.gif";
    		menuImage.src="../vgn/cfo/images/"+menuImages[i]+"_over.gif";

	}
   }
 }
}

function swapImage(id,src,tab){
        var imgId = document.getElementById(id);
        if(checkActive(id)==true){
         }
        else{
       
         if(tab == "home"){
		imgId.oSrc ="../vgn/cfo/images/"+src+".gif";
         	imgId.src ="../vgn/cfo/images/"+src+".gif";

          }
		else{
        	 imgId.oSrc ="../vgn/cfo/images/"+src+".gif";
         	imgId.src ="../vgn/cfo/images/"+src+".gif";
		}
       }
      //alert(imgId.src);
 }



function swapImageRestore(id,src,tab){
     	var imgId = document.getElementById(id);
     if(checkActive(id)==true){

     }
     else{
         if(tab == "home"){

         imgId.oSrc ="../vgn/cfo/images/"+src+"_over.gif";
         imgId.src ="../vgn/cfo/images/"+src+"_over.gif";
}
else{


         imgId.oSrc ="../vgn/cfo/images/"+src+"_over.gif";
         imgId.src ="../vgn/cfo/images/"+src+"_over.gif";

}
     }
//alert(imgId.src);
 }


function checkActive(id){
      var isActive;
	var imgId = document.getElementById(id);
//alert( imgId.getAttribute('src'));
     var parray = imgId.getAttribute('src').split("/");
     var imgName = parray[parray.length-1];
//alert(imgName);

     var la = imgName.split("_");
     var last = la[la.length-1];

     //alert(last);
 if(last == "active.gif"){
      isActive = true;
//alert(last);
     }
     else{
       isActive = false;

         
     }
   return isActive;

}

//************************************ IMAGE SWAPPING ENDS *******************************************//
//************************************* SWAPPING TABS ENDS *******************************************//



function MM_openBrWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}





////CHU

function MM_swapImgRestore() { 
  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_swapImage() { 
  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];}
}///CHU

//************************************image swap end ****************************************************//


//***********************************Location Div Swaping******************************************************//
var arrLocationDivIds=['atlantaR','atlantaM','atlantaH','chicagoR','chicagoM','chicagoH','losR','losM','losH','melnoR','melnoM','melnoH','jerseyR','jerseyM','jerseyH','franciscoR','franciscoM','franciscoH','seattleR','seattleM','seattleH','scottR','scottM','scottH']
var arrLocationBlueDivIds=['atlantaB','chicagoB','losB','melnoB','jerseyB','franciscoB','seattleB','scottB']
function showChosenDiv(chosenId1,chosenId2,chosenId3,chosenId4) {

var chosenDiv1=document.getElementById(chosenId1);
var chosenDiv2=document.getElementById(chosenId2);
var chosenDiv3=document.getElementById(chosenId3);
var chosenDiv4=document.getElementById(chosenId4);


document.getElementById(chosenId2).style.display='inline';
document.getElementById(chosenId3).style.display='inline';
document.getElementById(chosenId4).style.display='inline';


for(var i=0;i<arrLocationBlueDivIds.length;i++){
	if(document.getElementById(arrLocationBlueDivIds[i])!=chosenDiv1){
	document.getElementById(arrLocationBlueDivIds[i]).style.display='inline';
	}else {
	document.getElementById(chosenId1).style.display='none';
	}
}
for(var i=0;i<arrLocationDivIds.length;i++){

if((document.getElementById(arrLocationDivIds[i])!=chosenDiv2)&&(document.getElementById(arrLocationDivIds[i])!=chosenDiv3)&&(document.getElementById(arrLocationDivIds[i])!=chosenDiv4)){

var arrDivElement=document.getElementById(arrLocationDivIds[i]);

if(arrDivElement!=null){
arrDivElement.style.display='none';
	}
     }
   }
}

//***********************************Location Div Swaping End******************************************************//

function showLocationDiv(){
var url=window.location.href;
var loc=url.split("=");
var pageindex=loc[loc.length-1];
if(pageindex=="1"){
showChosenDiv('atlantaB','atlantaR','atlantaM','atlantaH')
}
if(pageindex=="2"){
showChosenDiv('chicagoB','chicagoR','chicagoM','chicagoH')
}
if(pageindex=="3"){
showChosenDiv('losB','losR','losM','losH')
}
if(pageindex=="4"){
showChosenDiv('melnoB','melnoR','melnoM','melnoH')}

if(pageindex=="5"){
showChosenDiv('jerseyB','jerseyR','jerseyM','jerseyH')}

if(pageindex=="6"){
showChosenDiv('franciscoB','franciscoR','franciscoM','franciscoH')}

if(pageindex=="7"){
showChosenDiv('seattleB','seattleR','seattleM','seattleH')
}
if(pageindex=="8"){
showChosenDiv('scottB','scottR','scottM','scottH')
}

}
//***********************************Popup Div Swaping for home ******************************************************//
var popupId1=['my_popup1','my_popup2','my_popup3']
function showPopup123(id){
var chosenDiv1=document.getElementById(id);
for(var i=0;i<popupId1.length;i++){
	if(document.getElementById(popupId1[i])==chosenDiv1){
	document.getElementById(popupId1[i]).style.display='block';
	}else{
	document.getElementById(popupId1[i]).style.display='none';
	}
}
}

function hidePopup123(id){
document.getElementById(id).style.display='none';
}


//***********************************Popup Div End******************************************************//
//***********************************Popup Div Swaping for contactus ******************************************************//
var popupId=['my_popup1','my_popup2','my_popup3','my_popup4','my_popup5','my_popup6','my_popup7','my_popup8']
function showPopup1234(id){
var chosenDiv1=document.getElementById(id);
for(var i=0;i<popupId.length;i++){
	if(document.getElementById(popupId[i])==chosenDiv1){
	document.getElementById(popupId[i]).style.display='block';
	}else{
	document.getElementById(popupId[i]).style.display='none';
	}
}
}

function hidePopup1234(id){
document.getElementById(id).style.display='none';
}
function doNothing(){
}

var topHead=['intergenerational','bussiness','investments','faminly','estate']
function showTopHead(){
var url=window.location.href;
var loc=url.split("=");
var head=loc[loc.length-1];

	var chosenhead=document.getElementById(head);
	if(chosenhead != null) {
		document.getElementById(head).style.display='inline';
	}
		for(var i=0;i<topHead.length;i++){
			if(document.getElementById(topHead[i])!=chosenhead){
			document.getElementById(topHead[i]).style.display='none';
			}
		}
	
}

function loadPage(){
var url=window.location.href;
var loc=url.split("=");
var head=loc[loc.length-1];

if(head=="intergenerational"){
		window.location.href="0,4854,52776115_54486010,00.html";
		}
	if(head=="bussiness"){
		window.location.href="0,4854,52776115_57323166,00.html";
		}
	if(head=="investments"){
		window.location.href="0,4854,52776115_54486034,00.html";
		}	
	if(head=="faminly"){
		window.location.href="0,4854,52776115_54483583,00.html";
		}
	if(head=="estate"){
		window.location.href="0,4854,52776115_54486066,00.html";
		}
}

function showContactus(){
document.getElementById('sp').className='linkblue_u';
document.getElementById('gt').style.display='block';

}