// menu
function menuInit (path) {		
	var menuListID = 'menuList-' + path[0];	
	for (var i=0; i<document.getElementsByTagName('ul').length; i++) {
		if (document.getElementsByTagName('ul').item(i).id.indexOf(menuListID + '-') != -1) {
			document.getElementsByTagName('ul').item(i).style.display = 'none';
			}
		}
	
	for (var i=0; i<document.getElementsByTagName('a').length; i++) {
		if (document.getElementsByTagName('a').item(i).className == "push") {
			document.getElementsByTagName('a').item(i).className = "";
			}
		}	
	for (var i=1; i<path.length; i++) {		
		menuListID += '-' + path[i];
		document.getElementById(menuListID).style.display = 'block';
		}
	}	
function expandMenuList (item,menuListID,change) {
	var path = menuListID.split('-');
	for (var i=0; i<path.length-1; i++) path[i] = path[i+1];
	path.length--;
	item.blur();
	menuInit(path);
	if (change) item.className="push";
	return false;
	}


function getObj(x) {
	if (typeof x != 'string') return x;
	else if (Boolean(document.getElementById)) return document.getElementById(x);
		else return null;
	}
function getObjStyle (obj,prop) {
	var o = getObj(obj);
	if (document.defaultView) var val = window.document.defaultView.getComputedStyle(o,null).getPropertyValue(prop); // Mozilla
	else if (o.currentStyle) var val = eval('o.currentStyle.' + prop); // IE
	return val;
	}

function setCookie(name, value, path, domain, secure) {
	expires = new Date ();
	expires.setTime (expires.getTime() + (24 * 60 * 60 * 1000 * 31));    
	document.cookie= name + "=" + escape(value) +
	((expires) ? "; expires=" + expires.toGMTString() : "") +
	((path) ? "; path=" + path : "") +
	((domain) ? "; domain=" + domain : "") +
	((secure) ? "; secure" : "");     
	}

var detailPopupWindow;
function detailPopup (src,width,Height) {
	if (detailPopupWindow) detailPopupWindow.close();
	width += 20;
	Height += 120;
	if (width < 400)  width = 400;
	if (Height < 300) Height = 300;
	if (width > 800 || Height > 600) var s = 'scrollbars=yes';
	else var s = 'scrollbars=no';
	if (width > 800)  width = 800;
	if (Height > 600) Height = 600;
	var p = 'toolbar=no,menubar=no,location=no,resizable=yes,directories=no,status=no,width=' + width + ',height=' + Height + ',left=' + (screen.availWidth/2-width/2) + ',top=' + (screen.availHeight/2-Height/2) + ',' + s;
	detailPopupWindow = window.open(src,'',p);
	detailPopupWindow.focus();
	return false;
	}


	
