// JavaScript Document

$(document).ready(function() {
		
	
	$("#icon_row li a").click(function() {
		$icon_info_rel = $(this).attr('rel');
		$icon_info_display = $(this).attr('id');
		$icon_info_title = $(this).attr('title');
			// move the info up if it's a big panel
			if ($icon_info_title == "Suntile Information") {
				
				$("#icon_info_row").css('top','-50px');
				}	else { 
				$("#icon_info_row").css('top','-30px'); 
			}
		if ($icon_info_rel > '') {
			if ($icon_info_rel != 'contact.php') {
				target_value = ' target="_blank" ';	
			} else {
				target_value = '';	
			}
			var texttoshow = '&nbsp;<a href="'+$icon_info_rel+'" '+ target_value +'>'+$icon_info_display+'</a>';
					
		} else {
			var texttoshow = $icon_info_display;
		}
		if ($("#icon_info_row").is(":visible")) {

			$("#icon_info_row").hide("slide", { direction: "down" }, 500, function() {
				// adjust the top of the area for more room for the information bar						 
				$("#icon_info_row").html(texttoshow);
				$("#icon_info_row").show("slide", { direction: "down" }, 500);;
			})
		
			  } else {
				  
				  $("#icon_info_row").html(texttoshow);
				$("#icon_info_row").show("slide", { direction: "down" }, 500)
			  }

		return false;
	})
	
  	// this cludge seems to work (apart from the width. )
  	$('.tsandcsshow').live('mouseenter', function(){ 
  		
  		$(this).fancybox({'width':'400px'})
  	}); 
							   
		
	
})
