$(function(){
    //Body Load
    $(".top_bar .background").each(function(){ $(this).css("width",$("h3",this).width()); });
    $(function(){
        if ((BrowserDetect.browser=="Explorer")&&(BrowserDetect.version<="8")) { } else {
            $(".Phuse_PanelContainingDiv td").each(function(){ $(this).css("width",$(this).parent().parent().parent().attr("width")+"px"); });
        }
    });
//    var bgImg=new Array();
//        bgImg[0]="02";
//        bgImg[1]="03";
//        bgImg[2]="04";
//        bgImg[3]="05";
//        bgImg[4]="06";
//        bgImg[5]="08";
//        bgImg[6]="09";
//    var randomImg=Math.floor(Math.random()*6);
//    $("body").css("background-image","url(http://www.skevents.co.uk/res/builtin/backgrounds/"+bgImg[randomImg]+".jpg)");
    $("#blogItems").html($("#blogFeed").html());
    $("#quick_services .services:last").css("margin-right","0px");
    $(".side_item:first").hide();
    $(".archive_item:lt(5)").hide();
    $("#breadcrumb").each(function(){
        var charReplace = $(this).html();
        charReplace = charReplace.replace("&gt;","/");
        charReplace = charReplace.replace("&gt;","/");
        charReplace = charReplace.replace("&gt;","/");
        charReplace = charReplace.replace("&gt;","/");
        charReplace = charReplace.replace("&gt;","/");
        $(this).html(charReplace);
    });
    $("#home_content_top .MMDataCaptureForm_SubmitButton").attr("value","");
	TopUp.host = "http://www.skevents.co.uk/";
	TopUp.images_path = "res/builtin/topup_images/";
	TopUp.players_path = "res/builtin/players/";
    
    //User Interaction
    $(".services").hover(function(){
        $(".image_holder",this).stop().animate({ width:"148px",height:"93px",marginTop:"-5px",marginLeft:"1px",backgroundPosition:"-10px 0px" },150);
    },function(){
        $(".image_holder",this).stop().animate({ width:"138px",height:"83px",marginTop:"0px",marginLeft:"6px",backgroundPosition:"0px 0px" },150);
    }).fullLink();
	TopUp.addPresets({
		".lightbox a": {
			group: "images",
			shaded: 1,
			resizable: 0
		}
	});
    $(".side_item,.full_side_item").hover(function(){ $(".image",this).stop().animate({backgroundColor:"#22222"},150); },function(){ $(".image",this).stop().animate({backgroundColor:"#0e0e0e"},150); }).fullLink();
    $(".lightbox").hover(function(){ $(this).stop().animate({backgroundColor:"#22222"},150); },function(){ $(this).stop().animate({backgroundColor:"#0e0e0e"},150); });
});