document.write('<link rel="stylesheet" type="text/css" href="#dotdotpath#_include/css/got-js.css" />');


//send to friend
$(document).ready(function(){
		//input focus fire
		
	 $("input.required").focus(function () {
		var formtext = $(this).parent().find("label").text();	
		 $(this).parents("div:last").find("#thing").append("<span class=tt_req></span>");
		 $(this).parents().find(".box_bg span.tt_req").html( "* " + formtext + " is required ");					
		 $(this).parents("div:last").find("span.tt_req").fadeIn(300);
	});
	 
	 $("input.invalid").focus(function () {
		var formtext = $(this).parent().find("label").text();	
		 $(this).parents("div:last").find("#thing").append("<span class=tt_req></span>");
		 $(this).parents().find(".box_bg span.tt_req").html( "* " + formtext + " is invalid ");					
		 $(this).parents("div:last").find("span.tt_req").fadeIn(300);
	});	 
	 
	  $("input.txt").blur(function () {
		 	$(this).parents("div:last").find(".box_bg span.tt_req").fadeOut(300,
							function (){$(this).remove();}
									  );
		
	});
	  
 });


//form elements
$(document).ready(function(){
	  
	 $(".check").hover(
		 function(){
			$(this).find("span").addClass("underline");								
		},function(){
			$(this).find("span").removeClass("underline");								
	}); 
	  
	$("input").focus(function () { 
				 $(this).addClass("focus")
							   });
	$("input").blur(function () { 
				 $(this).removeClass("focus")
								   });
	  
	 //submit button hover 
	 $(".submit").hover(
		 function(){
			$(this).addClass("submit_hover");								
		},function(){
			$(this).removeClass("submit_hover");								
	}); 	
	 
/*
	//side bar toggle
	$('.related_js li.first_set h3').parent().append('<span class="toggle right">more/less</span>'); //draw toggle button

	$('.related_js li.first_set').css( { display : 'block'});
	$('.related_js li.hidden_set').css( { display : 'none'});
	
	$('.toggle').click(function() {
			$(this).parent().parent().find('.hidden_set').stop().slideToggle(400);
		return false;
	});*/
	
	  
 });







//navigation
$(document).ready(function(){
		
      //Grab the original BG color of the link
      var originalBG = $("#primary li a").not("a.active").css("background-color");
      var originalTxtColor = $("#primary li a").not("a.active").css("color");
			var originalSubTxtColor = $('#primary li ul li a').not('a.active').css('color');
      var originalSubBG = $("#primary li ul li a").not("a.active").css("background-color");
	  
	  var activeBG = $("#primary li a.active").css("background-color");
      var activeText = $("#primary li a.active").css("color");
	  
	  if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ 
		 var ieversion=new Number(RegExp.$1) 
		 if (ieversion<=6)
		  	  $("#primary li ul li a").addClass("ie6");
		}
	  
	    $("#primary li a").not("a.active").hover(
			  function() {
				  $(this)
				  	.stop()
				  	.css({backgroundColor:""})
				  	.css({color:""})
			  },
			 function(){
				 var ele = $(this).parent().parent().parent();
				 if(ele.get(0).nodeName == 'LI') {
				 	BG = originalSubBG;
					txtColor = originalSubTxtColor;
				 } else {
					 BG = originalBG;
					 txtColor = originalTxtColor;
				 }
				 $(this)
					 .stop()
					 .animate({backgroundColor:BG}, 200)
					 .css({color:txtColor})
			  }
      );
		

  }); 



//bells and whistles
this.hover_fade = function(){	
	
	$("#banner_ads li, #features li").css({backgroundColor : "#000000"});
	$(".content_list li a, .dl_6, div.tabs ul.tab_nav a, #banner_ads li a, #features li a ").not("a.active").hover(
			  function() {
				  $(this)
				  	.css({opacity : 0.6})
				  	.animate({opacity : 1}, 500)
			  },
			 function(){
				  $(this)
					.css({opacity : 1})
			}
      );
	
};

$(document).ready(function(){
	hover_fade();
});



//tool tips

/*
 * Url preview script 
 * powered by jQuery (http://www.jquery.com)
 * 
 * written by Alen Grakalic (http://cssglobe.com)
 * 
 * for more info visit http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery
 *
 */
 
this.tooltips = function(){	
	/* CONFIG */
		
		xOffset = 10;
		yOffset = 30;
		yOffset2 = -230;
		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result
		
	/* END CONFIG */
	$("a.tooltip").hover(function(e){
		this.t = this.title;
		this.title = "";	
		var c = (this.t != "") ? "" + this.t : "";
//		$("body").append("<p id='tooltip'><img src='"+ this.rel +"' alt='url preview' />"+ c +"</p>");								 
		$("body").append( "<p id='tooltip'>"
						 	+ "<span>"
							+ c 
							+"</span> "
							
							+ this.rel 
							
							+"</p>");	
		
		
			$("#tooltip")
				.css("top",(e.pageY - xOffset) + "px")
				.css("left",(e.pageX + yOffset) + "px")
				.show();
			
			
    },
	function(){
		this.title = this.t;	
		$("#tooltip")
			.css({"display" : "none"})
			.remove();
    });	
	$("a.tooltip").mousemove(function(e){
		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.css({opacity : 0.95});
	});	
	
//right hand side elments	
	$("a.tooltip2").hover(function(e){
		this.t = this.title;
		this.title = "";	
		var c = (this.t != "") ? "" + this.t : "";
		$("body").append( "<p id='tooltip'>"
						 	+ "<span>"
							+ c 
							+"</span>"
							
							+ this.rel 
							
							+"</p>");	
		
			$("#tooltip")
				.css("top",(e.pageY - xOffset) + "px")
				.css("right",(e.pageX + yOffset2) + "px")
				.css({opacity : 0.95})
				.show();
			
    },
	function(){
		this.title = this.t;	
		$("#tooltip").remove();
    });	
	$("a.tooltip2").mousemove(function(e){
		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset2) + "px");
	});	
	
	
	
};

// starting the script on page load
$(document).ready(function(){
	tooltips();
});



