function showMap(url) {
  window.open(url, 'hotelmap', 'scrollbars=yes,status=no,resizable=yes,width=500,height=500');
}

function switchLang(lang) {
        var cururl = unescape(document.location.toString());
        var newurl = "";
        var sind = cururl.indexOf("lang=");
        if (sind != -1) {
                var eind = cururl.indexOf("&", sind);
                if (eind != -1) {
                        newurl = cururl.substring(0, sind) + "lang=" + lang + cururl.substring(eind, cururl.length);
                } else {
                        newurl = cururl.substring(0, sind) + "lang=" + lang;
                }
        } else {
        	var tmpurl = cururl.substr(7);
        	var urlarr = tmpurl.split("/");        	
        	if (urlarr[2] != undefined) {
	        	urlarr[2] = lang;
	        	newurl = "http://" + urlarr.join("/");
	        }
        }
        document.location = newurl;
}

function changeArea(code) {
  var areaPath = window.location.href;
  areaPath = areaPath.substring(0, areaPath.lastIndexOf("/"));
  if (code != '') {
  	areaPath = areaPath + '/' + code;
  }
  window.location.href = areaPath;
}

function popUpWin(url, x, y) {
	popUpWin(url, x, y, null);
}

function popUpWin(url, x, y, winName) {
	if (x == null || y == null) {
		var newWin = window.open(url, '');
	} else {
		if (winName == null) {
			winName = 'Popup';
		}
		eval ("window.open(url, winName, 'width="+x+",height="+y+",,resizable=1,scrollbars=1');");
	}	
}

function popup(url) {
	popUpWin(url, 640, 480, null);
}

function markErrorFields()
{
	if(errStr != null && errStr != "")
	{
		index = errStr.indexOf(",");
	}
	while(errStr != null && errStr != "")
	{
		if(index < 0)
		{
			errorfield = errStr;
			errStr = "";
		}
		else
		{
			errorfield = errStr.substring(0,index);
		}
		errorElement = document.getElementById(errorfield);
		lbErrorElement = eval("document.getElementById('lb_" + errorfield + "')");
		if(errorElement)
		{
			if(errorElement.type!="radio" && errorElement.type!="checkbox"){
			errorElement.className = "txt error";			
			}
		} 	
		if(lbErrorElement)
		{
			tmpLable = lbErrorElement.innerHTML;
			lbErrorElement.innerHTML = "<Strong>" + tmpLable + "</Strong>";
			lbErrorElement.className = "error";	
		}
		
		if(errStr != "")
		{
			errStr = errStr.substring(index + 1);
			index = errStr.indexOf(",");
		}
	
	}
	fnShowMenu();
}

function fnShowMenu()
{
	document.getElementById('content').style.display='inline';	
}

var isCountryDivOpen = false;

function fnRemove(fromWhere)
{
	if(fromWhere == "open")
	{
		isCountryDivOpen = true;
	}
	if(!isCountryDivOpen)
	{
		document.getElementById('regionlistHeader').style.display = "none";
		document.getElementById('frameElement').style.display = "none";
		isCountryDivOpen = true;
	}
	if(fromWhere == "no")
	{
		isCountryDivOpen = false;
	}
}

function fnPopup()
{
	if(document.getElementById('regionlistHeader').style.display == "none")
	{
		document.getElementById('regionlistHeader').style.display = "block";
		if(checkBrowser())
		{
		document.getElementById('frameElement').style.filter='progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)';
		document.getElementById('frameElement').style.display = "inline";
		}
	}
	else if(document.getElementById('regionlistHeader').style.display == "block")
	{
		document.getElementById('regionlistHeader').style.display = "none";
		document.getElementById('frameElement').style.display = "none";
	}
}
