
/* --- Schuelerlexikon - Lexika CD --------*/
/*                                         */ 
/* Projekt: PAETEC-DUDEN, Schuelerlexikon  */ 
/* Autor: Maurice Karg					   */
/* Kontakt: karg@helliwood.de         	   */
/* Generator: EduDesk 2000                 */
/* Datei: allgem.js                    	   */
/* ------------------- www.helliwood.de ---*/


/* Externe Fenster */


var swapImage = "";



function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function FensterOpen(myUrl,winName)
{ 
  winName=winName+String(Math.floor(Math.random()*1000));
  window.open(myUrl, winName, "scrollbars=yes,menubar=yes,toolbar=yes,status=yes,resizable=yes,width=620,height=460");
}

function FensterOpenImpressum(myUrl,winName)
{ 
  winName=winName+String(Math.floor(Math.random()*1000));
  window.open(myUrl, winName, "scrollbars=yes,menubar=yes,toolbar=yes,status=yes,resizable=yes,width=620,height=460");
}
   
function LinkOpen(myUrl,winName)
{ 
  winName=winName+String(Math.floor(Math.random()*1000));
  window.open(myUrl, winName,"scrollbars=yes,menubar=yes,toolbar=yes,status=yes,resizable=yes,location=yes,width=620,height=460");
}

var myMediaFile ='';

function MyMediaOpen(myUrl,winName,myMediaUrl)
{ 
  myMediaFile = myMediaUrl;
  winName=winName+String(Math.floor(Math.random()*1000));
  window.open(myUrl, winName,"scrollbars=yes,menubar=yes,toolbar=no,status=no,resizable=no,location=no,width=360,height=320");
}

var myPdfFile ='';

function MyPdfOpen(myUrl,winName,myPdfUrl)
{ 
  myPdfFile = myPdfUrl;
  winName=winName+String(Math.floor(Math.random()*1000));
  window.open(myUrl, winName,"scrollbars=yes,menubar=yes,toolbar=yes,status=yes,resizable=yes,location=no,width=560,height=460");
}

var myMathCadView ='';
var myMathCadFile ='';

function MyMathCadOpen(myUrl,winName,myMathCadUrl,myMathCadGif)
{ 
  myMathCadView = myMathCadGif;
  myMathCadFile = myMathCadUrl;
  winName=winName+String(Math.floor(Math.random()*1000));
  window.open(myUrl, winName,"scrollbars=yes,menubar=yes,toolbar=yes,status=yes,resizable=no,location=no,width=620,height=460");
}

function MyMore()
{
  document.location.href="full.htm"
}


function BildInfo()
{	
 if (parent.frames.length != 0)
 {
   MyHeadInfo = '<img src="../../../images/leer.gif" height="1">'
 }  
 else
 {
	var breite = 590;
 	var hoehe = 500;
   	self.resizeTo(breite,hoehe);
   MyHeadInfo = '<img src="../../../images/printpic.gif">'
 }
}

function MyCRight()
{	
	MyCRightInfo = '<div class="textCopyright" style="margin-left:130px;margin-top:10px; width:422px">© Bibliographisches Institut & F. A. Brockhaus AG, Mannheim und DUDEN PAETEC GmbH, Berlin. Alle Rechte vorbehalten. www.schuelerlexikon.de</div>';
}

function MyCRight2()
{	
	MyCRightInfo = '<span class="copyright">© Bibliographisches Institut & F. A. Brockhaus AG, Mannheim und DUDEN PAETEC GmbH, Berlin. Alle Rechte vorbehalten. www.schuelerlexikon.de</span>';
}

function MyOpenAno( id )
{
	args = MyOpenAno.arguments;
	if( args[1] != undefined ) {
		imgNr = args[1];
	} else {
		imgNr = "";
	}
	
	if( swapImage != "" ) {
		MM_swapImage(swapImage,'','../images/i_site.gif',1);
	}
	
	if( imgNr != "" ) {
		MM_swapImage('site'+imgNr,'','../images/i_site2.gif',1);
		swapImage = 'site'+imgNr;
	} else {
		MM_swapImage('site'+id,'','../images/i_site2.gif',1);
		swapImage = 'site'+id;
	}
	info = parent.parent.frames['naviFrame']['searchFrame'].content[id];
	parent.parent.frames['mainFrame'].location.href=info[2]+"ano.htm";
	parent.parent.frames['toolsFrame'].location.href="../related/rela"+id+".htm";
	
}

function MyOpenRelatedAno( id )
{
	info = parent.frames['naviFrame']['searchFrame'].content[id];
	parent.frames['mainFrame'].location.href=info[2]+"ano.htm";
	parent.frames['toolsFrame'].location.href="../related/rela"+id+".htm";
}

function MyTimelineOpenAno( id )
{
	info = parent.frames['naviFrame']['searchFrame'].content[id];
	winName="timeline";
	winName=winName+String(Math.floor(Math.random()*1000));
	window.open(info[2]+"ano.htm", winName, "scrollbars=yes,menubar=yes,toolbar=yes,status=yes,resizable=yes,width=620,height=460");
}

function MyInhalt()
{
	parent.parent.frames['naviFrame'].location.href="navi.htm";
	parent.parent.frames['mainFrame'].location.href="main.htm";
	parent.parent.frames['toolsFrame'].location.href="tools.htm";
}

function MyAZ()
{
	info = parent.parent.frames['naviFrame']['searchFrame'].content[0];
	parent.parent.frames['naviFrame'].location.href="navi_a_z.htm";
	parent.parent.frames['mainFrame'].location.href=info[2]+"ano.htm";
	parent.parent.frames['toolsFrame'].location.href="../related/rela"+0+".htm";
}

function showKeywords( span ) {

	displayType = ( document.getElementById( span ).style.display == 'none' ) ? 'inline' : 'none';
	document.getElementById( span ).style.display = displayType;
	
}  

function MyPrintVersion()
{
  winName="Print";
  myUrl = parent.frames['mainFrame'].location.href;
  myHelp = myUrl.toLowerCase();
  if (myHelp.indexOf('related') == -1)
  {
    winName=winName+String(Math.floor(Math.random()*1000));
    window.open(myUrl, winName, "scrollbars=yes,menubar=yes,toolbar=yes,status=yes,resizable=yes,width=620,height=460");
  }	
}

function MyOnlineLink(mySection)
{
 Check = confirm("Bist du bereits online?");
 if (Check == true) 
 {
    winName="Online"+String(Math.floor(Math.random()*1000));
	myContent="physik";
	myUrl="http://www.schuelerlexikon.de/cgi-bin/related.pl?"+myContent+"."+mySection;
    window.open(myUrl, winName,"scrollbars=yes,menubar=yes,toolbar=yes,location=yes,status=yes,resizable=yes,width=620,height=460");
 } 
 else 
   alert('Verbinde dich erst mit dem Internet!');
 }
 
 function MyDirectLink(myID)
{
 Check = confirm("Bist du bereits online?");
 if (Check == true) 
 {
    winName="Online"+String(Math.floor(Math.random()*1000));
	myContent="physik";
	myUrl="http://www.schuelerlexikon.de/connect/directlink.php?fach="+myContent+"&id"+myID;
    window.open(myUrl, winName,"scrollbars=yes,menubar=yes,toolbar=yes,location=yes,status=yes,resizable=yes,width=620,height=460");
 } 
 else 
   alert('Verbinde dich erst mit dem Internet!');
 }
 
function MyOnline() {

	Check = confirm("Bist du bereits online?");
	
	if(Check == true) {
		winName="Online"+String(Math.floor(Math.random()*1000));
		myUrl="http://www.schuelerlexikon.de";
		window.open(myUrl, winName,"scrollbars=yes,menubar=yes,toolbar=yes,location=yes,status=yes,resizable=yes,width=640,height=480");
	} else { 
 		alert('Verbinde dich erst mit dem Internet!');
	}
}
// SCROLLER-FUNCTIONS

// Geschwindigkeit
var speed=2;

containerHeight = new Object();
resizeLayer		= new Object();

function Scroller( sName, count, row_max, row_height, offset ) {
	
	// Fenstergröße ermitteln und in ArrayObject einfügen	
	if( count <= row_max ) {
		containerHeight[sName] 	= count*row_height + (offset);
		resizeLayer[sName]		= true;
	} else {
		containerHeight[sName] = row_max*row_height + (offset);
		resizeLayer[sName]		= false;
	}
	
	document.write('<div id="'+sName+'Container" style="z-index:1;position:relative;height:'+containerHeight[sName]+'px;width:150px;overflow:hidden;">');
	document.write('<div id="'+sName+'" style="position:absolute;width:150px;left:0px;top:0px">');
	
}

function endScroller( sName ) {

	document.write('</div></div>');

//	alert(document.all.verwandt.offsetHeight);
	
	crossobj = MM_findObj(sName);
	contentheight = crossobj.offsetHeight;
	
}

function resizeScrollLayer() {
	
	for( var key in resizeLayer ) {
		
		crossobj = MM_findObj(key);
		contentheight = crossobj.offsetHeight;
		
		if( resizeLayer[key] == true ) {
			containerHeight[key] = contentheight;
			MM_changeProp(key+'Container','','style.height',contentheight+'px');
		} else {
			MM_changeProp('b_'+key+'_up','','style.display','inline');
			MM_changeProp('b_'+key+'_down','','style.display','inline');
		}
	}
	
}

function moveDown( sName ) {
	
	crossobj = MM_findObj(sName);
	contentheight = crossobj.offsetHeight;
	
	if( window.moveupvar ) clearTimeout( moveupvar );
	
	if( parseInt( crossobj.style.top ) >= (contentheight*(-1)+(containerHeight[sName]+2)) ) {
		crossobj.style.top = parseInt(crossobj.style.top)-speed+"px";
	}
	
	movedownvar = setTimeout("moveDown('"+sName+"')",20);
	
}

function moveUp( sName ) {

	crossobj = MM_findObj(sName);
	contentheight = crossobj.offsetHeight;
	
	if( window.movedownvar ) clearTimeout( movedownvar );
	
	if( parseInt( crossobj.style.top ) <= -2 ) {
		crossobj.style.top = parseInt(crossobj.style.top)+speed+"px";
	}
	
	moveupvar = setTimeout("moveUp('"+sName+"')",20);
	
}

function stopScroll() {

	if ( window.moveupvar ) clearTimeout(moveupvar);
	if ( window.movedownvar ) clearTimeout(movedownvar);
	
}


// TOPIC-MAP

function MyOpenTopicMap( id ) {
	
	parent.frames['mainFrame'].location.href = "../topicmap/tnavigat/start/map.htm#"+id;
	
}
