$(document).ready(function(){
    makeFlash();
});

function makeFlash() {
	$('h1:not(.flash-replaced)').flash(
        {
            src: '/flash/sifr.swf',
            wmode: 'transparent',
            flashvars: {
                css: [
                    '* { color: #FFFFFF; text-transform: uppercase;letter-spacing: 4px; }'
                ].join(' ')
            }
        },
        { version: 7 },
        function(htmlOptions) {
            htmlOptions.flashvars.txt = this.innerHTML.toUpperCase();
            this.innerHTML = '<div>'+this.innerHTML+'</div>';
            var $alt = $(this.firstChild);
            htmlOptions.height = $alt.height();
            htmlOptions.width = $alt.width();
            $alt.addClass('alt');
            $(this)
                .addClass('flash-replaced')
                .prepend($.fn.flash.transform(htmlOptions));
        }
    );
	$('h4:not(.flash-replaced)').flash(
        {
            src: '/flash/sifr.swf',
            wmode: 'transparent',
            flashvars: {
                css: [
                    '* { color: #FFFFFF; text-transform: uppercase;letter-spacing: 4px; }'
                ].join(' ')
            }
        },
        { version: 7 },
        function(htmlOptions) {
            htmlOptions.flashvars.txt = this.innerHTML.toUpperCase();
            this.innerHTML = '<div>'+this.innerHTML+'</div>';
            var $alt = $(this.firstChild);
            htmlOptions.height = $alt.height();
            htmlOptions.width = $alt.width();
            $alt.addClass('alt');
            $(this)
                .addClass('flash-replaced')
                .prepend($.fn.flash.transform(htmlOptions));
        }
    );
}

function setLang(lang) {
	document.cookie = 'fa_language=' + lang + '; expires=Thu, 2 Aug 2020 20:00:00 UTC; path=/';
}