// JavaScript Document

function picStretch(sName){
	//to stretch the window width and height use
	imgWidth = (window.innerWidth ? window.innerWidth : document.body.clientWidth)
	imgHeight =(window.innerHeight ? window.innerHeight : document.body.clientHeight)

	//to stretch the document width and height use
	//imgWidth=document.body.scrollWidth
	//imgHeight=document.body.scrollHeight

	document.getElementById("bg_img").style.width = imgWidth + "px"
	document.getElementById("bg_img").style.height = imgHeight + "px"
}

//PopUp Fenster öffnen
function PopUp(url, title, type) {
	// default Fenster Parameter
	var defaults = {top:50, left:80, width:480, height:270, location:false, resizable:false, dependent:true,
					 scrollbars:false, status:false, toolbar:false, menubar:false, center:false};
	
	if (!title) title = "Mawage Group";
	if (!url) url = "http://www.mawage.de/";
	
	for (var prop in defaults) {
		 if (type[prop] == undefined) {
			 type[prop] = defaults[prop];
		  } else if (type[prop] === true) {
			 if (type.name != "center") {
				 type[prop] = "yes"
			 }
		  } else if (type[prop] === false) {
			 if (type.name != "center") {
				 type[prop] = "no"
			 }
		 }
	}
	
	if (type["center"] == "yes") {
		var sh = screen.availHeight - 20;
		var sw = screen.availWidth - 10;
	
		type["left"] = (sw / 2) - (type["width"] / 2);
		type["top"] = (sh / 2) - (type["height"] / 2);
	}
	
	var p = "width=" + type["width"];
	p = p + ",height=" + type["height"];
	p = p + ",left=" + type["left"];
	p = p + ",top=" + type["top"];
	p = p + ",screenX=" + type["left"];
	p = p + ",screenY=" + type["top"];
	p = p + ",location=" + type["location"];
	p = p + ",resizable=" + type["resizable"];
	p = p + ",scrollbars=" + type["scrollbars"];
	p = p + ",status=" + type["status"];
	p = p + ",toolbar=" + type["toolbar"];
	p = p + ",menubar=" + type["menubar"];
	p = p + ",dependent=" + type["dependent"];
	
	var popUpWin = window.open("", "", p);
	if(popUpWin) {
		popUpWin.focus();

		with (popUpWin) {
			document.write('<html><head>');
		
			// geändert 2004 für Mozilla
			document.write('<scr' + 'ipt type="text/javascr' + 'ipt" language="JavaScr' + 'ipt">');
			document.write("function click() {window.close();} ");  //Fenster bei click  schliessen
			document.write("document.onmousedown=click ");
		
			// geändert 2004 für Mozilla
			document.write('</scr' + 'ipt>');
			document.write('<title>'+ title +'</title></head>');
		
			// Zeile geändert Aug 2003 (Dreamweaver machte Probleme)
			document.write('<' + 'body onblur="window.close();" ');// bei Focusverlust schliessen
			document.write('marginwidth="0" marginheight="0" leftmargin="0" topmargin="0">');
			document.write('<img src="'+ url +'"border="0">');
			document.write('</body></html>');
			popUpWin.document.close();
		}
	}
}
