var agt = navigator.userAgent.toLowerCase ();
var is_major = parseInt (navigator.appVersion);
var is_minor = parseFloat (navigator.appVersion);
var is_nav  = ((agt.indexOf ('mozilla') != -1) && (agt.indexOf ('spoofer') == -1) && (agt.indexOf ('compatible') == -1) && (agt.indexOf ('opera') == -1) && (agt.indexOf ('webtv') == -1) && (agt.indexOf ('hotjava') == -1) && (agt.indexOf ('safari') == -1));
var is_nav6 = (is_nav && (is_major == 5) && (agt.indexOf ("netscape") != -1) && (agt.indexOf ("netscape/7") == -1));
var is_nav6up = ((is_nav && (is_major >= 5)) || (is_nav && (agt.indexOf ('netscape/7') != -1)));
var is_ie      = ((agt.indexOf ("msie") != -1) && (agt.indexOf ("opera") == -1) && (agt.indexOf ("safari") == -1));
var is_ie3     = (is_ie && (is_major < 4));
var is_ie4     = (is_ie && (is_major == 4) && (agt.indexOf ("msie 4")!=-1));
var is_ie4up   = (is_ie && (is_major >= 4));
var is_ie5     = (is_ie && (is_major == 4) && (agt.indexOf ("msie 5.0") != -1));
var is_ie5_5   = (is_ie && (is_major == 4) && (agt.indexOf ("msie 5.5") != -1));
var is_ie5up   = (is_ie && !is_ie3 && !is_ie4);
var is_ie5_5up = (is_ie && !is_ie3 && !is_ie4 && !is_ie5)
var is_firefox = ((agt.indexOf ("firefox") != -1) && (agt.indexOf ("opera") == -1) && (agt.indexOf ("safari") == -1));
var is_opera = (agt.indexOf ("opera") != -1);
var is_nn = ((is_nav6 || is_nav6up) ? true : false);

var lm_imgs = new Array();
var lm_imgs_a = new Array();

var oldNext=false;
var oldId=false;

startList = function() { 
if (is_ie || is_opera){

	nodes = document.getElementById("top_menu").getElementsByTagName("DIV");
	if (nodes) {
		for (var i=0; i<nodes.length; i++) { 
			if (nodes[i].className=="menu1"){
				nodes[i].onmouseover = function() { 
					this.className += "_over"; 
				} 
			nodes[i].onmouseout = function() { 
				this.className = this.className.replace(new RegExp("_over\\b"), ""); 
			}
			} 
		} 
	}
}	
	nodes = document.getElementById("left_menu").getElementsByTagName("DIV");
	if (nodes) {
		for (var i=0; i<nodes.length; i++) { 
			if (nodes[i].className=="menu1"){
				nodes[i].onmouseover = function() { 
					this.className += "_over";
					var id=Number(this.id.replace('lm_',''));
					var img = document.getElementById("lm_img_"+id);
					if (img){
						img.src=lm_imgs_a[id].src;
						oldId=id;
					}
					var nextElId = 'lm_'+(id+1);
					var nextEl= document.getElementById(nextElId);
					if (nextEl){
						oldNext=nextEl;
						nextEl.className += " next";
					}
				} 
			nodes[i].onmouseout = function() { 
				this.className = this.className.replace(new RegExp("_over\\b"), "");
				if (oldId){
					var img = document.getElementById("lm_img_"+oldId);
					img.src=lm_imgs[oldId].src;
					oldId=false;
				}
				if (oldNext){
					oldNext.className = oldNext.className.replace(new RegExp(" next\\b"), "");
					oldNext=false;
				}
			}
			} 
		} 
	}
	
	if (document.getElementById("informers")){
	nodes = document.getElementById("informers").getElementsByTagName("DIV");
	
	if (nodes) {
		for (var i=0; i<nodes.length; i++) { 
			if (nodes[i].className.indexOf("info_title")!=-1){
				var nondeId =nodes[i].id.replace('info_','');
				if (getCookieInfo("informer_"+nondeId)=="1"){
					var thisContent = document.getElementById('info_'+nondeId+"_c");
					nodes[i].className += " act";
					thisContent.style.display="block";
				}
				nodes[i].onclick = function() { 
					
					var thisId = this.id.replace('info_','');
					var thisContent = document.getElementById('info_'+thisId+"_c");
					if (thisContent){
						if (thisContent.style.display!="block"){
							this.className += " act";
							thisContent.style.display="block";
							setCookieInfo("informer_"+thisId,"1");
						} else {
							thisContent.style.display="none";
							this.className = this.className.replace(new RegExp(" act\\b"), "");
							setCookieInfo("informer_"+thisId,"0");
						}
					}
					
				} 
			} 
		} 
	}
	}

}



function setCookieInfo (name, value) {
	var argv = setCookieInfo.arguments;
	var argc = setCookieInfo.arguments.length;
	var expires = new Date ();
	expires.setTime(expires.getTime() + (365 * 24 * 3600 * 1000));
	var path = (argc > 3) ? argv[3] : null;
	var domain = (argc > 4) ? argv[4] : null;
	var secure = (argc > 5) ? argv[5] : false;
	document.cookie = name + "=" + escape (value) +
		((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
		((path == null) ? "; path=/" : ("; path=" + path)) +
		((domain == null) ? "" : ("; domain=" + domain)) +
		((secure == true) ? "; secure" : "");
}
	

function getCookieInfo(name) {
	if(document.cookie == "") return false; 
	else {
		var cookieStart, cookieEnd;
		var cookieString = document.cookie;
		cookieStart = cookieString.indexOf(name+"=");
		if(cookieStart != -1) {
		cookieStart += name.length+1;
		cookieEnd = cookieString.indexOf(";", cookieStart);
		if(cookieEnd == -1) cookieEnd = cookieString.length;
			return cookieString.substring(cookieStart, cookieEnd);
		} else {
			return false;
		}
	}
}


function openMember(path){
	var width=600;
	var height=360;
	var name="member";
	
	var left=(window.screen.availWidth/2)-(width/2);
	var top=(window.screen.availHeight/2)-(height/2);
	var param = "scrollbars=yes,status=no,resizable=0,width=" + width + ",height=" + height + ",left=" + left + ",top=" + top;
	eval(name+'=window.open("'+path+'", "'+name+'", "'+param+'");');
	eval(name+'.focus();');
}

window.onload=startList;
