$(function() 	// Document is ready
{
var videoname = $("#CRhelper_videoname").text();
videoname = $.trim(videoname);
var bildname = $("#CRhelper_bildname").text();
bildname = $.trim(bildname);
var haus = $("#CRhelper_haus").text();
haus = $.trim(haus);

$('#CRcontainer_middle_left_startseite').mousewheel(); 
//$("#startseite_videoleiste").jCarouselLite({ speed: 600, visible: 5, mouseWheel: true, btnPrev: "#next_button", btnNext: "#prev_button" });
$("#haus_videoleiste").jCarouselLite({ vertical: true, speed: 600, visible: 6, scroll: 3, mouseWheel: true, btnPrev: "#up_button", btnNext: "#down_button", circular: false });

$('#CRcontainer_startseite_flash').flashembed({src: "./ContentRex/project/videomaterial/startseite.swf", wmode: 'transparent'});

if (videoname == '') 
{
$('#CRcontainer_haus_flash').css({border: '1px solid #1F222B', width: '650px', height: '240px'})
$('#CRcontainer_haus_flash').flashembed({src:"./ContentRex/project/videomaterial/"+haus+".swf", wmode: 'transparent'});
}
else
{
$('#CRcontainer_haus_flash').flashembed({src:"./ContentRex/project/videomaterial/player.swf", wmode: 'transparent'} ,
    {
        'flv':'http://www.theater-tv.com/flv/'+haus+'/'+videoname+'.flv' ,
        'showfullscreen': '1',
        'bgcolor':'000000',
        'bgcolor1':'363636',
        'bgcolor2':'363636',
        'videobgcolor':'000000',
        'sliderovercolor':'7994ec',
        'buttonovercolor':'7994ec',
        'showiconplay':'1',
        'startimage':'http://www.theater-tv.com/flv/'+haus+'/'+bildname+''

    });
}    

$(".video_eintrag img").hover(function ()
            {
                var imglink = $(this).attr('src');
                var imgalt = $(this).attr('alt');
                $("#info").html("<img id='info_bild' src='"+imglink+"' width='420' height='256' alt='' /><div id='info_text'>"+imgalt+"</div>");
                
                $("#info").fadeIn();
            },
            function ()
            {
                $("#info").fadeOut(100);
            }
            );

/**
 * $(".hausvideo_eintrag img").hover(function ()
            {
                
                var imgalt = $(this).attr('alt');
                $("#videoinfo").html("<div id='videoinfo_text'>"+imgalt+"</div>");

                $("#videoinfo").fadeIn();
            },
            function ()
            {
                $("#videoinfo").fadeOut(100);
            }
            );
 */


$("#impressum").click(function()
{
    $("#impressumbox").fadeIn();
    return false;
});
$("#impressumbox").live("click",function()
{
    $("#impressumbox").fadeOut(100);
});

$("#ueberuns").click(function()
{
    $("#ueberunsbox").fadeIn();
    return false;
});
$("#ueberunsbox").click(function()
{
    $("#ueberunsbox").fadeOut(100);
});


$("#videopopupbox_close").click(function()
{
    $("#videopopupbox").fadeOut(100);
});

});
