var windowhandle=null;
var COOKIENAME="PATA";

function displayPopup(source,height,width) {
	var properties = "toolbar=0,menubar=no,scrollbars=no,location=0,height="+(height+20);
	properties = properties+",width="+(width+20);
	if (windowhandle != null && !windowhandle.closed) {
		windowhandle.close();
		windowhandle = null;
	}
	windowhandle = open(source,"Enlarge",properties);
	windowhandle.focus();
}

function MM_displayStatusMsg(what)
{
	status = what;
}

function checkexist(what) {
	var temp = getCookie(COOKIENAME);
	if (temp == null || temp == "") {
		return 0;
	}
	selected = temp.split('?');
	for (i=0;i<selected.length;i++) {
		if (selected[i] == what) {
			return 1;
		}
	}
	return 0;
}

function checkchange(what) {
	flag = 0;
	temp2 = "";
	temp = getCookie(COOKIENAME);
	if (temp != null && temp != "") {
		var selected = temp.split('?');
		for (i=0;i<selected.length;i++) {
			if (selected[i] == what) {
				flag = 1;
			} else {
				if (i!=0) {
					temp2 += "?";
				}
				temp2 += selected[i];
			}
		}
		if (flag == 0) {
			temp2 += "?"+what;
		}
	} else {
		temp2 = what;
	}
	setCookie(COOKIENAME,temp2);
}

function MM_checkbox(what)
{
	existing = checkexist(what);
	ckb = "<INPUT TYPE=CHECKBOX VALUE=" + what;
	if (existing == 1) {
		ckb += " CHECKED";
	}
	ckb += " onClick=\"checkchange\('" + what + "')\">";

	this.document.open();
	this.document.writeln(ckb);
	this.document.close();
}