$(function(){
/*
     * Styling
     */
    
    /*
     * Pretty forms
     */
    $('form.prettyform input[@type*=radio]').css('border','none');
    $('form.prettyform input[@type*=checkbox]').css('border','none');
    if($.browser.mozilla) { prettyform(); }
    
    /*
     * LI hover fix for IE6
     */
    $('#navigation ul li').each( function(){
        $(this).mouseover( function(){ $(this).addClass('hover'); } ).mouseout( function(){ $(this).removeClass('hover'); } );
    });
    
    /*
     * Blur on focus
     */
    $('a').focus(function() { this.blur(); });
    $('input[@type*=submit]').focus(function() { this.blur(); });
    $('input[@type=text], input[@type=password]').addClass("input");
    
    $('#navigation a.active:last').addClass('current');

   // Shift header table if its there, and add some borders to the images
   if( $("#bannerTable").length ) {
	   //$("#bannerTable img.bannerImg").empty();
	   $("#sectionBanner img.bannerImg").replaceWith($("#bannerTable"));
	   
	   if(  $("#bannerTable img").size() == 3 ) {
		   $("#bannerTable td:first").next('td').find('img').addClass("borderLeft borderRight");
	   } else if( $("#bannerTable img").size() == 2 ){
		   $("#bannerTable img:first").addClass("borderRight");
		   //$("#bannerTable img:last").addClass("borderLeft");
	   }
	   $("#sectionBanner a").attr('rel','banner');
	   
	   $('#bannerTable a').lightBox();
   }
    
   // $("div.gallery-image a").vAlign();
    
   // Book Now link
   var bookNowLink = "http://www.seekom.com/accommodation/Property.php?op=Crusoes&amp;pid=3725";
   $("#nav_node29 a").attr('href',bookNowLink);
   $("#nav_node29 a").attr('target','_blank');
   
   // Video Link
   $("#nav_node26 a").attr('onload',"this.parentNode.style.display='block'");
   $("#nav_node26 a").attr('src',"http://www.prevucorporation.com/PrevuVideo/plantlive.cfm?pc_id=1070&amp;plant_id=525");
   $("#nav_node26 a").click(function () { 
	   	window.open('http://www.prevucorporation.com/PrevuVideo/popup.cfm?pc_id=1070&plant_id=525', '', 'resizable=yes,noscrollbars,status=yes');
   }
	   );
		  
   $("#nav_node26 a").attr('href',"javascript:void(0);"); 
 
   

});
/*
(function ($) {
	
    $.fn.vAlign = function(container) {
    	alert('test');
        return this.each(function(i){
	   if(container == null) {
	      container = 'div';
	   }
	   var paddingPx = 10; //change this value as you need (It is the extra height for the parent element)
	   $(this).html("<" + container + ">" + $(this).html() + "</" + container + ">");
	   var el = $(this).children(container + ":first");
	   var elh = $(el).height(); //new element height
	   var ph = $(this).height(); //parent height
	   if(elh > ph) { //if new element height is larger apply this to parent
	       $(this).height(elh + paddingPx);
	       ph = elh + paddingPx;
	   }
	   var nh = (ph - elh) / 2; //new margin to apply
	   $(el).css('margin-top', nh);
        });
     };
})(jQuery);

*/
/*
 * Pretty forms
 */
function prettyform(){
  /*
   * Hide forms
   */
  $( 'form.prettyform' ).hide().end();
  /*
   * Label & list formatting
   */
  $( 'form.prettyform' ).find( 'label' ).not( '.noprettyform' ).each( function( i ){
    var labelContent = this.innerHTML;
    var labelWidth = document.defaultView.getComputedStyle( this, '' ).getPropertyValue( 'width' );
    var labelSpan = document.createElement( 'span' );
        labelSpan.style.display = 'block';
        labelSpan.style.width = labelWidth;
        labelSpan.innerHTML = labelContent;
    this.style.display = '-moz-inline-box';
    this.innerHTML = '';
    this.appendChild( labelSpan );
  } ).end();
  
  /*
   * Show forms
   */
  $( 'form.prettyform' ).show().end();
}