// JavaScript Document

$(document).ready(function(){
	var overtip=".overtip";
	
	
	var overtip_over=function(e) {								  
		var xx=e.originalEvent.x||e.originalEvent.layerX||0;
     	var yy=e.originalEvent.y||e.originalEvent.layerY||0;
		$('div.overtip_text').parent('em').hide();
		$(this).next("em").attr('top',yy-45);
		$(this).next("em").animate({opacity: "show" }, "slow");		//, top: yy-25 	
	};
	var overtip_out=function(e) {
		var xx=e.originalEvent.x||e.originalEvent.layerX||0;
     	var yy=e.originalEvent.y||e.originalEvent.layerY||0;
		$(this).next("em").animate({opacity: "hide" }, "fast");	//, top: yy-45 
	};
	
	$(overtip).each(function(i){
		$(this).after("<em><div class='overtip_text'>"+$(this).attr('overtip')+"</div></em>");		
		$(this).next("em").addClass( 'overtip '+ ( $(this).attr('emclass')?$(this).attr('emclass'):'overtip_right')	);
		$(this).next("em").click(function(){$(this).hide()});
		if($(this).attr('href')){			
			$(this).hover(overtip_over, overtip_out);
		}else if($(this).children('iframe').size()){
			$(this).bind('mouseover',overtip_over);
			$(this).bind('mouseout',overtip_out);
		}else{
			$(this).bind('click',overtip_over);
			$(this).bind('mouseout',overtip_out);
		}
		
	});
	

});
/*
	<a href="javascript:;" class="overtip" emclass="smallright" overtip="更多选项请在上面查询框中选择，谢谢！">更多</<em>士大夫似的 <b>T</b>echnology</em>a>
*/


