function openWithSelfMain(url,name,width,height){
	var options = "width=" + width + ",height=" + height + "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no";
	new_window = window.open(url, name, options);
	window.self.name = "main";
	new_window.moveTo(((screen.availWidth/2)-(width/2)),((screen.availHeight/2)-(height/2)))
	new_window.focus();
}

function GetElementById(id){
	if (document.getElementById(id)){
		return document.getElementById(id);
	}else if (document.all[id]){
		return document.all[id];
	}else if (document.layers && document.layers[id]){
		return (document.layers[id]);
	}else{
		return false;
	}
}


function CheckAll(formname, switchid) {
	var ele = document.forms[formname].elements;
	var switch_cbox = GetElementById(switchid);
	for (var i=0; i<ele.length; i++) {
		var e = ele[i];
		if ( (e.name != switch_cbox.name) && (e.type == 'checkbox') ) {
			e.checked = switch_cbox.checked;
		}
	}
}

