function winopen(site)
{
	win = open(site,"win","width=700,height=480,screenX=0,screenY=0,menubar=no,scrollbars=yes,resizable=no");
	win.focus();
}

function oeffnefenster (url) {   fenster = window.open(url, "fenster1", "width=600,height=600,status=no,scrollbars=no,resizable=no");   fenster.focus();  }

$(document).ready(function() {
	$("ul#topten li:nth-child(odd)").addClass("colored");
    
    $("ul#topten span#one").mouseover(function () {
      $("ul#topten li span.one").pause(slideToggle("slow"));
    });
    
    $(".sub_header_center .button").click(function() {
      $(this).toggleClass("hover");
      $(this).parents(".sub_header").next(".box").slideToggle("slow");
      $(this).parents(".sub_header").next(".bc_slide").slideToggle("slow", function() {
        $(".bar", this).animate({
          "width":"toggle"
        }, {
          duration: "slow" });
        });
      });
    
    $("#togglewrite").click(function() {
      $("#bc_review").slideToggle("slow");
      return false;
    });

    $("#togglenmdf").click(function() {
      $("#bc_nmdf_nonmemberform").slideToggle("slow");
      return false;
    });
    $("#togglenmdf").click(function() {
      $("#bc_nmdf_select").slideToggle("slow");
      return false;
    });
    
    $(".show_preview").hover(function () {
       $(this).children(".spot.info").stop().fadeIn("fast").fadeTo("fast", 1);
       }, function () {
       $(this).children(".spot.info").stop().fadeOut("fast");
    });
 
    $(".spot.info").click(function () {
        var aktuell = $(this).parent().children(".preview.dn");
        
        var img_width = $(this).parent().find("img:first").attr("width");
        var img_height = $(this).parent().find("img:first").attr("height");
        
        $(aktuell).width(img_width-15);
        
        var info_height = $(aktuell).height();
        
        $(aktuell).css("top", img_height - info_height - 10);
        $(aktuell).css("left", 3);
        
        $(".preview").not(aktuell).fadeOut();
        $(aktuell).fadeIn("fast");
        return false;
    });

      $("a.close_description").click(function () {
       $(this).parent().parent().parent().fadeOut("fast");
       return false;
       });
       
     $(".partner img").fadeTo("fast", 0.33);
     $(".partner img").hover(function() {
        $(this).fadeTo("fast", 1.00);
     }, function () {
        $(this).fadeTo("fast", 0.33); 
    });
    
    // Umfrage
    // Umfrage abgegeben?    
    if($.cookie('hide_poll'))
    {
        if($.cookie('hide_poll') == "true")
        {
            $("#show_poll").hide();
        }
        else
        {
            $("#show_poll").show();
        }
    }
    
    $("#poll_button").click(function(){
        var display = $("#show_poll").css("display");
        if (display == "none" )
        {
            $("#show_poll").show();
            $.cookie('hide_poll', 'false', { expires: 1, path: '/' });
            $(".bar").fadeIn("slow");
        }
        else
        {
            $("#show_poll").hide();
            $(".bar").fadeOut("slow");
        }
        return false;
    });
    
    $("#close_poll").click(function(){
        $("#show_poll").hide();
        $.cookie('hide_poll', 'true', { expires: 1, path: '/' });
        return false;
    });  
    // Umfrage
    
    // Produktvoting
    
    $("#productvoting").easySlider({
            orientation:'vertical',
            prevText:         '',    
            nextText:         ''
        });
    
    // Produktvoting
	
    // Fancy Zoom
    $('div.photo a').fancyZoom({scaleImg: true, closeOnClick: true});
	$('.thumbborder a.zoom').fancyZoom({scaleImg: true, closeOnClick: true});
    $('#medium_box_link').fancyZoom({width:400, height:300});
    $('#large_box_link').fancyZoom();
    $('#flash_box_link').fancyZoom();
    // Fancy Zoom

     
});