$(function() {
    // Body Load
	var currentURL = window.location;
	var blogContent = $(".blogFeed").html();
    $(".ExtraLinksControl .Control").addClass("cursor").click(function() {
	    if ($(".ExtraLinks").is(":visible")) {
		    $(".ExtraLinks").slideUp(1000,"easeInBack");
		    $(".ExtraLinksControl .Control").html("<img src=\"http://www.ph-creative.com/res/builtin/open.gif\" /> Open").css("cursor","pointer");
	    } else {
		    $(".ExtraLinks").slideDown(1000,"easeOutBack");
		    $(".ExtraLinksControl .Control").html("<img src=\"http://www.ph-creative.com/res/builtin/close.gif\" /> Close").css("cursor","pointer");
	    }
    }).html("<img src=\"http://www.ph-creative.com/res/builtin/open.gif\" /> Open").css("cursor","pointer");;
    $(".Manchester,.London,.NewYork").hide();
    $("#Liverpool").css("background","url(http://www.ph-creative.com/res/builtin/Liverpool-lozenge.gif) repeat-x #ededed");
    $("#blogFeed").hide().html(blogContent).fadeIn();
    $("#blogFeed li:first,.BottomContent .PhUseFeed li:first").addClass("newItem");
    
    // User Interaction
    $(".Contacts p.Location").click(function() {
        $(".Contacts p.Location").css("background","none");
        var contact = $(this).attr("id");
        $(this).css("background","url(http://www.ph-creative.com/res/builtin/"+contact+"-lozenge.gif) repeat-x #ededed");
        if ($(".Contacts ."+contact+"").is(":hidden")) {$(".Contacts div.hideLocation").hide();$(".Contacts ."+contact+"").fadeIn();}
    });
    $("#googleMap").hover(function(){$(this).stop().animate({height:"300px"},1000,"easeInOutBack");},function(){$(this).stop().animate({height:"172px"},1000,"easeInOutBack");}).stop(); 
    $("#twitter").click(function(){ location.href="http://twitter.com/home?status=Currently reading "+currentURL+""; });
    $("#stumble").click(function(){ location.href="http://www.stumbleupon.com/submit?url="+currentURL+""; });
    $("#delicious").click(function(){ location.href="http://del.icio.us/post?url="+currentURL+""; });
    $("#facebook").click(function(){ location.href="http://www.facebook.com/sharer.php?u="+currentURL+""; });
    $("#digg").click(function(){ location.href="http://digg.com/submit?url="+currentURL+""; });
    $("#reddit").click(function(){ location.href="http://reddit.com/submit?url="+currentURL+""; });
    $("#rss").click(function(){ location.href="http://www.ph-creative.com/res/xml/rss/PF_1.xml"; });
    $("#email").click(function(){ location.href="mailto:?subject=Ph.Creative&body="+currentURL+""; });
    $("#print").click(function(){ window.print(); });
    
    
	
	$(".mm_form table").addClass("MMDataCaptureForm_Table");
    $(".mm_form tr").each(function(){
        $("td:first",this).addClass("MMDataCaptureForm_LabelTD");
    });
    $(".mm_form tr").each(function(){
        $("td:last",this).addClass("MMDataCaptureForm_FieldTD");
    });
    
    
    $(".mm_form .MMDataCaptureForm_LabelTD").wrapInner("<div></div>");

    
    $(".mm_form .MMDataCaptureForm_FieldTD input").addClass("MMDataCaptureForm_Input");
    
    
    $(".mm_form").each(function(){
        $(".MMDataCaptureForm_FieldTD:last input",this).removeClass("MMDataCaptureForm_Input").addClass("MMDataCaptureForm_SubmitButton").parent().addClass("MMDataCaptureForm_ButtonTD").removeClass("MMDataCaptureForm_FieldTD");
    });
    

});