function openURL(url) {
	window.location.href = url;
}

$(document).ready(function() {
	function minHeightSize(){
		var documentH = Math.round($(document).height());
		var footerH = Math.round($("#footer").height());		
		var minH = documentH - footerH;
		if(minH > 740){
			$("#mainContainer").css({"min-height" : minH});
		}else{
			minH = 740;
			$("#mainContainer").css({"min-height" : minH});
		}
	}
	minHeightSize();	
	$(window).resize(function(){
		minHeightSize();
	});
});

$(window).load(function() {
    $('#slider').nivoSlider({
    	pauseTime: 5000,
    	//effect: 'fade',
    	directionNav: false,
    	controlNav: false,
    	keyboardNav: false,
    	pauseOnHover: false    	
    	//randomStart: true 	
    });
});

$(document).ready(function() {
	$('#subPageRight a').mouseenter(function() {
		$(this).animate({width:"290px", opacity: 0.9},
			function() {
				$(this).children(".rigthText").css({display:"block"});
			}
		);
		$(this).children(".rightBgColor").animate({width:"290px"});			
	});
	
	$('#subPageRight a').mouseleave(function() {
		$(this).animate({width:"96px", opacity: 1},
			function() {
				$(this).children(".rigthText").css({display:"none"});
			}
		);
		$(this).children(".rightBgColor").animate({width:"90px"});		
	});
});

/*Media and Image Gallery Script*/
$(document).ready(function() {
	$("a.fancybox").fancybox({
		prevEffect		: 'fade',
		nextEffect		: 'fade',
		helpers		: { 
			title	: { type : 'inside' }            			
		}
	});
	
	$("a.fancyboxMedia").fancybox({
        width       : 640,
        height      : 480,			        
		prevEffect  : 'fade',
		nextEffect	: 'fade',
		fitToView   : false,					
		helpers		: { 
			title	: { type : 'inside' }
		}
	});
});
