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_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function setHideTimer() {
	hideTimer=setTimeout("hideAllMenus()",300);
}

function clearHideTimer() {
	clearTimeout(hideTimer);
}

function hideAllMenus() {
	MM_showHideLayers('naviLeft','','hide');
	MM_showHideLayers('naviRight','','hide');
}

function showLayerNavigation(layerName) {
	MM_showHideLayers(layerName,'','show');
}

function MM_showHideLayers() { //v6.0 modified by I. Lozina
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  if (document.getElementById) {
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'block':(v=='hide')?'none':v; }
    obj.display=v; }
	}
}

function meilensteine(language) {
	var w=730;
	var h=545;
	if (window.screen) w = window.screen.availWidth;
	if (window.screen) h = window.screen.availHeight;
	// falls die Hoehe der Bildschirmaufloesung groesser als 650px
	if (h >= 650) h = 650;
	MM_openBrWindow('http://www.jokey.com/static/meilensteine/' + language + '/index.html','','width='+ w + ',height=' + h + ',top=0,left=0,scrollbars=0,resizable=0,status=0,toolbar=0,directories=0,menubar=0,location=0');
}

function popupDoc(doc,width_,height_) {
	var w = width_;
	var h = height_;

	var sBaseHref = document.getElementsByTagName("base")[0];
	if (sBaseHref) {
		var baseHref = sBaseHref.getAttribute("href");
		if (doc.search(/http.+/) < 0) {
			doc = baseHref+doc;	
		}
	}

	MM_openBrWindow(doc,'','width='+ w + ',height=' + h + ',top=0,left=0,scrollbars=1,resizable=1,status=0,toolbar=0,directories=0,menubar=0,location=0');
}


function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}


// -----------------------------------------------------------------------
// FENSTER FUER DIE ANZEIGE DER GROSSABBILDUNG
//
//  img = Bildname
//  w = Breite
//  h =	Hoehe
// -----------------------------------------------------------------------
function popUp(img,w,h) {

	var imgPath = img;

	var sBaseHref = document.getElementsByTagName("base")[0];
	if (sBaseHref) {
		var baseHref = sBaseHref.getAttribute("href");
		if (imgPath.search(/http.+/) < 0) {
			imgPath = baseHref+imgPath;	
		}
	}

	// Fenster oeffnen
	var windowPrefs = "scrollbars=no,resizable=no,width="+ (w - 2) + ",height=" + (h + 30);
	var dispWindow = window.open("", "", windowPrefs);
   	//dispWindow.focus();

	// HTML-Code in das geoefnete Fenster schreiben
	with (dispWindow.document) {
			open ("text/html");
			writeln ('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
			writeln ('<html xmlns="http://www.w3.org/1999/xhtml">');
			writeln ('<head>');
			writeln ('<title>Jokey Plastik GmbH</title>');
			writeln ('<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />');
			writeln ('<style type="text/css">');
			writeln ('body {background: #fff url('+ imgPath +') 0px 30px repeat-y; margin: 0; padding: 0; font-family: Arial, Helvetica, sans-serif;}');
			writeln ('#backLink {position: relative; margin: 0 auto; padding: 0; background-color: #6685A2; height: 30px;}');
			writeln ('#backLink table {margin: 0; padding: 0; border: 0px solid; height: 30px; width: 100%;}');
			writeln ('#backLink td {padding: 0 0 0 10px; vertical-align: middle;}');
			writeln ('a {font-size: 12px; font-weight: bold; text-decoration: none; vertical-align: middle;}');
			writeln ('a:link, a:active, a:visited {color: #fff;}');
			writeln ('a:hover {color: #003366;}');
			writeln ('</style>');
			writeln ('</head>');
			writeln ('<body>');
			writeln ('<div id="backLink">');
				writeln ('<table cellspacing="0">');
					writeln ('<tr>');
						writeln ('<td><a href="javascript:self.close();">CLOSE</a></td>');
					writeln ('</tr>');
				writeln ('</table>');
			writeln ('</div>');
			writeln ('</body>');
			writeln ('</html>');
			close();
	}
}

