// JavaScript Document
/**
 * Displays an confirmation box beforme to submit a "Löschen" query.
 * This function is called while clicking links
 *
 * @param   object   the link
 * @param   object   the sql query to submit
 *
 * @return  boolean  whether to run the query or not
 */
function confirmLink(theLink, theAction)
{
    // Confirmation is not required if browser is Opera (crappy js implementation)
    if (typeof(window.opera) != 'undefined') {
        return true;
    }

    var is_confirmed = confirm(theAction);
    if (is_confirmed) {
        theLink.href += '&is_js_confirmed=1';
    }

    return is_confirmed;
} // end of the 'confirmLink()' function



/** 
 * Öffnen eines kleinen Fensters für Autoren, Lehrbücher usw.
*/
function kindWindow(theFile, theTitel, theSizeX, theSizeY)
{
  window.open(theFile,theTitel,'width='+theSizeX+',height='+theSizeY+',screenX=10,screenY=10,resizable=no')
}

function kindWindowRes(theFile, theTitel, theSizeX, theSizeY)
{
  window.open(theFile,theTitel,'width='+theSizeX+',height='+theSizeY+',screenX=10,screenY=10,resizable=yes')
}

// Frontpage Preload / Overlay-Funktionen
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_preloadImagesPlusScrollStart() {
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImagesPlusScrollStart.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}

	if (d.all) iemarquee(slider);
	else if (d.getElementById)
	ns6marquee(d.getElementById('slider'));
	else if(d.layers)
	ns4marquee(d.slider1.document.slider2);

}

function MM_findObj(n, d) { //v3.0
  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); return x;
}

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 swapImage (id, img)
{
  var imgObj = getElement (id);
  if (imgObj != null) {
    imgObj.src = img.src;
  }
  return false;
}


//Scrollbox
function start_scroller(){
    var d=document;	
	
	if (d.all) iemarquee(slider);
	else if (d.getElementById)
	ns6marquee(d.getElementById('slider'));
	else if(d.layers)
	ns4marquee(d.slider1.document.slider2);
}

function iemarquee(whichdiv){
	iediv=eval(whichdiv)
	iediv.style.pixelTop=sheight
	iediv.innerHTML=msg 
	sizeup=iediv.offsetHeight
	ieslide()
}
function ieslide(){
	if (iediv.style.pixelTop>=sizeup*(-1)){
	iediv.style.pixelTop-=sspeed
	setTimeout("ieslide()",100)
	}
	else{
	iediv.style.pixelTop=sheight
	ieslide()
	}
}
function ns4marquee(whichlayer){
	ns4layer=eval(whichlayer)
	ns4layer.top=sheight
	ns4layer.document.write(msg)
	ns4layer.document.close()
	sizeup=ns4layer.document.height
	ns4slide()
}
function ns4slide(){
	if (ns4layer.top>=sizeup*(-1)){
	ns4layer.top-=sspeed
	setTimeout("ns4slide()",100)
	}
	else{
	ns4layer.top=sheight
	ns4slide()
	}
}
function ns6marquee(whichdiv){
	ns6div=eval(whichdiv)
	ns6div.style.top=sheight
	ns6div.innerHTML=msg
	sizeup=ns6div.offsetHeight
	ns6slide()
}
function ns6slide(){
	if (parseInt(ns6div.style.top)>=sizeup*(-1)){
	ns6div.style.top=parseInt(ns6div.style.top)-sspeed
	setTimeout("ns6slide()",100)
	}
	else{
	ns6div.style.top=sheight
	ns6slide()
	}
}




//-->

