/*
 * Title		: main.js
 * Description	: Main javascript
 * Author		: Fajar Chandra
 * Date			: 2010.05.17
 */

// jQuery codes start here ...
$(function() {
	
/// ShoutMix Handler ///
$('.ShoutMixBtn').dblclick(function() {
	$('#ShoutMixBtn').css('width', '150px');
});

$('.ShoutMixBtn').click(function() {
	if($('#ShoutMixPanel').is(':hidden'))
		$('#ShoutMixPanel').slideDown();
	else
		$('#ShoutMixPanel').slideUp();
	return false;
});
/// end - ShoutMix Handler ///

/// Hover states on the static widgets ///
$('input.ui-state-default, a.ui-state-default').hover(
	function() { $(this).addClass('ui-state-hover'); }, 
	function() { $(this).removeClass('ui-state-hover'); }
);
/// end - Hover states ///
	
/// Check Window size & give suggestions ///
if(($(window).height() < 600 || $(window).width() < 900) && $.cookie("j2_notice_browser_size") != "on") {
	$('#Dialog').attr("title", "Suggestion");
	$('#Dialog').html("<p>I think your current browser window size is too small. You might want to resize it for better surfing experience.</p>");
	$('#Dialog').dialog({
		buttons: {"Close": function() { $('#Dialog').dialog('close'); } }
	});
	$.cookie("j2_notice_browser_size", "on", { expires: 7 });
}
/// end - Check Window size ///

});
