function afterFlashReplace(htmlOptions, target, tempH){

	checkHasFlash?checkHasFlash:checkHasFlash=true;

jQuery(target).css('font-size', ((parseInt(jQuery(target).css('font-size'))+2)+'px'));	
	 var temp = target.innerHTML;
            htmlOptions.flashvars.txt = target.innerHTML;
            try{target.innerHTML = '<div>'+temp+'</div>';}catch(e){};
            var jQueryalt = jQuery(target.firstChild);
            htmlOptions.height = jQueryalt.height();
			if(tempH){
				
            htmlOptions.height = tempH;
			}	
            htmlOptions.width = jQueryalt.width();
            jQueryalt.addClass('alt');
            jQuery(target).addClass('flash-replaced').prepend(jQuery.fn.flash.transform(htmlOptions));	
					
					
}



jQuery(document).ready(function () {
																						 
	
	//console.log("check start "+checkHasFlash);
	
	jQuery(".jgallerylink").each(function(){
		jQuery(this).click(function(){
			jQuery("#jgalleryimage").css("background-image", "url("+jQuery("#jgalleryimage img").attr("src")+")");
			var temp = jQuery(this).attr("href");
			jQuery("#jgalleryimage img").attr("src", '').attr("src", temp);	
			return false;
		});
						   
						   
	});
	
	if(jQuery(".jgallerylink").get(0)){
		jQuery(".jgallerylink").eq(0).click();	
	}
	
	jQuery('#checkFlash').flash(
        { 
            src: '/images/jfr.swf', 
						wmode: "Transparent"
        },
        { version: 7, update:false},
        function(htmlOptions) {afterFlashReplace(htmlOptions, this); }
    );
	
	/*
	
	jQuery('#head h2, .box_small h3, #content h2:not(.normal), #head h3,#head h4,  #jgallerythumbs h3, #nav li').each(function(){
		jQuery(this).css('font-size', ((parseInt(jQuery(this).css('font-size'))-2)+'px'));																																			   
																																							   
	});
	
	
	
	 jQuery('#head h2, .box_small h3, #content h2:not(.normal)').flash(
        { 
            src: '/images/jfr.swf', 
			wmode: "Transparent",
            flashvars: { 
                css: [
                    '* { color: #FFFFFF;}'
                ].join(' ')
            }
        },
        { version: 7 , update:false},
        function(htmlOptions) {afterFlashReplace(htmlOptions, this); }
    );
	 
	 
	 														 
	 jQuery('#head h3').flash(
        { 
            src: '/images/jfr.swf', 
						wmode: "Transparent",
            flashvars: { 
                css: [
                    '* { color: #b00400; }'
                ].join(' ')
            }
        },
        { version: 7, update:false},
        function(htmlOptions) {afterFlashReplace(htmlOptions, this); }
    );
	 
	 														 
	 jQuery('#head h4,  #jgallerythumbs h3').flash(
        { 
            src: '/images/jfr.swf',
						wmode: "Transparent",
            flashvars: { 
                css: [
                    '* { color: #afafaf;}'
                ].join(' ')
            }
        },
        { version: 7 , update:false},
        function(htmlOptions) {afterFlashReplace(htmlOptions, this); }
    );
	 
	 
	 
	
	 jQuery('#nav li.li_item').flash(
        { 
            src: '/images/jfr.swf',
						wmode: "Transparent",
            flashvars: { 
                css: [
                    '* { color: #ffffff; text-align:center;}'
                ].join(' ')
            }
        },
        { version: 7 , update:false},
        function(htmlOptions) {afterFlashReplace(htmlOptions, this, 22); }
    );
	 
	
	jQuery('#nav li.currentli_item').flash(
        { 
            src: '/images/jfr.swf',
						wmode: "Transparent",
            flashvars: { 
                css: [
                    '* { color: #ffa7a7; text-align:center;}'
                ].join(' ')
            }
        },
        { version: 7 , update:false},
        function(htmlOptions) {afterFlashReplace(htmlOptions, this, 22); }
    );
	
	*/
	//console.log("check end "+checkHasFlash);
	
});
