﻿$(document).ready(function() {
	var _browser = navigator.appName;
	
	/* TEXT FIELD TXT SWAP
	*/
	$("#searchText").focus(function(){ 
		if($(this).val() == $(this).attr("defaultValue")) {
		  $(this).val('');
		}
	});
	
	$("#searchText").blur(function(){
		if($(this).val() == "") {
		  $(this).val($(this).attr("defaultValue"));
		} 
	});
	
	/* TAB CONTENT INTERACTION
	*/
	var tabs = $("div.tab-content > div");
	
	$(".tabs a").click(function() {
        tabs.hide().filter(this.hash).show();
        $(".tabs li").removeClass("active");
        $(this).parent().addClass("active");
        return false;
	}).filter(":first").click();

	
	/* BUCKET HOVER CONTENT
	*/
	$(".ms-roll").hover(function() {
	    
	    var links = $(".show a.more", this).text();
	    
	    if (links.toLowerCase() == "link") {
	        $(this).css("background-color", "#e2ebed");
	        $(".hide", this).hide();
	    } else {
	        // For IE6 because it doesn't recognize
	        // the CSS pseudo class used for hovers.
	        if (_browser == "Microsoft Internet Explorer") {
	            $(this).css("z-index", "999");
	            $(".col, .col-marg").css("z-index", "0");
	        }
	        // END: For IE6.
	        
	        $(this).css("background-color", "#e2ebed");
            $(".hide", this).show();
	    }
	    
	}, function() {
	    
	    // For IE6 because it doesn't recognize
	    // the CSS pseudo class used for hovers.
	    var browser = navigator.appName;
	    if (browser == "Microsoft Internet Explorer") {
	        $(this).css("z-index", "0");
	        $(".col, .col-marg").css("z-index", "0");
	    }
	    // END: For IE6.
	        
	    $(this).css("background-color", "transparent");
	    $(".hide", this).hide();
	    
	});
	
	/* KEEP CURRENT YEAR IN THE FOOTER
	*/
    _stamp = new Date();
	_year = _stamp.getYear();
    	
	if (_year < 2000) {
	    _year = 1900 + _year;	
	}
    	
	var writeYear = document.createTextNode(_year);
	var displayYear = document.getElementById("year");
	displayYear.appendChild(writeYear);
	
});
