// JavaScript Document
<!--
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function mmLoadMenus() {
  if (window.mm_menu_weddings) return;
  window.mm_menu_weddings = new Menu("root",124,18,"Arial, Helvetica, sans-serif",10,"#000000","#ffffff","#f4f4f4","#000000","center","middle",2,1,100,-5,7,false,true,true,0,false,false);
   mm_menu_weddings.addMenuItem("Menus","location='http://catering.pganationalemenus.com'");
   mm_menu_weddings.addMenuItem("Resort&nbsp;Info","location='resort-info.aspx'");
   mm_menu_weddings.addMenuItem("Spa&nbsp;Services","location='spa-services.aspx'");
   mm_menu_weddings.addMenuItem("Cultural&nbsp;Weddings","location='cultural-weddings.aspx'");
   mm_menu_weddings.addMenuItem("Destination&nbsp;Weddings","location='destination-weddings.aspx'");
   mm_menu_weddings.addMenuItem("Honeymoons","location='honeymoons.aspx'");
   mm_menu_weddings.addMenuItem("Wed-I-quette","location='wed-iquette.aspx'");
   mm_menu_weddings.addMenuItem("Wedding&nbsp;Boutique","location='wedding-boutique.aspx'");
   mm_menu_weddings.addMenuItem("Transportation","location='transportation.aspx'");
     mm_menu_weddings.addMenuItem("Facilities","location='facilities.aspx'");
	 mm_menu_weddings.addMenuItem("Event RFP","location='event_rfp.aspx'");
   mm_menu_weddings.fontWeight="bold";
   mm_menu_weddings.hideOnMouseOut=true;
   mm_menu_weddings.menuBorder=0;
   mm_menu_weddings.menuItemBorder=0;
   mm_menu_weddings.menuLiteBgColor='#ffffff';
   mm_menu_weddings.menuBorderBgColor='#000000';
   mm_menu_weddings.bgColor='#000000';
  window.mm_menu_social = new Menu("root",179,18,"Arial, Helvetica, sans-serif",10,"#000000","#ffffff","#f4f4f4","#000000","center","middle",2,1,100,-5,7,false,true,true,0,false,false);
   mm_menu_social.addMenuItem("Galas","location='galas.aspx'");
   mm_menu_social.addMenuItem("Reunions","window.open('reunions.aspx', '_self');");
   mm_menu_social.addMenuItem("Birthdays","location='birthdays.aspx'");
   mm_menu_social.addMenuItem("Anniversaries","location='anniversaries.aspx'");
   mm_menu_social.addMenuItem("Bar&nbsp;and&nbsp;Bat&nbsp;Mitzvahs","location='mitzvahs.aspx'");
   mm_menu_social.addMenuItem("Quincea&ntilde;os","location='quince.aspx'");
   mm_menu_social.addMenuItem("Showers","location='showers.aspx'");
   mm_menu_social.addMenuItem("Menus","location='http://catering.pganationalemenus.com'");
   mm_menu_social.addMenuItem("Facilities","location='social-facilities.aspx'");
   	 mm_menu_social.addMenuItem("Event RFP","location='event_rfp.aspx'");
   mm_menu_social.fontWeight="bold";
   mm_menu_social.hideOnMouseOut=true;
   mm_menu_social.menuBorder=0;
   mm_menu_social.menuItemBorder=0;
   mm_menu_social.menuLiteBgColor='#ffffff';
   mm_menu_social.menuBorderBgColor='#000000';
   mm_menu_social.bgColor='#000000';
  window.mm_menu_corp = new Menu("root",175,18,"Arial, Helvetica, sans-serif",10,"#000000","#ffffff","#f4f4f4","#000000","center","middle",2,1,100,-5,7,false,true,true,0,false,false);
   mm_menu_corp.addMenuItem("Floor&nbsp;Plans","location='floor-plans.aspx'");
   mm_menu_corp.addMenuItem("Capacity","location='capacity.aspx'");
   mm_menu_corp.addMenuItem("Banquet&nbsp;Menus&nbsp;","location='banquet-menus.aspx'");
   mm_menu_corp.addMenuItem("Audio/Visual","location='audio-visual.aspx'");
   	 mm_menu_corp.addMenuItem("Company RFP","location='company_rfp.aspx'");
   mm_menu_corp.fontWeight="bold";
   mm_menu_corp.hideOnMouseOut=true;
   mm_menu_corp.menuBorder=0;
   mm_menu_corp.menuItemBorder=0;
   mm_menu_corp.menuLiteBgColor='#ffffff';
   mm_menu_corp.menuBorderBgColor='#000000';
   mm_menu_corp.bgColor='#000000';

  mm_menu_corp.writeMenus();
} // mmLoadMenus()

//-->




/* Modified to support Opera */
function bookmarksite(title,url){
if (window.sidebar) // firefox
	window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
	var elem = document.createElement('a');
	elem.setAttribute('href',url);
	elem.setAttribute('title',title);
	elem.setAttribute('rel','sidebar');
	elem.click();
} 
else if(document.all)// ie
	window.external.AddFavorite(url, title);
}
	

//-->



/* Transitions on the main page */
///////////////////////////////////////////////////////////////////////////////////////////////////////

		//SET OPACITY ON IMAGES
		////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		function blendimage(divid, imageid, imagefile, millisec) { 
			var speed = Math.round(millisec / 100); 
			var timer = 0; 
			 
			//set the current image as background 
			document.getElementById(divid).style.backgroundImage = "url(" + document.getElementById(imageid).src + ")"; 
			 
			//make image transparent 
			changeOpac(0, imageid); 
			 
			//make new image 
			document.getElementById(imageid).src = imagefile; 
		
			//fade in image 
			for(i = 0; i <= 100; i++) { 
				setTimeout("changeOpac(" + i + ",'" + imageid + "')",(timer * speed)); 
				timer++; 
			} 
		}
		
		
		function opacity(id, opacStart, opacEnd, millisec) { 
			//speed for each frame 
			var speed = Math.round(millisec / 100); 
			var timer = 0; 
		
			//determine the direction for the blending, if start and end are the same nothing happens 
			if(opacStart > opacEnd) { 
				for(i = opacStart; i >= opacEnd; i--) { 
					setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
					timer++; 
				} 
			} else if(opacStart < opacEnd) { 
				for(i = opacStart; i <= opacEnd; i++) 
					{ 
					setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
					timer++; 
				} 
			} 
		} 
		
		//change the opacity for different browsers 
		function changeOpac(opacity, id) { 
			var object = document.getElementById(id).style; 
			object.opacity = (opacity / 100); 
			object.MozOpacity = (opacity / 100); 
			object.KhtmlOpacity = (opacity / 100); 
			object.filter = "alpha(opacity=" + opacity + ")"; 
		}
		


		///////////////////////////////////////////////////////////////////////////////
		// ROTATE IMAGES
		///////////////////////////////////////////////////////////////////////////////
		var current_location = 1;
		var next_location = 1;
		var rotation_size = 4;
		var timer;
		var photos= new Array();
		photos['1'] = "rot_imgs4.jpg";
		photos['4'] = "rot_imgs1.jpg";
		photos['2'] = "rot_imgs2.jpg";
		photos['3'] = "rot_imgs3.jpg";
		

	
		function play() {
			go_to_next_photo();
		}
		
		function go_to_next_photo() {
			current_location = next_location;
			show_current_photo();
			reset_timer();
		}
		
		function reset_timer() {
			clearTimeout(timer);
			timeout_value = 5 * 800; // Timer of transition
			timer = setTimeout('go_to_next_photo()', timeout_value);
			if(current_location == rotation_size){ next_location = 1; } else { next_location = current_location + 1; }
		}
		
		
		function show_current_photo() {
			var speed = Math.round(500 / 100); 
			var timer = 0; 
			// document.getElementById('headphoto').src = "images/" + photos[current_location];
			
		 	document.getElementById('headphotoblock').style.backgroundImage = "url(" + document.getElementById('headphoto').src + ")"; 
			
			changeOpac(0, 'headphoto'); 
			
			document.getElementById('headphoto').src = "images/front/" + photos[current_location]; 
			
			for(i = 0; i <= 100; i++) { 
				setTimeout("changeOpac(" + i + ",'" + 'headphoto' + "')",(timer * speed)); 
				timer++; 
			} 
			
			return 1;
		}
		
		function toggleDiv(divID, status){    
			var active_color = "#597da6";
			var inactive_color = "#003876";
			var linkID = divID + "link";
			if(document.getElementById(divID)){
				document.getElementById(divID).style.display = status;
			}
			if(document.getElementById(linkID)){
				if(status == "block"){
					document.getElementById(linkID).style.background = active_color;
				}else{
					document.getElementById(linkID).style.background = inactive_color;
				}
			}
		}
		
		
		function clearNavs(){
			toggleDiv('subnav1','none');
			toggleDiv('subnav2','none');
			toggleDiv('subnav3','none');
			toggleDiv('subnav4','none');
			toggleDiv('subnav4sub','none');
			toggleDiv('subnav5','none');
			toggleDiv('subnav5sub1','none');
			toggleDiv('subnav5sub2','none');
		}
		
		