//<!-- 
var PageLoad = false;
var isW3C = (document.getElementById && !document.all) ? 1 : 0;
var isMac = (navigator.appVersion.indexOf("Mac") != -1);
var isIE = (document.all) ? 1 : 0;
var isNS4 = (document.layers) ? 1 : 0;
var isSafari = (navigator.userAgent.toLowerCase().indexOf("safari") != -1);

// ------[ Generic Popup Window ]------------------------------------------------- //
function popWin(url,w,h,scroll,tools,name,center) {
	var str = "height=" + h + ",innerHeight=" + h;
	str += ",width=" + w + ",innerWidth=" + w;
	if(!center) var center = false;
	if(!scroll) scroll = 0;
	if(!tools) tools = 0;
	if(!name) name = "pop";

	if((window.screen) && (center)) {
		var ah = screen.availHeight - 30;
		var aw = screen.availWidth - 10;

		var xc = (aw - w) / 2;
		var yc = (ah - h) / 2;

		str += ",left=" + xc + ",screenX=" + xc;
		str += ",top=" + yc + ",screenY=" + yc;
		}
		
	pop = window.open(url,name,'toolbar=' + tools + ',location=0,directories=0,status=0,menubar=0,scrollbars=' + scroll + ',resizable=1,' + str).focus();
	}
	
// ------[ Cookie Handle ]------------------------------------------------- //
var now = new Date();
var expires = now.getTime() + 365 * 24 * 60 * 60 * 1000;
var expires = new Date(expires)
function WriteCookie(name, value) {
	document.cookie = name + "=" + escape(value) + "; expires=" + expires.toGMTString();
	}

function WriteCookieExp(name, value, Exp) {
	var expires = now.getTime() + Exp;
	var expires = new Date(expires)	
	document.cookie = name + "=" + escape(value) + "; expires=" + expires.toGMTString();
	}	

function ReadCookie(Name) {   
	var search = Name + "="   
	if (document.cookie.length > 0) { 					// if there are any cookies      
		offset = document.cookie.indexOf(search)       
		if (offset != -1) { 							// if cookie exists          
			offset += search.length  					// set index of beginning of value         
			end = document.cookie.indexOf(";", offset)	// set index of end of cookie value         
			if (end == -1) end = document.cookie.length         
			return unescape(document.cookie.substring(offset, end))      
			}    
		}
	}	

// ------[ Create XHTML Element ]------------------------------------------------- //
function createElement(element) {
	if (typeof document.createElementNS != 'undefined') {
		return document.createElementNS('http://www.w3.org/1999/xhtml', element);
		}
	if (typeof document.createElement != 'undefined') {
		return document.createElement(element);
		}
	return false;
	}		

// ------[ Navigation DHTML multibrowser Event Manager (LI:hover not compatible with IE6) ]------------------------------------------------- //	
Navigation = {	
	
	Root : null,
	
	Body : null,
	
	CurrentSection : null,
	
	Init : function() {
		this.Body = document.getElementsByTagName("body")[0];
		this.CurrentSection = this.Body.className;
		
		this.Root = document.getElementById("navigation");
		if(Navigation.Root) this.Render(Navigation.Root, 1)
		},
		
	Render : function(obj, level, section) {
		for (var i=0; i<obj.childNodes.length; i++) {
			var node = obj.childNodes[i];
			
			if(node.nodeName=="UL") level++;
				
			if(node.nodeName=="LI") {
				if(level == 1) {
					var section = node.id.replace(new RegExp("nav-\\b"), '');
					node.section = section;
				} else {
					node.section = section;
					}
				
				if(!node.className) node.className = "null";
				node.level = level;
				node.onmouseover = Navigation.MouseOver;
				node.onmouseout = Navigation.MouseOut;	
				}
			if(node.childNodes) Navigation.Render(node, level, section);
			}
		},
		
	MouseOver : function() {
		this.className += ' hover';
		if(Navigation.CurrentSection.indexOf(this.section) == -1) {		
			Navigation.Body.className += ' hide';
			}
		},
		
	MouseOut : function() {
		this.className = this.className.replace(new RegExp("hover\\b"), '');
		if(Navigation.CurrentSection.indexOf(this.section) == -1) {
			Navigation.Body.className = Navigation.Body.className.replace(new RegExp("hide\\b"), '');

			}
		}
	};

YAHOO.util.Event.addListener(window, "load", Navigation.Init, Navigation, true);


//-->	
