$(document).ready(function(){
/* START JQuery CSS Hacks */

	var userOSAgent = navigator.userAgent.toLowerCase();

	/* CSS Hacks for all browsers in Windows */
	if (/win/.test(userOSAgent)) {
		$("div#search-block").css("margin-top","-23px");
		$("div#search-block input#searchsubmit").css("margin-top","4px");
		$("div#global-navs div ul").css("padding-top","9px");
		$("div#global-navs div ul").css("padding-bottom","11px");
		$("div#global-navs div ul ul").css("padding-top","4px");
		$("div#global-navs div ul ul").css("padding-bottom","4px");
		$("div#global-navs div ul ul").css("margin-top","9px");
		$("form.comment-form p.commentarea").css("margin-top","-40px");
		$("form.cform ol li img.captcha").css("height","26px");
	}
		
	/* CSS Hacks for Firefox V.3 browser */
	if (/firefox\/3/.test(userOSAgent)) {
		if (/mac/.test(userOSAgent)) {
			$("form.comment-form p.commentarea").css("margin-top","-39px");
			$("p.cf-sb").css("margin-top","-2px");
			$("div#ec3_big_cal table.nav").css("margin-bottom","-17px");
		}
		else if (/win/.test(userOSAgent)) { $("form.comment-form p.commentarea").css("margin-top","-41px"); }
		
		$("form.cform ol li input").css("margin-bottom","5px");
	}

	/* CSS Hacks for MSIE V.7 browser */
	if (/msie 7/.test(userOSAgent)) {
		$("form.cform ol li img.captcha").css("margin-bottom","-4px");
	}

	/* CSS Hacks for MSIE V.8 browser */
	if (/msie 8/.test(userOSAgent)) {
		$("form.comment-form p.commentarea").css("margin-top","-41px");
	}

	/* CSS Hacks for Opera browser */
	if (/opera/.test(userOSAgent)) {
		if (/mac/.test(userOSAgent)) {
			$("form.comment-form p.commentarea").css("margin-top","-36px");
			$("form.comment-form p.logged_commentarea").css("margin-top","-40px");
			$("div#ec3_big_cal table.nav").css("margin-bottom","-17px");
		}
	}
	
	/* Add margin-bottom: 0px to the last post list item */
	$("#post-lists div.post-list:last-child").css('margin-bottom','0');

/* END JQuery CSS Hacks */



/* START Search Box' Default Value */

	$("div#search-block input[name='s']").focus(function(){
		if ($(this)[0].defaultValue==$(this).val()) {
			$(this).val("");
		}
	}).blur(function() {
		if ($(this).val()=="") {
			$(this).val($(this)[0].defaultValue);
		}
	});

/* END Search Box' Default Value */



/* START Global Navs Hack */

	/* Remove Title Attribute in Global Navigation */
	$("div.Suckerfish_41 a").removeAttr("title");

	/* Add class="selected" to Global Navs "Home" for Sub-sites */
	var main_url = "http://" + jQuery.url.attr("host") + jQuery.url.attr("path");
	var home_url = $("div.Suckerfish_41 li.home a").attr("href");
	
	if (main_url==home_url) $("div.Suckerfish_41 li.home").attr("class","selected");

/* END Global Navs Hack */



/* START EC3 Hack */
	/* Change the Title Attribute in Post Link */
	$("p.ec3_event a").attr("title","View this Event");
	
	/* Remove the Click Property of Date */
	$("a.ec3_daynum").click(function(){
		return false;
	});
/* END EC3 Hack */



/* START Subscriber 2 Hack */
	/* Align the buttons to the right */
	$("div.subscribe form p input[name='subscribe']").parent().css("text-align","right");
/* END Subscriber 2 Hack */
});


