﻿/* 	JAVASCRIPT Code www.cogbyte.de  	*/
/*	A. Dickmann 17.02.2007			*/
/*       the Cogbyte-Team		      	*/


var german = new String('<object type="text/html" data="/Cogbyte/content/hallo_de.html" width="650" height="420"></object>');
var russia='<object type="text/html" data="/Cogbyte/content/hallo_ru.html" width="650" height="420"></object>';
var english='<object type="text/html" data="/Cogbyte/content/hallo_en.html" width="650" height="420"></object>';
var vietnam='<object type="text/html" data="/Cogbyte/content/hallo_vn.html" width="650" height="420"></object>';
var poland='<object type="text/html" data="/Cogbyte/content/hallo_pl.html" width="650" height="420"></object>';
var france='<object type="text/html" data="/Cogbyte/content/hallo_fr.html" width="650" height="420"></object>';
var spain='<object type="text/html" data="/Cogbyte/content/hallo_sp.html" width="650" height="420"></object>';
var croat='<object type="text/html" data="/Cogbyte/content/hallo_hr.html" width="650" height="420"></object>';
var portugal='<object type="text/html" data="/Cogbyte/content/hallo_pt.html" width="650" height="420"></object>';

var infoLink1='<p>Ihr wollt ein <b>Unternehmen</b> an eurer Schule gründen? Hier findet ihr Antworten zur<br />Vorgehensweise, Anmeldung und Förderung.<p>Wie gründe ich eine <b>Schülerzeitung?</b> Hier findet ihr Tipps zum Gründungsablauf sowie<br /> zum Schreiben und Gestalten.</p>';
var infoLink2='<p>Ihr wollt mehr über <b>Wirtschaftsthemen</b> erfahren? Hier findet ihr Anregungen für Vorträge oder<br />Projekte im Unterricht.<p>Diese könnt ihr in den Fächern Arbeitslehre, Politische Weltkunde, Ethik und Wirtschaft vorstellen.</p>';
var infoLink3='<p><b>Cogbyte-Ticker Juni 2010:</b></p><br /><br /><b>Neuregelung zum Kontopf&auml;ndungsschutz</b><br /><p>Ab 1. Juli 2010 werden Schuldner bei Kontopf&auml;ndungen besser geschützt. Grund ist die Reformierung des Kontopf&auml;ndungsschutzes.</p><br />Weitere Info findest du <a href="http://www.cogbyte.de/project/Ticker.1394.0.html">hier</a>';

news = '<strong syle="font-size: 0.8pc;">'
  +'<ul><li><a href="/project/Newsletter.952.0.html" target="_self" title="Energieverbrauchskennzeichnung">Energieverbrauchskennzeichnung</a></li>'
  +'<li><a href="/project/Papier und Umwelt.1426.0.html" target="_self" title="Papier und Umwelt">Papier und Umwelt</a></li>'
  +'<li><a href="/project/Schiedsämter und Schiedsstellen.1083.0.html" target="_self" title="Schiedsämter und Schiedsstellen">Schiedsämter und Schiedsstellen</a></li>' 
  +'<li><a href="/project/Archiv.1053.0.html" target="_self" title="Archiv-Downloads">Archiv</a></li></ul></strong>';


function Alert(text, variable) {
  alert(text+" "+variable);
}

function ShowBox(lang, value) {

  switch(lang)
  {
    case "ger":
      document.getElementById("lang").innerHTML=german;
      document.getElementById("lang").style.top="120px";
    break;
    case "eng":
      document.getElementById("lang").innerHTML=english;
      document.getElementById("lang").style.top="120px";
    break;
    case "ru":
      document.getElementById("lang").innerHTML=russia;
      document.getElementById("lang").style.top="120px";
    break;
    case "vt":
      document.getElementById("lang").innerHTML=vietnam;
      document.getElementById("lang").style.top="120px";
    break;
    case "pl":
      document.getElementById("lang").innerHTML=poland;
      document.getElementById("lang").style.top="120px";
    break;
    case "fr":
      document.getElementById("lang").innerHTML=france;
      document.getElementById("lang").style.top="120px";
    break;
    case "sp":
      document.getElementById("lang").innerHTML=spain;
      document.getElementById("lang").style.top="120px";
    break;
    case "hr":
      document.getElementById("lang").innerHTML=croat;
      document.getElementById("lang").style.top="120px";
    break;
    case "pt":
      document.getElementById("lang").innerHTML=portugal;
      document.getElementById("lang").style.top="120px";
    break;
    case "infoLink1":
      document.getElementById("lang").innerHTML=infoLink1;
      document.getElementById("lang").style.top="180px";
    break;
    case "infoLink2":
      document.getElementById("lang").innerHTML=infoLink2;
      document.getElementById("lang").style.top="360px";
    break;
    case "infoLink3":
      document.getElementById("lang").innerHTML=infoLink3;
      document.getElementById("lang").style.top="60px";
      document.getElementById("lang").style.left="350px";
    break;
    case "nl":
      document.getElementById("lang").innerHTML=news;
      document.getElementById("lang").style.top="400px";
      document.getElementById("lang").style.left="16px";
    break;
  }
  document.getElementById("lang").style.display="inline";
}

function HideBox() {
  document.getElementById("lang").style.display="none";
  document.getElementById("lang").style.left="270px";
}

function Init(wnd)  {
    var x,y;

  x=screen.width;
  y=screen.height;
}

function Greeting() {
   document.write("<h1>TOLL, DASS DU UNSER ANGEBOT NUTZT...</h1>");
	//OS  = navigator.userAgent;
	//if(OS.search(/Linux/) != -1)
	//	alert("LINUX");
  /* if(navigator.appName == "Microsoft Internet Explorer")
      alert("Bitte über das Menü 'Ansicht -> Schriftgrad/Textgröße: sehr klein' wählen. Wir empfehlen übrigens Mozilla Firefox ...");
 */
}

function correctPNG() // correctly handle PNG transparency in Win IE 5.5 or higher.
   {
   browser = navigator.appVersion;
   result = browser.search(/MSIE 6.+/);
   if(result != -1) {
	for(var i=0; i<document.images.length; i++)
      {
	  var img = document.images[i]
	  var imgName = img.src.toUpperCase()
	  if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
	     {

		 var imgID = (img.id) ? "id='" + img.id + "' " : ""
		 var imgClass = (img.className) ? "class='" + img.className + "' " : ""
		 var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
		 var imgStyle = "display:inline-block;" + img.style.cssText 
		 if (img.align == "left") imgStyle = "float:left;" + imgStyle
		 if (img.align == "right") imgStyle = "float:right;" + imgStyle
		 if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle		
		 var strNewHTML = "<span " + imgID + imgClass + imgTitle
		 + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
	     + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
		 + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
		 img.outerHTML = strNewHTML
		 i = i-1
	     }
      }
   }
}
//window.attachEvent("onload", correctPNG);	//fknt. nur bei IE

function navigWindow()  {  
  var wnd;
  
  if (navigator.javaEnabled())  {
    var txt='<div id="Navig" style="display:none;" align="center"><applet  id="Baum" CODE = "com.touchgraph.linkbrowser.LinkBrowserApplet.class" ARCHIVE = "/Hexplorer/TGLinkBrowser.jar, /Hexplorer/nanoxml-2.1.1.jar" width = "615" HEIGHT = "425"> <PARAM NAME = "type" VALUE="application/x-java-applet;version=1.3" /> <PARAM NAME = "scriptable" VALUE="false" /> <PARAM NAME = "browser" VALUE ="yes" />  <param name=targetFrame value= "seite" /> <param name=externalFrame value = "externalFrame" /> <param name=initialXmlFile value = "/Hexplorer/TouchGraph.xml" /> <!-- <param name=initialNode value="" /> --></applet></div>';
    if (wnd==null || wnd.closed==true)  {
	if (this.navigator.appName=="Netscape")
        wnd = open('','navig','width=635, height=500, screenX=206, screenY=180, resizable=no');
      else
        wnd = open('','navig','width=635, height=500, left=206, top=180, resizable=no');          	//alert("Fenster: "+wnd.name+" Frame: "+this.name);
	  
	wnd.document.title="Cogbyte's graphische Navigation ";
      wnd.document.write('<h4><font face="Verdana, Arial">Navigation im Wissens-Speicher von Cogbyte</font></h4><hr />');
      wnd.document.write(txt);
      wnd.document.getElementById("Navig").style.display = "inline";
      wnd.document.close();
    }
  }
  else  {
    wnd=this;
    document.write('<h3>*** Bitte Java im Browser einschalten oder <a href="Hilfe.348.0.html" style="text-decoration:none;">installieren</a> ***</h3>');
    document.write('<div align="center"><img src="fileadmin/images/navi-baum.png"'); 
    document.write(' alt="Navigation im Speicher mit dem Hyper-Graph" width="580" height="350" /></div>');
    document.close();
  }
  return wnd;
}

function NaviBaum()  {

  this.name="seite";
  if(window.wnd==null)  {
    window.wnd=navigWindow();
    //alert("window.wnd==null: "+window.wnd.name+"\nName: "+this.name);
    wnd.focus();
    return;
  }
  if (window.wnd.closed==true)  {
	window.wnd=navigWindow();
      //alert("window.wnd.closed==true: "+window.wnd.name);
      wnd.focus();
    }
    else	{
      //alert("minimiert: "+wnd.name);
      wnd.focus();
    }
}

