// Global variables
var fertig = false
var nn4 = false;	// Netscape Navigator or Communicator
var ie4 = false;
var ie5 = false;
var ie6 = false;
var ie = false;		//IE 5 und IE6
var ns6 = false;    	// Netscape 6
var ns7 = false;   	 // Netscape 7
var moz = false;		// Mozilla Engine
var dom1 = false;	// fully supports DOM1
var dom2 = false;	// fully supports (important bits of) DOM2
var op = false;  		//all opera
var op7 = false;  	//opera 7
var mac = false;		//mac
var safari = false;	//mac Safari

var old = false;		// very old browser

var browserWarn = false;
var strAgent = window.navigator.userAgent;
function browser_detect()
{
	op = (strAgent.indexOf("Opera") > -1);
	op7 = (strAgent.indexOf("Opera/7") > -1) || (strAgent.indexOf("Opera 7") > -1);	

    // do it the official W3C way
    if ( window.document.implementation != null)
    {
         dom1 = window.document.implementation.hasFeature("HTML","1.0");
         dom2 = window.document.implementation.hasFeature("HTML","2.0") &&
         	window.document.implementation.hasFeature("Events","2.0") &&
         	window.document.implementation.hasFeature("Core","2.0") &&
         	window.document.implementation.hasFeature("CSS2","2.0");
    }
    // Mozilla based browsers contain the Gecko rendering engine
    moz = (window.navigator != null )
		? (strAgent.indexOf("ecko") != -1 )
		: false;
    nn4 = (window.document.layers != null && !moz);
	ns6 = (moz && !dom2);
	ns7 = (moz && (strAgent.indexOf("Netscape/7") > 0));
	
    // IE has incremental support for the Document Object Model
    ie6 = (window.document.all && dom1);
    ie5 = (window.document.all && (strAgent.indexOf('MSIE 5')>0));		//&& window.document.getElementsByTagName()
	ie  = (ie5 || ie6 && !op);
    ie4 = (window.document.all && !ie6 && !ie5); 
	mac = (strAgent.indexOf('Mac')>0);
	safari = (strAgent.indexOf('Safari')>0)
    // something horrible and old
    old = (!ie && !dom1 && !moz);
	
	// set flag browserWarn true if IE<5 or Netscape < 6
	if (ie == true || moz== true){
		browserWarn = false;
	} 
	else {
		browserWarn = true;
	}
	//alert (browserWarn);
}

var scriptsPath = '/global/scripts/'
document.write('<s' + 'cript type="text/javascript" language="JavaScript" src="' + scriptsPath + 'umfrage.js"><' + '/script>') 
browser_detect();

function popup_content(fenstername,fensterlink,breite,hoehe,scrolling,resizablevar){
        eval("var "+fenstername+" = window.open('"+fensterlink+"','"+fenstername+"','scrollbars="+scrolling+",width="+breite+",height="+hoehe+",resizable="+resizablevar+",top=116,left=116,status=yes')");
}

function popup_fenster(fenstername,fensterlink,breite,hoehe,scrolling,toolbarvar,locationvar,directoriesvar,statusvar,menubarvar,resizablevar,xpos,ypos){
        eval("var "+fenstername+" = window.open('"+fensterlink+"','"+fenstername+"','width="+breite+",height="+hoehe+",scrollbars="+scrolling+",toolbar="+toolbarvar+",location="+locationvar+",directories="+directoriesvar+",status="+statusvar+",menubar="+menubarvar+",resizable="+resizablevar+",top="+ypos+",left="+ypos+"')");
}
		

function showVTS(){
	var CommandID = 'D';
	var ServiceID = 'privat';
	//var ServiceID='dialog';
	var KundenPLZ = document.fachmann.Plz.value;
	var KundenStr = document.fachmann.Strasse.value;
	if (KundenPLZ=='' && KundenStr=='')
		CommandID = 'S'
		
	URI="https://service40.allianz.de/VTS_app/VTS";

	URI+='?ServiceID=' + escape(ServiceID);
	URI+='&AppFlag=VTS';
	URI+='&integrated=false';
	URI+='&CommandID=' + escape(CommandID);
	URI+='&plz_prox=' + escape(KundenPLZ);
	URI+='&ort_prox=';
	URI+='&str_prox=' + escape(KundenStr);
	
	var satellit = window.open(URI,'newSatellit','toolbar=0, location=0, directories=0, status=1, menubar=0, scrollbars=yes,resizable=1, width=700, height=670, screenX=300, screenY=250').focus;
}
function showprint(){
	var path = window.location.pathname;
	var pathsplit = path.split("\/");
	var name= pathsplit[(pathsplit.length)-1];
	var namesplit= name.split(".");
	var myName=namesplit[0].replace(/\_\d+$/, "");
	myName= myName+ '_print.html';
	if(!name)
		myName = 'index_print.html'
	eval("var newWin = window.open('"+ myName +"', 'newWin','height=600,width=800,top=0,left=0,status=yes,scrollbars=yes,resizable=yes,toolbar=yes,menubar=yes,location=yes')");
}

function popup_navigator(fenstername,fensterlink,breite,hoehe){
        if (ie){
                if (navigator.platform.indexOf("Win") == -1){
                        var xPos = 482;
                        var yPos = 34;}
                else{
                        var xPos = window.screenLeft +  482;
                        var yPos = window.screenTop - 104;}}
        else{
                var xPos = window.screenX + 482;
                var yPos = window.screenY + 34;}
        //alert("X-Pos:" + xPos + "\nY-Pos:" + yPos)
        eval("var "+fenstername+" = window.open('"+fensterlink+"','"+fenstername+"','width="+breite+",height="+hoehe+",scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,top="+yPos+",left="+xPos+"')");
        eval(fenstername+".focus()");}



