/**
 * Cufon
 */

if (typeof Cufon != "undefined") {

	Cufon.replace('.post h3', {
		hover: true
	});

	Cufon.replace('#sidebar h2', {
		hover: true
	});
	
}


/**
 * Initialize
 */
jQuery(document).ready(function() { 

	// init category menu (hover simulation for ie6, other browser don’t need this script)
	jQuery("#topmenu ul li").mouseover(function() {
		jQuery(this).addClass("sfhover");
	});
	jQuery("#topmenu ul li").mouseout(function() {
		jQuery(this).removeClass("sfhover");
	});

	// init search box
	// BURN_SEARCH_VALUE has to be defined before (e.g. html head)
	if (typeof BURN_SEARCH_VALUE != "undefined") {
		if (jQuery("#s").val() == "") {
			jQuery("#s").val(BURN_SEARCH_VALUE);
		}
		jQuery("#s").focus(function() {
			jQuery(this).val("");
		});
		jQuery("#s").blur(function() {
			if (jQuery("#s").val() == "") {
				jQuery("#s").val(BURN_SEARCH_VALUE);
			}
		});
	}

	// last.fm behaviour
	jQuery("#sidebar li.lastfm a.popup").click(function() {
		jQuery(this).attr("title", jQuery(this).text());
		var url = jQuery(this).attr("href");
		var windowOptions = "width=234,height=250,left=0,top=0,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no";
		var lastfmPlayer = window.open(url, "burnLastFm", windowOptions);
		lastfmPlayer.focus();
		return false;
	});


	/**
	 * login
	 */


	// ajax login
	/*jQuery("body").gmc_ajaxLogin({
		templateUrl: burn.pluginBaseUrl + "/gmc-ajax-login/login_template.php",
		submitUrl: burn.pluginBaseUrl + "/gmc-ajax-login/login.php"
	});*/

	// init hot or not
	jQuery(".hotornot").gmc_hotOrNot({
		submitUrl: burn.pluginBaseUrl + "/gmc-hotornot/save.php"
	});
	
}); 
