$(function(){
 $('a img').hover(function(){
  $(this).fadeTo(200,0.6);},function(){
   $(this).fadeTo(300,1);
 });
});
$(function(){
 $(":image").hover(function(){
  $(this).fadeTo(200,0.6);},function(){
   $(this).fadeTo(300,1);
 });
});

function ShowLength( str ) {
      document.getElementById("inputlength").innerHTML = str.length + "•¶Žš";
   }
function ShowLength2( str ) {
      document.getElementById("inputlength2").innerHTML = str.length + "•¶Žš";
   }


$(function() {
   $('a[rel=tooltip]').mouseover(function(e) {
      var tip = $(this).attr('title');
      $(this).attr('title','');
      $(this).append('<div id="tooltip"><div class="tipHeader"></div><div class="tipBody">' + tip + '</div><div class="tipFooter"></div></div>');
      $('#tooltip').fadeIn("20");
   }).mousemove(function(e) {
      $('#tooltip').css('top', e.pageY +15 );
      $('#tooltip').css('left', e.pageX +15 );
   }).mouseout(function() {
      $(this).attr('title',$('.tipBody').html());
      $(this).children('div#tooltip').remove();
   });
});


$(function() {
   $('a[rel=tooltip_l]').mouseover(function(e) {
      var tip = $(this).attr('title');
      $(this).attr('title','');
      $(this).append('<div id="tooltip"><div class="tipHeader"></div><div class="tipBody">' + tip + '</div><div class="tipFooter"></div></div>');
      $('#tooltip').fadeIn("20");
   }).mousemove(function(e) {
      $('#tooltip').css('top', e.pageY);
      $('#tooltip').css('left', e.pageX +15 );
   }).mouseout(function() {
      $(this).attr('title',$('.tipBody').html());
      $(this).children('div#tooltip').remove();
   });
});


$(function(){
	$(":input").focus(function(){
		$(this).css("border","1px solid #f08300");
	}).blur(function(){
		$(this).css("border","1px solid #777");
	});
});


$(function(){
	$("a.open").click(function(){
		$("#floatWindow").fadeIn("fast");
		return false;
	});
	$("#floatWindow a.close").click(function(){
		$("#floatWindow").fadeOut("fast");
		return false;
	});
	$("#floatWindow dl dt").mousedown(function(e){
		
		$("body").bind('selectstart', function(){
			return false;
		});
		$("#floatWindow")
			.data("clickPointX" , e.pageX - $("#floatWindow").offset().left)
			.data("clickPointY" , e.pageY - $("#floatWindow").offset().top);
		
		$(document).mousemove(function(e){
			$("#floatWindow").css({
				top:e.pageY  - $("#floatWindow").data("clickPointY")+"px",
				left:e.pageX - $("#floatWindow").data("clickPointX")+"px"
			});
		});
	}).mouseup(function(){
		$("body").unbind('selectstart');
		$(document).unbind("mousemove");	
	});
});

$(function(){
	 $("#myTable").tablesorter(); 
});


