


$(function() { 
	    
	    //Adjust image size
	    $.fn.resizenow = function() {
	        //Define starting width and height values for the original image
	        var startwidth = 1440;  
	        var startheight = 900;
	        //Define image ratio
	        var ratio = startheight/startwidth;
	        //Gather browser dimensions
	        var browserwidth = $(window).width();
	        var browserheight = $(window).height();
	        //Resize image to proper ratio
	        if ((browserheight/browserwidth) > ratio) {
	            $(this).height(browserheight);
	            $(this).width(browserheight / ratio);
	            $(this).children().height(browserheight);
	            $(this).children().width(browserheight / ratio);
	        } else {
	            $(this).width(browserwidth);
	            $(this).height(browserwidth * ratio);
	            $(this).children().width(browserwidth);
	            $(this).children().height(browserwidth * ratio);
	        }
	        //Make sure the image stays center in the window
	        $(this).children().css('left', (browserwidth - $(this).width())/2);
	        $(this).children().css('top', (browserheight - $(this).height())/2);
	    };
	    
	    
		$('#homepage-container').resizenow(); 

		$(window).bind("resize", function() {
			$('#homepage-container').resizenow(); 
		});
		
		
		// Any pages with videos that have thumbnail pictures
		
		var clickedThumb;
		$('.room-thumbs li a').click(function(){  
			clickedThumb = $(this).attr('rel');
			$('#flash-video, .skip-video, video').hide();
			$('iframe').remove();
			$('.post-video, .view-video').show();
			$('.post-video img').hide();
			$('.post-video img#'+clickedThumb).show();
		});
		

		
		
		// Neat enlarger for Press Images
		
		$('.press-page img').animate({ opacity: ".75" });
		$('.press-page img').hover(function(){  
			$(this).addClass('hover');
			$(this).animate({ opacity: "1" }, 500);
		},function(){  
			$(this).removeClass('hover');
			$(this).animate({ opacity: ".75" }, 500);
		});
		
		
		
		
		// Video Related Scripts
		
		$('.skip-video').show();
		
		$('.skip-video').click(function(){ 
			$(this).hide();
			$('#flash-video, video').hide();
			$('iframe').remove();
			$('.post-video img').hide();
			$('.post-video, .post-video img:first').fadeIn();
		});
		
		$('.view-video').click(function(){
			location.reload();
			//$(this).hide();
			//$('.post-video, .post-video img:first').hide();
			//$('#flash-video, .skip-video, video').show();
		});
		
		
		
	







// JavaScript Document	



});

function OpenNewWindow(url) {
    

    var wnd = window.open(url);
}

var theLinks; 
var nCount = 0; 
var theTimerID; 
 
function init(){ 
    $("div#mygalone").slideView(); 
    theLinks = jQuery('#stripTransmitter0 a'); 
 
        //for kill interval purposes 
        theTimerID = setInterval("autoSlide()", 7000); 
} 
function autoSlide(){ 
    jQuery.each(theLinks, function(i){ 
        if(jQuery(this).hasClass('current')){ 
            jQuery(theLinks[((i+1 < theLinks.length) ? (i+1) : 0)] ).trigger("click"); 
            return false; 
        } 
    }); 
} 
 
$(window).bind("load", init ); 





