function setHeight(op)
{
	clearHeight();
	var bodycontentPadding = 45;
	var leftPadding = 17;
	var maincontentPadding = 30;
	var rightPadding = 0;
	//IE
	if (document.styleSheets[0].rules)
	{
		if (op != "sitemap")
		{
			if (getIEVersionNumber() == 6)
			{
				leftPadding = 0;
				bodycontentPadding = 28;
				rightPadding = -17;
			}
		}
	}

	var mainHeight = document.getElementById("bodycontent").offsetHeight;
	var leftHeight = document.getElementById("left").offsetHeight;
	var rightHeight = document.getElementById("right").offsetHeight;

	var offHeight = 0;
	//alert("mainHeight=" + mainHeight+"  leftHeight=" +leftHeight+"  rightHeight=" + rightHeight);
	offHeight = leftHeight;
	if (mainHeight > offHeight) offHeight = mainHeight;
	if (rightHeight > offHeight) offHeight = rightHeight;
	//if (offHeight<680) offHeight=680; //right image height+linkbox;

	offHeight += 50;

	if (document.getElementById('newsletter_table'))
	{
		offHeight += 50;
	}

	document.getElementById("bodycontent").style.height = (offHeight - bodycontentPadding) + "px"; //45 is the top+bottom margin/padding.
	document.getElementById("left").style.height = (offHeight - leftPadding + 19) + "px"; //45 is the top+bottom margin/padding.
	document.getElementById("right").style.height = (offHeight - rightPadding) + "px";
	document.getElementById("maincontent").style.height = (offHeight + maincontentPadding) + "px";
}

function clearHeight()
{
	document.getElementById("bodycontent").style.height = "auto";
	document.getElementById("left").style.height = "auto";
	document.getElementById("right").style.height = "auto";
	document.getElementById("maincontent").style.height = "auto";
}

function setPrivateSectionHeight()
{
	document.getElementById("bodycontent").style.height = "334px";
	document.getElementById("left").style.height = "362px";
	document.getElementById("right").style.height = "379px";
	document.getElementById("maincontent").style.height = "409px";
}


function getIEVersionNumber()
{
	var ua = navigator.userAgent;
	var MSIEOffset = ua.indexOf("MSIE ");
	if (MSIEOffset == -1)
	{
		return 0;
	} else
	{
		return parseFloat(ua.substring(MSIEOffset + 5, ua.indexOf(";", MSIEOffset)));
	}
}

function clearNewsletter(curItem)
{
	if (curItem.value == 'submit your email')
		curItem.value = '';
}

function setNewsletter(curItem)
{
	if (curItem.value == '' || curItem.value == 'submit your email')
		curItem.value = 'submit your email';
}

function checkEmail(strng)
{
	error = validateEmail(strng);
	if (error != "")
	{
		alert(error);
		return false;
	} else
		return true;
}

function validateEmail(strng)
{
	var error = "";
	if (strng == "")
	{
		error = "You didn't enter an email address.\n";
	}

	var emailFilter = /^.+@.+\..{2,3}$/;
	if (!(emailFilter.test(strng)))
	{
		error = "Please enter a valid email address.\n";
	}
	else
	{
		//test email for illegal characters
		var illegalChars = /[\(\)\<\>\,\;\:\\\"\[\]]/
		if (strng.match(illegalChars))
		{
			error = "The email address contains illegal characters.\n";
		}
	}

	return error
}

function showPopUp(page, width, height)
{
	var popUp = window.open(page, 'popup', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=yes,width=' + width + ',height=' + height);
}


function enableSearch(id)
{

	var s = 0;
	var c = 0;
	var h = 0;
	if (id == 'citydropdownlist')
	{
		s = document.getElementById("countrydropdownlist").value;
		h = document.getElementById("hoteldropdownlist").value;
	}
	else
	{
		c = document.getElementById("countrydropdownlist").value;
		s = document.getElementById("citydropdownlist").value;
		h = document.getElementById("hoteldropdownlist").value;
	}

	url = '/include/search_drop_down.asp?element_id=' + id + '&select_id=' + s + '&country_id=' + c + '&hotel_id=' + h;
	//alert(url);

	makeRequest(url, "careersdropdownlistcontainer");

}

function setHeight2()
{
	clearHeight();
	var bodycontentPadding = 45;
	var leftPadding = 17;
	var maincontentPadding = 30;
	var rightPadding = 0;
	//IE
	if (document.styleSheets[0].rules)
	{

	}

	var mainHeight = document.getElementById("bodycontent").offsetHeight;
	var leftHeight = document.getElementById("left").offsetHeight;
	var rightHeight = document.getElementById("right").offsetHeight;

	var offHeight = 0;
	//alert("mainHeight=" + mainHeight+"  leftHeight=" +leftHeight+"  rightHeight=" + rightHeight);
	offHeight = leftHeight;
	if (mainHeight > offHeight) offHeight = mainHeight;
	if (rightHeight > offHeight) offHeight = rightHeight;
	//if (offHeight<680) offHeight=680; //right image height+linkbox;
	offHeight += 50;

	document.getElementById("bodycontent").style.height = (offHeight - bodycontentPadding) + "px"; //45 is the top+bottom margin/padding.
	document.getElementById("left").style.height = (offHeight - leftPadding + 49) + "px"; //45 is the top+bottom margin/padding.
	document.getElementById("right").style.height = (offHeight - rightPadding) + "px";
	document.getElementById("maincontent").style.height = (offHeight + maincontentPadding) + "px";
}

function loadSharePrice()
{
	var sf = document.getElementById("sharefeed");

	if (sf)
	{
		url = '/include/loadShareFeed.asp';

		makeRequest(url, "sharefeed");
	}
}

function showMeetingsOptions()
{
	if (document.getElementById("meeting_event").checked == true)
	{
		document.getElementById("MEoptions").style.display = "block";
	}
	else
	{
		document.getElementById("MEoptions").style.display = "none";
	}
}

