// JavaScript Document

$(document).ready(function(){
	
	/************ scrollbar ************/
	$('.scrollPane').jScrollPane({scrollbarWidth:17,scrollbarMargin:20,showArrows:true,wheelSpeed:30});
 
});

var checkScreenHeight = function () {
	var $container = $("#container");
	var containerHeight = parseFloat( $container.css("height").replace("px","") );	
	if( $("body").innerHeight() < containerHeight ) {
		$container.css("top", "0px");
		$container.css("margin-top", "0px");
	} else {
		$container.css("top", "50%");
		
		$container.css("margin-top", (0-(containerHeight/2)).toString() + "px");
	}
}
if (!$.browser.safari) {
	$(document).ready( checkScreenHeight );
	$(window).resize( checkScreenHeight );
}

function clf(e) { e.value = ""; }
function clearform () {		
	for (var n = 0; n < document.updateForm.elements.length; n++) { 
		field = document.updateForm.elements[n];
		if (field.type == "text") {
			if (field.value.substring(0,5)=="enter" || field.value.substring(0,6)=="please") field.value = "";
		}
	}	
}

function showLink ( linkName ) {
	var $theTitle = $("#home_"+linkName);	
	$theTitle.addClass("isOver");
	$theTitle.mouseover(function () {
		$(this).addClass("isOver");			
	});
	$theTitle.mouseout(function () {
		hideLink( linkName );		
	});
	$theTitle.fadeIn(300);
}

function hideLink ( linkName ) {
	var $theTitle = $("#home_"+linkName);
	$theTitle.removeClass("isOver");
	$theTitle.oneTime(100, function() {
 		if ($(this).hasClass("isOver") == false) {
			$(this).fadeOut(300);
		}
  	});
}




