var serverRoot = "/nde/"; //top.location.href.split("index.jsp")[0].split(";")[0];//without index.jsp(if attached) and then no ;jsession


//---------------------------------------------------------------------------------------------

function changePic(name,newpic){
	if (document.images) //mouseover supported
		document.images[name].src = newpic;
}

//---------------------------------------------------------------------------------------------

function refreshNavigation(intMenuLevel1, intMenuLevel2){
	if(top.frames["navi"]){
		currentNaviL1 = (top.frames["navi"].document.forms[0])?top.frames["navi"].document.forms[0].firstLevel.value:0;
		currentNaviL2 = (top.frames["navi"].document.forms[0])?top.frames["navi"].document.forms[0].secondLevel.value:0;
		//alert("currentNaviL1:" + currentNaviL1 + " currentNaviL2:" + currentNaviL2);
		//alert("intMenuLevel1:" + intMenuLevel1 + " intMenuLevel2:" + intMenuLevel2);
		if(currentNaviL1!=intMenuLevel1 || currentNaviL2!=intMenuLevel2){
			//alert("reload navi...");
			top.frames["navi"].location.href = serverRoot + "navi.jsp?m1="+intMenuLevel1 + "&m2="+intMenuLevel2 ;

			if(top.frames["content"].frames.length){ //if left frame exists...
				currentLeft = top.frames["content"].frames["left"].location.href.split("/");
				currentRight = this.location.href.split("/");
				//alert("currentLeft:" + currentLeft[currentLeft.length-2] + " currentRight:" + currentRight[currentRight.length-2]);
				//if left frame doesn't correspond to right -->reload left...
				if(currentLeft[currentLeft.length-2] != currentRight[currentRight.length-2]){
					//alert("reload left...");
					top.frames["content"].frames["left"].location.href ="visual.jsp";
				}

			}//if(top.frames
		}//of if(currentNaviL1
	}
	else
		top.location.href=serverRoot + "index.jsp";
}


//---------------------------------------------------------------------------------------------

function openContent(site){
	top.opener.top.content.location.href= serverRoot + site;
	top.close();
}

//---------------------------------------------------------------------------------------------

function popup(url,name,width,height, customProperties) {
	popupProperties = (customProperties)?"width="+width+",height="+height+",scrollbars=yes, "+ customProperties:"width="+width+",height="+height+",scrollbars=yes";
	popupWin = window.open(url,name,popupProperties);
	x_pos = screen.width/2 - width/2;
	y_pos = screen.height/2 - height/2;
	//alert(x_pos);
	popupWin.moveTo(x_pos,y_pos);
	popupWin.focus();
}

//---------------------------------------------------------------------------------------------

function openFaq(pageNr) {
	popup(serverRoot + 'site_utilities/faq/index.jsp?page='+pageNr,'faqlexikon', 541, 400);
}

//---------------------------------------------------------------------------------------------

function openLexikon(item) {
	popup(serverRoot + 'site_utilities/lexikon/index.jsp','faqlexikon', 541, 400);
}

//---------------------------------------------------------------------------------------------

function openInfo(item) {
	popup(serverRoot + 'site_utilities/infopopups/'+item+'.jsp','dermatologischeInfo', 499, 400);
}

//---------------------------------------------------------------------------------------------

function expertisePopup(item){
	popup(serverRoot + 'site_utilities/expertisepopups/'+item+'.jsp','expertisePopup', 521, 400);
}

//---------------------------------------------------------------------------------------------

function openTellAFriend(){
	popup(serverRoot + 'site_utilities/tell_a_friend/tell_a_friend.jsp','Tell_A_Friend', 521, 400);
}


//---------------------------------------------------------------------------------------------


function openDatenschutz(anker){
	popup(serverRoot + 'datenschutz.jsp#'+anker,'legalnotes',468,460);
}
//--

function externalLink(url) {
	popup(serverRoot + 'p_externalLink.jsp?url='+url,'externalLink', 820, 500, 'menubar=1, toolbar=1, locationbar=1,location=1, personalbar=1, status=1, ,resizable=1');
}


function checkRadio(radioName,radiosAmount, radioNr, radioValue){
	//set the form value
	document.forms[0].elements[radioName].value = radioValue;
	//alert(document.forms[0].elements[radioName].value);

	radioImageHi = serverRoot + "art/btns/radiobutton_hi.gif";
	radioImageLo = serverRoot + "art/btns/radiobutton_lo.gif";
	
	//reset all
	for(i=1;i<=radiosAmount;i++){
		changePic(radioName+i,radioImageLo);
	}

	//highlight the clicked one
	changePic(radioName+radioNr,radioImageHi);
}

//---------------------------------------------------------------------------------------------

function checkCheckbox(cboxName){
	//set the form value
	cboxValue = document.forms[0].elements[cboxName].value;
	//alert(document.forms[0].elements[cboxName].value);
	if(cboxValue=="1"){
		
		document.forms[0].elements[cboxName].value = "0";
		cboxImage = serverRoot + "art/btns/checkbox_lo.gif";
	}
	else{
		document.forms[0].elements[cboxName].value = "1";
		cboxImage = serverRoot + "art/btns/checkbox_hi.gif";
	}
	//alert(document.forms[0].elements[cboxName].value);
	changePic(cboxName,cboxImage);
}

//---------------------------------------------------------------------------------------------


function swapLayerContent(destLayer,srcLayer) { 

	if(document.layers) { // Netscape 4.x
		document.layers[destLayer].document.open();
		document.layers[destLayer].document.write("NS4");
		document.layers[destLayer].document.close();
	}
	else if(document.all) { // Internet Explorer 4+
		document.all[destLayer].innerHTML=document.all[srcLayer].innerHTML;
	}
	else if(document.getElementById) { // W3C konform zB. Opera, Mozilla, Netscape 6+ 
		//var temp=document.createTextNode(text);
		var div1 = document.getElementById(destLayer);
		var div2 = document.getElementById(srcLayer);
		//alert("destLayer=" + destLayer);
		//alert("srcLayer=" + srcLayer);
		//alert("div1=" + div1);
		//alert("div2=" + div2);
		while (div1.hasChildNodes()) {
			div1.removeChild(div1.lastChild);
		}
		div1.appendChild(div2.cloneNode(true));
	}
}

//---------------------------------------------------------------------------------------------



		/*
		Disable right click script II (on images)- By Dynamicdrive.com
		For full source, Terms of service, and 100s DTHML scripts
		Visit http://www.dynamicdrive.com
		*/

		var clickmessage="Right click disabled on images!"

		function disableclick(e) {
			
			if (document.all) {
				//alert("disableclick event.button=" + event.button );
				//alert("disableclick event.srcElement.tagName=" + event.srcElement.tagName);
				if (event.button==2||event.button==3) {
					if (event.srcElement.tagName=="IMG"){
					alert(clickmessage);
					return false;
					}
				}
			}
			else if (document.layers) {
				//alert("disableclick e.button=" + e.button );
				
				if (e.which == 2 || e.which == 3) {
				alert(clickmessage);
				return false;
				}
			}
			else if (document.getElementById){
				//alert("disableclick e.button=" + e.button );
				//alert("disableclick event.srcElement.tagName=" + e.target.tagName);
				if ((e.button == 2 || e.button == 3)&&e.target.tagName=="IMG"){
				alert(clickmessage)
				return false
				}
			}
		}

		function associateimages(){
			for(i=0;i<document.images.length;i++)
			document.images[i].onmousedown=disableclick;
		}

		if (document.all)
			document.onmousedown=disableclick;
		else if (document.getElementById)
			document.onmouseup=disableclick;
		else if (document.layers)
			associateimages();

//---------------------------------------------------------------------------------------------

function FlashMovie(src, movie, width, height, version, quality, menu, bgcolor, flashvars)
{
	document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version="+version+",0,0,0' width='" +width+ "' height='" +height+ "' id='" +movie+ "'>");
	document.write("<param name='movie' value='" +src+ "' />");
	document.write("<param name='FlashVars' value='" +flashvars+ "'>");
	document.write("<param name='quality' value='" +quality+ "' />");
	document.write("<param name='menu' value='" +menu+ "' />");
	document.write("<param name='bgcolor' value='" +bgcolor+ "' />");
	document.write("<embed src='" +src+ "' swLiveConnect='true' menu='" +menu+ "' FlashVars='" +flashvars+ "' quality='" +quality+ "' bgcolor='" +bgcolor+ "' width='" +width+ "' height='" +height+ "' name='" +movie+ "' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />");
	document.write("</object>");
}


function show(id){
   document.getElementById(id).style.display = 'block';
}

 function hide(id) {
  document.getElementById(id).style.display = 'none';
}


// div toggle
function toggle(id){
 if(document.getElementById(id).style.display == 'none')
 {
  document.getElementById(id).style.display = 'block';
  //document.getElementById(img).src = 'img/minus.gif'; 
 }
 else
 {
  document.getElementById(id).style.display = 'none';
  //document.getElementById(img).src = 'img/plus.gif'; 
 }

}