var Hoffset=0; //Enter logo's offset from left edge of window (edit only if you don't like the default offset)
var Voffset=0; //Enter logo's offset from bottom edge of window (edit only if you don't like the default offset)

var layerwidth=782;
var layerheight=20;


///////////////////////////Footer-positioning/////////////////////////
var ie,naviLayer_obj = "";

function startLayer () {
	ie=document.all&&navigator.userAgent.indexOf("Opera")==-1;
	naviLayer_obj=ie? document.all.naviLayer : document.getElementById? document.getElementById("naviLayer") : document.naviLayer;

	if (ie||document.getElementById||document.layers) window.onload=displayNavi;

	footerMap();
}


function positionNaviLayer () {
	var dsocleft=ie? document.body.scrollLeft : pageXOffset;
	var dsoctop=ie? document.body.scrollTop : pageYOffset;
	var window_height=ie? document.body.clientHeight : window.innerHeight;
	

	
	if (ie||document.getElementById) {
		//naviLayer_obj.style.left=parseInt(dsocleft)+Hoffset
		naviLayer_obj.style.top=parseInt(dsoctop)+parseInt(window_height)-layerheight-Voffset +"px";
	}
	else if (document.layers) {
		//naviLayer_obj.left=dsocleft+Hoffset
		naviLayer_obj.top=dsoctop+window_height-layerheight-Voffset +"px";
	}
}


function displayNavi (){
	naviInterval=setInterval("positionNaviLayer()",50);
}

function footerMap (){
	document.write('<map name="footer">');
	document.write('<area alt="Home" coords="0,2,118,20" href="index.html">');
	document.write('<area alt="Greenpeace Story" coords="120,2,238,20" href="/deutschland/kids/start/greenpeace-story">');
	document.write('<area alt="Deine Meinung" coords="240,2,358,21" href="/deutschland/kids/start/deine-meinung">');
	document.write('<area alt="E-Card" coords="360,2,478,20" href="/deutschland/kids/start/ecard">');
	document.write('<area alt="Kontakt" coords="480,2,595,20" href="/deutschland/kids/start/kontakt">');
	document.write('<area alt="Sitemap" coords="597,2,654,20" href="/deutschland/kids/start/sitemap">');
	document.write('<area alt="Impressum" coords="656,2,721,20" href="/deutschland/kids/start/impressum">');
	document.write('<area alt="Hilfe" coords="723,2,780,21" href="/deutschland/kids/start/hilfe">');
	document.write('</map>');
}

///////////////////////////naviFallback-imagemap/////////////////////////

function fbMap () {
	document.write('<map name="naviFB">');
	document.write('<area alt="Themen" coords="2,2,119,24" href="/deutschland/kids/themen">');
	document.write('<area alt="Aktionen" coords="120,2,238,24" href="/deutschland/kids/aktionen">');
	document.write('<area alt="Community" coords="240,2,357,24" href="/deutschland/kids/community">');
	document.write('<area alt="Greenteams" coords="359,2,476,24" href="/deutschland/kids/greenteams">');
	document.write('<area alt="Fun" coords="478,2,594,24" href="/deutschland/kids/fun">');
	document.write('</map>');
}

///////////////////////////flash-detection2/////////////////////////


var testToVersion = 10;
var requiredVersion = 6; // 6

var flash = new Object();
flash.installed=false;
flash.version='0.0';

// test fuer ns
if (navigator.plugins && navigator.plugins.length) {
	for (x=0; x < navigator.plugins.length; x++) {
		if (navigator.plugins[x].name.indexOf('Shockwave Flash') != -1) {
			flash.version = navigator.plugins[x].description.split('Shockwave Flash ')[1];
			flash.installed = true;
			break;
		}
	}
}

// und fuer IE
else if (window.ActiveXObject) {
	for (x = 2; x <= testToVersion; x++) {
		try {
			oFlash = eval("new ActiveXObject('ShockwaveFlash.ShockwaveFlash." + x + "');");
			if(oFlash) {
				flash.installed = true;
				flash.version = x + '.0';
			}
		}
		catch(e) {}
	}
}


function insertFlash (flashName,fbiName,isWussi,size) {
	var height = 226;
	var width = 595;

	if (!size) {
		size = flashName.substring (0,1);
	}
	
	switch(size){
		case "s": 
		case "k":
			width = 112;
			break;
			
		case "m":
		case "g":
			width = 180;
			break;
			
		case "l":
			width = 194;
			break;
			
		default:
			height = 47;
	}

	if ( flash.installed && parseInt(flash.version) >= requiredVersion ) {
		document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
		document.write('  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ');
		document.write(' ID="script" WIDTH="'+width+'" HEIGHT="'+height+'" ALIGN="">');
		document.write(' <PARAM NAME=movie VALUE="fileadmin/4_kids/user_upload/allgemein/flash/'+flashName+'"> <PARAM NAME=quality VALUE=high> <PARAM NAME=wmode VALUE=transparent>  '); 
		document.write(' <EMBED src="fileadmin/4_kids/user_upload/allgemein/flash/'+flashName+'" quality=high bgcolor=#FFFFEF  ');
		document.write(' swLiveConnect=FALSE WIDTH="'+width+'" HEIGHT="'+height+'" WMODE="transparent" NAME="script" ALIGN=""');
		document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">');
		document.write(' </EMBED>');
		document.write(' </OBJECT>');


	} else{
		
		if (isWussi==1){
			document.write('<img src="'+fbiName+'" width="'+width+'" height="'+height+'" alt="" border="0">');
		} else {
			document.write('<img src="'+fbiName+'" width="'+width+'" height="'+height+'" usemap="#naviFB" alt="" border="0">');
		}
	}
}




function popup (url, width, height, myparams) {
	var params = "width=" + width + ",height=" + height + ",";
	if (myparams) {
		params += myparams;
	} else {
		params += "toolbar=no,location=no,directories=no,scrollbars=no,status=no,menubar=no,resizable=no";
	}
	var windowname = "gp4kidspopup" + Math.floor (Math.random () * 100000);
	var p = window.open (url, windowname, params);
}