/* --------------------------------------------------------------------------
	Browserüberprüfung
-------------------------------------------------------------------------- */
var agt=navigator.userAgent.toLowerCase();
var is_major = parseInt(navigator.appVersion);

var is_gecko = (agt.indexOf('gecko') != -1);
var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
var is_ie3    = (is_ie && (is_major < 4));
var is_ie4    = (is_ie && (is_major == 4) && (agt.indexOf("msie 5")==-1) );
var is_ie5    = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );
var is_ie5_5  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.5") !=-1));
var is_ie5up  = (is_ie  && !is_ie3 && !is_ie4);
var is_ie6 = (is_ie  && (is_major == 4) && (agt.indexOf("msie 6.0") !=-1));
var is_mac = (agt.indexOf("mac")!=-1);


/* --------------------------------------------------------------------------
	Zerlegen des Query-Strings und die in arrPattern definierten
	Query-Parameter herausholen und in die sidpat-Variablen schreiben
-------------------------------------------------------------------------- */
var sidpat_js ='';
var sidpat0_js = '';
var sidpat3_js = '';

arrPattern = new Array('id','si');
arrSidpat = new Array();
var count = 0;

if (window.location.search.indexOf("<") == -1 && window.location.search.indexOf(">") == -1){
	if(window.location.search != ""){
		var queryString = "&"+window.location.search.substr(1);
		var querys = queryString.split("&");
		for (i=0; i<querys.length; i++){
			if (querys[i].indexOf("=") != -1){
				nameValue = querys[i].split("=");
				for (j=0; j<arrPattern.length; j++){
					if (arrPattern[j] == nameValue[0]){
						count++;
						// Sonderfall "id=V00..."
						if (nameValue[0] == "id" && nameValue[1].substr(0,4) == "V00-"){
							arrSidpat[count] = nameValue[0]+"="+nameValue[1].substr(4);
						} else {
							arrSidpat[count] = nameValue[0]+"="+nameValue[1];
						}
					}
				}
			}
		}
	}
	
	// Zusammenbauen der sidpats-Strings
	if (arrSidpat.length > 0){
		for (i=1; i<arrSidpat.length; i++){
			sidpat3_js += "&"+arrSidpat[i];
		}
		sidpat_js = "?"+sidpat3_js.substr(1);
		sidpat0_js = sidpat3_js.substr(1);
	}

}


function select(imgName,stat) {
	if (document.images) {
		document [imgName].src = eval(imgName + "_" + stat + ".src");
	}
}

function reloadTheOpener(){
	if (parent.opener != null){
		var openerUrl = ""+parent.opener.location;
		if (openerUrl.indexOf("?") != -1){
			openerUrl += sidpat3_js;
		} else {
			openerUrl += sidpat_js;
		}
		parent.opener.location.href = openerUrl;
	}
}

function makePopup(popupURL, popupName, breite, hoehe, xpos, ypos, resize, locbar, menbar, toolbar, personal, scroll, session, statbar){

	if (resize == '1'){
		resize = 'yes';
	} else {
		if (resize == '0'){
			resize = 'no';
		} else {
			if (!resize){
				resize = 'yes';
			}
		}
	}

	if (scroll == '1'){
		scroll = 'yes';
	} else {
		if (scroll == '0'){
			scroll = 'no';
		} else {
			if (!scroll){
				scroll = 'yes';
			}
		}
	}

	//alert(locbar);
	if (locbar == '1' || locbar == 'yes'){
		//locbar = 'yes';
		locbar = 1;
	} else {
		//locbar = 'no';
		locbar = 0;
	}

	if (menbar == '1' || menbar == 'yes'){
		menbar = 'yes';
	} else {
		menbar = 'no';
	}

	if (personal == '1' || personal == 'yes'){
		personal = 'yes';
	} else {
		personal = 'no';
	}

	if (toolbar == '1' || toolbar == 'yes'){
		toolbar = 'yes';
	} else {
		toolbar = 'no';
	}

	if (parseInt(breite) == 0 || String(parseInt(breite)) ==  'NaN'){
		breite = 800;
	}

	if (parseInt(hoehe) == 0 || String(parseInt(hoehe)) ==  'NaN'){
		hoehe = 600;
	}

	if (parseInt(xpos) == 0 || String(parseInt(xpos)) ==  'NaN'){
		xpos = 100;
	}

	if (parseInt(ypos) == 0 || String(parseInt(ypos)) ==  'NaN'){
		ypos = 100;
	}

	if (!popupName){
		popupName = 'standardWindow';
	}

	if (session != 'no'){
		if (popupURL.indexOf("?") != -1){
			popupURL = popupURL+sidpat3_js;
		} else {
			popupURL = popupURL+sidpat_js;
		}
	}
	//alert(locbar);
        newPopup = window.open(popupURL,popupName,"width="+breite+",height="+hoehe+",menubar="+menbar+", personalbar="+personal+", toolbar="+toolbar+",resizable="+resize+",scrollbars="+scroll+",location="+locbar+",left="+xpos+",top="+ypos+",status="+statbar);    
        //newPopup = window.open(popupURL,popupName,"width="+breite+",height="+hoehe+",menubar="+menbar+", personalbar="+personal+", toolbar="+toolbar+",resizable="+resize+",scrollbars="+scroll+",location=1,left="+xpos+",top="+ypos+",status="+statbar);    
        newPopup.focus();
}

function closePopup(){

	if (parent.document.getElementById("popupFk")){
		parent.document.getElementById("popupFk").style.display = 'none';
	} else {
		self.close();
	}

}

function fenster(jurl,name,menbar,toolbar,statbar,breite,hoehe){
        makePopup(jurl, name, breite, hoehe, 100, 100, 1, 1, menbar, toolbar, 0, 1, 'yes', statbar);
        /*
        if (jurl.indexOf("?") != -1){
                jurl = jurl+sidpat3_js;
        } else {
                jurl = jurl+sidpat_js;
        }
        neuesfenster = window.open(jurl,name,"width="+breite+",height="+hoehe+",menubar="+menbar+",toolbar="+toolbar+",resizable=1,scrollbars=1,location=1,top=50,left=50,status="+statbar);
        neuesfenster.focus();
        */
}



