$(document).ready(function(){

	$(".footer > div > ul > li:not(.footer > div > ul > li:last)").after(" <span class=\"separator\">|</span> ");
	$(".navigation > div > ul > li > a").each(function() {
		$(this).html($(this).html().replace("/","/ "));
	});
	Cufon.replace('.navigation > div > ul > li > a', { textShadow: '0px 0px 0px #b99d5b'});
	Cufon.now();
	
	if (swfobject.hasFlashPlayerVersion("9.0.0")) {
		introStart();
		var flashvars = {};
		var params = {};
		params.quality = "best";
		params.scale = "exactfit";
		params.wmode = "opaque";
		params.allowscriptaccess = "always";
		var attributes = {};
		attributes.id = "flash-slideshow";
		swfobject.embedSWF("wp-content/uploads/2011/08/slideshow.swf", "flash-slideshow", "1066", "553", "9.0.0", "wp-content/uploads/2011/08/expressInstall.swf", flashvars, params, attributes);
	} else {
		introEnd();
	}
	
    if(window.opera) {
        if ($("a.jqbookmark").attr("rel") != ""){ // don't overwrite the rel attrib if already set
            $("a.jqbookmark").attr("rel","sidebar");
        }
    }
    $("a#bookmark").click(function(event){
        event.preventDefault(); // prevent the anchor tag from sending the user off to the link
        var url = this.href;
        var title = this.title;
        if (window.sidebar) { // Mozilla Firefox Bookmark
            window.sidebar.addPanel(title, url,"");
        } else if( window.external ) { // IE Favorite
            window.external.AddFavorite( url, title);
        } else if(window.opera) { // Opera 7+
            return false; // do nothing - the rel="sidebar" should do the trick
        } else { // for Safari, Konq etc - browsers who do not support bookmarking scripts (that i could find anyway)
             alert('Unfortunately, this browser does not support the requested action, please bookmark this page manually.');
        }
    });
});

function introStart() {
	$(".jslideshow").hide();
	$(".jslideshow .images").animate({ opacity:0 }, 1);
}

function introEnd() {
	$(".fslideshow").animate({ opacity:0 }, 500);
	setTimeout(function() { $(".fslideshow").remove(); }, 500);
	$(".jslideshow").show();
	$(".jslideshow .images").cycle({
		fx: 'fade',
		pause: 0,
		speed: 1000,
		timeout: 4000
	});
	$(".jslideshow .images").cycle("pause");
	setTimeout(function() {
		$(".jslideshow .images").animate({ opacity:1 }, 1000);
		$(".jslideshow .images").cycle("resume");
	}, 500);
}

