$(document).ready(function(){
	
	/* PNGFIX start *******************************************************************/
		$(document).pngFix();
	/* PNGFIX end *********************************************************************/
	
	/* EXTERNAL LINKS start ***********************************************************/
	$('a[@rel$="external"]').click(function(){
		this.target = "_blank";
	});	
	/* EXTERNAL LINKS end *************************************************************/

	/* NAVIGATION start ***************************************************************/
	$('#nav ul ul').hide();
	//hover show 2nd level
	$('#nav ul > li').hover(function() {
		$('ul:first', this).show();
	},
	function() {$('ul:first', this).hide();});
	//hover 3rd level
	$('#nav ul li li').hover(function() {
		$('ul:first', this).each(function() {
			$(this).show();
		});
	},
	function() {$('ul:first', this).hide();});
	//hover 4th level
	$('#nav ul li li li').hover(function() {
		$('ul:first', this).each(function() {
			$(this).show();
		});
	},
	function() {$('ul:first', this).hide();});
	/* NAVIGATION end ****************************************************************/
	
	/* SIFR***************************************************************************/
    $('h1.oss').flash(
        { 
            src: '/includes/media/font-porn-star-academy.swf', 
            flashvars: { 
                css: [
                    '* { color:#FFFFFF; }'
                ].join(' ')
            }
        },
        { version: 8 },
        function(htmlOptions) {
            htmlOptions.flashvars.txt = this.innerHTML;
            this.innerHTML = '<div>'+this.innerHTML+'</div>';
            var $alt = $(this.firstChild);
            htmlOptions.width = $(this).width();
            htmlOptions.height = $(this).height();// don't know why this won't work $alt.height()
            $alt.addClass('alt');
            $(this)
                .addClass('sifr-text-alt')
                .prepend($.fn.flash.transform(htmlOptions));						
        }
    );
		$('h1.totf').flash(
        { 
            src: '/includes/media/font-designer-block.swf', 
            flashvars: { 
                css: [
                    '* { color:#FFFFFF; }'
                ].join(' ')
            }
        },
        { version: 8 },
        function(htmlOptions) {
            htmlOptions.flashvars.txt = this.innerHTML;
            this.innerHTML = '<div>'+this.innerHTML+'</div>';
            var $alt = $(this.firstChild);
            htmlOptions.width = $(this).width();
            htmlOptions.height = $(this).height();// don't know why this won't work $alt.height()
            $alt.addClass('alt');
            $(this)
                .addClass('sifr-text-alt')
                .prepend($.fn.flash.transform(htmlOptions));						
        }
    );
		$('h1.photo-text').flash(
        { 
            src: '/includes/media/font-arial.swf', 
            flashvars: { 
                css: [
                    '* { color:#FFFFFF; }'
                ].join(' ')
            }
        },
        { version: 8 },
        function(htmlOptions) {
            htmlOptions.flashvars.txt = this.innerHTML;
            this.innerHTML = '<div>'+this.innerHTML+'</div>';
            var $alt = $(this.firstChild);
            htmlOptions.width = $(this).width();
            htmlOptions.height = $(this).height();// don't know why this won't work $alt.height()
            $alt.addClass('alt');
            $(this)
                .addClass('sifr-text-alt')
                .prepend($.fn.flash.transform(htmlOptions));						
        }
    );
	/* SIFR**************************************************************************/

}); //close document.ready