function WritePlayer(container, id, file) 
{
	document.getElementById(container).innerHTML = 
	    "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' width='17' height='17' id='" +
	        id + "' data='/resources/musicplayer.swf?song_url=/resources/voices/" + file + "' align='middle'><param name='allowScriptAccess' value='sameDomain' /><param name='movie' value='/resources/musicplayer.swf?song_url=/resources/voices/" + file + 
	        "' /><param name='quality' value='high' /><param name='bgcolor' value='#ffffff' /><embed src='/resources/musicplayer.swf?song_url=/resources/voices/" + 
	        file + "' quality='high' bgcolor='#ffffff' width='17' height='17' name='" + id + 
	        "' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' /></object>";
}



function setCookie(name, value, bolSession) {
//alert (name + ", " + value);
	var expdate = new Date();
	expdate.setTime(expdate.getTime() +  (24 * 60 * 60 * 1000 * 365)); 
	
	var strCookie = name + "=" + value + "; "
	if (bolSession == false)
		strCookie += "expires=" + expdate.toGMTString();
	document.cookie = strCookie;
}

function getCookie(name) {
	var strCookies = String(document.cookie);	
	var intCookieStart = strCookies.indexOf(name);
	if(intCookieStart != -1) {
		intCookieStart = intCookieStart + name.length + 1;
		var intCookieEnd = strCookies.indexOf(";", intCookieStart);
		if(intCookieEnd = -1) intCookieEnd = strCookies.length
			return strCookies.substring(intCookieStart, intCookieEnd);
	} else {
		return false;
	}
}

function printarticle(lngId)
{
	strWin = window.open ("/printarticle.php?id=" + lngId , "_blank", "toolbar=yes,menubar=yes,scrollbars=yes,resizable=yes,width=800,height=500");
}

//sfHover = function() {
//	var navEl = document.getElementById("nav");
//	if (navEl != null)
//	{
//		var sfEls = navEl.getElementsByTagName("LI");
//		for (var i=0; i<sfEls.length; i++) {
//			sfEls[i].onmouseover=function() {
//				this.className+=" sfhover";
//			}
//			sfEls[i].onmouseout=function() {
//				this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
//			}
//		}
//	}
//}
//if (window.attachEvent) window.attachEvent("onload", sfHover);


function SwitchImg(imgName, over)
{
	fld = document.getElementById (imgName + "img");
	eval ("fld.src = img" + imgName + (over ? "over" : "off") +".src;");
	//fld.src = "/_structure/images/system/" + imgName + (over ? "over" : "off") + ".jpg";
}


function FindHeight(obj)
{
    return (obj.offsetHeight);
}



function FindWidth(obj)
{
    return (obj.offsetWidth);
}



function HideMsg(type)
{
    var msg = document.getElementById(type);
    msg.style.display = "none";
}
