var agt=navigator.userAgent.toLowerCase();
var is_major = parseInt(navigator.appVersion);
var is_minor = parseFloat(navigator.appVersion);
var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
            && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
            && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));

function DisplayDiv(name, disp)
{
	if (document.all[name] == null)
		return;
	if (disp == 0)
		document.all[name].style.display = "none";
	else if (disp == 1)
		document.all[name].style.display = "";
}

function noop()
{

}



function ShowDialog(url, cache, center, scroll, left, top, width, height)
{
	if (true)
	{
		if (cache == 0)
		{
			var d = new Date();
			if (url.indexOf('?') == -1)
				url = url + "?pageversion=" + d.getTime();
			else
				url = url + "&pageversion=" + d.getTime();
		}
		if (center == 1)
		{
			left = (screen.availWidth - width)/2;
			top = (screen.availHeight - height)/2;
		}
		var features = "toolbar=0,scrollbars=" + scroll + ",left=" + left + ",top=" + top + ",height=" + height + ",width=" + width + "";
		window.open(url, "", features);
	}
}

function ShowDialogV2(url, cache, center, scroll, left, top, width, height, advancedFeatures)
{
	if (true)
	{
		if (cache == 0)
		{
			var d = new Date();
			if (url.indexOf('?') == -1)
				url = url + "?pageversion=" + d.getTime();
			else
				url = url + "&pageversion=" + d.getTime();
		}
		if (center == 1)
		{
			left = (screen.availWidth - width)/2;
			top = (screen.availHeight - height)/2;
		}
		var features = "toolbar=0,scrollbars=" + scroll + ",left=" + left + ",top=" + top + ",height=" + height + ",width=" + width + "";
		if (advancedFeatures != "")
			features = features + "," + advancedFeatures;
		window.open(url, "", features);
	}
}


function TermsAndConditions()
{
	ShowDialog("Terms.aspx", 0, 1, 1, 0, 0, 760, 540);
}

function ViewContent(doc, title)
{
	var url = "Terms.aspx?Page=1";
	if (doc != null)
		url += "&Doc=" + doc;
	if (title != null)
		url += "&Title=" + title;
	ShowDialog(url, 0, 1, 1, 0, 0, 760, 540);
}



function GoToURL(url)
{
	window.location = url;
}
