/*
author :Ken
Design:Date:2011-5-11
*/

//tips
this.tooltip = function(){	
	/* CONFIG */		
	xOffset = 10;
	yOffset = 20;		
	// these 2 variable determine popup's distance from the cursor
	// you might want to adjust to get the right result		
	/* END CONFIG */		
	$(".show-tooltip a").hover(function(e){											  
		this.t = this.title;
		this.title = "";									  
		$("body").append('<span class="show-tooltip-text"><div class="inner-boundary"><p>'+ this.t +'</p></div></span>');
		$(".show-tooltip-text")
		.css("top",(e.pageY - xOffset) + "px")
		.css("left",(e.pageX + yOffset) + "px")
		.fadeIn("fast");		
	},
	function(){
		this.title = this.t;		
		$(".show-tooltip-text").remove();
	});	
	$(".show-tooltip a").mousemove(function(e){
		$(".show-tooltip-text")
		.css("top",(e.pageY - xOffset) + "px")
		.css("left",(e.pageX + yOffset) + "px");
	});			
};


/*search */
function empty_box(id){
	var result=document.getElementById("search_box").value;
	if(id==0)
	{
		document.getElementById("search_box").value='';
	}else if(id==1 && result==''){
		document.getElementById("search_box").value='search...';
	}
	else if(id==1 && result!=''){
		document.getElementById("search_box").value=result;
	}
}

$(function(){
	$('ul.sf-menu').superfish();
});	

$(function() {
	$("img[original]").lazyload();
})

$(document).ready(function(){
	if($(".show-tooltip a")){tooltip();}
});
