﻿//Flash Replacement
//Flash Object
//ASP.NET Menu Adapters
//already inc.
var SITE_PATH = "/";

var BankGothicMdBT = {
  src: SITE_PATH+'Flash/BankGothicMdBT.swf'
};
var Georgia = {
  src: SITE_PATH+'Flash/Georgia.swf'
};

baseClass = '';
previousDiv = '';

function GetSubElements(elem){
    var startingNode, childNodes, childNode, dispCNode;
    startingNode = document.getElementById(elem);
    prtnrLoopItem(0);
    newsLoopItem(0);
    if (startingNode.hasChildNodes() == true){
        childNodes = startingNode.getElementsByTagName('li');
        dispCNode = Math.round((childNodes.length-1)*Math.random())-1;
        srItemClassChange(childNodes[dispCNode]);
        childNodes[dispCNode].getElementsByTagName('a')[0].className = 'click';
        for (i=0;i<childNodes.length;i++){
        
            PVGHome('.pnlAdvisory ul #adv'+(i)+' span');
            
            
        }
        
    }
   
}
var prtnrLoopPos = 0;
var prtnrLoopLimit;
function prtnrLoopItem(prtnrLoopPos){
	_targetNodes = document.getElementById('partnerLoop').getElementsByTagName('dl');
	_targetNodes[prtnrLoopPos].style.display = "block";
	prtnrLoopLimit = _targetNodes.length;
	prtnrTimeLoopItem(5)
}

//looping with an interval
var prtnrLoopInterval;
function prtnrTimeLoopItem(interval)
{
	prtnrLoopInterval = setInterval("prtnrLoopItemInterval()", (interval * 1000));
}
function prtnrLoopItemInterval(){
		clearInterval(prtnrLoopInterval);
		document.getElementById('partnerLoop').getElementsByTagName('dl')[prtnrLoopPos].style.display = "none";
		prtnrLoopPos++;
		if (prtnrLoopPos == prtnrLoopLimit)
			prtnrLoopPos = 0;
		prtnrLoopItem(prtnrLoopPos);
}
var newsLoopPos = 0;
var newsLoopLimit;
function newsLoopItem(newsLoopPos){
	_targetNodes = document.getElementById('newsLoop').getElementsByTagName('dd');
	_targetNodes[newsLoopPos].style.display = "inline";
	newsLoopLimit = _targetNodes.length;
	newsTimeLoopItem(5)
}

//looping with an interval
var newsLoopInterval;
function newsTimeLoopItem(interval)
{
	newsLoopInterval = setInterval("newsLoopItemInterval()", (interval * 1000));
}
function newsLoopItemInterval(){
		clearInterval(newsLoopInterval);
		document.getElementById('newsLoop').getElementsByTagName('dd')[newsLoopPos].style.display = "none";
		newsLoopPos++;
		if (newsLoopPos == newsLoopLimit)
			newsLoopPos = 0;
		newsLoopItem(newsLoopPos);
}

function srItemClassChange(target)
{
	if (target != undefined){
		elem = target;
		if(previousDiv != elem)
		{
			//window.alert(elem.className);
			previousDiv.className=baseClass;
			baseClass = elem.className;
			elem.className=baseClass+'click';
			previousDiv  = elem;
		}
		else{
			//nothing
		}
	}
}
function srItemClassClick(target){
    
	if (target != undefined){
		elem = document.getElementById(target);
		if(previousDiv != elem)
		{
			//window.alert(elem.className);
			var innerValue = previousDiv.getElementsByTagName('a')[0].innerHTML.toString();
			if(sIFR.isActive)
				sIFR.callbacks[".pnlAdvisory ul #"+previousDiv.id+" span"][0].replaceText("<a href=\"javascript:srItemClassClick(\'"+previousDiv.id+"\')\">"+innerValue.toUpperCase()+"</a>");
			previousDiv.className=baseClass;
			previousDiv.getElementsByTagName('a')[0].className=baseClass;
			baseClass = elem.className;
			elem.className=baseClass+'click';
			elem.getElementsByTagName('a')[0].className=baseClass+'click';
			previousDiv  = elem;
			var innerValue = previousDiv.getElementsByTagName('a')[0].innerHTML.toString();
			if(sIFR.isActive)
				sIFR.callbacks[".pnlAdvisory ul #"+previousDiv.id+" span"][0].replaceText("<a class=\'click\' href=\"javascript:srItemClassClick(\'"+previousDiv.id+"\')\">"+innerValue.toUpperCase()+"</a>");			
		}
		else{
			//nothing
		}
	}
}

	


sIFR.prefetch(BankGothicMdBT, Georgia);
sIFR.activate();



function PVGHome(target){
	sIFR.replace(BankGothicMdBT, {
               selector:target
              ,css: [
                '.sIFR-root { text-align: left; font-weight: normal; font-size:12; text-transform:uppercase;}'
                ,'.click { color: #efebd2; }'
                ,'.click:link { color: #efebd2; }'
                ,'.click:hover { color: #efebd2; }'
                ,'a { text-decoration: none;  color:#b1b8b3;}'
                ,'a:link { color: #b1b8b3; }'
                ,'a:hover { color: #efebd2; }'
                
                ]
                ,wmode: 'transparent'
              
            });
     sIFR.replace(BankGothicMdBT, {
               selector:'.pnlPartners h2'
              ,css: [
                '.sIFR-root { text-align: left; font-weight: normal; font-size:14; text-transform:uppercase; color:#587087;}'
                ,'a { text-decoration: none;  color:#587087;}'
                ,'a:link { color: #587087; }'
                ,'a:hover { color: #587087; }'
                
                ]
                ,wmode: 'transparent'
              
            });
     sIFR.replace(BankGothicMdBT, {
               selector:'.pnlExecIns h2'
              ,css: [
                '.sIFR-root { text-align: left; font-weight: normal; font-size:14; text-transform:uppercase; color:#587087;}'
                ,'a { text-decoration: none;  color:#587087;}'
                ,'a:link { color: #587087; }'
                ,'a:hover { color: #587087; }'
                
                ]
                ,wmode: 'transparent'
              
            });
}

function PVGPage(){
    sIFR.replace(Georgia, {
      selector:'#mSNav dd.sNav ul.AspNet-Menu li ul li.AspNet-Menu-Selected span'
      ,css: [
        '.sIFR-root { text-align: left; font-weight: normal; font-size:12; text-transform:none;}'
        ,'a { text-decoration: none;  color:#eaf1f0;}'
        ,'a:link { color: #eaf1f0; }'
        ,'a:hover { color: #eaf1f0; }'
      ]
      ,wmode: 'transparent'
      
    });
    sIFR.replace(Georgia, {
      selector:'#mSNav dd.sNav ul.AspNet-Menu li ul li.AspNet-Menu-Leaf span'
      ,css: [
        '.sIFR-root { text-align: left; font-weight: normal; font-size:12; text-transform:none;}'
        ,'a.AspNet-Menu-Selected { text-decoration: none;  color:#eaf1f0;}'
        ,'a.AspNet-Menu-Selected:link { color: #eaf1f0; }'
        ,'a.AspNet-Menu-Selected:hover { color: #eaf1f0; }'
        ,'a { text-decoration: none;  color:#bfcbd1;}'
        ,'a:link { color: #bfcbd1; }'
        ,'a:hover { color: #eaf1f0; }'
      ]
      ,wmode: 'transparent'
      
    });
    sIFR.replace(BankGothicMdBT, {
      selector:'#mSNav dd.sNav ul.AspNet-Menu li.AspNet-Menu-Selected span, #mSNav dd.sNav ul.AspNet-Menu li.AspNet-Menu-ChildSelected span'
        ,css: [
        '.sIFR-root { text-align: left; font-weight: normal; font-size:12; text-transform:uppercase;}'
        ,'a { text-decoration: none;  color:#efebd2;}'
      ,'a:link { color: #efebd2; }'
        ,'a:hover { color: #efebd2; }'
      ]
      ,wmode: 'transparent'
      
    });
    sIFR.replace(BankGothicMdBT, {
       selector:'#mSNav dd.sNav ul.AspNet-Menu li span'
      ,css: [
        '.sIFR-root { text-align: left; font-weight: normal; font-size:12; text-transform:uppercase;}'
        ,'a { text-decoration: none;  color:#b1b8b3;}'
        ,'a:link { color: #b1b8b3; }'
        ,'a:hover { color: #efebd2; }'
        ]
        ,wmode: 'transparent'
      
    });
}

    

function foHome(){
    /* <![CDATA[ */
	    var homeBanner = new SWFObject(SITE_PATH+"Flash/pvg_092007.swf", "homeBanner", "573", "305", "8", "#ffffff");
	    homeBanner.addParam("BASE", SITE_PATH+"Flash/");
	    homeBanner.addParam("wmode", "opaque");
	    homeBanner.useExpressInstall(SITE_PATH+"Flash/expressinstall.swf");
	    fLoaded = homeBanner.write("homeFlash");
		if (fLoaded) document.getElementById('homeFlash').style.textIndent="0px";
    /* ]]> */
}