
function externalLinks() {   
	if (!document.getElementsByTagName) return;
	var anchors = document.getElementsByTagName("a");
	for (var i=0; i<anchors.length; i++) {
		var anchor = anchors[i];
		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external")
			anchor.target = "_blank";                                                 
	}
}                	

function addOnLoad(func) {       
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			oldonload();
			func();
		}  
	}
}

function activateMenu() {                         
    nav = document.getElementById('top_menu_nav');
	if (document.all && nav.currentStyle) {      
        var navroot = nav;
        var lis=navroot.getElementsByTagName("LI");  
        for (i=0; i<lis.length; i++) {
            if(lis[i].lastChild.tagName == "DIV"){
             	lis[i].onmouseover = function() {this.lastChild.style.display="block"; }
                lis[i].onmouseout=function()    {this.lastChild.style.display="none";}
            }
        }
    }
}

// addOnLoad(activateMenu);
// addOnLoad(externalLinks);




// -------------------------- extra drop menu --------------------
var tid;
function showLayer() {	
	if (tid) {  clearTimeout(tid)};
	document.getElementById('extra_top_menu').style.display = "block";        
}
function hideLayer(layerName) {
	document.getElementById('extra_top_menu').style.display = "none";
}
function off() {
	hideLayer('extra_top_menu');
}
function to() {
	tid = setTimeout("off()",500);
}
function overLayer() {		
	off(); 	
	showLayer();	
}




// -------------------------- gallery image --------------------
function showPhoto(imgUrl) {
	$('gallery_photo_container').innerHTML = "<img src=\""+imgUrl+"\" alt=\"\" />";
}   


