function gaSubmit()
	{
		
		if(
			!$('#arrive')[0].value.match(/\d{1,}\/\d{1,}\/\d{1,}/)
			|| !$('#depart')[0].value.match(/\d{1,}\/\d{1,}\/\d{1,}/)
		){
			alert('Please select an arrival and departure date.');
		}else{
			/*Removed old address on 5/3/2010 ASR*/
			//var bookingLink = "https://gc.synxis.com/rez.aspx?Hotel=2&Chain=2&Promo=";
			//var bookingLink = "https://gc.synxis.com/rez.aspx?Hotel=27205&Chain=10237&Promo=";
			//var bookingLink = "https://www.phgsecure.com/IBE/bookingRedirect.ashx?propertyCode=BOSCO";
			var bookingLink = "https://gc.synxis.com/rez.aspx?hotel=27205"+(document.reservationsFormColonnade.Promo.value!=''?("&Promo="+document.reservationsFormColonnade.Promo.value):"")+(document.reservationsFormColonnade.Group.value!=''?("&Group="+document.reservationsFormColonnade.Group.value):"")+"&start=1&shell=BOSCO&chain=10237&template=BOSCO&locale=en-US&avcurrency=USD&";
			myBookingLink = bookingLink + '&arrive=' + document.reservationsFormColonnade.arrive.value + '&depart=' + document.reservationsFormColonnade.depart.value + '&Adult=' + document.reservationsFormColonnade.Adult[document.reservationsFormColonnade.Adult.selectedIndex].value + '&Child=' + document.reservationsFormColonnade.Child[document.reservationsFormColonnade.Child.selectedIndex].value;	
			__utmLinker(myBookingLink);
			//omniture code
			var s=s_gi('thaycolonnade'); s.linkTrackVars='prop1,eVar1,events'; s.events='event1'; s.prop1='Reservation Widget'; s.eVar1='Reservation Widget'; s.tl(this,'o','Reservation Widget');
			
			return false;
		}
	}
function reservationsNavLink(myHREF)
	{
		var s=s_gi('thaycolonnade'); 
		s.linkTrackVars='prop1,eVar1,events'; 
		s.events='event1'; 
		s.prop1='Reservation Nav'; 
		s.eVar1='Reservation Nav'; 
		s.tl(this,'o','Reservation Nav');
		__utmLinker(myHREF);
		
		return false;		
	}
function MM_openBrWindow(theURL,winName,features) { //v2.0
   //__utmLinkPost(theURL);
   //window.open(theURL,winName,features);
   __utmLinker(theURL)
}






var version4 = (navigator.appVersion.charAt(0) >= 4);
var popupHandle;
function closePopup() {
if(popupHandle != null && !popupHandle.closed) popupHandle.close()
}


function displayPopup(position,url,name,height,width,evnt)
{
// Nannette Thacker http://www.shiningstar.net
// position=1 POPUP: makes screen display up and/or left,
//    down and/or right
// depending on where cursor falls and size of window to open
// position=2 CENTER: makes screen fall in center

var properties = "toolbar=0,location=0,height="+height
properties = properties+",width="+width

var leftprop, topprop, screenX, screenY, cursorX, cursorY, padAmt

if(navigator.appName == "Microsoft Internet Explorer")
{
	screenY = document.body.offsetHeight
	screenX = window.screen.availWidth
}
else
{ // Navigator coordinates
//		screenY = window.outerHeight
//		screenX = window.outerWidth
	// change made 3/16/01 to work with Netscape:
		screenY = screen.height;
		screenX = screen.width;
}

if(position == 1)	// if POPUP not CENTER
{
	cursorX = evnt.screenX
	cursorY = evnt.screenY
	padAmtX = 10
	padAmtY = 10
	
	if((cursorY + height + padAmtY) > screenY)	
	// make sizes a negative number to move left/up
	{
		padAmtY = (-30) + (height*-1);	
		// if up or to left, make 30 as padding amount
	}
	if((cursorX + width + padAmtX) > screenX)
	{
		padAmtX = (-30) + (width*-1);	
		// if up or to left, make 30 as padding amount
	}

	if(navigator.appName == "Microsoft Internet Explorer")
	{
		leftprop = cursorX + padAmtX
		topprop = cursorY + padAmtY
	}
	else
	{ // adjust Netscape coordinates for scrolling
		leftprop = (cursorX - pageXOffset + padAmtX)
		topprop = (cursorY - pageYOffset + padAmtY)
	}
}
else	// CENTER
{
	leftvar = (screenX - width) / 2
	rightvar = (screenY - height) / 2
		
	if(navigator.appName == "Microsoft Internet Explorer")
	{
		leftprop = leftvar
		topprop = rightvar
	}
	else
	{ // adjust Netscape coordinates for scrolling
		leftprop = (leftvar - pageXOffset)
		topprop = (rightvar - pageYOffset)
	}
}

if(evnt != null)
{
properties = properties+",left="+leftprop
properties = properties+",top="+topprop
}
closePopup()
popupHandle = open(url,name,properties)
}

function calcMonth(selectedValue)	
	{
		var todaysDate 	= 	new Date();
		var todaysYear 	= 	todaysDate.getFullYear();
		var baseDate 	= 	new Date(todaysYear, todaysDate.getMonth(), 1);
		var myMonth 	= 	(baseDate.getMonth()*1)+(selectedValue*1) - 1;
		var myYear 		= 	todaysYear;
		
		if(myMonth > 12)
			{
				myMonth = myMonth - 12;
				myYear = (todaysYear*1) + (1*1);
			}
		
		//calculate the number of days in this month/year
		return days_in_month(myYear,myMonth);
	}

function reloadSelectStart(selectCount)
	{
		var myDayField	=	window.document.form1.day1;
		//clear out the current field
		for (var i = myDayField.length; i >= 0; i--)
			{
			myDayField.options[i] = null;
			}
		//reload the field
		for (var t = 1; t <= selectCount; t++)
			{
				SubTopic = new Option( t, t, false, false );
				myDayField.options[t-1] = SubTopic;
			}
	}
function reloadSelectEnd(selectCount)
	{
		var myDayField	=	window.document.form1.day2;
		//clear out the current field
		for (var i = myDayField.length; i >= 0; i--)
			{
			myDayField.options[i] = null;
			}
		//reload the field
		for (var t = 1; t <= selectCount; t++)
			{
				SubTopic = new Option( t, t, false, false );
				myDayField.options[t-1] = SubTopic;
			}
	}
	
function days_in_month (year, month) 
	{
		return 32 - new Date(year, month, 32).getDate();
	}

//check to see if the correct number of days are loaded into the day field for the selected month

function validateStart()
	{
		//setup the base values
		var myStartField	=	window.document.form1.month1;
		var myStartDayField	=	window.document.form1.day1;
		var myStartValue	=	myStartField[myStartField.selectedIndex].value;
		//calculate the current month selected and the number of days in that month
		var startDays		=	calcMonth(myStartValue);
		//if days != select box THEN update it
		if(startDays 		!= 	myStartDayField.length)
			{
				//alert('The wrong number of days are in the select box: ' + startDays + ' ' + window.document.form1.day2.length)
				//store the selected index to re apply it later
				var currentIndex = myStartDayField.selectedIndex;
				//reload the select box with the correct number of days
				reloadSelectStart(startDays);
				//reset the selected index
				if( (currentIndex+1) > (startDays))
					{
						myStartDayField.selectedIndex = (startDays*1) - (1*1);
					}
				else
					{
						myStartDayField.selectedIndex = currentIndex;
					}
				
			}
	}

function validateEnd()
	{
		//setup the base values
		var myEndField		=	window.document.form1.month2;
		var myEndDayField	=	window.document.form1.day2;
		var myEndValue		=	myEndField[myEndField.selectedIndex].value;
		//calculate the current month selected and the number of days in that month
		var endDays			=	calcMonth(myEndValue);
		//if days != select box THEN update it
		if(endDays 			!= 	myEndDayField.length)
			{
				//alert('The wrong number of days are in the select box: ' + startDays + ' ' + window.document.form1.day2.length)
				//store the selected index to re apply it later
				var currentIndex = myEndDayField.selectedIndex;
				//reload the select box with the correct number of days
				reloadSelectEnd(endDays);
				//reset the selected index
				if( (currentIndex+1) > (endDays))
					{
						myEndDayField.selectedIndex = (endDays*1) - (1*1);
					}
				else
					{
						myEndDayField.selectedIndex = currentIndex;
					}
				
			}
	}


function CheckDates()
{
    if (window.document.form1.month2.selectedIndex < window.document.form1.month1.selectedIndex)
    {
		window.document.form1.month2.selectedIndex=window.document.form1.month1.selectedIndex;
    }
    if (window.document.form1.day2.selectedIndex <= window.document.form1.day1.selectedIndex && window.document.form1.month1.selectedIndex == window.document.form1.month2.selectedIndex)
    {
		if (window.document.form1.day1.selectedIndex+2 <= window.document.form1.day1.length)
		{
		window.document.form1.day2.selectedIndex=window.document.form1.day1.selectedIndex+1;
		}
		else
		{
		window.document.form1.day2.selectedIndex=window.document.form1.day1.selectedIndex;
		}
    }
	
	validateStart();
	validateEnd();
}

function getValue()

{
	var bookingLink = "https://reservations.synxis.com/XBE/rez.aspx?Hotel=2&Chain=2";
	var dateformat = "US";
	var err = 0;
	var errMSG = "Please check the following fields:";
	
	var paramAdult = 2;
	var paramChild = 0;
	var paramPromo = '';
	var paramGroup = '';
	
	//check to see if all of the fields have been selected
	
	todaysDate = new Date();
	todaysYear = todaysDate.getFullYear();
	
	//string dates
	AymValue = document.form1.month1[document.form1.month1.selectedIndex].value;
	AdValue = document.form1.day1[document.form1.day1.selectedIndex].value;
	DymValue = document.form1.month2[document.form1.month2.selectedIndex].value;
	DdValue = document.form1.day2[document.form1.day2.selectedIndex].value;
	baseDate = new Date(todaysYear, todaysDate.getMonth(), 1);
	//assemble the string dates first and then test their validity
	ArrivalDate_StringTemp_Day = AdValue;
	ArrivalDate_StringTemp_Month = (baseDate.getMonth()*1)+(AymValue*1);
	if(ArrivalDate_StringTemp_Month > 12)
		{
		ArrivalDate_StringTemp_Year = (todaysYear*1) + (1*1);
		ArrivalDate_StringTemp_Month = ArrivalDate_StringTemp_Month - 12;
		}
	else
		{
		ArrivalDate_StringTemp_Year = todaysYear;
		}
	ArrivalDate_StringTemp 		=  ArrivalDate_StringTemp_Month + "/" + ArrivalDate_StringTemp_Day + "/" + ArrivalDate_StringTemp_Year;
	//alert(ArrivalDate_StringTemp);
	if(!isDate(ArrivalDate_StringTemp))
				{err = 1; errMSG = errMSG + "\nYour Arrival Date is not valid";}
	//assemble the depart date string
	DepartureDate_StringTemp_Day = DdValue;
	DepartureDate_StringTemp_Month = (baseDate.getMonth()*1)+(DymValue*1);
	if(DepartureDate_StringTemp_Month > 12)
		{
		DepartureDate_StringTemp_Year = (todaysYear*1) + (1*1);
		DepartureDate_StringTemp_Month = DepartureDate_StringTemp_Month - 12;
		}
	else
		{
		DepartureDate_StringTemp_Year = todaysYear;
		}
	DepartureDate_StringTemp 	=  DepartureDate_StringTemp_Month + "/" + DepartureDate_StringTemp_Day + "/" + DepartureDate_StringTemp_Year;
	if(!isDate(DepartureDate_StringTemp))
				{err = 1; errMSG = errMSG + "\nYour Departure Date is not valid";}
	//these are the real dates
	ArrivalDate = new Date(todaysYear, (baseDate.getMonth()*1)+(AymValue*1)-(1*1) , AdValue);
	DepartureDate = new Date(todaysYear, (baseDate.getMonth()*1)+(DymValue*1)-(1*1), DdValue);
	TotalDays = (( (DepartureDate.getTime() * 1) - (ArrivalDate.getTime() * 1) ) / (86400000));
	
	if (ArrivalDate.getYear()>2000)
		{
		ArrivalDate_String =  ((ArrivalDate.getMonth()*1)+(1*1))+ "/" + AdValue + "/" + ArrivalDate.getYear();
		DepartureDate_String = ((DepartureDate.getMonth()*1)+(1*1)) + "/" + DdValue + "/" + DepartureDate.getYear();
		}
	else
		{
		ArrivalDate_String =  ((ArrivalDate.getMonth()*1)+(1*1)) + "/" + AdValue + "/" + ArrivalDate.getFullYear();
		DepartureDate_String = ((DepartureDate.getMonth()*1)+(1*1)) + "/" + DdValue + "/" + DepartureDate.getFullYear();
		}
	//alert(ArrivalDate + ' ' + ArrivalDate_String + ' ' + isDate(ArrivalDate_String)); 
	//test the other possible scenarios
	if(err == 0)
		{
		//test the dates
			//is the arrival date legitimate
			
			//if(!isDate(ArrivalDate_String))
				//{err = 1; errMSG = errMSG + "\nYour Arrival Date is not valid";}
			//is the departure date legitimate
		//	if(!isDate(DepartureDate_String))
			//	{err = 1; errMSG = errMSG + "\nYour Departure Date is not valid";}
		//if the dates are legitimate test to see if the arrival is before the departure
		//if( (DepartureDate <= ArrivalDate) )
			//{err = 1; errMSG = errMSG + "\nYour Arrival Date must be prior to your Departure Date";}
		//test to see if the dates are in the furture
		//if( (DepartureDate < todaysDate) || (ArrivalDate < todaysDate))
			//{err = 1; errMSG = errMSG + "\nYour must select dates in the future";}
		//check to see if the total number of days is gt 20
		if(TotalDays > 20)
			{err = 1; errMSG = errMSG + "\nThe maximum number of nights is 20";}
		//if after all of that there is an error, show the message and return false to the form
		
		}
	
	//if there are any errors show the error messages
	if(err == 1)
		{
			alert(errMSG);
			//return false;
		}
	
	//no errors, send them to the booking engine
	else
	{
		if (dateformat=="euro")
		{
			if (ArrivalDate.getYear()>2000)
			{	
			ArrivalDate_String =  AdValue + "/" + ((ArrivalDate.getMonth()*1)+(1*1)) + "/" + ArrivalDate.getYear();
			DepartureDate_String = DdValue + "/" + ((DepartureDate.getMonth()*1)+(1*1)) + "/" + DepartureDate.getYear();
			}
			else
			{
			ArrivalDate_String =  AdValue + "/" + ((ArrivalDate.getMonth()*1)+(1*1)) + "/" + ArrivalDate.getFullYear();
			DepartureDate_String = DdValue + "/" + ((DepartureDate.getMonth()*1)+(1*1)) + "/" + DepartureDate.getFullYear();
			}
		}

		
		myBookingLink = bookingLink + "&arrive=" + escape(ArrivalDate_String) + "&depart=" + escape(DepartureDate_String) + "&Adult=" + paramAdult + "&Child=" + paramChild + "&Promo=" + paramPromo + "&Group=" + paramGroup;
		//__utmLinkPost(myBookingLink);
		__utmLinker(myBookingLink)
		//open the new window
		//window.open(myBookingLink,'Synxis_Colonnade','toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes,height=650,width=850');
		//return false;
	}
	
	
		
}			
function popupPostcard(href,width,height,scroll)
			{
			postCard= window.open(href,'myPostcard','resizable=no,toolbar=no,left=200,top=200,status=no,location=no,height=' + height + ',width=' + width + ',scrollbars=' + scroll + "'");
			};



$(document).ready(function() {
	$('#arrive').datepicker({showAnim: 'slideDown', minDate: new Date(), dateFormat: 'm/dd/yy', showButtonPanel: true, showOn: 'both', buttonImage: '/i/SITE_080130_13165265_U51YS/templates/btn_cal.gif', buttonImageOnly: true }).change(function(){
		var secondsInADay = 1000*60*60*24;
		$('#depart').datepicker("option",{
			/* Set the Minimum Date to this guys Days ahead plus 1 */
			minDate: Math.ceil((new Date(this.value) - new Date())/secondsInADay)- -1
		});
		/* Change the Date to that Date */
		if(isDate(this.value))	
			{$('#depart').datepicker("setDate", new Date(new Date(this.value)- -secondsInADay));}
		
	}); 
	$('#depart').datepicker({showAnim: 'slideDown', minDate: new Date(), dateFormat: 'm/dd/yy', showButtonPanel: true, showOn: 'both', buttonImage: '/i/SITE_080130_13165265_U51YS/templates/btn_cal.gif', buttonImageOnly: true });
	if(!$('#PromoCode').text().match(/lorem/i))$('[name=Promo]').val($('#PromoCode').text());
	if(!$('#GroupCode').text().match(/lorem/i))$('[name=Group]').val($('#GroupCode').text());
} );


init = function(){
	
$(document).ready(function(){
if( (!document.cookie.match(/hidefeedback/)) && (!window.location.href.match("postcard")) )
	$(document.body).append('<div id="feedbackButton"></div>');
	var createForm = function(){
		if ($('#feedbackContainer').length==0){
			$(document.body).append('<div id="feedbackContainer"></div>');
			$('#feedbackContainer').css({
				top:		($(window).height()-290+$(document).scrollTop())+'px',
				left:		($(window).width()-415+$(document).scrollLeft())+'px',
				background:	'#FFFFFF',
				border:		'1px solid #918A87',
				height:		'250px',
				width:		'395px',
				position:	'absolute'
			}).html('<form id="feedbackForm"><table style="padding:5px" class="copy txt"><td>Name:</td><td><input id="nameField" style="float:left;"><a href="#" style="float:right;" id="hideLink">Hide</a></td></tr><tr><td>Phone:</td><td><input id="phoneField"></td></tr><tr><td>Email:</td><td><input id="emailField"></td></tr><tr><td colspan="2">Comments:<br><textarea id="commentsField" style="height:85px;margin-left:20px;width:335px;" /></td></tr><tr><td colspan="2"><input type="checkbox" id="optinField"><font style="font-size:1em;"> Yes, I would like to receive exclusive offers via email.</font></td></tr><tr><td colspan="2" align="right"><input type="button" value="Cancel" id="cancelButton"> <input type="submit" value="Submit"></td></tr></table></form>').hide().fadeIn(400);
		}else{
			$('#feedbackContainer').fadeIn(400);
		}
		$('#hideLink').bind('click',function(){
			document.cookie = 'hidefeedback=true; expires=Thu, 1 Jan 2099 20:00:00 UTC; path=/';
			$('#feedbackContainer').fadeOut(400);
			$('#feedbackButton').fadeOut(400);
			return false;
		});
		var removeForm = function(e){
			if (
				($(e.target).parents('#feedbackContainer').length == 0 || e.target.id == 'cancelButton')
				&& $(e.target).parents('#feedbackButton').length == 0
				&& e.target.id != 'feedbackContainer'
				&& e.target.id != 'feedbackButton'
			){
				$('#feedbackContainer').fadeOut(400);
				$(document).unbind('click',removeForm);
				$('#feedbackButton').bind('click',createForm);
			}
		};
		$('#feedbackForm').submit(function(){
			$.soap.request({
				url: '/cfcs/feedbackform.cfc',
				method: 'submitFeedbackForm', 
				params: {
					Name:	$('#nameField')[0].value,
					Email:	$('#emailField')[0].value,
					Phone:	$('#phoneField')[0].value,
					Comments:	$('#commentsField')[0].value,
					OptIn:	($('#optinField')[0].checked?1:0)
				},
				callback: function(r){
				}
			});
			document.cookie = 'hidefeedback=true; expires=Thu, 1 Jan 2099 20:00:00 UTC; path=/';
			$('#feedbackContainer').fadeOut(400);
			$('#feedbackButton').fadeOut(400);
			return false;
		});
		$(document).bind('click',removeForm);
		$('#feedbackButton').unbind('click',createForm);
	};
	$('#feedbackButton').css({
			top:	($(window).height()-35+$(document).scrollTop())+'px',
			left:	($(window).width()-100+$(document).scrollLeft())+'px',
			position:'absolute',cursor:'pointer'}).html('<img src="/i/SITE_080130_13165265_U51YS/templates/btn_feedback.gif">').click(createForm);
	var rePos = function(){
		$('#feedbackButton').stop({clearQueue: true, gotoEnd:true}).animate({
			top:	($(window).height()-35+$(document).scrollTop())+'px',
			left:	($(window).width()-100+$(document).scrollLeft())+'px'
		},250);
		$('#feedbackContainer').stop({clearQueue: true, gotoEnd:true}).animate({
			top:		($(window).height()-290+$(document).scrollTop())+'px',
			left:		($(window).width()-415+$(document).scrollLeft())+'px'
		},250);
	};
	rePos();
	$(window).bind('scroll resize',rePos);
});




/* 
 * 
 * Generic Soap Function for JQuery for calling CFC's for JavaScript
 * 
 * Derek Bredensteiner 11/23/2008
 * 
 */
 
jQuery.soap = {
	// Our static wsdlCache which will be used and referenced later
	wsdlCache: {},
	translateNode : function (node, types){
		if (node == null)
			return null;
		// In some cases, empty spaces end up as nodes, Over here we don't care much for wide open spaces
		if (node.nodeType == 3
			&& typeof(node.nodeValue)=='string' 
			&& node.nodeValue.match(/^[\n 	]{1,}$/) )
				return null;
		if (node.nodeType == 3 || node.nodeType == 4){
			var v = node.nodeValue;
			switch((types[node.nodeName]+"").replace(/^[^:]*:/,"")){
				default:
					var t = v + "";
					// See if we can make it a valid Date/Time
					t = t.replace(/\.\d*/gi,"");
					t = t.replace(/T/gi," ");
					t = t.replace(/-/gi,"/");
					t = t.replace(/ \/(\d\d\d\d)$/gi," -$1");
					t = t.replace(/\/(\d\d):(\d\d)$/gi," -$1$2");
					var d = new Date();
					d.setTime(Date.parse(t));
					if(d!='Invalid Date'&&d!='NaN') return d;
					// And if not, just set it to whatever it is literally
					return (v != null) ? v + "" : "";
				case "string":
					return (v != null) ? v + "" : "";
				case "boolean":
					// If it's "true" or "1" and the type is boolean
					return (v + "").match(/^(true|1)$/i) ? true : false;
				case "int":
				case "long":
					return (v != null) ? parseInt(v + "", 10) : 0;
				case "double":
					return (v != null) ? parseFloat(v + "") : 0;
			}
		}
		if (node.childNodes.length == 1 && (node.childNodes[0].nodeType == 3 || node.childNodes[0].nodeType == 4))
			return this.translateNode(node.childNodes[0], types);
		// If the type has "arrayof" in it, we know *for sure* that it's an array
		if (types[node.nodeName] && types[node.nodeName].match(/(arrayof)/i)){
			var l = new Array();
			for (var i = 0; i < node.childNodes.length; i++){
				var p = this.translateNode(node.childNodes[i], types);
				if (p) l[l.length] = p;
			}
			return l;
		}else{
			// But down here we are less sure that it's an array or an object or ... whatever
			var obj = null;
			if (node.hasChildNodes())
				obj = new Object();
			for (var i = 0; i < node.childNodes.length; i++){
				var p = this.translateNode(node.childNodes[i], types);
				var nodeName = node.childNodes[i].nodeName.replace(/^[^:]*:/,'');
				if (p){
					if(!obj[nodeName]&&!obj.length)
						obj[nodeName] = p;
					else if (obj.length)
						obj[obj.length] = p;
					else{
						// This means we have repeated nodes with the same name, so it's probably supposed to be an array
						var l = new Array;
						l[l.length]=obj[nodeName];
						obj=l;
						obj[obj.length] = p;
					}
				}
			}
			return obj;
		}
		return null;
	},
	getElementsByTagName : function(wsdl,tagName){
		if(typeof(tagName)!='object')
			tagName = [tagName];
		var tags = [];
		var reg = "<([^ <]*)("+tagName[0];
		for(var i = 1; i < tagName.length; i++){
			reg+="|"+tagName[i];
		}
		reg+=")";
		var tag = wsdl.responseText.match(new RegExp(reg,"i"));
		if(tag&&tag.length>1){
			tags = wsdl.responseXML.getElementsByTagName(tag[1]+tag[2]);
			if (tags.length==0)
				tags = wsdl.responseXML.getElementsByTagName(tag[2]);
		}
		return tags;
	},
	translateType : function(node,wsdl,depth){
		if (!depth) var depth = 0;
		if (depth>10)return null;
		if (node.hasChildNodes()){		
			var obj = {};
			for(var i = 0; i < node.childNodes.length; i++){
				var p = this.translateType(node.childNodes[i],wsdl,depth+1);
				if(p){
					if (node.childNodes[i].attributes && node.childNodes[i].attributes.getNamedItem("name"))
						obj[node.childNodes[i].attributes.getNamedItem("name").nodeValue] = p;
					else if (node.childNodes[i].attributes.length>0)
						obj[node.childNodes[i].nodeName] = p;
					else
						obj = p;
					
				}
			}
			return obj;
		}else if (node.attributes){
			var nodeType = (
				node.attributes.getNamedItem("message") ? 
				node.attributes.getNamedItem("message").nodeValue.replace(/^[^:]*:/,"") :
				(node.attributes.getNamedItem("type") ? 
				node.attributes.getNamedItem("type").nodeValue.replace(/^[^:]*:/,"") :
				(node.attributes.getNamedItem("element") ? 
				node.attributes.getNamedItem("element").nodeValue.replace(/^[^:]*:/,"") :
				''))
			);
			var merge = function(args1,args2){
				for (var i = 0; i < args2.length; i++){
					args1.push(args2[i]);
				}
				return args1;
			};
			var tags = merge(merge(merge([],
				this.getElementsByTagName(wsdl,'message')),
				this.getElementsByTagName(wsdl,'complexType')),
				this.getElementsByTagName(wsdl,'element'));
			
			for(var i = 0; i < tags.length; i++){
				if (tags[i].attributes.getNamedItem("name")
					&& tags[i].attributes.getNamedItem("name").nodeValue == nodeType)
					return this.translateType(tags[i],wsdl,depth+1);
			}
			return nodeType;
		}else{
			return null;
		}
		
	},
	getOperations : function(o){
		// Check the availibility of a Cache of the specified wsdl from url
		if(this.wsdlCache[o.url]){
			var wsdl = this.wsdlCache[o.url];
			var operations = {};
			var tags = this.getElementsByTagName(wsdl,'operation');
			for(var i = 0; i < tags.length; i++){
				if(tags[i].attributes.getNamedItem("name") != null
					&& !operations[tags[i].attributes.getNamedItem("name").nodeValue]
					)
						operations[tags[i].attributes.getNamedItem("name").nodeValue] = this.translateType(tags[i],wsdl);
			}
			if(o.callback) o.callback(operations);
		}else{
			// Get the wsdl and Cache it, then continue with the request
			// passThis because this changes once we get to the callback
			var passThis = this;
			$.ajax({
			  type: "GET",
			  url: o.url.replace(/^http:/,'services/proxy.php?http:').replace(/([^?][^w][^s][^d][^l])$/i,"$1?wsdl"),
			  complete: function(r){
					passThis.wsdlCache[o.url]=r;
					passThis.getOperations(o);
			  }
			});
		}
	},
        getTypes : function(wsdl){
		var types = [];
		var tags = this.getElementsByTagName(wsdl,['element','part']);
		for(var i = 0; i < tags.length; i++){
			if(tags[i].attributes.getNamedItem("name") != null && tags[i].attributes.getNamedItem("type") != null) 
				types[tags[i].attributes.getNamedItem("name").nodeValue] = tags[i].attributes.getNamedItem("type").nodeValue;
		}
		return types;
	},
        serialize : function(o){
		var s = "";
		switch(typeof(o)){
			case "string":
				s += o.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
				break;
			case "number":
			case "boolean":
				s += o.toString();
				break;
			case "object":
				if (o!=null){
					if(typeof(o)=='object' && typeof(o.dateFormat)=='function'){
						s += o.dateFormat('Y-m-d\\TH:i:sO');
					}else if(typeof(o)=='object' && typeof(o.length)=='number'){
						for(var p=0;p<o.length;p++)
							s += "<" + p + ">" + this.serialize(o[p]) + "</" + p + ">";
					}else
						for(var p in o)
							s += "<" + p + ">" + this.serialize(o[p]) + "</" + p + ">";
					}
				break;
			default:
				break;
		}
		return s;
	},
	request : function (o){
		// Check the availibility of a Cache of the specified wsdl from url
		if(this.wsdlCache[o.url]){
			var wsdl = this.wsdlCache[o.url];
			// Get our NameSpace
			var ns = wsdl.responseXML.documentElement.attributes.getNamedItem("targetNamespace").nodeValue;
			if(this.defaultHeaders&&!o.headers) o.headers = this.defaultHeaders;
			// passThis because this changes once we get to the callback
			var passThis = this;
			 $.ajax({
			    type: "POST",
			    url: this.getElementsByTagName(wsdl,"address")[0].attributes.getNamedItem("location").nodeValue,
				complete: function(r){
					r=passThis.translateNode(r.responseXML.lastChild,passThis.getTypes(wsdl));
					if (typeof(r)=='object'&&r['return']) r=r['return'];
					
					// Specifics for Coldfusion Body/Response/Return
					if(typeof(r)=='object'&&typeof(r.Body)=='object'&&typeof(r.Body[o.method+'Response'])=='object'&&typeof(r.Body[o.method+'Response'][o.method+'Return'])=='object')
						var r = r.Body[o.method+'Response'][o.method+'Return'];
					
					// Specifics for converting a coldfusion query response into something more usable
					if (typeof(r)=='object'&&typeof(r.columnList)=='object'){
						var allRows = [];
						if(typeof(r.data[0])!='object')r.data=[r.data]; // Fix for only one record returned in different format
						for(var i = 0; i< r.data.length; i++){
							var thisRow = {};
							for( var j = 0; j < r.columnList.length; j++){
								thisRow[r.columnList[j]] = r.data[i][j];
							}
							allRows.push(thisRow);
						}
						r=allRows;
					}
					
					
					
					// Specifics for converting a coldfusion object response into something more usable
					if (typeof(r)=='object'&&typeof(r.length)=='number'&&typeof(r[0])=='object'&&typeof(r[0].key)!='undefined'){
						var allRows = {};
						for(var i = 0; i< r.length; i++){
							if (typeof(r[i])=='object')
								allRows[r[i].key] = r[i].value;
						}
						r=allRows;
					}
					
					if(o.callback) o.callback(r);
				},
				beforeSend: function(req) {
					req.setRequestHeader("SOAPAction",ns.replace(/([^\/]$)/,"$1/")+o.method);
				},
				data: "<?xml version=\"1.0\" encoding=\"utf-8\"?><soap:Envelope "
				+ "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "
				+ "xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" "
				+ "xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"
				+ (o.headers?"<soap:Header>"+this.serialize(o.headers)+"</soap:Header>":"")
				+ "<soap:Body>"
				+ "<" + o.method + " xmlns=\"" + ns + "\">"
				+ this.serialize(o.params)
				+ "</" + o.method + "></soap:Body></soap:Envelope>",
				processData: false
			});
		}else{
			// Get the wsdl and Cache it, then continue with the request
			// passThis because this changes once we get to the callback
			var passThis = this;
			$.ajax({
			  	type: "GET",
				url: o.url.replace(/^http:/,'services/proxy.php?http:').replace(/([^?][^w][^s][^d][^l])$/i,"$1?wsdl"),
				complete: function(r){
					passThis.wsdlCache[o.url]=r;
					passThis.request(o);
				}
			});
		}
	}
};

}

window.onload = init;

/**
 * --------------------------------------------------------------------
 * jQuery-Plugin "pngFix"
 * Version: 1.1, 11.09.2007
 * by Andreas Eberhard, andreas.eberhard@gmail.com
 *                      http://jquery.andreaseberhard.de/
 *
 * Copyright (c) 2007 Andreas Eberhard
 * Licensed under GPL (http://www.opensource.org/licenses/gpl-license.php)
 */
eval(function(p,a,c,k,e,r){e=function(c){return(c<62?'':e(parseInt(c/62)))+((c=c%62)>35?String.fromCharCode(c+29):c.toString(36))};if('0'.replace(0,e)==0){while(c--)r[e(c)]=k[c];k=[function(e){return r[e]||e}];e=function(){return'([237-9n-zA-Z]|1\\w)'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(s(m){3.fn.pngFix=s(c){c=3.extend({P:\'blank.gif\'},c);8 e=(o.Q=="t R S"&&T(o.u)==4&&o.u.A("U 5.5")!=-1);8 f=(o.Q=="t R S"&&T(o.u)==4&&o.u.A("U 6.0")!=-1);p(3.browser.msie&&(e||f)){3(2).B("img[n$=.C]").D(s(){3(2).7(\'q\',3(2).q());3(2).7(\'r\',3(2).r());8 a=\'\';8 b=\'\';8 g=(3(2).7(\'E\'))?\'E="\'+3(2).7(\'E\')+\'" \':\'\';8 h=(3(2).7(\'F\'))?\'F="\'+3(2).7(\'F\')+\'" \':\'\';8 i=(3(2).7(\'G\'))?\'G="\'+3(2).7(\'G\')+\'" \':\'\';8 j=(3(2).7(\'H\'))?\'H="\'+3(2).7(\'H\')+\'" \':\'\';8 k=(3(2).7(\'V\'))?\'float:\'+3(2).7(\'V\')+\';\':\'\';8 d=(3(2).parent().7(\'href\'))?\'cursor:hand;\':\'\';p(2.9.v){a+=\'v:\'+2.9.v+\';\';2.9.v=\'\'}p(2.9.w){a+=\'w:\'+2.9.w+\';\';2.9.w=\'\'}p(2.9.x){a+=\'x:\'+2.9.x+\';\';2.9.x=\'\'}8 l=(2.9.cssText);b+=\'<y \'+g+h+i+j;b+=\'9="W:X;white-space:pre-line;Y:Z-10;I:transparent;\'+k+d;b+=\'q:\'+3(2).q()+\'z;r:\'+3(2).r()+\'z;\';b+=\'J:K:L.t.M(n=\\\'\'+3(2).7(\'n\')+\'\\\', N=\\\'O\\\');\';b+=l+\'"></y>\';p(a!=\'\'){b=\'<y 9="W:X;Y:Z-10;\'+a+d+\'q:\'+3(2).q()+\'z;r:\'+3(2).r()+\'z;">\'+b+\'</y>\'}3(2).hide();3(2).after(b)});3(2).B("*").D(s(){8 a=3(2).11(\'I-12\');p(a.A(".C")!=-1){8 b=a.13(\'url("\')[1].13(\'")\')[0];3(2).11(\'I-12\',\'none\');3(2).14(0).15.J="K:L.t.M(n=\'"+b+"\',N=\'O\')"}});3(2).B("input[n$=.C]").D(s(){8 a=3(2).7(\'n\');3(2).14(0).15.J=\'K:L.t.M(n=\\\'\'+a+\'\\\', N=\\\'O\\\');\';3(2).7(\'n\',c.P)})}return 3}})(3);',[],68,'||this|jQuery||||attr|var|style||||||||||||||src|navigator|if|width|height|function|Microsoft|appVersion|border|padding|margin|span|px|indexOf|find|png|each|id|class|title|alt|background|filter|progid|DXImageTransform|AlphaImageLoader|sizingMethod|scale|blankgif|appName|Internet|Explorer|parseInt|MSIE|align|position|relative|display|inline|block|css|image|split|get|runtimeStyle'.split('|'),0,{}))

if($())
	$(document).ready(function(){
		$('.CollapseTitle').bind('click',function(){
			var el = $(this).next();
			if(el.is(':hidden')){
				$(this).next().slideDown(250);
				$(this).addClass('CollapseHidden');
			}else{
				$(this).next().slideUp(250);
				$(this).removeClass('CollapseHidden');
			}
		});
		$('.CollapseTitle [name='+window.location.hash.split('#').join('')+']').click();
	});


$(document).ready(function(){
    $('#floatIMG img').after('<br style="clear:both;"><div class="clickHere"><img src="/photolink.png" height="26" width="151" border="0" alt="Click here to view our Image Gallery" /></div>');
	$('div.clickHere').show();
	$(document).pngFix();
	$('div.clickHere').hide();
    $('td#floatIMG').mouseenter(function(){
        $('div.clickHere').fadeIn(300);
    }).mouseleave(function(){
        $('div.clickHere').fadeOut(300);
    }).click(function(){
		document.location.href='/gallery/';
	});
});
