var ff = (navigator.userAgent.indexOf("Firefox") != -1) ? true : false;
		if(ff) $('.item strong').css({opacity: .9999}); 
	
		var timeUP = 300;
		var timeDN = 300;		

        $(document).ready(function() {
		
            $("#homeUpper li.image").hover(
              function () {
			  		if(!$(".overlay-text",this).hasClass('on')) {
				  		$(".overlay-text",this).addClass('on');
				  		$(".overlay-text",this).fadeIn(timeUP);
					}
				}, 
              function () { 
			  		if($(".overlay-text",this).hasClass('on')) {
						$(".overlay-text",this).fadeOut(timeDN, function() {
							$(this).removeClass('on');
						});
					}
				}
            );
			
			
			
	
		
		
			//Disappearing labels on forms
	
			$('input', '#newsletterForm').each(function() {
				if ($(this).val() != "") {
					$(this).prev('label').addClass('hiddenLabel');
				}
			});
			
			//setup the form tooltips & label disappearances
			$('input,select,textarea','#newsletterForm').focus(function(thisInput) {
				
				thisInput = thisInput.target;
				
				// hide the label
				$("label[@for=" + thisInput.id + "]").addClass('hiddenLabel');
		
			
				return true;
				
			}).blur(function(thisInput) {
		
				thisInput = thisInput.target;
		
				// re-display the label
				if ($(thisInput).val() == "") {
					$(thisInput).prev('label').removeClass('hiddenLabel');
				}
		
				
				
				
			});
			
			// Setup Select Boxes
			$('select', '#suggest_form').each(function() {
				var labeltxt = $("label[@for=" + $(this).attr("id") + "]").html();
				$(this).prepend('<option value="">'+  labeltxt + '</option>');
			});

                       
        });   
		
		
		
	// Gallery Display for cartoons and images
	
	function galleryDisplay(showCartoonDiv,hideCartoonDiv1,hideCartoonDiv2) {
	var el1 = document.getElementById(showCartoonDiv);	
	var el2 = document.getElementById(hideCartoonDiv1);	
	var el3 = document.getElementById(hideCartoonDiv2);
	
	el1.style.display = "block";
	el2.style.display = "none";
	el3.style.display = "none";
}

// Email the cartoons

function emailCartoon(emailUrl,cartoonLinkId){

	document.getElementById(cartoonLinkId).href=emailUrl;
}

// Newsletter Signup


// function added for implementing omniture script 
		function omniture_script()
		 {
		if(document.getElementById("epid") && document.getElementById("optInOutList") ) {
		strEpid = document.getElementById("epid").value;
		optInOut = document.getElementById("optInOutList").value;                       
		s.eVar5 = "newsLetterSignupRightNav";	
		s.pageName="newsLetterSignupRightNav";
		s.eVar19 = strEpid;
		// Newsletter signin and signout		 
			if (optInOut.length > 0) {
				s.prop9 = optInOut.substring(0, optInOut.indexOf("|"));
				s.prop10 = optInOut.substring(optInOut.indexOf("|") + 1);
			}
		 s.events = "event5";
		 void(s.t());
		}
		}

	function submitNewsletterSignUp() {
	
	    var sourceId = document.leftNavPreferenceForm.sourceId.value;
	    var preferences =""; 
	    for (i=0;i<document.leftNavPreferenceForm.preferences.length;i++){
	    	if(document.leftNavPreferenceForm.preferences[i].checked)
	    		preferences=preferences+"&preferences="+document.leftNavPreferenceForm.preferences[i].value;
	    }
	    var emailAddress = document.leftNavPreferenceForm.emailAddress.value;
	    var ajax = new net.ContentLoader("/savePreferences.do?emailAddress=" + emailAddress + preferences + "&sourceId=" + sourceId,getSuccessResponse,getFailureResponse)
	
	}

	function getSuccessResponse(){
		
	    document.getElementById("newsletterInnerBox").innerHTML=this.req.responseText;
		document.getElementById("error").innerHTML="";
      // calling the omniture_script function
		omniture_script();
		
	}

	function getFailureResponse(){
		
	    document.getElementById("error").innerHTML=this.req.responseText;
	    document.getElementById("error").innerHTML="We are currently experiencing some technical difficulties. Please try again later.";
	}