/*
*** a3design Gmbh
*** last update: 23.08.2001

LOOK ALSO IN LAYOUT-PATH !!!!!!!!!!!!!!!
LOOK ALSO IN LAYOUT-PATH !!!!!!!!!!!!!!!
LOOK ALSO IN LAYOUT-PATH !!!!!!!!!!!!!!!
*/

// Browsercheck

function getBrowserTyp() {
   if (document.all) {
       typ = "1ie";
   }
   else {
       version = navigator.appVersion;
       version = version.substr(0,4);
          if (version < 4.72 || version > 6) {
	      typ = "0ns"
	  }
	  else if (version >= 4.72) {
	      typ = "1ns"
	  }
   }

   if (navigator.platform == "Win32") {
      typ = typ + "W";
   } else {
      typ = typ + "O";
   };


   breite = parseInt(screen.width);
   hoehe = parseInt(screen.height);

   if (breite<parseInt(700) && hoehe<parseInt(500)) {
      typ = typ + "8";
   } else if (breite<parseInt(820) && hoehe<parseInt(620)) {
      typ = typ + "8";
   } else if (breite>parseInt(1020) && hoehe>parseInt(750)) {
      typ = typ + "1";
   }

   return typ;

}

function submitme() {

  document.btformular.$b.value = getBrowserTyp();

  document.btformular.submit();
}



// Logic fuer korrigierung der Selektion der Top-Navigation

function compareTopNavigationSelections(soll_topl1, soll_topl2, script_url) {

	if (top.document == document) return;

	var ist_topl1 = top.topframe.top_navi_level1;
	var ist_topl2 = top.topframe.top_navi_level2;
	
	if ((ist_topl1 == soll_topl1) && (ist_topl2 == soll_topl2)) 
		return;

	top.topframe.location.href = script_url + "&window=topframe"
};

function compareLeftNavigationSelections(soll_leftl1, soll_leftl2, script_url) {

	if (top.document == document) return;

	var ist_leftl1 = top.leftframe.left_navi_level1;
	var ist_leftl2 = top.leftframe.left_navi_level2;
	
//	if ((ist_leftl1 == soll_leftl1) && (ist_leftl2 == soll_leftl2)) 
	if ((ist_leftl1 == soll_leftl1))
		return;

	top.leftframe.location.href = script_url + "&window=leftframe"
};

// Cookie Check

function noCookie(){
  cookieName = 'CookieTest_'+ String(Math.random()).replace(/./,'');
  document.cookie = cookieName+'=GZBank';
  if (eval('document.cookie.search(/'+cookieName+'/)')==-1)
      return true;
  else
      return false;
}


// Bei Klick auf Suchergebnis werden die Nav-Frames richtig geladen

function smatchclick(action,strukid,sid,framename,nodeid,window,cmd,layername,anzahl,type) {
   ok = false
   if (type == "server") {
      nav = eval('top.'+framename+'.location');
      ref=action+'?node_id='+nodeid+'&sid='+sid+'&window='+window+'&cmd='+cmd
      nav.href=ref;
      ok = true;
   } else if (type == "dhtml") {
      nav = eval('top.'+framename);
      if (nav.loaded) { //pruefe ob das Frame geladen ist
	ok = true;
        nav.showLayer(layername,anzahl);
      }
   }
   if (ok) {
      href=action+'?node_id='+strukid+'&sid='+sid+'&window=contentframe'
      top.contentframe.location.href=href;
   }
}


function myClick(action, struk_id, sid, aid, cmd) {
   top.leftframe.location.href = action + "?node_id="+struk_id+"&sid=" + sid +"&aid=" + aid + "&window=leftframe&cmd=" + cmd;
   top.topframe.location.href = action + "?node_id="+struk_id+"&sid=" + sid + "&aid=" + aid +  "&window=topframe&cmd=" + cmd;
   top.contentframe.location.href = action + "?node_id="+struk_id+"&sid=" + sid + "&aid=" + aid +  "&window=contentframe&cmd=" + cmd;

};



function openPopup(url,titel,optionen) {

       if (!optionen)  { 
         optionen = "width=800,height=530,dependent=no,status=yes,location=no,scrollbars=yes,resizable=yes,toolbar=no,menubar=no,hotkeys=no,top=0,left=0";
       }

       popup = window.open(url,titel,optionen);

       popup.focus();
};
   


var bankingw = 0;

function openExternSystem(url,sysurl,title,struk_id,ts, optionen) {

       if (!optionen)  {
         optionen = "width=800,height=530,dependent=no,status=yes,location=no,scrollbars=yes,resizable=yes,toolbar=no,menubar=no,hotkeys=no,top=0,left=0";
       }

       try { //wird erneut der Link zum oeffnen des Fensters geklickt, kommt es zum Fehler
         bankingw = window.open("",title,optionen);	
       
         if (bankingw) { // Ein blocker koennte das oeffnen des Fensters verhindern
           bankingw.openBankingWindow = openBankingWindowInWindow;  // Trickystuff
           bankingw.openBrokerageWindow = openBrokerageWindowInWindow;  // Trickystuff

           if (sysurl && checkSkip(struk_id, ts)) {
	           bankingw.document.location.href = sysurl
           } else {
	           bankingw.document.location.href = url
           };


           bankingw.focus();
         };
       } catch(e) {
/*       
           alert("Diese Anwendung haben Sie bereits ge?ffnet. \nBitte wechseln Sie zu dem gew?nschten Fenster.")
*/           
           text = "Offenbar haben Sie einen PopUp - Blocker aktiviert.\nDeshalb können Sie das Angebot der Bank 1 Saar -Webseite nur eingeschränkt nutzen.\n";
           text = text +"Bitte deaktivieren Sie den Blocker für  www.bank1saar.de, um alle Funktionen nutzen zu können.";
           alert(text);           
       }
};

function openEuroRechner() {
       optionen = "width=330,height=360,dependent=no,status=yes,location=no,scrollbars=yes,resizable=no,toolbar=no,menubar=no,hotkeys=no"
       w = window.open("../eurorechner.html","Eurorechner",optionen);	
       w.focus();
};



function openHelpWindow(url) {
       optionen = "width=590,height=450,dependent=no,status=yes,location=no,scrollbars=yes,resizable=no,toolbar=no,menubar=no,hotkeys=no"
       w = window.open(url, "Hilfe", optionen);	
       w.focus();    
};


function openBeraterWindow(url, add_data_key) {
       if (!add_data_key) add_data_key = "";
       optionen = "width=590,height=480,dependent=no,status=yes,location=no,scrollbars=yes,resizable=no,toolbar=no,menubar=no,hotkeys=no"
       w = window.open(url + "&window=kontakt&adddatakey=" + add_data_key, "kontaktwindow",optionen);	
       w.focus();    
};

function openEmpfehlungsWindow(url) {
       optionen = "width=590,height=480,dependent=no,status=yes,location=no,scrollbars=yes,resizable=no,toolbar=no,menubar=no,hotkeys=no"
       w = window.open(url + "&window=empfehlung","empfwindow",optionen);	
       w.focus();    
};

function openPrintWindow(url) {
       optionen = "width=650,height=550,dependent=no,status=yes,location=no,scrollbars=yes,resizable=no,toolbar=no,menubar=no,hotkeys=no"
       w = window.open(url + "&window=print","printwindow",optionen);	
       w.focus();    
};

function openPrintWindow2(url,quittung) {
       optionen = "width=650,height=550,dependent=no,status=yes,location=no,scrollbars=yes,resizable=no,toolbar=no,menubar=no,hotkeys=no"
       if (quittung) {
           w = window.open(url + "&window=print&quittung_id=" + quittung,"printwindow",optionen);	
           w.focus();    
       } else{
 	   //alert("An dieser Stelle ist kein Ausdruck m?glich. Erst nach dem Absenden des Formulars kann ein Ausdruck erfolgen.")
       }
};

function openBankingWindowInWindow() { // Trickystuff
   openBankingWindow(bankingw);
};


function openBankingWindow(where) {

   if (!where) where = document;
   datum = new Date();
   url = "https://www.vr-networld-banking.de/banking/servlet/IndexFAG;jsessionid=setr92mup1?BankID=fag-0803-0803&time="+ Date.parse(datum) + "&rz=fag&bank=0803";
   url = "https://www.vr-networld-banking.de/banking/banking.jsp?rz=fag&bank=0803"
   where.location.href = url;
}


function openBrokerageWindowInWindow() { // Trickystuff
   openBrokerageWindow(bankingw);
};

function openBrokerageWindow(where) {

   if (!where) where = document;

    var ie = (document.all) ? true : false;
    var nn = (document.layers) ? true : false;

    var contentframeset = (document.all) ? 'contentframeset_ie.jsp?md=803_1&img=no&bgc=no&frc=no&hlc=no&css=no&title1=no&title2=no' : 'contentframeset_nn.jsp?md=803_1&img=no&bgc=no&frc=no&hlc=no&css=no&title1=no&title2=no';
    if (navigator.appVersion.substring(0,1) < 4 || noCookie()==true)
	contentframeset = (document.all) ? 'contentframeset_nostart_ie.htm' : 'contentframeset_nostart_nn.htm';
    
    where.location.href = "https://brokerage.gz-bank.de/xTrade/" + contentframeset;
};

function openChartWindow(url) {
       optionen = "width=650,height=550,dependent=no,status=yes,location=no,scrollbars=yes,resizable=yes,toolbar=no,menubar=no,hotkeys=no";
       w = window.open(url,"content",optionen);
//       page = "<html><head><title></title><frameset cols=*><frame name=\"content\" src="+url+" scrolling=auto></frame></frameset></head><body></body></html>"
//       w.document.write(page)
       w.focus();    
};


if (document.location.href.substr(4,1) != "s") { 
   if (!window.opener) top.openBankingWindow = openBankingWindow;
   if (!window.opener) top.openBrokerageWindow = openBrokerageWindow;
};


//// Diese funktion wird nicht mehr aufgerufen !!!
function openImmoWindow(imgurl,basehref,ueberschrift) {
   opt = "width=650,height=550,location=no,scrollbars=yes,resizable=yes,toolbar=no,menubar=no,hotkeys=no";
   w = window.open("","",opt)
   p = "<html><head><base href=\""+basehref+"\"><link rel=\"STYLESHEET\" type=\"text/css\" href=\"style.css\"><title>Bank 1 Saar - Immobilien</title></head>"
   p = p + "<body bgcolor=white><table border=0 cellspacing=0 cellpadding=0 width=90% align=center><tr><td align=right><img src=\"lgo_print.gif\"></td></tr></table>"
   p = p + "<table border=0 bgcolor=black cellspacing=1 cellpadding=0 width=90% align=center><tr><td><table border=0 bgcolor=white width=100% cellspacing=0 cellpadding=1>"
   p = p + "<tr><td align=left><img src=\"img_pfeil.gif\" border=0><img src=\"img_pfeil.gif\" border=0>&nbsp;<span class=\"ueberschrift\">"+ueberschrift+"</span></td>"
   p = p + "<td align=right><a href=\"javascript:window.print();\"><img src=\"img_drucken.gif\" border=0></a>&nbsp;</td></tr>"
   p = p + "<tr><td bgcolor=#ED870D height=2 colspan=2><img src=\"abs_trans.gif\" width=1 height=1></td></tr>"
   p = p + "<tr><td align=center colspan=2><br><img src=\""+imgurl+"\" border=1></td></tr>"
   p = p + "<tr><td align=right colspan=2><br>[<a href=\"javascript:window.close();\" class=\"linkname\">Fenster schlie&szlig;en</a>]&nbsp;</td></tr>"
   p = p + "<tr><td colspan=2 bgcolor=white><img src=\"abs_trans.gif\" width=1 height=10></td></tr>"
   p = p + "</table></td></tr></table></body></html>"

   w.document.write(p);
   w.document.close();
   w.focus();
}; 

function openAssiWizard(url, opt) {
   if (!opt) {
       opt = "width=720,height=550,location=no,scrollbars=yes,resizable=yes,toolbar=no,menubar=no,hotkeys=no,status=yes";
   }
   
   window.top.assi_wizard_window = window.open(url,"assiwizard", opt);
   window.top.assi_wizard_window.focus();

/*   document.getElementById("wizard_icon").style["display"] = "block";
     wird ueber checkAssiWizard gesetzt und funzt immer !! braucht man hier also nicht. adj
*/
};

function focusAssiWizard() {
   try {
           window.top.assi_wizard_window.focus();
   } catch (e) {};
};

setTimeout('checkAssiWizard()', 200);

function checkAssiWizard() {

   try {
          if (window.top.assi_wizard_window.closed == true) document.getElementById("wizard_icon").style["display"] = "none";
          if (window.top.assi_wizard_window.closed == false) document.getElementById("wizard_icon").style["display"] = "block";
   } catch (e) {
   };
   setTimeout('checkAssiWizard()', 1000);
};

function wizardShowPage(url) {
        window.location.href = url;
};










