function MM_preloadImages() { //v3.0
  var d=document;
  if(d.images){
  	if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments;
	for(i=0;i<a.length;i++)
    if (a[i].indexOf("#")!=0){
		d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}
	}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr;
  for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)
  x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;
  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
  }
  if(!(x=d[n])&&d.all) x=d.all[n];
  for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n);
  return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments;
  document.MM_sr=new Array;
  for(i=0;i<(a.length-2);i+=3)
  if ((x=MM_findObj(a[i]))!=null){
  	document.MM_sr[j++]=x;
	if(!x.oSrc) x.oSrc=x.src;
	x.src=a[i+2];
  }
}

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 MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  	if ((obj=MM_findObj(args[i]))!=null) {
  		v=args[i+2];
    	if (obj.style) {
    		obj=obj.style;
    		v=(v=='show')?'visible':(v='hide')?'hidden':v;
    	}
    obj.visibility=v;
    }
}

var detect = navigator.userAgent.toLowerCase();
var OS,browser,version,thestring;

if (checkIt('konqueror'))
{
	browser = "Konqueror";
	OS = "Linux";
}
else if (checkIt('omniweb')) browser = "OmniWeb"
else if (checkIt('opera')) browser = "Opera"
else if (checkIt('webtv')) browser = "WebTV";
else if (checkIt('icab')) browser = "iCab"
else if (checkIt('msie')) browser = "Internet Explorer"
else if (!checkIt('compatible'))
{
	browser = "Netscape Navigator"
	version = detect.charAt(8);
}
else browser = "An unknown browser";

if (!version) version = detect.charAt(place + thestring.length);

if (!OS)
{
	if (checkIt('linux')) OS = "Linux";
	else if (checkIt('x11')) OS = "Unix";
	else if (checkIt('mac')) OS = "Mac"
	else if (checkIt('win')) OS = "Windows"
	else OS = "an unknown operating system";
}

function checkIt(string)
{
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
}

function neuesFenster(txt) {
newWin = window.open(txt,'Grossbild','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=650,height=500');
}
function Daten(txt) {
newWin = window.open(txt,'Technik','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=690,height=450');
}

function HilfeFenster(txt,groesse) {
// var ende = txt.length;
// var anfang = txt.lastIndexOf("/");
// var datei = txt.substring(anfang+1,ende);

if (groesse == 1) {
newWin = window.open(txt,'Detail','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=400,height=300');
}

if (groesse == 2) {
newWin = window.open(txt,'Detail','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=670,height=500');
}

if (groesse == 3) {
newWin = window.open(txt,'Detail','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=400,height=470');
}

if (groesse == 4 && txt != 'bezugsquelle' && txt != 'ipk') {
newWin = window.open(txt,'Detail','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=690,height=450',false,'450|690');
}

if (groesse == 5) {
newWin = window.open(txt,'downloads','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=520,height=300');
}

if (groesse == 6) {
newWin = window.open(txt,'soluzioni','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=1003,height=550');
}

if ((txt == 'bezugsquelle') && (groesse == 4)) {
newWin = window.open('http://www.junkers.com/app/adr/jsp/Controller.jsp?land=de&marke=Junkers&sprache=de&layoutvariante=2','JUNKERS','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=690,height=450',false,'450|690');
}
}

var hili;


if (!opener)
{
  var jQueryScriptOutputted = false;
  function initJQuery() {
      
      //if the jQuery object isn't available
      if (typeof(jQuery) == 'undefined') {
      
      
          if (! jQueryScriptOutputted) {
              //only output the script once..
              jQueryScriptOutputted = true;
              
              //output the script (load it from google api)
              document.write("<scr" + "ipt type=\"text/javascript\" src=\"https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js\"></scr" + "ipt>");
              document.write("<scr" + "ipt type=\"text/javascript\" src=\"https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js\"></scr" + "ipt>");
          }
          setTimeout("initJQuery()", 50);
      } else {
                          
          $(function() {  

          $("head").append("<link>");
          css = $("head").children(":last");
          css.attr({
            rel:  "stylesheet",
            type: "text/css",
            href: "http://ajax.googleapis.com//ajax/libs/jqueryui/1.8.16/themes/ui-lightness/jquery-ui.css"
          });

          /**
             * jQuery Cookie plugin
             *
             * Copyright (c) 2010 Klaus Hartl (stilbuero.de)
             * Dual licensed under the MIT and GPL licenses:
             * http://www.opensource.org/licenses/mit-license.php
             * http://www.gnu.org/licenses/gpl.html
             *
             */
            jQuery.cookie = function (key, value, options) {

                // key and at least value given, set cookie...
                if (arguments.length > 1 && String(value) !== "[object Object]") {
                    options = jQuery.extend({}, options);

                    if (value === null || value === undefined) {
                        options.expires = -1;
                    }

                    if (typeof options.expires === 'number') {
                        var days = options.expires, t = options.expires = new Date();
                        t.setDate(t.getDate() + days);
                    }

                    value = String(value);

                    return (document.cookie = [
                        encodeURIComponent(key), '=',
                        options.raw ? value : encodeURIComponent(value),
                        options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
                        options.path ? '; path=' + options.path : '',
                        options.domain ? '; domain=' + options.domain : '',
                        options.secure ? '; secure' : ''
                    ].join(''));
                }

                // key and possibly options given, get cookie...
                options = value || {};
                var result, decode = options.raw ? function (s) { return s; } : decodeURIComponent;
                return (result = new RegExp('(?:^|; )' + encodeURIComponent(key) + '=([^;]*)').exec(document.cookie)) ? decode(result[1]) : null;
            };
            
            $('body').append( '<div style="display: none;" id="umfrage"><iframe scrolling="no" frameborder="0" src="https://inquery.bosch-thermotechnik.de/cgi-bin/s.app?A=m6Zjz3dq" style="border: none;width: 95%; height: 95%; padding: 0; margin: 0"></iframe></div>');
       
              
              if($.cookie('umfrage') != 1)
              {
                $('#umfrage').dialog({     
                  height: 700, 
                  width: 800,
                  modal: true,
                  bgiframe: true,
                  title: 'Bienvenido a Junkers',
                  open: function() { $('html, body').animate({ scrollTop: 0 }, 0); $('object').hide(); $('embed').hide(); },
                  close: function() {  $('object').show(); $('embed').show(); }
                });
              }
              
              $.cookie('umfrage', '1', { expires: 365, path: '/' });

          });
      }
              
  }
  initJQuery();
}
  

