$(document).ready(function(){
   var tempsrc = "";
   $(".menupunkt .normal img").hover(
      function () {
      	var src = $(this).parent().parent().find(".hover img").attr("src");
      	tempsrc = $(this).attr("src");
        $(this).attr("src",src);
      }, 
      function () {
        $(this).attr("src",tempsrc);
      }
    );
    
   $('div.buttonblock').pngFix( );
   $('div.class-poll div.content-body').pngFix( );
   $('form').pngFix( );
   
   $(".jQueryPopup").mouseover(function() {        
       var name = $(this).attr("name");
       $(name).show("fast");
   });

   $(".jQueryPopup").mouseout(function() {        
       var name = $(this).attr("name");
       $(name).hide("fast");
   });

   $(".buttonblock input:disabled").each(function(){
   	// var bg = $(this).css("background-image");
   	// bg = bg.substr(0,bg.length-6)+'d.png")';
   	// alert(bg);
   	$(this).css("background-image","url('/design/fcsavanna/images/b100d.png')");
   });

  $(".multiproj input.trehund").addClass("customTB");
  $(".multiproj input#by").removeClass("customTB");

   $(".multiproj input.customTB").focus(function afocus() {
    if($(this).attr("title")==$(this).attr("value"))
    {
      $(this).attr("value","");
    }
    });
	
    $(".multiproj input.customTB").blur( function () {
      if($(this).attr("value")=="")
      {
        $(this).attr("value",$(this).attr("title"));
      }
    });
    
    $(".buttonblock input:disabled").each(function(){
    	// var bg = $(this).css("background-image");
    	// bg = bg.substr(0,bg.length-6)+'d.png")';
    	// alert(bg);
    	$(this).css("background-image","url('/design/fcsavanna/images/b100d.png')");
    });


   $(".betting select").change(function(){
     $(this).parent().find("input").attr("value",this.options[this.selectedIndex].text);
     $(this).parent().parent().find(".col1 input").attr("checked","checked");
     $('#gotocheckoutbutton').attr('disabled', '');
   });

   $(".betting .col5 input").click(function(){
     $(this).parent().parent().find(".col1 input").attr("checked","checked");
     if($(this).attr("title")==$(this).attr("value"))
       $(this).attr("value","");
     $('#gotocheckoutbutton').attr('disabled', '');
   });

   $(".betting .col5 input").blur( function () {
     if($(this).attr("value")=="") {
       $(this).attr("value",$(this).attr("title"));
       $(this).parent().parent().find(".col1 input").attr("checked","");
     }
   });

});


