function showhide(id,element)
{
	
	if($("#"+id).css("display") == "none") 
	{
		$("#"+id).show();
		$(element).removeClass('expand');
		 $(element).addClass('collapse');
	}
	else
	{
		$("#"+id).hide();
		 $(element).removeClass('collapse');
         $(element).addClass('expand');

	}
	
}

function validateEmail(email)
{
	if(email.indexOf ('@',0) == -1 || email.indexOf ('.',0) == -1)
	{
		return false;
	}
	else
	{
		return true;
	}
}


$(document).ready(function() {

   // put all your jQuery goodness in here.		
	$(function() {
		
		//TABLE ALT ROW STYLING -------------------------------
		$("tr:visible:even").css("background-color", "#d7d5d3");
  		//$("tr:odd").css("background-color", "#EFF1F1");
	
		//IF overlay DIV exists then...
		if($('a[rel="#overlay"]').length != 0)addOverlayFunctionality()
		
		
		if ($('a.mt_email').length > 0){
			$.getScript('js/mailto.js',function(){ 
				$('a.mt_email').mailto();
			});
		}	
	
		
	});
		
});

function addOverlayFunctionality(){
	// if the function argument is given to overlay,
	// it is assumed to be the onBeforeLoad event listener
	// Setup a basic iframe for use inside overlays.
	var theframe = $('<iframe frameborder="0" scrolling="auto"></iframe>');
	

	$('a[rel="#overlay"]').overlay({
	
		mask: {color:'#000',loadSpeed: 'fast',opacity: '0.5', startOpacity:'0.5'},
		
		oneInstance:true,
		onBeforeLoad: function() {
			//First get the wrap
			var wrap = this.getOverlay().find(".contentWrap");
			//Get the URL from the trigger
			var link = this.getTrigger().attr("href");
			//Add the link and style attributes to the basic iframe
			$(theframe).attr({ src: link, style: 'height:450px; width:585px; border:none;' });
			//Write the iframe into the wrap
			wrap.append(theframe);
							
		}
	
	
	});
	
	
	// if the function argument is given to overlay,
	// it is assumed to be the onBeforeLoad event listener
	$('a[rel="#meeting_overlay"]').overlay({
		mask: {color:'#000',loadSpeed: 'fast',opacity: '0.5', startOpacity:'0.5'},
		
		oneInstance:true,
		close:null,
		onBeforeLoad: function() {
			//First get the wrap
			var wrap = this.getOverlay().find(".contentWrap");
			//Get the URL from the trigger
			var link = this.getTrigger().attr("href");
			//Add the link and style attributes to the basic iframe
			//$(theframe).attr({ src: link, style: 'height:600px; width:960px; border:none;' });
			$(theframe).attr({ src: link, style: 'height:600px; width:960px; border:none;' });
			//Write the iframe into the wrap
			wrap.append(theframe);
							
		}
	
	
	});

}

