
function openPopup(uHREF, uName, uWidth, uHeight, uScrollbars, uResizable) {
    
    
    locParams =
        "width="      + uWidth                     + "," +
        "height="     + uHeight                    + "," +
        "scrollbars=" + ((uScrollbars)?"yes":"no") + "," +
        "resizable="  + ((uResizable)?"yes":"no")  + "," +
        "caption=no," +
        "menubar=no," +
        "toolbar=no," +
        "status=yes," +
        "location=no";
    locWindow = window.open(uHREF, uName, locParams);
    //locWindow.focus();
    
}

function Blotter() {
    this.blotterTab = [];
    this.blotterRegister = [];
    this.startTab = "";
    this.startRegister = "";
    this.setStartTab = function(tab, register) {
        this.startTab = tab;
        this.startRegister = register;
    }
    this.showStartTab = function(tab, register) {
        this.closeAllTabs();
        this.setStartTab(tab, register);
        document.getElementById(this.startTab).className = "active";
        document.getElementById(this.startRegister).style.display = "block";
    }
    this.addTab = function(tab, register) {
        this.blotterTab.push(tab);
        this.blotterRegister.push(register);
    }
    this.showTab = function(tab, register) {
        this.closeAllTabs()
        document.getElementById(tab).className = "active";
        document.getElementById(register).style.display = "block";
        $("#areaWerbung, #areacenter,#shadowLeft ,#shadowRight").height($("#areaBody").height()+194);

    }
    this.closeAllTabs = function() {
        var blotterRegisterCount = this.blotterRegister.length;
        for (var i = 0; i < blotterRegisterCount; i++) {
            document.getElementById(this.blotterRegister[i]).className = "";
        }
        var blotterTabCount = this.blotterTab.length;
        for (var i = 0; i < blotterTabCount; i++) {
            document.getElementById(this.blotterTab[i]).style.display = "none";;
        }
    }
}
function switchBlotterTab(blotterId, tab) {
    eval("var blotterArray = blotter" + blotterId + "TabNamen['" + tab + "']");
    if (blotterArray != undefined) 
        eval("blotter" + blotterId + ".showStartTab('" + blotterArray[1] + "', '" + blotterArray[0] + "')");
} 

//Setzen der ordahl für adTags
ord=Math.random()*100000000000;
function openLayer(url, width, height) {
    thisUrl = url.indexOf("?") == -1 ? url+"?TB_iframe=true&width="+width+"&height="+height : url+"&TB_iframe=true&width="+width+"&height="+height;
    tb_show(null,thisUrl, false);
}
/* MUSS NOCH ANGEPASST WERDEN !!
$(function() {
    $(".loginButton .loginbtn").bind("click", function() {
        s.linkTrackVars='prop50,eVar50';
        s.prop50 = s.eVar50 = $(".loginKundennummer .txtKundennummer").val();
        s.tl(this,'o','Login');
    });
    $("#loginContentId input[type='image']").bind("click", function() {
        s.linkTrackVars='prop50,eVar50';
        s.prop50 = s.eVar50 = $("#loginContentId input[name='login']").val();
        s.tl(this,'o','Login');
    });
});
*/


function singleSubmit(formName,formField){
 if(document.forms[formName].elements[formField].value == "0"){
  document.forms[formName].elements[formField].value = "1";
  return true;
 } else {
  return false;
 }
}
function singleSubmitDisable(form, flagName, submitButtonName) {
 if (form.elements[flagName].value == "0") {
  form.elements[flagName].value = "1";
  form.elements[submitButtonName].disabled = true;
  return true;
 } else {
  return false;
 }
}

$(function() {
    if ( $(".hnavmenu li:first").hasClass("hnavactiv") ) {
        $(".hnavmenu li:first").css({"border-left" : "none"});    
        $(".hnavmenu li:first ul:first").css({"left" : "-3px"});
    }
    $("#areaWerbung, #areacenter,#shadowLeft ,#shadowRight").height($("#areaWerbung").height()+194);
    if(typeof document.body.style.maxHeight === "undefined") {
        $(".hnavmenu li, .hnavmenu li li, #quickdone li, #quickdone2 li").each(function() { 
            that = $(this);
            $(that).bind("mouseenter", function() {
                $(this).addClass("hoverMe");
            });
            $(that).bind("mouseleave", function() {
                $(this).removeClass("hoverMe");
            });
        });
    if ( $(".hnavmenu li:first").hasClass("hnavactiv") ) {
        $(".hnavmenu li:first ul:first").css({"left" : "0px"});
    }
    }
    $("input[name='email']").blur(function(){
        if ($(this).val() == "")  {
            $(this).val($(this).attr("title"));
        }
    });
    $("#rightLogin input[name='password']").blur(function(){
        if ($(this).val() == "") {
            $(this).parent().hide().next().show();
        }
    }).parent().hide();
    $("#rightLogin input[name='passwordfake']").focus(function(){
        $(this).parent().hide().prev().show().children("input").focus();
    }).parent().show();
});

// Für Teaser mit Dropdown
function checkAuswahl(uName) {
   
   eval('locAnzahl = document.' + uName + 'form.' + uName + '.length');
   for(i=0; i < locAnzahl; i++) {
       eval('locSelect = document.' + uName + 'form.' + uName + '.options[i].selected');
       if(locSelect == true) {
           eval('locValue = document.' + uName + 'form.' + uName + '.options[i].value');
           if (locValue != "") {
               locTarget = locValue.split("|");
               if(locTarget.length > 1)
               {
                if(locTarget[0] != "")
                {
                 Fenster1 = window.open(locTarget[0], "Seite");
                }
               }
               else
               {
                location.href = locValue;
               }
           }
       }
   }
}
