archivList=[
	["Ausgabe 1 - Juni 2010","/archiv/2010-1/"],
	["Ausgabe 2 - Dezember 2009","/archiv/2009-2/"],
	["Ausgabe 1 - Juni 2009","/archiv/2009-1/"],
	["Ausgabe 2 - Dezember 2008","/archiv/2008-2/"],
	["Ausgabe 1 - Juli 2008","/archiv/2008-1/"],
	["Ausgabe 2 - Dezember 2007","/archiv/2007-2/"],
	["Ausgabe 1 - Juni 2007","/archiv/2007-1/"],
	["Ausgabe 2 - Dezember 2006","/archiv/ausgabe_2_2006.shtml"],
	["Ausgabe 1 - Juni 2006","/archiv/ausgabe_1_2006.shtml"]
]
kongressList=[
	["EASL 2010 in Wien","/kongresse/easl2010/"],
	["60. AASLD in Boston","/kongresse/aasld2009/"],
	["<span style='white-space:nowrap'>44. EASL (2009) in Kopenhagen</span>","/kongresse/easl2009/"] ,
	["59. AASLD in San Francisco","/kongresse/aasld2008/"],
	["EASL 2008 in Milan","/kongresse/easl2008/"],
	["58. AASLD in Boston","/kongresse/aasld2007/"],
	["EASL 2007 in Barcelona","/kongresse/easl2007/"] 
]



window.onload=init

function init(){
	setLocation();
	//document.body.onmouseover=showElm
}


function showFootNote(elm){
	var fn=document.getElementById("literatur")
	var lst=fn.getElementsByTagName("SPAN")
	var n=parseInt(elm.innerHTML)
	var txt=lst[n-1].parentNode.innerHTML
}



function setLocation(){
	if(!document.getElementById) return false
	if(!document.getElementById("primNav")) return false
	var loc=window.location.pathname
	if(loc.indexOf("/index.shtml") == 0 || loc =="/" ) sName="homeLink"
	else if(loc.indexOf("/archiv") == 0) sName="archiveLink"
	else if(loc.indexOf("/kongresse") ==0 ) sName="kongresseLink"
	else if(loc.indexOf("/kurzinfo") == 0 ) sName="kurzInfoLink"
	else if(loc.indexOf("/experte") == 0 ) sName="experteLink"
	else if(loc.indexOf("/kontakt") == 0 ) sName="kontaktLink"
	else if(loc.indexOf("/linkList") == 0 ) sName="moreInfoLink"
	else if(loc.indexOf("/fortbildung") == 0 ) sName="fortbildLink"
	else sName=null
	if(sName){
		document.getElementById(sName).className="primNavCurrent"
	}
}



function mailThingy(lnk,mb){
	lnk.href="ma" + "ilto" + ":" + mb + String.fromCharCode(64)
		+ "hepatitisandmore.de"
}




function mapHi(n){
	theImg=document.getElementById ? document.getElementById("deMap")
		: document.images ? document.images["deMap"] : false
	if(theImg) theImg.src="/images/map" + n + ".gif"
}

function mapLo(){
	theImg=document.getElementById ? document.getElementById("deMap")
		: document.images ? document.images["deMap"] : false
	if(theImg) theImg.src="/images/mapall.gif"
}


function loadMapImages(){
	mapImgLst=new Array()
	for(var i=0; i<10 ;i++){
		mapImgLst[i]=new Image()
		mapImgLst[i].src="/images/map" + i + ".gif"
	}
}


function popWin(loc,winName,w,h){
	dims="resizable=yes,scrollbars=yes"
	if(w)dims+=",width="+w
	if(h)dims+=",height="+h
	window.open(loc,winName,dims)
}





/*####### MENU #########*/
function popupMenu(elm,e,menu){
	if(!document.body.appendChild || !document.createElement)return false
	stopClear(e)
	if(!window.menuLay){
		menuLay=document.body.appendChild(document.createElement("DIV"))
		menuLay.style.visibility="hidden"
		menuLay.onmouseover=stopClear
		menuLay.onmouseout=setClear
	}
	menuLay.innerHTML=makeMenuList(menu)
	elm.onmouseout=setClear
	clearHover(elm)
	if(elm.className=="primNavLink")elm.className="primNavPseudoHover"
	menuLay.srcMI=elm
	menuLay.className="menuLayer"
	menuLay.style.top=getElmTop(elm) + getElmHeight(elm)
	menuLay.style.left=getElmLeft(elm)
	menuLay.style.visibility="visible"
}

function clearHover(elm){
	var m=elm.parentNode
	var lnks=m.getElementsByTagName("A")
	for(var i=0; i < lnks.length; i++){
		lnks[i].className="primNavLink"
	}
	setLocation()
}

function makeMenuList(m){
	if(!m)m=archivList
	str=""
	var loc=window.location.href
	for(var i=0; i<m.length  ;i++){
		var cur=loc.indexOf(m[i][1]) >=0 ? " class='current'" : ""
		str += "<A href='" + m[i][1] + "' target='_top'" + cur + ">" + m[i][0] + "</A>"
	}
	return str
}


function clearMenu(){
	if(!window.menuLay)return false
	if(menuLay.srcMI && menuLay.srcMI.className=="primNavPseudoHover")menuLay.srcMI.className="primNavLink"
	menuLay.style.visibility="hidden"
}
function setClear(){clearTimer=window.setTimeout("clearMenu()",200)}
function stopClear(e){if(window.clearTimer)clearTimeout(clearTimer);killBubble(e)}

function getElmLeft(elm){return elm ? elm.offsetLeft + getElmLeft(elm.offsetParent) : 0}
function getElmTop(elm){return elm ? elm.offsetTop + getElmTop(elm.offsetParent) : 0}
function getElmHeight(elm){	return elm.offsetHeight }
function getElmWidth(elm){return elm.offsetWidth}
function killBubble(e){
	if(!e)e=event
	if(!e)return false
	if(e.stopPropagation)e.stopPropagation()
	else e.cancelBubble=true
}
function getScrollY() {
  return typeof( window.pageYOffset ) == 'number' ? window.pageYOffset
    	: document.body && document.body.scrollTop ? document.body.scrollTop
    	: document.documentElement.scrollTop
}

function getEventTarget(e){
	return e.srcElement ? e.srcElement : e.target ? e.target : null
}




/*########### interview player popup ################*/


function playInterviewPopup(url,noSp, dims){
	if(!noSp) document.write("&nbsp;&nbsp;&nbsp;")
	document.write("<a href='javascript:void(0)' onclick='openInterview(\""
		+ url + "\"" 
		+(dims ? ",\"" + dims + "\"" : "")
		
		+ ")'><img src='/images/button_audio.gif' class='playAudio'>Interview abspielen</a>")
}

function closeIVWin(){
	if(window.ivWin && !window.ivWin.closed)window.ivWin.close()
}
function openInterview(url,dims){
	var tDims=dims ? dims : "width=350,height=250"
	closeIVWin()
	ivWin=window.open(url + ".htm", "ivWin", tDims)
}



/*########### etc, diagnostic ################*/

function showElm(e){
	e = e ? e : window.event
	trgt=getEventTarget(e)
	if(!trgt) return false
	var str =""
	var par=trgt 
	while (par && par.tagName!="BODY") {
		str +=	par.tagName 
			 + ( par.className ? " : (" + par.className + ") " : "" )
			 + (par.id? " [ #" + par.id + " ]" : "")
			 + " > "
		par=par.parentNode

	}
	
	window.defaultStatus=str
	return true
}
	


/* ####### COOKIES ######## */

function setCookie(name, value, expire, path){
	var str= name + "=" + escape(value)
	if(expire) str +="; EXPIRES=" + expire.toGMTString()
	var path=path?path:"/"
	str += "; PATH=" + path
	document.cookie = str
}

function getCookie(cname){
	var search = cname + "="
	if (document.cookie.length > 0) {
		offset = document.cookie.indexOf(search)
		if (offset != -1) {
			offset += search.length
			end = document.cookie.indexOf(";", offset)
			if (end == -1) end = document.cookie.length
			return unescape(document.cookie.substring(offset, end))
		}
	}
}




