$j(".deleteItem").live("click", function() {
    
    if(! confirm("Esti sigur?")) {
        return false;
    }
    
    $j(this).find("img").attr("src", "/casino/img/smallLoadingAnimation.gif");
    
    var video_id = $j(this).parent("div").parent("div").attr("id");
    
    $j.post($j(this).attr("href"), {}, function(data, textStatus) {
        $j("#" + data.type + "_block_" + data.id).hide("slow", function(){ $j(this).remove(); });
    }, "json");
    
    return false;
});

$j(document).ready(function(){ 
   $j(".rounded").corner();
   
   
   //menu1 rollover
   $j("#menuTop").find("a > img").hover(
        function () {
            this.src = this.src.replace("1.jpg", "2.jpg");
            
            if($j(this).attr("id") == "firstMenu") {
                $j("#topLeftMenu").each(function () {
                    this.src = this.src.replace("1.jpg", "2.jpg");
                });
            } else if($j(this).attr("id") == "lastMenu") {
                $j("#topRightMenu").each(function () {
                    this.src = this.src.replace("1.jpg", "2.jpg");
                });
            }
        },
        
        function () {
            this.src = this.src.replace("2.jpg", "1.jpg");
            
            if($j(this).attr("id") == "firstMenu") {
                $j("#topLeftMenu").each(function () {
                    this.src = this.src.replace("2.jpg", "1.jpg");
                });
            } else if($j(this).attr("id") == "lastMenu") {
                $j("#topRightMenu").each(function () {
                    this.src = this.src.replace("2.jpg", "1.jpg");
                });
            }
        }
   );
   
   //menu2 rollover
   $j("#menuBottom").find("a > img").hover(
        function () {
            this.src = this.src.replace("1.jpg", "2.jpg");
            
            if($j(this).attr("id") == "firstBottomMenu") {
                $j("#bottomLeftMenu").each(function () {
                    this.src = this.src.replace("1.jpg", "2.jpg");
                });
            } else if($j(this).attr("id") == "lastBottomMenu") {
                $j("#bottomRightMenu").each(function () {
                    this.src = this.src.replace("1.jpg", "2.jpg");
                });
            }
        },
        
        function () {
            this.src = this.src.replace("2.jpg", "1.jpg");
            
            if($j(this).attr("id") == "firstBottomMenu") {
                $j("#bottomLeftMenu").each(function () {
                    this.src = this.src.replace("2.jpg", "1.jpg");
                });
            } else if($j(this).attr("id") == "lastBottomMenu") {
                $j("#bottomRightMenu").each(function () {
                    this.src = this.src.replace("2.jpg", "1.jpg");
                });
            }
        }
   );
   
   $j.fn.qtip.styles.redStyle = {
		    name: 'red', // Inherit from preset style
		    color: 'white',
		    background: '#9E0B0F',
		    border: {
		        width: 1,
		        radius: 6,
		        color: '#9E0B0F'
		    },
		    tip: 'bottomLeft'
	}
   
   
   $j.fn.qtip.styles.blackStyle = {
			name: 'red', // Inherit from preset style
			color: '#C45A02',
			background: '#000000',    
			border: {
			    width: 1,
			    radius: 6,
			    color: '#000000'
			},
			tip: 'bottomLeft'
		};   
   
   //rounded corner divs
   $j(".wrappedContent").wrap('<div class="roundedContainer"><div style="background:url(' + webroot + 'img/content/Bkg-content-sus.jpg) top left no-repeat;"><div style="background:url(' + webroot + 'img/content/Bkg-content-jos.jpg) bottom left no-repeat; padding-bottom:10px;"></div></div></div>');
   
   $j('span[title], a[title]').not(".noTitle").hovertip();
   
});

