/*
 * Author => Company       : Prodo Ltd
 *        => Website       : http://www.prodo.com
 * Code   => Last Modified : 24 March 2010
 */

$(function() {
	
	/*
	 * 
	 */
	$(document).pngFix();
	
	/*
	 * Make external links open in a new window
	 */
	$('a[rel=external]').click(function(e) {
		open(this.href);
		e.preventDefault();
	}).attr('title', 'Opens in a new window');
	
	/*
	 * 
	 */
	$('.animation').append('<img alt=" " height="260" src="/images/animation/2.jpg" width="960" /><img alt=" " height="260" src="/images/animation/3.jpg" width="960" />');
	$('.animation').innerfade({
		containerheight : '260px',
		speed           : 'slow',
		timeout         : 3000,
		type            : 'random_start'
	});
	
	/*
	 * 
	 */
	$('.navigation ul li:last').addClass('last-item');
	
	/*
	 * Manipulate Umbraco's image alignment
	 */
	$('#content img').each(function(e) {
		if($(this).css('float') == 'left') {
			$(this).addClass('left');
		}
		else if($(this).css('float') == 'right') {
			$(this).addClass('right');
		}
	});
	
	/*
	 * Animation SWF Popup
	 */
	$('a[href=/media/5077/animation.swf]').click(function(e) {
		open('/media/5077/animation.swf', '', 'height=400, width=600, left=0, top=0, location=0, menubar=0, resizable=0, scrollbars=0, status=0, titlebar=0, toolbar=0');
		e.preventDefault();
	});
	
	/*
	 * 
	 */
	$('.video').flash({
		flashvars : {
			file  : '../storage/media/pilgrim_02_edit_master_v2_320x240.flv',
			image : 'storage/media/pilgrim_02_edit_master_v2_320x240.jpg'
		},
		height    : '264',
		swf       : 'storage/player.swf',
		width     : '320'
	});
	
});
