// JavaScript Document


function addshadowbox(){//if shadowbox doesn't exist in the dom, add it
if($('#overlay').length == 0){;
$('body').prepend('<div id="overlay"></div><div id="shadow_box_container"><div id="closebutton"><img src="images/close_button.gif" alt="Close"  /></div><div id="sb_inner"><div id="vid_holder"></div></div></div>')
	}
}


$(document).ready(function(){
	//$(".show_hide_wrap a").click(function(event){
	$(document).pngFix(); 
	
										  
$(".show_hide_wrap a").toggle(
  function () {
    $(this).removeClass("closed");
	 $(this).addClass("open");
	 $(this).parent().parent().parent().find(".list").slideDown("fast");
  },
  function () {
     $(this).removeClass("open");
	 $(this).addClass("closed");
	  $(this).parent().parent().parent().find(".list").slideUp("fast");
  }
);
		//event.preventDefault();
		
//initial click on sidebar video
	$('#watch_video, #watch_video_inline').click(function(e){
	e.preventDefault();
		addshadowbox()
		//fade in the shadowbox
		$(document).pngFix(); 
		$('#overlay').fadeIn('slow', function(){
			$('#shadow_box_container').show();
			//add default movie
			$('#vid_holder').html('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="545" height="327" id="viddler_8fd71747"><param name="movie" value="http://www.viddler.com/simple/8fd71747/" /><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="true" /><embed src="http://www.viddler.com/simple/8fd71747/" width="545" height="327" type="application/x-shockwave-flash" allowScriptAccess="always" allowFullScreen="true" name="viddler_8fd71747"></embed></object>');
		});
		//hide the shadowbox and reset the defaults
		$('#overlay, #closebutton').click(function(e){
			e.preventDefault();
			$('#shadow_box_container').hide();
			$('#overlay').fadeOut('slow')
		});
	})
	
	
	
		
		
});
	
	
	






	
	
		
	

	
	
	








function write_eml(prefix, suffix){
	return(document.write("<a href='mailto:" + prefix + "@" + suffix + "'>" + prefix + "@" + suffix + "</a>"));
};

function setFocus(thisELE, thisValue){

	$(thisELE).removeClass('form_alert');
	thisValueString=thisValue.toString();

	if(thisELE.value==thisValueString){
		msg='';
		thisELE.value=msg;
	}

	thisELE.onblur=function(){
		if(thisELE.value==''){
			thisELE.value=thisValue;
		}
	}
};



