/*make outside pages open in separate window*/
$(function(){
	$('a[rel="external"]').live("click" ,function(){
		window.open(this.href);
		return false;
	});
});
/*navigation toggle*/
$('nav a[href="#"]').toggle(
	function() {
		$('nav a[href!="#"]').css('display', 'block');
		$(this).html('Menu &mdash;')
	},
	function() {
		$('nav a[href!="#"]').css('display', 'none');
		$(this).html('Menu +')
	}
);
/*load fancybox*/
$(document).ready(function() {
	$("a[href*='newsletter'],a[href='/popups/request.php']").fancybox({
		'overlayColor' : '#000000',
		'type' : 'iframe',
		'height' : '100%',
		'width' : 400,
		'centerOnScroll' : 'true',
		'onStart' : function() {
			 if ( $.browser.msie ) {
				$("html, body").animate({ scrollTop: 0 }, "slow");
			 }
		}
	});
});
$(document).ready(function() {
	$("a[href*='contact']").fancybox({
		'overlayColor' : '#000000',
		'centerOnScroll' : 'true',
		'onStart' : function() {
			 if ( $.browser.msie ) {
				$("html, body").animate({ scrollTop: 0 }, "slow");
			 }
		}
	});
});
$(document).ready(function() {
	$("html.ie6 a[href*='contact'],html.ie7 a[href*='contact'],html.ie8 a[href*='contact']").fancybox({
		'overlayColor' : '#000000',
		'centerOnScroll' : 'true',
		'onStart' : function() {
			 if ( $.browser.msie ) {
				$("html, body").animate({ scrollTop: 0 }, "slow");
			 }
		}
	});
});
$(document).ready(function() {
	$("a[href*='player']").fancybox({
		'overlayColor' : '#000000',
		'autoDimensions' : false,
		'width' : 230,
		'height' : 'auto',
		'centerOnScroll' : 'true',
		'onStart' : function() {
			 if ( $.browser.msie ) {
				$("html, body").animate({ scrollTop: 0 }, "slow");
			 }
		},
		'onCleanup' : function() {
			$("#jquery_jplayer_1").jPlayer("destroy");
		}
	});
});
