// Default JS Content - Do Not Delete

if(!document.location.href.match(/hands-oncms/)&&!navigator.userAgent.match(/iPad/i)){
try{

       parent.document.title = document.title;

       if(parent==window){

              undefinedfunction();

       }

       parent.lastURL = '#'+document.location.href.replace(/^.*\.com/,''); // Stop it for reloading the page twice

       parent.document.location.href = '/f.html#'+document.location.href.replace(/^.*\.com/,'');

}catch(e){

       window.document.location.replace(document.location.href.replace(/\.com/,".com/f.html#"));

}
}

$(document).ready(function(){
  $('#Email').focus(function(){
    $(this).css('font-style','normal').css('color','#000');
    if(this.value=='your e-mail')this.value='';
  }).blur(function(){
    if(this.value==''){
      this.value='your e-mail';
      $(this).css('font-style','italic').css('color','#a0a0a0');
    }
  }).blur();
});

$(document).ready(function() {
	$("#terms").dialog({
		   modal: true,
		   autoOpen: false,
		   height:300,
		   width:475,
		   show: "fold",
		   position:"center",
		   buttons: {"Thank You": function() {$(this).dialog("close");}}
    });
        
    $('a.disclaimerID').click(function(e) {
		var ourContent = $('#' + $(this).attr("title")+ '').html();
		$('#terms').html('<div class="popDis">'+ ourContent + '</div>')
			$("#terms").dialog('open');
			$('.ui-widget-overlay').css({'z-index':'999'});
		return false;
	});
});


$(document).ready(function() {
$('body').append('<div id="booking" title="R & R Resorts Reservations" />');
	$("#booking").dialog({
		   modal: true,
		   autoOpen: false,
		   height:625,
		   width:800,
		   show: "fold",
		   hide:"fold",
		   position:"center",
		   close: function() {
		   		//$('.ui-widget-overlay').css({'z-index':'1'});
		   },
		   buttons: {"Thank You": function() {$(this).dialog("close");}}
    });
	

	$('.urlToBook div').unbind('click').click(function(e) {
		
		$('#booking').load('/i/SITE_091203_16103434_1BP6A/bookingEngine.cfm',{'url':$(this).attr('location')}, function() {
			$('#booking').dialog('open');
			return false;	
		});
		return false;
	});
	
	$('a[href^="https://orbe.coral-technologies.com"]').unbind('click').click(function(e) {
		
		$('#booking').load('/i/SITE_091203_16103434_1BP6A/bookingEngine.cfm',{'url':$(this).attr('href')}, function() {
			$('#booking').dialog('open');
			return false;	
		});
		return false;
	});
});
