﻿var w = screen.width/2;
var h = screen.height/2;
var property = 'resizable=no,'
			 + 'status=no,'
  		     + 'menubar=no,'
			 + 'scrollbars=yes,'
			 + 'location=no,'
			 + 'toolbar=no,'
			 + 'width=' + w + ','
			 + 'height=' + h;
function goList(form,action,target)
{
	document.all(form).action=action+"?currPage=1";
	document.all(form).target=target;
	document.all(form).submit();
}
function goDel(form,key,action)
{
	if(!deleteRecord(document.all(form),key))
		return;
	document.all(form).action=action;
	document.all(form).submit();
}
function goEdit(form,key,action)
{
	if(!editRecord(document.all(form),key))
        return;
    document.all(form).target="iFrameRight";
	document.all(form).action=action;
	document.all(form).submit();
	//window.open(action, 'iFrameRight', property);
}
function goAdd(action)
{
	window.open(action, '', property);
}
function goSave(form)
 { 
     document.all(form).submit();
 }
function switchAllCheckBoxes(form,key,bool){
	for(var i=0; i<document.all(form).elements.length; i++){
		var e = document.all(form).elements[i];
		if(e.type == 'checkbox' && e.name == key){
			e.checked = bool;
		}
	}
}
