﻿// JScript-Datei
// c'2007 Spilger Hard- und Software
// www.spilger-computer.de

function styleSwitch(theElement,theStyle){
    theElement.className=theStyle;
}

function writeFlashLayer() {
document.writeln('<div id="flash_wetter_div" style="text-align:center; width: 150px; height: 178px; visibility: visible; z-index:1000;">');
document.writeln('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="150" height="178" id="flash_wetter_obj" align="middle">');
document.writeln('<param name="allowScriptAccess" value="always" />');
document.writeln('<param name="movie" value="' + FlashFile + '" />');
document.writeln('<param name="quality" value="high" />');
document.writeln('<param name="wmode" value="transparent" />');
document.writeln('<param name="bgcolor" value="#ffffff" />');
document.writeln('<embed id="flash_wetter" src="' + FlashFile + '" quality="high" wmode="transparent" bgcolor="#ffffff" width="150" height="178" name="wetter" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
document.writeln('</object>');
document.writeln('</div>');
}

function showFlashLayer() {

    var d = document.getElementById('dummy_wetter_div');
    if (d != null) {
        d.style.visibility = 'hidden';
        d.style.width=1;
        d.style.height=1;
        d.style.left= '-100px';
        d.style.position= 'absolute';
        d.style.top= '-100px';
    }
       
       var l = document.getElementById('flash_wetter_div');
    if (l != null) {
        l.width=151;
        l.height=178;
    }
    
    l = document.getElementById('flash_wetter_obj');
    if (l != null) {
        l.width=151;
        l.height=178;
        l.focus();
    }
    
    l = document.getElementById('flash_wetter');
    if (l != null) {
        l.width=151;
        l.height=178;
    }
}

function hideFlashLayer() {
    var d = document.getElementById('flash_wetter_div');
    if (d != null) {
        d.style.visibility = 'hidden';
    }
}

function doSendToFriend(oPID) {

    var oWindow = window.radopen('/system/sendtofriend.aspx?id=' + oPID);
    oWindow.setSize(800, 550);
    oWindow.moveTo(10,10);
    return true;
}

function writeFlashLayerSpeaker() {
    document.writeln('<div id="flash_speaker_div" title="Code vorlesen" style="text-align:center; width: 20px; height: 20px; visibility: visible; z-index:1000;">');
    document.writeln('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="20" height="20" id="flash_speaker_obj" align="middle">');
    document.writeln('<param name="allowScriptAccess" value="always" />');
    document.writeln('<param name="FlashVars" value="' + FlashVars + '" />');
    document.writeln('<param name="movie" value="' + FlashFile + '" />');
    document.writeln('<param name="quality" value="high" />');
    document.writeln('<param name="wmode" value="transparent" />');
    document.writeln('<param name="bgcolor" value="#ffffff" />');
    document.writeln('<embed id="flash_speaker" src="' + FlashFile + '" quality="high" wmode="transparent" bgcolor="#ffffff" width="20" height="20" name="speaker" align="middle" allowScriptAccess="always" FlashVars="' + FlashVars + '" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
    document.writeln('</object>');
    document.writeln('</div>');
}

function showFlashLayerSpeaker() {

    var d = document.getElementById('dummy_speaker_div');
    if (d != null) {
        d.style.visibility = 'hidden';
        d.style.width=1;
        d.style.height=1;
        d.style.left= '-100px';
        d.style.position= 'absolute';
        d.style.top= '-100px';
    }
       
       var l = document.getElementById('flash_speaker_div');
    if (l != null) {
        l.width=20;
        l.height=20;
    }
    
    l = document.getElementById('flash_speaker_obj');
    if (l != null) {
        l.width=20;
        l.height=20;
        l.focus();
    }
    
    l = document.getElementById('flash_speaker');
    if (l != null) {
        l.width=20;
        l.height=20;
    }
}

function writeFlashLayerVideo() {

    document.writeln('<div id="' + flash_div + '" title="" style="text-align:center; width: ' + iWidth + 'px; height: ' + iHeight + 'px; visibility: visible; z-index:1000;">');
    document.writeln('<param name="allowScriptAccess" value="always" />');
    document.writeln('<param name="movie" value="' + FlashFile + '" />');
    document.writeln('<param name="FlashVars" value="' + FlashVars + '" />');
    document.writeln('<param name="quality" value="high" />');
    document.writeln('<param name="wmode" value="transparent" />');
    document.writeln('<param name="bgcolor" value="#ffffff" />');
    document.writeln('<embed id="' + flash_emb + '" src="' + FlashFile + '" quality="high" wmode="transparent" bgcolor="#ffffff" width="' + iWidth + '" height="' + iHeight + '" name="video" align="middle" allowScriptAccess="always" FlashVars="' + FlashVars + '" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
    document.writeln('</object>');
    document.writeln('</div>');
}

//function writeFlashLayerVideo() {
//    document.writeln('<div id="' + flash_div + '" title="" style="text-align:center; width: ' + iWidth + 'px; height: ' + iHeight + 'px; visibility: visible; z-index:1000;">');
//    document.writeln('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + iWidth + '" height="' + iHeight + '" id="' + flash_obj + '" align="middle">');
//    document.writeln('<param name="allowScriptAccess" value="always" />');
//    document.writeln('<param name="movie" value="' + FlashFile + '" />');
//    document.writeln('<param name="FlashVars" value="' + FlashVars + '" />');
//    document.writeln('<param name="quality" value="high" />');
//    document.writeln('<param name="wmode" value="transparent" />');
//    document.writeln('<param name="bgcolor" value="#ffffff" />');
//    document.writeln('<embed id="' + flash_emb + '" src="' + FlashFile + '" quality="high" wmode="transparent" bgcolor="#ffffff" width="' + iWidth + '" height="' + iHeight + '" name="video" align="middle" allowScriptAccess="always" FlashVars="' + FlashVars + '" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
//    document.writeln('</object>');
//    document.writeln('</div>');
//}

function showFlashLayerVideo() {

    var d = document.getElementById(dummy_div);
    if (d != null) {
        d.style.visibility = 'hidden';
        d.style.width=1;
        d.style.height=1;
        d.style.left= '-100px';
        d.style.position= 'absolute';
        d.style.top= '-100px';
    }
       
       var l = document.getElementById(flash_div);
    if (l != null) {
        l.width= iWidth;
        l.height= iHeight;
    }
    
    l = document.getElementById(flash_obj);
    if (l != null) {
        l.width=iWidth;
        l.height=iHeight;
        l.focus();
    }
    
    l = document.getElementById(flash_emb);
    if (l != null) {
        l.width=iWidth;
        l.height=iHeight;
    }
}
/*
Simple Image Trail script- By JavaScriptKit.com
Visit http://www.javascriptkit.com for this script and more
This notice must stay intact
*/
var itemWidth = 250;
var itemHeight = 250;
var InlinePos = 0;
var offsetfrommouse=[15,15]; //image x,y offsets from cursor position in pixels. Enter 0,0 for no offset
var displayduration=0; //duration in seconds image should remain visible. 0 for always.
var currentimageheight = 270;	// maximum image size.
var noPicture = false;
function gettrailobj(){
if (document.getElementById)
return document.getElementById("trailimageid").style
else if (document.all)
return document.all.trailimagid.style
}
function gettrailobjnostyle(){
if (document.getElementById)
return document.getElementById("trailimageid")
else if (document.all)
return document.all.trailimagid
}
function truebody(){
return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}
function showtrail(imagename,title,description,showthumb,height, newItemWidth){
   if (newItemWidth != false) {
		itemWidth = newItemWidth;
	}
	if (height > 0){
		currentimageheight = height;
	}
	document.onmousemove=followmouse;
	cameraHTML = '';
	newHTML = ''//'<div>';
	//newHTML = newHTML + '<span>' + title + '</span><div class="borderbot"></div>';
	if (showthumb > 0){
			newHTML = newHTML + '<div style="border: 1px solid #000000;" align="center"><img src="' + imagename + '" border="0"></div>';
	}
	newHTML = newHTML + '</div>';
    gettrailobjnostyle().innerHTML = newHTML;
	gettrailobj().visibility="visible";
}

function showImage(imagename,title,description,showthumb,height, newItemWidth, newInlinePos){
   InlinePos = newInlinePos;
   if (newItemWidth != false) {
		itemWidth = newItemWidth;
	}
	if (height > 0){
		currentimageheight = height;
		itemHeight = height;
	}
	document.onmousemove=findmouse;
	cameraHTML = '';
	newHTML = ''//'<div>';
	//newHTML = newHTML + '<span>' + title + '</span><div class="borderbot"></div>';
	if (showthumb > 0){
		newHTML = newHTML + '<div style="border: 1px solid #000000;" align="center"><img src="' + imagename + '" border="0"></div>';
	}
	newHTML = newHTML + '</div>';
    gettrailobjnostyle().innerHTML = newHTML;
	gettrailobj().visibility="visible";
}

function showhtml(newHtml,height) {
	document.onmousemove=followmouse;
	newHtml = '<div style="border: 1px solid #000000;background-color:#FFFFFF;padding:5px" align="left">' + newHtml + '<div>';
	gettrailobjnostyle().innerHTML = newHtml;
	gettrailobj().visibility="visible";
}
function hidetrail(){
	gettrailobj().visibility="hidden"
	document.onmousemove=""
	gettrailobj().left="-1000px"
	gettrailobj().top="-1000px"
}
function followmouse(e){
	var xcoord=offsetfrommouse[0]
	var ycoord=offsetfrommouse[1]
	var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
	var docheight=document.all? Math.min(truebody().scrollHeight, truebody().clientHeight) : Math.min(document.body.offsetHeight, window.innerHeight)
	if (typeof e != "undefined"){
		if (docwidth - e.pageX < itemWidth + 50){
			if (noPicture == "yes") {
				xcoord = e.pageX - xcoord - itemWidth; // Move to the left side of the cursor
			} else {
			xcoord = e.pageX - xcoord - itemWidth; // Move to the left side of the cursor
			}
		} else {
			xcoord += e.pageX;
		}
		if ((docheight - e.pageY) < (currentimageheight + 110)){
			ycoord += e.pageY - Math.max(0,(110 + currentimageheight + e.pageY - docheight - truebody().scrollTop));
			if (ycoord < e.pageY-currentimageheight){
			    ycoord=e.pageY-currentimageheight;
			    if (ycoord < e.pageY-currentimageheight){
			        ycoord=e.pageY;
			        if (ycoord < 1){
			            ycoord=e.pageY;
			        }
			    }
	        }
	
		} else {
			ycoord += e.pageY ;
		}
	} else if (typeof window.event != "undefined"){
		if (docwidth - event.clientX < itemWidth + 50){
			if (noPicture == "yes") {
				xcoord = event.clientX + truebody().scrollLeft - xcoord - itemWidth; // Move to the left side of the cursor
			} else {
				xcoord = event.clientX + truebody().scrollLeft - xcoord - itemWidth; // Move to the left side of the cursor
			}
		} else {
			xcoord += truebody().scrollLeft+event.clientX 
		}
		if (docheight - event.clientY < (currentimageheight + 110)){
			ycoord += event.clientY + truebody().scrollTop - Math.max(0,(110 + currentimageheight + event.clientY - docheight));
		} else {
			ycoord += truebody().scrollTop + event.clientY;
		}
	}
	var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
	var docheight=document.all? Math.max(truebody().scrollHeight, truebody().clientHeight) : Math.max(document.body.offsetHeight, window.innerHeight)
	gettrailobj().left=xcoord+"px"
	
	gettrailobj().top=ycoord+"px"
}

function findmouse(e){
	var xcoord=offsetfrommouse[0]
	var ycoord=offsetfrommouse[1]
	var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
	var docheight=document.all? Math.min(truebody().scrollHeight, truebody().clientHeight) : Math.min(document.body.offsetHeight, window.innerHeight)
	if (typeof e != "undefined"){
		if (InlinePos > 2){
			if (noPicture == "yes") {
				xcoord = e.pageX - xcoord - itemWidth; // Move to the left side of the cursor
			} else {
				xcoord = e.pageX - xcoord - itemWidth; // Move to the left side of the cursor
			}
		} else {
			xcoord += e.pageX;
		}
//		if ((docheight - e.pageY) < (currentimageheight + 110)){
//			ycoord += e.pageY - Math.max(0,(110 + currentimageheight + e.pageY - docheight - truebody().scrollTop));
//		} else {
			ycoord += e.pageY + ycoord;
//		}
	} else if (typeof window.event != "undefined"){
		if (InlinePos > 2){
			if (noPicture == "yes") {
				xcoord = event.clientX + truebody().scrollLeft - xcoord - itemWidth; // Move to the left side of the cursor
			} else {
				xcoord = event.clientX + truebody().scrollLeft - xcoord - itemWidth; // Move to the left side of the cursor
			}
		} else {
			xcoord += truebody().scrollLeft+event.clientX
		}
//		if (docheight - event.clientY < (currentimageheight + 110)){
//			ycoord += event.clientY + truebody().scrollTop - Math.max(0,(110 + currentimageheight + event.clientY - docheight));
//		} else {
			ycoord += truebody().scrollTop + event.clientY + ycoord;
//		}
	}
	var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
	var docheight=document.all? Math.max(truebody().scrollHeight, truebody().clientHeight) : Math.max(document.body.offsetHeight, window.innerHeight)
	gettrailobj().left=xcoord+"px"
	gettrailobj().top=ycoord+"px"
	document.onmousemove="";
}

function PopUpWindow(url){
	fenster3=window.open(url,"", "toolbar=no,height=400,width=500,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no");
	fenster3.focus();
}

function showPopUp(theDiv, iPosX, iPosY, iWidth, iHeight) {

    var d = document.getElementById(theDiv);
    if (d != null) {
        d.style.visibility = 'visible';
        d.style.width = iWidth;
        d.style.height = iHeight;
        d.style.left = iPosX;
        d.style.position = 'absolute';
        d.style.top = iPosY;
        d.style.zindez= 1000;
    }
  }

  function hidePopUp(theDiv) {
      var d = document.getElementById(theDiv);
    if (d != null) {
        d.style.visibility = 'hidden';
        d.style.width = 1;
        d.style.height = 1;
        d.style.left = '-2000px';
        d.style.position = 'absolute';
        d.style.top = '-2000px';
    }
}
