var openmenu_parent = null;
var openmenu_id = null;
var overlink = false;
		
function getObj(id) {
	return document.getElementById(id)
}
		
function DHTML_ImageSwap(id, src) {
	getObj(id).old_src = getObj(id).src;
	getObj(id).src = src;
}
function DHTML_ImageSwapRestore(id, src) {
	getObj(id).src = getObj(id).old_src;
}
			
function DHTML_TextHilight(id) {
	getObj(id).classNameOld = getObj(id).className;
	getObj(id).className = getObj(id).className + "_hilight";
}
function DHTML_TextActivate(id) {
	getObj(id).classNameOld = getObj(id).className;
	getObj(id).className = getObj(id).className + "_active";
}
function DHTML_TextRestore(id) {
	if (getObj(id).classNameOld != "")
	getObj(id).className = getObj(id).classNameOld;
}
function DHTML_SetClass(id, classname) {
	getObj(id).classNameOld = "";
	getObj(id).className = classname;
}
			
function DHTML_ShowHide(id, visible) {
	if (id == null || id == "") return;
	obj = getObj(id);
	if (obj.style) obj = obj.style;
	if (visible == 1) { obj.display = "block"; }
	else { obj.display = "none"; }
}

function DHTML_ToggleVisible(id, label, ontext, offtext) {
	obj = getObj(id);
	if (obj.style) obj = obj.style;
	visible = (obj.display == "none");
	if (visible) { obj.display = "block"; DHTML_SetText(label, ontext); }
	else { obj.display = "none"; DHTML_SetText(label, offtext); }
}

function DHTML_DoMenu(id1, id2, v) {
	if (v) {
		DHTML_TextHilight(id1);
		DHTML_ShowMenu(id1, id2, 1);
	} else {
		DHTML_TextRestore(id1);
		DHTML_ShowMenu(id1, id2, 0);
	}
}

function DHTML_ShowMenu(parent, id, v) {
	if (v == 1) {
		if (openmenu_id != null) {
			DHTML_ShowMenu(openmenu_parent, openmenu_id, 0);
		}
	} else {
		openmenu_id = null;
	}

	obj = getObj(id);
	parent = getObj(parent);
	if (obj == null) return;
	if (parent == null) return;
				
	if (obj.style) obj = obj.style;
	if (v == 1) {
		obj.left = clientLeft(parent);
		obj.top = clientTop(parent) + parent.offsetHeight;
		obj.visibility = "visible";
		obj.shouldbevisible = 'visible';

		openmenu_parent = parent;
		openmenu_id = id;
	} else {
		obj.shouldbevisible = 'hidden';
		setTimeout("objx = getObj('" + id + "'); if (objx.style) objx = objx.style; objx.visibility = objx.shouldbevisible;",100);

		//obj.visibility = "hidden";
	}
}
			
function clientLeft(obj) {
	if (obj == null) return 0;
	return obj.offsetLeft + clientLeft(obj.offsetParent);
}
function clientTop(obj) {
	if (obj == null) return 0;
	return obj.offsetTop + clientTop(obj.offsetParent);
}

function DHTML_SetText(obj, text) {
	getObj(obj).innerHTML = DHTML_Escape(text);
}

function DHTML_Escape(text) {
	text = text.replace("&lt;", "&amp;lt;");
	text = text.replace("&gt;", "&amp;gt;");
	return text;
}

function InitGoogleAd() {
	google_ad_client = "pub-3418906291605762";
	google_ad_width = 468; // 234
	google_ad_height = 60;
	google_ad_format = "468x60_as";
	google_ad_type = "text_image";
	google_color_border = "EEEEFF";
	google_color_bg = "DDDDEE";
	google_color_link = "000000";
	google_color_url = "666666";
	google_color_text = "333300";
	google_ad_channel = "8078749570";
}
