// /////////////////////////////////////////////////////////////////////
// ///// object: BrowserAbstraction

var BrowserAbstraction = function() {

	BrowserAbstraction.AGENTCODE_NS = "NS";
	BrowserAbstraction.AGENTCODE_MZ = "MZ";
	BrowserAbstraction.AGENTCODE_OP = "OP";
	BrowserAbstraction.AGENTCODE_IE = "IE";
	BrowserAbstraction.OSCODE_UNKNOWN = "??";

	BrowserAbstraction.OSCODE_WIN = "WIN";
	BrowserAbstraction.OSCODE_MAC = "MAC";
	BrowserAbstraction.OSCODE_UNX = "UNX";
	BrowserAbstraction.OSCODE_UNKNOWN = "??";

	// ///// getCurrentStyle
	this.getCurrentStyle = function(node, prop) {
		if(this.code == BrowserAbstraction.AGENTCODE_NS && this.os == BrowserAbstraction.OSCODE_WIN) return window.getComputedStyle(node, null)[prop];
		if(this.code == BrowserAbstraction.AGENTCODE_IE) return node.currentStyle[prop];
		return null;
	}
	// ///// getNextNode
	this.getNextNode = function(node) {
		while(node.nextSibling) {
			node = node.nextSibling;
			if(node.nodeName != "#text") return node;
		}
	};
	// ///// getNextNodeByTagName
	this.getNextNodeByTagName = function(node, tagname) {
		while(node.nextSibling) {
			node = node.nextSibling;
			if(node.nodeName.toUpperCase() == tagname.toUpperCase()) return node;
		}
	};
	// ///// getBrowserCode
	this.getBrowserCode = function() {
		if(document.layers) {
			return BrowserAbstraction.AGENTCODE_NS;
		}
		else if(navigator.userAgent.match(/gecko/gi) || navigator.userAgent.match(/netscape/gi)) {
			return BrowserAbstraction.AGENTCODE_MZ;
		}
		else if(navigator.userAgent.match(/opera/gi)) {
			return BrowserAbstraction.AGENTCODE_OP;
		}
		else if(navigator.userAgent.match(/msie/gi)) {
			return BrowserAbstraction.AGENTCODE_IE;
		}
		else return BrowserAbstraction.AGENTCODE_UNKNOWN;
	};
	// ///// getSystemPlatform
	this.getSystemPlatform = function() {
		if(navigator.platform.match(/win/gi)) {
			return BrowserAbstraction.OSCODE_WIN;
		}
		else if(navigator.platform.match(/mac/gi)) {
			return BrowserAbstraction.OSCODE_MAC;
		}
		else return BrowserAbstraction.OSCODE_UNKNOWN;
	};
	// ///// print
	this.print = function(win) {
		if(this.code == BrowserAbstraction.AGENTCODE_IE) win.document.execCommand("Print");
		else win.print();
	}
	// ///// CONSTRUCTOR
	this.code = this.getBrowserCode();
	this.os = this.getSystemPlatform();
};

// /////////////////////////////////////////////////////////////////////
// ///// object: LinksNavigation

var LinksNavigation = function(browser) {

	this.togglePanelDisplay = function(el) {
		parentEl = el.parentNode;
		if(parentEl.className == "navLinksExpanded" || parentEl.className == "navLinksCollapsed")
		{
			parentEl.className = (parentEl.className == "navLinksExpanded")?"navLinksCollapsed":"navLinksExpanded";
		}
	};

};


// Centralize the opening of the Fund Finder popup
function openPremiumFundFinderPopup(language) {
  
  var newLanguage='FR' ;
  
  switch(language){
    case 'FR' : newLanguage='FR'; break ;
    case 'DE' : newLanguage='AL'; break ;
    case 'EN' : newLanguage='AN'; break ;
    default:
  }
  
	popContentWin('http://fundservices.asp.quartal.com/esider/monitor.jsp?lang='+newLanguage,'','','795','587');
}