﻿function IsPreview()
{
	return (document.URL.toLowerCase().indexOf('preview=true') != -1);
}

function OpenSite(language)
{
	if(language == null)
		language = 'EN';
	var p = IsPreview();
	var url = 'Site.html?lang=' + language + ((p)?'&preview=true':'');
	//alert(url);
	window.open(url, 'PARK_Associati', 'fullscreen=yes');
};

function OpenTermsOfUse()
{
	OpenWindow("TermsOfUse.aspx", 800, 600);
};

function OpenWindow(pageUrl, width, height)
{
	var init_width = 840;
	var init_height = 600;
	if (width != null) init_width = width;
	if (height != null) init_height = height;

	var init_left = Math.floor((screen.availWidth - init_width) / 2);
	var init_top = Math.floor((screen.availHeight - init_height) / 2);

	var newWin = window.open(pageUrl,
		'_new',
		'width=' + init_width + ',height=' + init_height + ',top=' + init_top + ',left=' + init_left + ',scrollbars=yes,resizable=yes,status=no,location=no,toolbar=no');
};
