﻿function CancelAction()
{
	history.back(-1);
}

function RepeatString(txt, number)
{
	var ret = ""
	for (i = 0; i < number; i++)
	{
		ret += txt;
	}
	return ret;
}

function ShowConfirm(title, content)
{
	var output = "";
	output += title;
	output += RepeatString("\n", 2);
	output += content;
	if (window.confirm(output) == true)
	{
		return true;
	}
	else
	{
		return false;
	}
}

function ShowNewWindow(id, url, width, height)
{
	var prop = "";
	prop += "width=" + width + ",";
	prop += "height=" + height + ",";
	prop += "directories=0,";
	prop += "fullscreen=0,";
	prop += "location=0,";
	prop += "menubar=0,";
	prop += "resizable=0,";
	prop += "scrollbars=1,";
	prop += "titlebar=0,";
	prop += "toolbar=0,";
	prop += "top=200,";
	prop += "left=200,";
	prop += "channelmode=0,";
	window.open(url, id, prop);
}

function ShowModalDialog(url, width, height)
{
	var prop = "";
	prop += "dialogWidth:" + width + "px;";
	prop += "dialogHeight:" + height + "px;";
	prop += "center:1;";
	prop += "dialogHide:0;";
	prop += "edge:sunken;";
	prop += "help:0;";
	prop += "resizable:0;";
	prop += "scroll:1,";
	prop += "status:0,";
	prop += "unadorned:1;";
	window.showModalDialog(url, null, prop);
}

function ErrorHandle(msg, url, line)
{
	window.event.returnValue = true;
	return true;
}

window.onerror = ErrorHandle;