// variables
var searchStr = location.search;

// zeigt Flash an
function showFlash(src, width, height, quality, menu, bgcolor, flashvars) {
	closeTags = "</" + "embed></" + "object>";
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="' + width + '" height="' + height + '" title="flash" width="100%" height="100%" ><param name="movie" value="' + src + flashvars + '"><param name="quality" value="' + quality + '"><param name="bgcolor" value="' + bgcolor + '" /><param name=scale value=noscale /><param name="menu" value="' + menu + '"><param name="play" value="true"><embed src="' + src + flashvars + '" quality="' + quality + '" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" bgcolor="' + bgcolor + '" width="' + width + '" height="' + height + '" menu="' + menu + '" play="true">'+closeTags);
	// alert("showFlash() flashvars="+flashvars + " => " + src);
}

// popup
function centerPopup(popup_name,popup_url,popup_with,popup_height,myWidth,myHeight,myScrollbar) {
	if(!myWidth) {myWidth = 10;}
	if(!myHeight){myHeight = 50;}
	if(!myScrollbar){myScrollbar = 0;}
	var popup_left = (window.screen.width/2)  - (popup_with/2 + myWidth);
	var popup_top  = (window.screen.height/2) - (popup_height/2 + myHeight);
	var popspecial = window.open(popup_url ,popup_name,"toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=" + popup_with + ",height=" + popup_height + ",left=" + popup_left + ",top=" + popup_top + ",screenX=" + popup_left + ",screenY=" + popup_top);
	if (popspecial) {
		popspecial.focus();
	}
}

function openPopup(){
	if (window.location.search.indexOf("popup=false") == -1) {
	centerPopup('abw','index_popup.html' + searchStr,985,574);
	}
}

function fullscreen() {
	var BrowserName    = navigator.appName;
	var BrowserVersion = navigator.appVersion;
	var VersionShort   = BrowserVersion.substr(0, 1);
	
	window.moveTo(0, 0);
	var high  = screen.height;
	var wide = screen.width;
	if(VersionShort > 3) {
		window.moveTo(0, 0);
		if (BrowserName == "Netscape") {
			window.outerHeight = high;
			window.outerWidth = wide;
		} else if(BrowserName == "Microsoft Internet Explorer") {
			window.resizeTo(wide, high);
		}
	}
}

function fullscreen_v2() {
	top.window.moveTo(0,0);
	if (document.all) {
		top.window.resizeTo(screen.availWidth,screen.availHeight);
	}
	else if (document.layers || document.getElementById) {
		if (top.window.outerHeight<screen.availHeight || top.window.outerWidth<screen.availWidth){
			top.window.outerHeight = screen.availHeight;
			top.window.outerWidth = screen.availWidth;
		}
	}
}

// flashcheck redirect 
function flashExists(){
  self.location.href='abw.html' + searchStr;
}	

function noFlashExists(){
  setTimeout("self.location.href='flash_error.html'", 5000);
}
