var domain ='';
var domainRef ='';
function init(d, dr) {
	domain = d;
	domainRef = dr;
	$(document).ready(function(){
														 
		// prettyPhoto lightbox for youtube videos
		$("a[rel^='prettyPhoto']").prettyPhoto({
			autoplay: true,
			allowresize: true,
			default_width: 640,
			default_height: 391,
		});
														 
		// fix breadcrumbs
		$("#breadcrumbs li:last").removeAttr('class');
		$("#breadcrumbs li").each(function(){
			if ($(this).attr('class')) {
				$(this).find(".breadcrumb-title").wrapInner('<a href="'+$(this).attr('class')+'"></a>');
			}
		});
		
		// fix forms
		$(".siteForm").attr("rel", d + $(".siteForm").attr("name"));
		
		// room page menu hover effect
		$(".roomnav a img").hover(
			function(){
				$(this).attr("src", $(this).attr("src").replace(/\.gif/, '-o.gif'));
			},
			function(){
				$(this).attr("src", $(this).attr("src").replace(/\-o\.gif/, '.gif'));
			}
		);
		
		stripeTable();
		
		$("ul#menu").supersubs({ 
            minWidth:    12,   // minimum width of sub-menus in em units 
            maxWidth:    40,   // maximum width of sub-menus in em units 
            extraWidth:  1     // extra width can ensure lines don't sometimes turn over 
                               // due to slight rounding differences and font-family 
        });
		$("ul#menu").superfish();
		$("ul.sf-menu").supposition();
	});
}
jQuery.preloadImages = function() {
  for(var i = 0; i<arguments.length; i++) {
    jQuery("<img>").attr("src", domainRef+arguments[i]);
  }
}
function stripeTable() {
	$("table.stripe tr:even").addClass("even");
	$("table.stripe tr:odd").addClass("odd");
}