// JavaScript Document
$(document).ready(function(){init()});
function init(){
	//run init functions
	initBrowserDetectingMessage();					  
	initFlashMessanger();
	initCKEditor();
	initAssignCategories();
	initFontCategoriesBrowser();
}
//show bad message to bad people
function initBrowserDetectingMessage()
{
	if($.browser.version == 6.0 && $.browser.msie){
		$("body")
		.animate( { backgroundColor: '#000' }, 1000)
		.animate( { backgroundColor: '#f00' }, 1000).animate( { backgroundColor: '#000' }, 1000)
		.animate( { backgroundColor: '#f00' }, 1000).animate( { backgroundColor: '#000' }, 1000)
		.animate( { backgroundColor: '#f00' }, 1000).animate( { backgroundColor: '#000' }, 1000)
		.animate( { backgroundColor: '#f00' }, 1000).animate( { backgroundColor: '#000' }, 1000)
		.animate( { backgroundColor: '#f00' }, 1000).animate( { backgroundColor: '#000' }, 1000)
		.animate( { backgroundColor: '#f00' }, 1000)
		;
	}
	else{
		//$("body")
		//.animate( { backgroundColor: '#000' }, 500)
		//.animate( { backgroundColor: '#fff' }, 10000);
		/*
		.animate( { backgroundColor: '#fff' }, 10000)
		.animate( { backgroundColor: '#000' }, 10000)
		
		.animate( { backgroundColor: '#fff' }, 10000)
		.animate( { backgroundColor: '#000' }, 10000)
		
		.animate( { backgroundColor: '#fff' }, 10000)
		.animate( { backgroundColor: '#000' }, 10000)
		
		.animate( { backgroundColor: '#fff' }, 10000)
		.animate( { backgroundColor: '#000' }, 10000)
		;*/
	}
	$('#IE6Continue').bind('click', function(){
		  $('#IHATEIE6').hide('slow');
		  $('#page').show('slow');
	});
}
//init flash messanger functionality
function initFlashMessanger()
{
	//close on click
	$('.flashMessenger').bind('click',function(){
		$(this).remove();
		});
}
//replace something? what?! comment more asshole!
function initCKEditor()
{
	try{
		CKEDITOR.replace("fontTestingTextarea");
	}
	catch(e){}
}
//init category setting
function initAssignCategories()
{
	$('.setAllCategories').bind('change', function(){
		$('.categorySelect').val($(this).val());
		});
}
//initFontCategoriesBrowser
function initFontCategoriesBrowser()
{
	$('#browseCategories').accordion({autoHeight:false, collapsible:true, active:false});
}
