function init() {
	document.getElementById('loading').style.display='none';
}

$(document).ready(function() {						   
	var reserve_url = "http://reservations.parksidevictoria.com/irmnet/Res/ResMain.aspx?";
	var parent_url = window.location.href;

	var pos = parent_url.indexOf("?");
	if(pos != -1) {
		var request_string = parent_url.slice(pos + 1);		
		if(request_string.length > 0) {
			var request_items = request_string.split("&");
			
			if(request_items.length > 0) {			
				for($x=0; $x < request_items.length; $x++) {
					if(request_items[$x] != '') {
						reserve_url = reserve_url + request_items[$x] + "&";
					}
				}
			}
		}
	}

	// Remove the trailing '&' symbol if it exists
	reserve_url = reserve_url.replace(/&$/g, '');



	if (typeof _gaq!="undefined") {
		// Try loading the iFrame through analytics so we can pass along the cookie data
		_gaq.push(function() {
			// May 30th notes:
			// - Restructured the above code to use non deprecated functions
			var tracker = _gat._getTrackerByName();	 
			linker_url = tracker._getLinkerUrl(reserve_url);
			document.getElementById("irmFrame").src = linker_url; //converting to character codes?!?!?
			
			// Debug
			//$("#footer-bottom").append('<p style="margin: 15px 0; color: white; text-transform: none; font-size: 11px; line-height: 1em;">'+linker_url+'</p>');
		});
	} else {
		document.getElementById("irmFrame").src=reserve_url;
	}
	

});

