if (window!= top) {top.location.href = location.href;}

window.offscreenBuffering = true;

var detail_window = null;

function new_window(url, name) {
	var w = ""; var h = ""; var l = ""; var t = ""; var features = "";
	for (i=2; i<new_window.arguments.length; i++) {
		var param = new_window.arguments[i];
		if ( (parseInt(param) == 0) || (isNaN(parseInt(param))) ) {features += param + ',';}
		else {(w == "") ? w = "width=" + param + "," : (h == "") ? h = "height=" + param + "," : (l == "") ? l = "left = " + param + "," : t = "top=" + param;}
		}
	features += w + h + l + t;
	var code = "detail_window = window.open(url, name";
	if (new_window.arguments.length > 2) code += ", '" + features;
	code += "')";
	eval(code);
	if (!detail_window.opener) {detail_window.opener = self;}
	}

function shut_down() {
	if (detail_window != null && detail_window.open) detail_window.close();
	};

window.onfocus=shut_down;

function print_page(strid) {
	var prtContent = document.getElementById(strid);
	var strOldOne=prtContent.innerHTML;
	var WinPrint = window.open('','', 'left=10,top=10,width=800,height=640,toolbars=no,scrollbars=no,status=no,resizable=yes');
	WinPrint.document.write(prtContent.innerHTML);
	WinPrint.document.close();
	WinPrint.focus();
	WinPrint.print();
	WinPrint.close();
	prtContent.innerHTML=strOldOne;
	};

function change_image(initial, effect) {
	var objStr,obj;
	if (document.images) {
		if (typeof initial == 'string') {objStr = 'document.' + initial; obj = eval(objStr); obj.src = effect;}
		else if ((typeof initial == 'object') && initial && initial.src) {initial.src = effect;}
		}
	};

function fit_zoom() {
	if (window.innerWidth) {
		iWidth = window.innerWidth;
		iHeight = window.innerHeight;
		}
	else {
		iWidth = document.body.clientWidth;
		iHeight =document.body.clientHeight;
		}
	iWidth = document.images[0].width - iWidth;
	iHeight = document.images[0].height - iHeight;
	window.resizeBy(iWidth, iHeight);
	};

function disable_button() {
	this.value='Submitting...';
	this.disabled=true;
	};

function hide(object) {
	if (document.layers && document.layers[object] != null) document.layers[object].visibility = 'hidden';
	else if (document.all) document.all[object].style.visibility = 'hidden';
	};

function show(object) {
	if (document.layers && document.layers[object] != null) document.layers[object].visibility = 'visible';
	else if (document.all) document.all[object].style.visibility = 'visible';
	};

function toggle_display(id) {
	var elem = document.getElementById(id);
	if (elem) {
		if (elem.style.display != 'block') {
			elem.style.display = 'block';
			elem.style.visibility = 'visible';
			}
		else {
			elem.style.display = 'none';
			elem.style.visibility = 'hidden';
			}
		}
	return false;
	};

