// CSS CONDITIONALS
if ($.browser.safari) {document.writeln('<link rel="stylesheet" type="text/css" href="assets/css/safari.css" media="all" />');}


// GO TO URL
function goto(url) {
	document.location.href = url;
}


// get url
// Current Page Reference
// copyright Stephen Chapman, 1st Jan 2005
// you may copy this function but please keep the copyright notice with it
function getURL(uri) {
uri.dir = location.href.substring(0, location.href.lastIndexOf('\/'));
uri.dom = uri.dir; if (uri.dom.substr(0,7) == 'http:\/\/') uri.dom = uri.dom.substr(7);
uri.path = ''; var pos = uri.dom.indexOf('\/'); if (pos > -1) {uri.path = uri.dom.substr(pos+1); uri.dom = uri.dom.substr(0,pos);}
uri.page = location.href.substring(uri.dir.length+1, location.href.length+1);
pos = uri.page.indexOf('?');if (pos > -1) {uri.page = uri.page.substring(0, pos);}
pos = uri.page.indexOf('#');if (pos > -1) {uri.page = uri.page.substring(0, pos);}
uri.ext = ''; pos = uri.page.indexOf('.');if (pos > -1) {uri.ext =uri.page.substring(pos+1); uri.page = uri.page.substr(0,pos);}
uri.file = uri.page;
if (uri.ext != '') uri.file += '.' + uri.ext;
if (uri.file == '') uri.page = 'index';
uri.args = location.search.substr(1).split("?");
return uri;
}
var uri = new Object();
getURL(uri);


/// FORM SPLITTER

function SplitV(){

        var strFilled;

        strFilled=$("#checkInFullDate").val().split('/');

        $("#fm").val(strFilled[0]);
        $("#fd").val(strFilled[1]);
        $("#fy").val(strFilled[2]);
	    return true;
}









///////////////////////////// F U N C T I O N ////////////////////////// 



$(function() {

	//PRELOAD NAV
	(function($) {
	  var cache = [];
	  // Arguments are image paths relative to the current page.
	  $.preLoadImages = function() {
	    var args_len = arguments.length;
	    for (var i = args_len; i--;) {
	      var cacheImage = document.createElement('img');
	      cacheImage.src = arguments[i];
	      cache.push(cacheImage);
	    }
	  }
	})(jQuery)

	jQuery.preLoadImages('assets/images/button.png');


	// GLOBAL TOOLS
	// assign classes for first and last children
		$('ul li:first-child').addClass('first-child');
		$('ul li:last-child').addClass('last-child');
		$('table tr:first-child').addClass('first-child');
		$('table tr:last-child').addClass('last-child');
		$('table tr td:first-child').addClass('first-child');
		$('table tr td:last-child').addClass('last-child');
	// assign classes for form elements
	// assign last children for Events
	
	

	    $('.slideshow').cycle({
			fx: 'fade',
			next:   '#nextPhoto',
			prev:   '#prevPhoto'
		});
		
	




});


