// e-dvertising - Hinterdorfer & Edlinger OEG, http://e-dvertising.at/
if(self.name == '') {
	self.name = "cms_main";
}

//the next 3 lines are browser detection for user-agent DOMS
ns4 = (document.layers) ? true:false //required for Functions to work
ie4 = (document.all) ? true:false //required for Functions to work
ng5 = (document.getElementById) ? true:false //required for Functions to work

// 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;");

}

function popopen(pic_filename, width, height, popup_title, popup_alt){
	var_left = (screen.availWidth-width)/10;
	var_up = (screen.availHeight-height)/10;
	window.open('/popup.php?pic_filename=' + pic_filename + '&width=' + width + '&height=' + height + '&popup_title=' + popup_title + '&popup_alt=' + popup_alt + '', 'zoom', 'toolbar=no, menubar=no, screenY='+var_left+', screenX='+var_up+', left='+var_left+', top='+var_up+', resizable=no, scrollbars=no, width=' + width + ', height=' + height + '');
}

//poup für bilder aus kalender
function mod_cal_popopen(pic_filename, width, height, popup_title, popup_alt, host){
	var_left = (screen.availWidth-width)/10;
	var_up = (screen.availHeight-height)/10;
	window.open('/popup.php?pic_filename=' + pic_filename + '&width=' + width + '&height=' + height + '&popup_title=' + popup_title + '&popup_alt=' + popup_alt + '&host=' + host + '', 'zoom', 'toolbar=no, menubar=no, screenY='+var_left+', screenX='+var_up+', left='+var_left+', top='+var_up+', resizable=no, scrollbars=no, width=' + width + ', height=' + height + '');
}


// ACHTUNG! hier heissen pic_width und pic_height wieder _nur_ width und height!
function popopen1(pic_filename, width, height, popup_title, popup_alt){
	window.open('/popup1.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 popopen2(pic_filename, width, height, popup_title, popup_alt){
	window.open('/popup2.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 + '');
}

// Popup für Video-Files der SpitzenkandidatInnen-Diskussion im Rahmen der ÖH Wahlen
function popopen3(vid_filename, width, height, popup_title, popup_alt){
	var_left = (screen.availWidth-width)/10;
	var_up = (screen.availHeight-height)/10;
	window.open('/popup_vid.php?vid_filename=' + vid_filename + '&width=' + width + '&height=' + height + '&popup_title=' + popup_title + '&popup_alt=' + popup_alt + '', 'zoom', 'toolbar=no, menubar=no, screenY='+var_left+', screenX='+var_up+', left='+var_left+', top='+var_up+', resizable=no, scrollbars=no, width=' + width + ', height=' + height + '');
}

//admin popup
function openWindow(x) {
	var_left = (screen.availWidth-804)/10;
	var_up = (screen.availHeight-640)/10;

	var adminpopup = window.open('', 'adminpopup','width=804, height=640, screenY='+var_left+', screenX='+var_up+', left='+var_left+', top='+var_up+', scrollbars=yes, menubar=yes, locationbar=no, resizable=yes, status=yes');
	//funct auch im opera
	document.forms[x].submit();
	if (window.focus) {adminpopup.focus()}

	//funct nicht im opera!!!(testet in 6.01)
	//document.getElementById(x).submit();
	return;
}


//media library popup
function openWindowLib(x) {
	var_left = (screen.availWidth-824)/6;
	var_up = (screen.availHeight-640)/6;
	medialib = window.open('', 'medialib', 'width=824, height=640, screenY='+var_left+', screenX='+var_up+', left='+var_left+', top='+var_up+', scrollbars=yes, menubar=yes, locationbar=no, resizable=yes,status=no');
	document.forms[x].submit();
	medialib.focus();
	return;
}

//rel-edt check popup
function openWindowCheck(x) {
	checkpopup = window.open('', 'checkpopup', "width=500,height=580,left=400,top=20,scrollbars=yes,menubar=no,locationbar=no,statusbar=no,resizable=yes,status=yes");
	document.forms[x].submit();
	checkpopup.focus();
	return;
}

function is_array(obj)
{
	return(typeof(obj.length)=="undefined")?false:true;
}

// teil des _grossen_ sniffers ... (gecko -> netscape 6+)
var agt=navigator.userAgent.toLowerCase();
var is_gecko = (agt.indexOf('gecko') != -1);

// mouseOver (hoch bzw. x für quer) ausserdem preload von bilddaten ...
function moo(nrr){
	if (is_gecko) {
	document.getElementById("zoom01").src = '/_pix/' + nrr + '.gif';
	//document.getElementById("zoom02").src = '/_pix/blank.gif';
	}
	else {
		if (navigator.appName == "Netscape") {
			document.the_table.document.zoom01.src='/_pix/' + nrr + '.gif';
			//document.the_querf.document.zoom02.src='/_pix/blank.gif';
			document.the_table.document.zoom01.src='/_pix/' + nrr + '.gif';
			}
		else {
			document.zoom01.src='/_pix/' + nrr + '.gif';
			//document.zoom02.src='/_pix/blank.gif';
			}
		}
	}


function step_open(pic_filename, pic_alt, c_id, var_lang, w_width, w_height){
	window.open('/step_popup.php?pic_filename=' + pic_filename + '&pic_alt=' + pic_alt + '&var_lang=' + var_lang +'', 'zoom', 'toolbar=no, menubar=no, status=no, sreenY=10, screenX=10, left=10, top=10, resizable=no, scrollbars=no, width=' + w_width + ', height=' + w_height + '');
}
function step2_open(pic_filename, pic_alt, c_id, var_lang, w_width, w_height){
	window.open('/step2_popup.php?pic_filename=' + pic_filename + '&pic_alt=' + pic_alt + '&var_lang=' + var_lang +'', 'zoom', 'toolbar=no, menubar=no, status=no, sreenY=10, screenX=10, left=10, top=10, resizable=no, scrollbars=no, width=' + w_width + ', height=' + w_height + '');
}


// >>>>> validation-fenster schließen und opener reloaden <<<<<
function close_validation(opener_href){

	opener.location.href = opener_href;
	window.close();

}

// >>>>> auf quicklink-auswahl weiterleiten <<<<<
function f_follow_quicklink(){

	sbox_quicklink = document.forms['quicklinks_form'].elements['quicklinks'];
	//alert('SBox: ' + sbox_quicklink);

	sbox_quicklink_sindex = sbox_quicklink.options.selectedIndex;
	//alert('SBox-SIndex: ' + sbox_quicklink_sindex);

	sbox_quicklink_svalue = sbox_quicklink.options[sbox_quicklink_sindex].value;
	//alert('SBox-SValue: ' + sbox_quicklink_svalue);

	// verweis ausführen
	//alert ('Ziel: ' + sbox_quicklink_svalue);
	if (sbox_quicklink_svalue != '')
	{
		window.location.href = sbox_quicklink_svalue;
	}
}
