var route_map;

//--- OPENS INTERACTIVE MAP ---//

function open_interactive_map()
{
	if(route_map == undefined)
	{
    route_map = window.open('/ride/route_map/index.html', 'route_map_win', 'menubar=no, status=no, location=no, toolbar=no, scrollbars=no, resizable=yes, width=800, height=550');
	  route_map.focus();
	}
	else if(route_map.closed)
	{
		route_map = window.open('/ride/route_map/index.html', 'route_map_win', 'menubar=no, status=no, location=no, toolbar=no, scrollbars=no, resizable=yes, width=800, height=550');
	  route_map.focus();
	}
	else
	{
		route_map.focus();
	}
}

function open_tvm()
{
  window.open('/buy_tickets/tvm/tvm_pop.html', 'tvm', 'menubar=no, status=no, location=no, toolbar=no, scrollbars=no, resizable=yes, width=500, height=400');
}

function view_attraction(attraction_url)
{
	if((this.opener == undefined) || (this.opener == null))
	{
		opener = window.open(attraction_url, 'opener_win');
	}
	else if(opener)
	{
		opener.location = attraction_url;
		opener.focus();
	}
	else
	{
		this.opener.location = attraction_url;
		this.opener.focus();
	}
}


function openWindow(websiteAddress, newWindowName, desiredWidth, desiredHeight, isResizeable)
{
	var height = window.screen.availHeight;
	var width = window.screen.availWidth;
	var leftPoint = parseInt(width / 2) - parseInt(desiredWidth / 2);
	var topPoint = parseInt(height / 2) - parseInt(desiredHeight / 2);
	
	windowOptions = "width=" + desiredWidth + ", height=" + desiredHeight + ", " + "menubar=no, status=no, location=no, toolbar=no, scrollbars=yes, resizable=no, top=" + topPoint + ", left=" + leftPoint;
	new_window = window.open(websiteAddress, newWindowName, windowOptions);
	new_window.focus();
}


function windowopen(url, name, params) {
  window.open(url, name, params);
}
