// JavaScript Document

var currentYearFooter = new Date();



$(function(){//place all code to run on-DOM load in this function

if($.browser.mozilla && navigator.platform == "Win32"){
$('#tableNav').css('margin-bottom','11px');
}

	
	$("hr").attr({ size: "1", noshade: "noshade" });
	if($.browser.msie){$(".clearfloatNoHeight").empty()};
	$(currentYearFooter.getFullYear()).appendTo("#currentYear");//add current date to the footer
	
	//if(!$.browser.safari){
		if($(".recentCommentsHomepage li")[0]){
			$(".recentCommentsHomepage li").corner("7px");
		}
	//};
	
	$(".searchInput").val("keyword search...").focus(function(){
		if($(".searchInput")[0].value == "keyword search..."){
			$(this).val("")
		}
	}).blur(function(){
		if($(".searchInput")[0].value.length == "0" || $(".searchInput")[0].value == null){																			
				$(this).val("").val("keyword search...")
			}
	});
	
	if($("textarea[@name=code]")[0]){
	dp.SyntaxHighlighter.ClipboardSwf = '/swf/clipboard.swf';
	dp.SyntaxHighlighter.HighlightAll('code');
	}
	
	if($(".tableStyles")[0]){
		if($("table#linksTable")[0]){
			$(".tableStyles").tablesorter({cssHeader:"sortIcon", cssAsc:"sortIconUp", cssDesc:"sortIconDown", sortList: [[2,1]], 
			headers:{3:{sorter:false}}
			}); 
		}else{
			$(".tableStyles").tablesorter({cssHeader:"sortIcon", cssAsc:"sortIconUp", cssDesc:"sortIconDown",sortList: [[3,1]]}); 
		}
	}
	
	if($(".toolTip")[0]){
		$('.toolTip').Tooltip({ 
			track: true, 
			delay: 1, 
			showURL: false,  
			opacity: 0.85 
		});
	}

	
	if(!$("#cpreview")[0] && $(".article")[0] && $("#articles")[0]){
		
		$(".comment_name_input").val("Name").focus(function(){
			if($(".comment_name_input")[0].value == "Name"){
			$(this).val("")
			}
		}).blur(function(){
			if($(".comment_name_input")[0].value.length == "0" || $(".comment_name_input")[0].value == null){																			
				$(this).val("").val("Name")
			}
		});
		
		$(".comment_email_input").val("E-mail").focus(function(){
			if($(".comment_email_input")[0].value == "E-mail"){
			$(this).val("")
			}
		}).blur(function(){
			if($(".comment_email_input")[0].value.length == "0" || $(".comment_email_input")[0].value == null){																			
				$(this).val("").val("E-mail")
			}
		});
		
		$(".comment_web_input").val("URL").focus(function(){
			if($(".comment_web_input")[0].value == "URL"){
			$(this).val("")
			}
		}).blur(function(){
			if($(".comment_web_input")[0].value.length == "0" || $(".comment_web_input")[0].value == null){																			
				$(this).val("").val("URL")
			}
		});
		
		$(".txpCommentInputMessage").val("Comment").focus(function(){
			if($(".txpCommentInputMessage")[0].value == "Comment"){
			$(this).val("")
			}
		}).blur(function(){
			if($(".txpCommentInputMessage")[0].value.length == "0" || $(".txpCommentInputMessage")[0].value == null){																			
				$(this).val("").val("Comment")
			}
		});
		
	/*	comment_email_input
		comment_web_input
		txpCommentInputMessage*/
	
	}

});//END on-DOM load function