﻿// JavaScript Document

$(document).ready(function(){
var browser=navigator.appName;
var b_version=navigator.appVersion;
var version=parseFloat(b_version);						   
if ((browser=="Microsoft Internet Explorer")
  && (version<=6)){
	$("#homeMenu").hide().show(); //ie6 hack	
}
	
	$(document).pngFix();
	$("img.swapMouseover, li.swapMouseover img").preload({
		find: '_off',
		replace: '_on'
	});

	$("img.swapMouseover, li.swapMouseover img").hover(
	  function () {
		  if (this.tagName.toLowerCase() == "span") {
			$(this).css("filter", $(this).css("filter").replace("_off", "_on"));  
		  } else {
			$(this).attr("src", $(this).attr("src").replace("_off", "_on"));
		  }
	  }, 
	  function () {
		  if (this.tagName.toLowerCase() == "span") {
			$(this).css("filter", $(this).css("filter").replace("_on", "_off"));  
		  } else {
			$(this).attr("src", $(this).attr("src").replace("_on", "_off"));
		  }
	  }
	);   		

	// initialise superfish
	$("#navMain").superfish({
		hoverClass:    "hoverMouseover",
		dropShadows:   false,
		autoArrows:    false
	});
	/*
	var triggers = $("#signupNewsLetterLink")[0];		  		  
	  $("#signupWindow").jqm({
	    modal: false,
		trigger: triggers,
		closeClass: "signupClose",
		overlayClass: "signupOverlay",
		modal:false,
	    overlay: 1
	  });
	  
	 var modalOpen=function(hash) { hash.w.fadeIn('2000',function(){ hash.w.css({'z-index':'5000'}); }); };
	 $("#signupWindow").jqm({onShow :modalOpen}); 
*/
	$("#homeImgRotate").cycle();
	
	$("#signupNewsLetterLink").click(function(){
			$("#signupWindow").slideDown("normal",function(){ 
				$("#signupContainer #signupForm iframe").fadeIn("fast");  
			});						  
											  
	});
	
	$("#signupCloseLink").click(function(){
			$("#signupContainer #signupForm iframe").fadeOut("fast", function(){
				$("#signupWindow").slideUp("normal"); 
			} );  
								  
											  
	});	

  	var ind =5;
	$("ul#homeNews li").each(function(){
		$(this).css("z-index", ind);
		ind = ind -1;
	});
	$("ul#homeNews li a").hover(function(){
														$("span.description", this).css("visibility","hidden");
														$("span.descriptionFull", this).css("display","block");
													},
													function(){
														$("span.description", this).css("visibility","visible");
														$("span.descriptionFull", this).css("display","none");
													});
});
	
	



