// e-dvertising - Hinterdorfer & Edlinger OEG, http://e-dvertising.at/

/*
//Default browsercheck, added to all scripts! ... (support && credits: Thomas Brattli, http://www.bratta.com)
function checkBrowser(){
	this.ver = navigator.appVersion
	this.dom = document.getElementById?1:0
	this.ie5 = (this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie4 = (document.all && !this.dom)?1:0;
	this.ns5 = (this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns4 = (document.layers && !this.dom)?1:0;
	this.bw = (this.ie5 || this.ie4 || this.ns4 || this.ns5)
	return this
}
var bw=new checkBrowser()
*/

// abfrage der browserversion
var browserVersion = 0;
if ((navigator.appName == "Netscape" && parseInt(navigator.appVersion)  >= 3) || (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) >= 4)){browserVersion = 3;}

query_string = window.top.location.search;
if (query_string){query_string_p = (query_string + '&p=y');} 
else {query_string_p = ('?p=y');}

if (browserVersion == 3) {
	selfname="";
	fensterlcheck=false;

	einsopen = new Function("fensterl = window.open('/mail_article.php', 'mail_article', 'toolbar=no, menubar=no, sreenY=10, screenX=20, top=10, left=20, resizable=no, scrollbars=no, width=640, height=600'); fensterlcheck=true;");
	dreiopen = new Function("fensterl = window.open(query_string_p, 'drucken', 'toolbar=yes, menubar=no, sreenY=10, screenX=20, top=10, left=20, resizable=yes, scrollbars=yes, width=670, height=630'); fensterlcheck=true;");

	impropen = new Function("fensterl = window.open('impressum.php', 'impressum', 'toolbar=yes, menubar=no, sreenY=10, screenX=20, top=10, left=20, resizable=yes, scrollbars=yes, width=480, height=500'); fensterlcheck=true;");
	enimpropen = new Function("fensterl = window.open('/en/imprint', 'imprint', 'toolbar=yes, menubar=no, sreenY=10, screenX=20, top=10, left=20, resizable=yes, scrollbars=yes, width=480, height=500'); fensterlcheck=true;");
	discopen = new Function("fensterl = window.open('/disclaimer.php', 'haftungsausschluss', 'toolbar=yes, menubar=no, sreenY=10, screenX=20, top=10, left=20, resizable=yes, scrollbars=no, width=420, height=400');fensterlcheck=true;");
	agbopen  = new Function("fensterl = window.open('/agb.php', 'agb', 'toolbar=yes, menubar=no, sreenY=10, screenX=20, top=10, left=20, resizable=yes, scrollbars=yes, width=400, height=300'); fensterlcheck=true;");
}

function popopen(pic_filename, width, height, popup_title, popup_alt){ 
	window.open('/popup.php?pic_filename=' + pic_filename + '&pic_width=' + width + '&pic_height=' + height + '&popup_title=' + popup_title + '&popup_alt=' + popup_alt + '', 'zoom', 'toolbar=no, menubar=no, sreenY=10, screenX=10, left=10, top=10, resizable=no, scrollbars=no, width=' + width + ', height=' + height + '');
}

function expopen(o_id, k){ 
	window.open('/expose.php?o_id=' + o_id + '&k=' + k + '', 'Expose', 'toolbar=yes, menubar=no, sreenY=10, screenX=10, left=10, top=10, resizable=yes, scrollbars=yes, width=780, height=700');
}

function picgal_open(yellow_navtext, pic_dir, pic_name){ 
	window.open('/picgal_popup.php?yellow_navtext=' + yellow_navtext + '&pic_dir=' + pic_dir + '&pic_name=' + pic_name + '', 'zoom', 'toolbar=no, menubar=no, status=no, sreenY=10, screenX=10, left=10, top=10, resizable=no, scrollbars=no, width=506, height=506');
}

function popopenzwei(picname,dir,titel,width,height)
	    { 
		window.open('/popup2.php?pic_name=' + picname +'&dir=' + dir +'&titel=' + titel +'','zoom','toolbar=yes,menubar=no,pageYOffset=10,pageXOffset=10,resizable=no,scrollbars=no,width=' + width + ',height=' + height + '');
		}

function popopendrei(picname,popup_title,popup_alt_text,width,height)
	    { 
		window.open('/popup3.php?pic_name=' + picname +'&popup_title=' + popup_title +'&popup_alt_text=' + popup_alt_text +'&width=' + width +'&height=' + height +'','zoom','toolbar=yes,menubar=no,pageYOffset=10,pageXOffset=10,resizable=no,scrollbars=no,width=' + width + ',height=' + height + '');
		}

function popopenvier(picname,popup_title,popup_alt_text,width,height)
	    { 
		window.open('/popup4.php?pic_name=' + picname +'&popup_title=' + popup_title +'&popup_alt_text=' + popup_alt_text +'&width=' + width +'&height=' + height +'','zoom','toolbar=yes,menubar=no,pageYOffset=10,pageXOffset=10,resizable=no,scrollbars=no,width=' + width + ',height=' + height + '');
		}

//atg popoup
function popopenatg(x){ 
	//alert(x);
	if(x!=""){
		window.open('/atg_info.php?adm_form=bez_edt&selected_id=' + x + '','atg','toolbar=yes,menubar=no,pageYOffset=10,pageXOffset=10,toolbar=no,resizable=no,scrollbars=no,width=610,height=440');
	}
}


//objekt verwaltung popup
function openWindowObj(x) {
	medialib = window.open('', 'objpopup', "width=804,height=740,left=95,top=20,scrollbars=yes,menubar=no,resizable=yes,locationbar=no,status=yes");	
	document.forms[x].submit();
	return;
}


//PDF-objektliste popup
function openWindowPDF(x) {
	medialib = window.open('', 'pdfpopup', "width=804,height=740,left=95,top=20,scrollbars=yes,menubar=no,resizable=yes,locationbar=no,status=yes");	
	document.forms[x].submit();
	return;
}

/*function expSSopen(o_id, k){ 
	window.open('/expose_slideshow.php?o_id=' + o_id + '&k=' + k + '&fs=yes', 'Expose', 'toolbar=yes, menubar=no, sreenY=10, screenX=10, left=10, top=10, resizable=yes, scrollbars=yes, width=780, height=700');
}*/

//Slideshow-objektliste popup
function openWindowSS(x) {
	medialib = window.open('', 'slideshow', "width=804,height=900,left=95,top=0,toolbar=no,scrollbars=yes,menubar=yes,resizable=yes,locationbar=yes,status=yes");	
	document.forms[x].submit();
	return;
}

// the netscape bugfix "resize'it" ...
function MM_reloadPage(init) {			//reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function fieldname(i) {
	this.menue = "menue" + i ;
	this.preis = "preis" + i;
}


function preis_preview(i) {
	var field = new fieldname(i);
	var selectedbutton = document.forms['priv_form'].elements[field.sp];
	var selectedbuttonvalue = selectedbutton.options[selectedbutton.selectedIndex].value;
	var sp_values = selectedbuttonvalue.split(" ** ");
	var	preis = sp_values[2];

	document.forms['priv_form'].elements[field.preis].value = preis;
}


//grosses bild onclick
function bic_pic(x) {
	//if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion)  <= 4 )){
	//	document.layerbg.document.gross.document.nachher.src = "/_pix/" + x + ".gif";
	//} else {
		document.big.src = "/_img/_med/" + x;
	//}
}


//preload layer auschalten
function hide_preloader(){
	// getCont "id" - check per "dhtml.js"

	//hide_show_selbox("hide"); //alle "<select>" auswahlfelder ausblendet (IE)

	Inhalt = getCont("id", "preload_layer", null);
	if(Inhalt) {
		document.getElementById('preload_layer').style.display = "none"; 
		//document.getElementById('preload_layer').style.height = document.body.clientHeight; 

	} else {
		if(document.layers){
			document.layers.preload_layer.display = "none"; 
		}
		if(document.all){
			document.all.preload_layer.style.display = "none"; 
		}
	}

	//hide_show_selbox("show"); //alle "<select>" auswahlfelder wieder einblenden (IE)
}