$(document).ready(function()
{	
	/* COMMENTED OUT AS OF 1-12-2009
	// Send to frame if it's not an internal link or part of the trusted sites listed above
	$('a').click(function()
	{	var arrayCheck = 0;
		var safeURLArray = [
			"kidneycancer.org",
			"kidneycancervideo.com",
			"kidneycancerradio.com",
			"olivesoftware.com",
			"z2systems.com",
			"74.125.95"
			];
		thisHref = $(this).attr('href');
		thisTarget = $(this).attr('target');
		
		if ( thisHref.substring(0,1) != '/' && thisHref.substring(0,6) != 'mailto' )
		{	for ( var x=0; x<=3; x++ )
			{	if( thisHref.search( safeURLArray[x] ) > -1 )
				{	arrayCheck = arrayCheck + 1;	}
			}
			
			if ( arrayCheck == 0 )
			{	// if the target is blank, open this link in a new window with frame
				if ( thisTarget == "_blank" )
				{	window.open ("http://www.kidneycancer.org/frame.php?to="+thisHref+"&from="+window.location.protocol + "//" + window.location.host + window.location.pathname+"");	}
				// if the target is not blank, open this link in current window with frame
				else 
				{	window.location = "http://www.kidneycancer.org/frame.php?to="+thisHref+"&from="+window.location.protocol + "//" + window.location.host + window.location.pathname+"";	}
				return false;
			}
		}
	});
	*/
	
	// Subnav trigger
	$('#header .menu').superfish ( 
	{	delay:       800,                            // one second delay on mouseout 
		pathLevels:    1,                 			 // the number of levels of submenus that remain open or are restored using pathClass
		animation:   {opacity:'show',height:'show'},  // fade-in and slide-down animation 
		speed:       'fast',                          // faster animation speed 
		autoArrows:  false,                           // disable generation of arrow mark-up 
		dropShadows: true                            // disable drop shadows 
	});
	
	// add the dropshadow to each submenu
	$('#header .menu > li > ul').each(function(i)
	{	if ( $.browser.msie && parseInt($.browser.version) < 7)
		{	/**/	}
		else
		{	var newHeight = $(this).height() + 30;
			var newWidth = $(this).width() + 37;
			$(this).prepend('<div class="subnav_bottom" style="width:'+newWidth+'px"></div><div class="subnav_right" style="height:'+newHeight+'px"></div><div class="subnav_bottomRight"></div>');
		}
	});
	
	// Content Height should be at least the same and the sidebar
	$("#contentMain").css("min-height", $("#contentNav").height()+"px");
});

