$(document).ready(function () {

    var sysdate = new Date();
    $("#curr_time").text(sysdate.format("dddd, dd MMMM yyyy"));

    //slider plus/minus
    $(".slide_content").hide();
    $(".slide_heading_collapsed").click(function () {
        $(this).toggleClass("slide_heading_expanded");
        $(this).next(".slide_content").slideToggle(200);
        return false;
    });
    //slider plus/minus

    //tooltip starts
    $('.toolTip').hover(
		function () {
		    this.tip = this.title;
		    $(this).append(
			'<div class="toolTipWrapper">'
				+ '<div class="toolTipTop"></div>'
				+ '<div class="toolTipMid">'
					+ this.tip
				+ '</div>'
				+ '<div class="toolTipBtm"></div>'
			+ '</div>'
		);
		    this.title = "";
		    this.width = $(this).width();
		    $('.toolTipWrapper').fadeIn(300);
		},
	function () {
	    $('.toolTipWrapper').fadeOut(100);
	    $(this).children().remove();
	    this.title = this.tip;
	});
    // tooltip ends

    swapValues = [];
    $(".wm").each(function (i) {
        swapValues[i] = $(this).val();
        $(this).focus(function () {
            if ($(this).val() == swapValues[i]) {
                $(this).val("").removeClass("watermark")
            }
        }).blur(function () {
            if ($.trim($(this).val()) == "") { $(this).val(swapValues[i]).addClass("watermark") }
        })
    });

    //tabs Action
    $(".tab_content").hide(); //Hide all content
    $("ul.tabs li:first").addClass("active").show(); //Activate first tab
    $(".tab_content:first").show(); //Show first tab content

    //On Click Event
    $("ul.tabs li").click(function () {
        $("ul.tabs li").removeClass("active"); //Remove any "active" class
        $(this).addClass("active"); //Add "active" class to selected tab
        $(".tab_content").hide(); //Hide all tab content
        var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
        $(activeTab).fadeIn(); //Fade in the active content
        return false;
    });
});

