function showWSW (text, wo) 
{
  if (document.getElementById)
  
  	newtext = "";
  	za = "<tr><td width=20px align=center valign=middle>";
  	zz = "</p></td></tr>"
  	zm = "</td><td valign=middle><p class='text'>"
  	ag = "<img border=0 src='img/ampel_green.gif' width=7px height=7px>"
	ar = "<img border=0 src='img/ampel_red.gif' width=7px height=7px>"
 	ay = "<img border=0 src='img/ampel_yellow.gif' width=7px height=7px>"
  	kag = "<img border=0 src='img/ampel_green.gif' width=5px height=5px>"
	kar = "<img border=0 src='img/ampel_red.gif' width=5px height=5px>"
 	kay = "<img border=0 src='img/ampel_yellow.gif' width=5px height=5px>"
  	
  	textarr = text.split(";");
  	
  //1 Patent
  //2 Gbm
  //3 Gsm
  //4 Marke
  //5 UrhR
  //6 Wettb
  //7 Halbleiter
  //8 Sortensch
  
	newtext = "<table border=0 width='100%' cellspacing='0' cellpadding='0' style='border-collapse: collapse'>"
  	
	for (i=0; i<textarr.length; i++)
	{	
		ampel = "";
			if (textarr[i] == "10")
				ampel = ar;
			else if (textarr[i] == "11")
				ampel = ag;
			else
				ampel = ""
			
			switch (i) {
			    case 0 : newtext = newtext + za + ampel + zm + "Patent<sup><font size=1em>*</font></sup>&nbsp;<font size=1em>(Nur bei neuer technischer Lehre)</font>" + zz;
			        break;
			    case 1 : newtext = newtext + za + ampel + zm + "Gebrauchsmuster <sup><font size=1em>*</font></sup>&nbsp;<font size=1em>(Nur bei neuer technischer Lehre - keine Verfahren)</font>" + zz;
			        break;
			    case 2 : newtext = newtext + za + ampel + zm +  "Geschmacksmuster <sup><font size=1em>*</font></sup>&nbsp;" + zz;
			        break;
			    case 3 : newtext = newtext + za + ampel + zm +  "Marke <sup><font size=1em>*</font></sup>&nbsp;" + zz;
			        break;
			    case 4 : newtext = newtext + za + ampel + zm +  "Urheberrecht" + zz;
			        break;
			    case 5 : newtext = newtext + za + ampel + zm +  "Wettbewerbsrecht" + zz;
			        break;
			    case 6 : newtext = newtext + za + ampel + zm +  "Halbleiterschutz <sup><font size=1em>*</font></sup>&nbsp;" + zz;
			        break;
			    case 7 : newtext = newtext + za + ampel + zm +  "Sortenschutz <sup><font size=1em>*</font></sup>&nbsp;" + zz;
			        break;			        			        			        			        			        			        
			    default :
			        newtext = newtext + "0";
			}
	}  	
	
	newtext = newtext + "</table><br>"
	
	newtext = newtext + "<p class=text>" + kag + "&nbsp;&nbsp;.&nbsp;.&nbsp;.&nbsp;In erster Linie gesch&uuml;tzt</p>";
	newtext = newtext + "<p class=text>" + kar + "&nbsp;&nbsp;.&nbsp;.&nbsp;.&nbsp;In zweiter Linie und damit unzul&auml;nglich oder erg&auml;nzend gesch&uuml;tzt</p>";
	newtext = newtext + "<p class=text>" + "*&nbsp;.&nbsp;.&nbsp;.&nbsp;Schutz durch Anmeldung</p>";

//  	document.getElementById("wswdiv").style.top = window.event.clientY + document.body.scrollTop - 20;
  	if (wo == "r")
  		sl=450;
  	else
  		sl=150;
  		
//  	document.getElementById("wswdiv").style.left = window.event.clientX + document.body.scrollLeft+20;
//  	document.getElementById("wswdiv").style.left = sl;
    document.getElementById("wswdiv").innerHTML = newtext;
    document.getElementById("wswdiv").style.visibility = "visible";
}

function unshowWSW()
{
  if (document.getElementById)
    document.getElementById("wswdiv").style.visibility = "hidden";
}


function showbook (text) 
{
	if (document.getElementById)
	{ 
	  	document.getElementById("Bookdetail").style.top = window.event.clientY + document.body.scrollTop;
	  	document.getElementById("Bookdetail").style.left = window.event.clientX + document.body.scrollLeft;
	    document.getElementById("Bookdetail").innerHTML = text;  	
	    document.getElementById("Bookdetail").style.visibility = "visible";
	}
}

function unshowbook()
{
	if (document.getElementById)
		document.getElementById("Bookdetail").style.visibility = "hidden";
}



function ss(ID) 
{
	document.getElementById(ID).style.borderBottomWidth='2px';
	document.getElementById(ID).style.borderBottomStyle='inset';
	document.getElementById(ID).style.borderBottomColor='blue';
}

function rs(ID, iBorder) 
{

	document.getElementById(ID).style.borderBottomWidth='0px';
	if (iBorder==1)
	{
		document.getElementById(ID).style.borderBottomWidth='1px';
		document.getElementById(ID).style.borderBottomStyle='dashed';
		document.getElementById(ID).style.borderBottomColor='808080';
	}
}


function showPara (ID, src) 
{
	var source = "http://www.patentportal.eu/" + src;
	

	if (document.getElementById)
	{
		document.getElementById(ID).style.top = window.event.clientY + document.body.scrollTop;
		document.getElementById(ID).style.left = window.event.clientX + document.body.scrollLeft-225;
		document.getElementById(ID).style.visibility = "visible";
	}

GetContent(source, ID)
}

function unshowPara(ID)
{
	if (document.getElementById)
		document.getElementById(ID).style.visibility = "hidden";
}





function dropInfo(blockId, opt_image) 
{

// Icons für Tree + auf- und zuklappen
var TREE_OPEN_URL = "http://www.patentportal.eu/img/tree_open.GIF";
var TREE_CLOSE_URL = "http://www.patentportal.eu/img/tree_close.GIF";
 
image1 = new Image();
image1.src = TREE_OPEN_URL;

	var blockNode = document.getElementById(blockId);
	if (blockNode.style.display == 'block')
	{
		blockNode.style.display = 'none';
		if (opt_image) 
			opt_image.src = TREE_CLOSE_URL;
	} 
	else 
	{
		blockNode.style.display='block';
		if (opt_image) 
			opt_image.src = TREE_OPEN_URL;
	}
}



function showBlock(blockId, opt_image) 
{
// Icons für Tree + auf- und zuklappen
var TREE_OPEN_URL = "http://www.patentportal.eu/img/zuklappen.GIF";
var TREE_CLOSE_URL = "http://www.patentportal.eu/img/aufklappen.GIF";
 
image1 = new Image();
image1.src = TREE_OPEN_URL;
	var blockNode = document.getElementById(blockId);
	if (blockNode.style.display == 'block')
	{
		blockNode.style.display = 'none';
		if (opt_image) 
			opt_image.src = TREE_CLOSE_URL;
	} 
	else 
	{
		blockNode.style.display='block';
		if (opt_image) 
			opt_image.src = TREE_OPEN_URL;
	}
}





//XMLHttpRequest
//Erzeugung des Anfrageobjektes
function AjaxObj()
{
	var anfrageobj;
	var browser = navigator.appName;
	if(browser == "Microsoft Internet Explorer")
	{
		anfrageobj = new ActiveXObject("Microsoft.XMLHTTP");
	}
	else
		anfrageobj = new XMLHttpRequest();
	return anfrageobj;
}

//Anfrage senden
function GetContent(filename, target)
{
	ContentTarget = target;
	http.open('get', filename, false);
	http.onreadystatechange = ProcessContent_1;
	http.send(null);
}


//var backgroundservice = setInterval("GetContent()", 1000);
function ProcessContent_1()
{
	if(http.readyState == 4)
	{
		var response = http.responseText;
		if (response != "")
		{
			//alert(response);
			document.getElementById(ContentTarget).innerHTML = response;

		}
	}
}



function showRS(Gesetz, RSNo) 
{

	var sourcePara = "";
	var sourceKomm = "";
	
	sourcePara = "http://www.patentportal.eu/Rechtsprechung/" + Gesetz + "/RS_" + RSNo + ".html";
	
	GetContent(sourcePara, "d_tree_para");

	if (document.getElementById)
		document.getElementById("closebtn").style.visibility ="hidden";
}


function showKommentierung(Gesetz, Para) 
{

	var sourcePara = "";
	var sourceKomm = "";
	
	sourcePara = "http://www.patentportal.eu/Gesetze/" + Gesetz + "/para_" + Para + ".html";
	sourceKomm = "http://www.patentportal.eu/Gesetze/" + Gesetz + "/komm_" + Para + ".html";
	
	GetContent(sourcePara, "d_tree_para");
	GetContent(sourceKomm, "d_tree_komm");

	if (document.getElementById)
		document.getElementById("closebtn").style.visibility ="hidden";
}

