$(document).ready(function(){

	$('a[rel=external]').click(function(){
		window.open( $(this).attr('href') );
		return false;
	}); 


	$('#IPsearch').focus(function() {
		if( $(this).val()=='Search Here' )
			$(this).val('');	
	});
	

	$('#IPsearch').blur(function() {
		if( $(this).val()=='' )
			$(this).val('Search Here');	
	});
	


	$(".videos a, #homevid").click(function() {

		var curVid = $(this).attr("href");
		curVid = curVid.substr((curVid.indexOf("=")+1),curVid.length);

		//alert( curVid );
		
		var vidUrl = '/swf/player.swf?file=/vid/' + curVid + '&autostart=true';
		
		$.fancybox({
				'padding'			: 0,
				'transitionIn'		: 'elastic',
				'transitionOut'	: 'elastic',
				'title'				: this.title,
				'width'				: 640,
				'height'				: 504,
				'href'				: vidUrl,
				'type'				: 'swf',
				'swf'					: {
						'wmode'		: 'transparent',
						'allowfullscreen'	: 'true'
				}

		});
	
		return false;

	});




});



// suckerfish for sucker-browser!

sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

