
$(document).ready(function()
{
   $("a.imagezoom").fancybox();
   
	 
	 $("a[href^=javascript:]").removeAttr("onClick"); // ???
   
   
   	/*	
	$("ul#fachlexikon > li > ul").hide();
	$("ul#fachlexikon > li > h2").click(function()
	{
		var myul = $(this).parent().find("ul");
		myul.slideToggle(); 
	});
	*/	
	/*
	$("form#fachlexikonsuche").submit(function()
	{
		console.debug("CHANGE!");
		var sval = "/"+$(this).find("input[name=fachlexikonsuche]").val()+"/";
		console.debug(sval);
		$("ul#fachlexikon > li > ul > li").each(function()
		{
			var me = $(this);
			console.debug(me.text()+" = "+me.text().search(sval))
			if (me.text().search(sval) == -1)
				 me.hide();
			else
				 me.show();
			
		});
		return false;
	
	})
*/

    $("a.editmebutton").mouseenter(function()
    {
       bih_editme.setCurrent($(this).parent());
       if ($(this).hasClass("collection"))
            bih_editme.setCurrent($(this).parent().find(".articlecolums"));
    });
    $("a.editmebutton").mouseleave(function()
    {
        bih_editme.resetObject($(this).parent());
       if ($(this).hasClass("collection"))
            bih_editme.resetObject($(this).parent().find(".articlecolums"));
    });

    
    $("form#registerform > div.inputcheckbox").mouseenter(function()
    {
        $(this).addClass("inputover");  
    
    }).mouseleave(function()
    {
       $(this).removeClass("inputover");  
    });
   
   
   
   
    /*
    $("form#registerform2 > div.inputcheckbox > input[type=checkbox]").each(RegisterGroups.setUpGroup);
    RegisterGroups.firstCall = false;
    $("form#registerform2 > div.inputcheckbox > input[type=checkbox]").change(RegisterGroups.setUpGroup);
    */
    
    
    // Allgemeine Suche-Button durch Lupe-Image ersetzen...
    $("div#searchbox form p").each(function()
    {
        $(this).find("input.submit").remove();
        var searchinput = $(this).html();
        $(this).find("label").remove();
        $(this).find("input").remove();
        if ($.browser.msie && $.browser.version < 8)
        {
          $(this).append('<div style="border:0px solid;">' + 
                         '<div style="float:left; border:0px solid;">' + 
                         searchinput +
                         '</div>' + 
                         '<div style="margin-top:1px;border:1px solid #999;border-left:0px solid;float:left;padding-top:3px;background:#FFF;height:17px;">' +
                         '<input type="image" src="/bih/mainsuche.gif" alt="Suchen" title="Suchen">' +
                         '</div>' +
                         '</div>'
                         );
        }
        else
        {
          $(this).append('<div style="border:0px solid;">' + 
                         '<div style="float:left; border:0px solid;">' + 
                         searchinput +
                         '</div>' + 
                         '<div style="border:1px solid #999;border-left:0px solid;float:left;padding-top:3px;background:#FFF;height:17px;">' +
                         '<input type="image" src="/bih/mainsuche.gif" alt="Suchen" title="Suchen">' +
                         '</div>' +
                         '</div>'
                         );        
        }
    });    
    
    // Kontakt Suche-Button durch Lupe-Image ersetzen...
    $("div#kontaktsearchbox form p").each(function()
    {
        $(this).find("input.submit").remove();
        var searchinput = $(this).html();
        $(this).find("label").remove();
        $(this).find("input").remove();
        if ($.browser.msie && $.browser.version < 8)
        {
          $(this).append('<div style="border:0px solid;">' + 
                         '<div style="float:left; border:0px solid;">' + 
                         searchinput +
                         '</div><br>' + 
                         '<div style="margin-top:1px;border:1px solid #999;border-left:0px solid;float:left;padding-top:3px;background:#FFF;height:17px;">' +
                         '<input type="image" src="/bih/mainsuche.gif" alt="Suchen" title="Suchen">' +
                         '</div>' +
                         '</div>'
                         );
        }
        else
        {
          $(this).append('<div style="border:0px solid;">' + 
                         '<div style="float:left; border:0px solid;">' + 
                         searchinput +
                         '</div><br>' + 
                         '<div style="border:1px solid #999;border-left:0px solid;float:left;padding-top:3px;background:#FFF;height:17px;">' +
                         '<input type="image" src="/bih/mainsuche.gif" alt="Suchen" title="Suchen">' +
                         '</div>' +
                         '</div>'
                         );        
        }
    });
 
   
});

/*
var RegisterGroups = {}
RegisterGroups.firstCall = true;
RegisterGroups.setUpGroup = function()
{
    jQ = $(this);
    var sgroup = $("div.subgroup[id=subgroup_"+jQ.attr("id")+"]") 

    if (!RegisterGroups.firstCall)
    {
        jQ.parent(".inputcheckbox").find("div.error").hide();
        // jQ.parent(".inputcheckbox").parent("div.subgroup").find("div.error").hide();
    }
    

    if (jQ.is(":checked"))
    {
        sgroup.slideDown();
    }
    else  
    {
        sgroup.find("input[type=checkbox]").attr("checked", false); 
        if (RegisterGroups.firstCall)
            sgroup.hide();
        else
            sgroup.slideUp();
    }
}
 */
var bih_editme = {}
bih_editme.setCurrent = function(jQ)
{
        if (jQ.attr("style"))
            jQ.attr("oldstyle", jQ.attr("style"));
        else
            jQ.attr("oldstyle", "");
        jQ.css("background", "#fffaa3");
} 
bih_editme.resetObject = function(jQ)
{
        if (jQ.attr("oldstyle"))
            jQ.attr("style", jQ.attr("oldstyle"));
        else
            jQ.removeAttr("style"); 
}


// Recaptcha Initialisieren
var RecaptchaOptions = {
	theme : 'clean',
	lang: 'de',
	tabindex : 100,
	custom_theme_widget: 'recaptcha_widget'
};




// Da bei <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
// das target - Attribut im <a ... target="..."></a> nicht mehr erlaubt ist, hier setzen!
function setTarget(obj, target)
{
    if (target.length > 0)
        obj.target = target;
    else
        obj.target = "_self";
}


var webscormplayer; 
function launchplayer(wcapath) 
{
	var wswinwidth=790;
	var wswinheight=560;
	if (!webscormplayer || webscormplayer.closed == true) 
        webscormplayer = window.open(wcapath, '', 'dependent=yes,height='+wswinheight+',width='+wswinwidth+',location=no,menubar=no,resizable=yes,scrollbars=no,status=no,toolbar=no');
	if (webscormplayer) 
        webscormplayer.focus();
}



