/*-- SH Technologies Homepage - Java Script file --
Java Script File
Source : scripte.js
Author : Sven Hüber
Revision : 1.0
Date : 12-Oct-2001
*/

var NavType;					// variable contains used browser
var actCont = "shtechtext";		// defines current active content
var stockIndex = 0;				// shown stock window content number
var contentString;				// dynamic generated HTML content 

var array=[
"08.01.2002,11.01.2002,http://www.cesweb.org/,International Consumer Electronics (CES),Las Vegas-NV,Hardware",
"16.01.2002,,http://www.omnicard.de/chip_einstieg.php?ZielID=0,OmniCard,Berlin,Sicherheit",
"25.01.2002,,http://www.dfb.de,EM-Auslosung 2004,Porto,Sport",
"27.01.2002,30.01.2002,http://www.iuiconf.org/,International Conference on Intelligent User Interfaces (IUI),San Francisco-CA,Software Engineering",
"28.01.2002,31.01.2002,http://www.euro-online.de,Online,Düsseldorf,Internet",
"03.02.2002,,#,Super Bowl,New Orleans,Sport",
"04.02.2002,08.02.2002,http://www.milia.com/,Milia,Cannes,Computing",
"05.02.2002,08.02.2002,http://www.palmsource.com/,PalmSource,San Jose-CA,Hardware",
"05.02.2002,08.02.2002,http://www.learntec.de/,LearnTec,Karlsruhe,Software Engineering",
"08.02.2002,24.02.2002,#,Olympischen Winterspiele,Salt Lake City,Sport",
"13.02.2002,,http://www.dfb.de,L&auml;nderspiel Deutschland-Israel,Kaiserslautern,Sport",
"13.02.2002,15.02.2002,http://www.perlworkshop.de/2002/,Deutscher Perl-Workshop 4.0,Sankt Augustin,Programming",
"18.02.2002,22.02.2002,http://www.nordu.org/NordU2002/,4th NordU/Usenix Conference,Helsinki,Systeme",
"03.03.2002,,http://www.formel1.de,GP von Australien,Melbourne,Sport",
"04.03.2002,07.03.2002,http://www.key3media.com/comdex/chicago2002/,Comdex,Chicago-IL,Hardware",
"07.03.2002,16.03.2002,#,Paralympics,Salt Lake City,Sport",
"11.03.2002,14.03.2002,http://www.knowledgetechnologies.net/,Knowledge Technologies Conference,Seattle-WA,Computing",
"13.03.2002,20.03.2002,http://www.cebit.de/,CeBIT,Hannover,Hardware",
"21.03.2002,22.03.2002,http://www.information24.net/kwid/,Business Intelligence (11.Fachkonferenz von DGI und SVD-ASD),Heidelberg,E-Commerce",
"24.03.2002,28.03.2002,http://www.VR2002.org/,Virtual Reality,Orlando-FL,Multimedia",
"25.03.2002,29.03.2002,http://servlet.java.sun.com/javaone/,JavaOne,San Francisco-CA,Java",
"27.03.2002,,http://www.dfb.de,L&auml;nderspiel Deutschland-USA,Rostock,Sport",
"14.04.2002,17.04.2002,http://www.taga.org/events/taga2002-asheville.html,Technical Association of Graphics Art (TAGA),Asheville-NC,Multimedia",
"15.04.2002,20.04.2002,http://www.hannovermesse.de/,Hannovermesse Industrie (HMI),Hannover,Hardware",
"17.04.2002,,http://www.dfb.de,L&auml;nderspiel Deutschland-Argentinien,Stuttgart,Sport",
"21.04.2002,24.04.2002,http://www.science.uva.nl/events/ICCS2002/,International Conference on Computational Science,Amsterdam,Computing",
"28.04.2002,,#,Motocross WM-Lauf,Mitteldeutschland,Sport",
"07.05.2002,11.05.2002,http://www.www2002.org/,11th World Wide Web Conference,Honolulu-Hawaii,WWW",
"09.05.2002,,http://www.dfb.de,L&auml;nderspiel Deutschland-Kuwait,Freiburg,Sport",
"11.05.2002,,http://www.dfb.de,DFB-Pokal-Finale,Berlin,Sport",
"11.05.2002,02.06.2002,#,Giro dItalia,Italien,Sport",
"14.05.2002,,http://www.dfb.de,L&auml;nderspiel Deutschland-Wales,Cardiff,Sport",
"14.05.2002,16.05.2002,http://www.infosecurity.de/Start.html,infosecurity.de,Düsseldorf,Sicherheit",
"15.05.2002,,http://www.championsleague.com,Champions-League-Finale,Glasgow,Sport",
"18.05.2002,,http://www.dfb.de,L&auml;nderspiel Deutschland-&Ouml;stereich,Leverkusen,Sport",
"27.05.2002,31.05.2002,http://www.nluug.nl/events/sane2002/,3rd International SANE Conference,Maastricht,Verwaltung",
"04.06.2002,08.06.2002,http://www.reedexpo.com/,Digital Behaviour,Düsseldorf,Computing",
"04.06.2002,06.06.2002,http://www.internetworld-messe.de/,Internet World,Berlin,Internet",
"11.06.2002,,http://www.ltt.de/,Linux@work,Frankfurt/Main,Linux.BSD",
"16.06.2002,17.06.2002,#,24 Stunden von Le Mans,Le Mans,Sport",
"21.06.2002,,http://www.formel1.de,GP von Europa,Nuuml;rburgring,Sport",
"21.07.2002,25.07.2002,http://www.siggraph.org/s2002/,SIGGraph,San Antonio-TX,Multimedia",
"22.07.2002,,#,Motorad-WM,Sachsenring,Sport",
"22.07.2002,26.07.2002,http://ddi.cs.uni-dortmund.de/dortmund2002/index_html,Social,ethical and cognitive issues of informatics and ICT SECI3 (IFIP/GI),Dortmund,Computing",
"28.07.2002,,http://www.formel1.de,GP von Deutschland,Hockenheim-Ring,Sport",
"15.09.2002,,#,US-Cart-Serie,Lausitzring,Sport",
"13.10.2002,,http://www.formel1.de,GP von Japan,Suzuka,Sport",
"28.12.2002,13.01.2003,#,Rallye Paris-Dakar,Afrika,Sport"
];


// function to automatic activate the right page version
function changeSite()
{
 Nav=navigator.appName+" "+navigator.appVersion;
 if(Nav.indexOf("4.")!=-1) location.href="content_css.html";
 else if(Nav.indexOf("5.")!=-1) location.href="content_css.html";
 else if(Nav.indexOf("6.")!=-1) location.href="content_css.html";
 else location.href="frameset.html";
}


// function to save the used browser version at NavType variable
function NavTypeDetection()
{
 if(navigator.appName.indexOf("Netscape")!=-1)
 {
  if(navigator.appVersion.substring(0,1) == "4") NavType = "N4";
  if(navigator.appVersion.substring(0,1) == "5") NavType = "N6";
 }
 else NavType = "M";
}


// function to change the stock window content
function stockChange(direction)
{
 var stockArray = new Array("http://cdchart.innovative-software.com/informer2/small_chart?symm=dax_intra","http://cdchart.innovative-software.com/informer2/small_chart?symm=nm_intra","http://cdchart.innovative-software.com/informer2/small_chart?symm=dj_intra","http://cdchart.innovative-software.com/informer2/small_chart?symm=nasdaq_intra");
 if(NavType=="N4" && direction==1)
 {
  stockIndex+=1;
  if(stockIndex == 4) stockIndex=0;
  document.layers["chart"].src=stockArray[stockIndex];
 }
 if(NavType=="N4" && direction==0)
 {
  stockIndex-=1;
  if(stockIndex == -1) stockIndex=3;
  document.layers["chart"].src=stockArray[stockIndex];
 }
 if((NavType=="M" || NavType=="N6") && direction==1)
 {
  stockIndex+=1;
  if(stockIndex == 4) stockIndex=0;
  document.getElementsByName("chart").innerHTML="<IMG SRC="+stockArray[stockIndex]+">";
 }
 if((NavType=="M" || NavType=="N6") && direction==0)
 {
  stockIndex-=1;
  if(stockIndex == -1) stockIndex=3;
  document.getElementsByName("chart").innerHTML="<IMG SRC="+stockArray[stockIndex]+">";
 }
}


// function to show/hide additional toc description
function dynInfo(obj,action)
{
 if(NavType=="N4" && action==1) document.layers[obj].visibility="visible";
 if(NavType=="N4" && action==0) document.layers[obj].visibility="hide";
 if((NavType=="M" || NavType=="N6") && action==1) document.getElementById(obj).style.visibility="visible";
 if((NavType=="M" || NavType=="N6") && action==0) document.getElementById(obj).style.visibility="hidden";
}


// function for dynamic event table creation
function createEventTable()
{
 contentString="<table width=100% height=100% border=1 cellspacing=2 cellpadding=5 align=center><tr bgcolor=#000066><td><font color=#FFFFFF><b>Area</b></font></td><td><font color=#FFFFFF><b>Event</b></font></td><td><font color=#FFFFFF><b>Date</b></font></td><td><font color=#FFFFFF><b>Location</b></font></td></tr>"
 today=new Date();
 date=today.getDate()+(today.getMonth()+1)*100+today.getFullYear()*10000;
 for(var lines=0;lines<array.length;lines++)
 {
  data=array[lines].split(",");
  datearray1=data[0].split(".");
  date1=datearray1[0]*1+datearray1[1]*100+datearray1[2]*10000;
  if(data[1]!="")
  {
   datearray2=data[1].split(".");
   date2=datearray2[0]*1+datearray2[1]*100+datearray2[2]*10000;  
  }
  else date2=date1;
  if(date<=date2)
  {
   if(date>=date1&&date<=date2) color="00FF00";
   else color="FFFFFF";
   contentString+="<tr bgcolor=#"+color+"><td>"+data[5]+"</td><td><a href="+data[2]+" target=_top>";
   contentString+="<font size=3><b>"+data[3]+"</b></font><br></a></td>";
   if(data[1]!="") contentString+="<td>"+data[0]+" - "+data[1]+"</td>";
   else contentString+="<td>"+data[0]+"</td>";
   contentString+="<td>"+data[4]+"</td></tr>";
  }
 }
 contentString+="</table>"
 
 if(NavType == "N4")
 {
  document.layers["event"].document.open();
  document.layers["event"].document.writeln(contentString);
  document.layers["event"].document.close();
 }
 
 if((NavType == "M") || (NavType == "N6"))
 {
  document.getElementById("event").innerHTML=contentString;
 }
}


// function to change the shown main content
function activeContent(obj)
{
 if(NavType == "N4")
 {
  if(obj == "en")
  {
   document.layers["content_de"].visibility="hide";
   document.layers["content_en"].visibility="visible";
  }
  else
  {
   document.layers["content_en"].visibility="hide";
   document.layers["content_de"].visibility="visible";
  }
 }
 if((NavType == "M") || (NavType == "N6"))
 {
  if(obj == "en")
  {
   document.getElementById("content_de").style.visibility="hidden";
   document.getElementById("content_en").style.visibility="visible";
  }
  else
  {
   document.getElementById("content_en").style.visibility="hidden";
   document.getElementById("content_de").style.visibility="visible";
  }
 }
}


// change headline image of light version page
function chgHeadline(file)
{
 filename="./Images/"+file;
 if(top.frames.length > 0) parent.frames[0].document.images[5].src=filename;
}


// change to german page version
function chg2de()
{
 str=parent.frames[2].location.pathname.split("/"); <!-- bei WWW-URLs Dateiname=Array[1]-->
 strfn=str[1].split("-");
 if(strfn[1]=="en.html") parent.frames[2].location.href=strfn[0]+"-de.html";
}


// change to englisj page version
function chg2eng()
{
 str=parent.frames[2].location.pathname.split("/"); <!-- bei WWW-URLs Dateiname=Array[1]-->
 strfn=str[1].split("-");
 if(strfn[1]=="de.html") parent.frames[2].location.href=strfn[0]+"-en.html";
}


// change the dedicated picture
function showpic(picture)
{
 if(picture=="wetter")
 {
  var today=new Date();
  var ms=today.getTime();
  var yesterday=new Date();
  yesterday.setTime(ms-86400000);
  picID=yesterday.getYear()*10000+(yesterday.getMonth()+1)*100+yesterday.getDate();
  pic="pre"+picID;
  wetterpic="http://www.t-online.de/nachrich/images/ic"+pic.slice(4,10)+".gif";
  document.images[1].src=wetterpic;
 }
 else document.images[2].src=picture;
}

// function to realize the drop down box selection at linkpage
function Go(x)
{
 if(x == "nothing")
 {
  document.forms[0].reset();
  document.forms[0].elements[0].blur();
  return;
 }
 else
 {
  location.href = "csstest-de.html"+x;
  document.forms[0].reset();
  document.forms[0].elements[0].blur();
 }
}


// photo album function
function pic(x)
{
 picture="http://home.t-online.de/home/sven.hueber/photos/Pic0"+x+".jpg";
 picview = open("","picview","toolbar=no,location=no,directories=no,menubar=no,status=no,width=550,height=550");
 picview.document.open();
 picview.document.writeln("<html><head><title>Picture View</title>");
 picview.document.writeln("</head><body>");
 picview.document.writeln("<table width=100% height=80%><tr align=center valign=center><td><img src="+picture+"></td></tr></table>");
 picview.document.writeln("<table width=100%><tr align=center><td><a href='javascript:close();'><b>BACK</b></a></td></tr></table>");
 picview.document.writeln("</body></html>");
 picview.document.close();
 picview.focus();
}

