function set_class(placeholder) {
	if (document.all && document.getElementsByTagName) {
		navRoot = document.getElementById(placeholder)
		if (navRoot) {
			list_items = navRoot.getElementsByTagName("LI");
			for (i=0; i<list_items.length; i++) {
				node = list_items[i];
				if (node.parentElement.parentElement.tagName != "LI") {
//					node.onmouseover=function() { this.className+=" over"; } 
//					node.onmouseout=function() { this.className=this.className.replace(" over", ""); } 
										
					node.onmouseover=function() { if (!event.toElement || event.toElement.className != "a_sub") this.className+=" over"; } 
					node.onmouseout=function() { if (!event.toElement || event.toElement.className != "a_sub") this.className=this.className.replace(" over", ""); } 

				}
			}
		}
	}
}


function setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}


function getCookie(name) {
	var dc = document.cookie;
	var prefix = name + "=";
	var begin = dc.indexOf("; " + prefix);
	if (begin == -1) {
		begin = dc.indexOf(prefix);
		if (begin != 0) return null;
	} else {
		begin += 2;
	}
	var end = document.cookie.indexOf(";", begin);
	if (end == -1) {
		end = dc.length;
	}
	return unescape(dc.substring(begin + prefix.length, end));
}


function deleteCookie( name, path, domain ) {
	if ( getCookie(name) ) 
		document.cookie = name + "=" + ( ( path ) ? ";path=" + path : "") + ( ( domain ) ? ";domain=" + domain : "" ) + ";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}

function get_top_left(width, height) {

	if (parseInt(navigator.appVersion)>3) {

		if (navigator.appName=="Netscape") {
	  		winW = window.innerWidth;
	  		winH = window.innerHeight;
	 		winL = window.screenX;
	 		winT = window.screenY;
	 	} else{
	  		winW = document.body.offsetWidth;
	  		winH = document.body.offsetHeight;
	  		winL = window.screenLeft;
	  		winT = window.screenTop;
	 	}
	}
	
	var scroll = 0;
	var l = winL + winW/2 - width/2;
	var t = winT + winH/2 - height/2;
	
	
  	if (screen.width <= width){
  		width=screen.width;
  	}
  	if (screen.height <= height){
  		height=screen.height;
 	 	var t = 0;
  		var scroll = 1;
  	}
	return Array(t,l);
}

function open_gallery (uri, w, h) {

	title = 'gallery';

	wwidth = (w) ? w : 660;
	
	wheight = (h) ? h : 740;
	
	xy = get_top_left(wwidth, wheight);

	wleft = xy[1];
	wtop = xy[0];
	
	prefs = "width="+wwidth+", height="+wheight+", left="+wleft+", top="+wtop+", toolbar=no, location=no, scrollbars=yes, status=no, menubar=no, resizable=no, directories=no";
	
	wnd = window.open(uri, title, prefs);
	
	return false;
}


function gallery_zoom(url,name,width,height){

	var l = 0;
	var t = 0;
	
	if (!width){
	width=screen.width;
	}
	if (!height){
	height=screen.height;
	}

	mewin=window.open(url,name,'toolbar=0,location=0,top='+t+',left='+l+',directories=0,status=0,'+'menubar=0,scrollbars=auto,resizable=1,width='+width+',height='+height);
	mewin.focus();
}


function openwin(uri,title,w,h){
	if(w){wwidth = w;}else{	wwidth = 380;}
	if(h){wheight = h; }else{ wheight = 380;}
	xy = get_top_left(wwidth, wheight);
	wleft = xy[1];
	wtop = xy[0];
	wnd = window.open(uri, title, "width="+wwidth+", height="+wheight+", left="+wleft+", top="+wtop+", toolbar=no, location=no, scrollbars=yes, status=no, menubar=no, resizable=no, directories=no");
}
/*
	INIT
*/



window.onload = function() {
	set_class('hmenu');
}



