// 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=640, 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 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 + '');
		}

// 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;
}
