function formFocus(element){

	  var focusControl = element;				
	  if (focusControl != null && focusControl.type != "hidden") {
	     focusControl.focus();
	  }
	  
}


function confirmLinkLoc(url, confirmMsg){
	if (!confirmLink('', confirmMsg)) {
		return;
	} 
	window.location = url;
}


function confirmLink(theLink, theConfirmMsg)
   {
       // Check if Confirmation is not needed
       // or browser is Opera (crappy js implementation)
       if (theConfirmMsg == '' || typeof(window.opera) != 'undefined') {
           return true;
       }

       var is_confirmed = confirm(theConfirmMsg + '\n');
       if (is_confirmed) {
           theLink.href += '&is_js_confirmed=1';
       }

       return is_confirmed;
   } // end of the 'confirmLink()' function
   

function checkAll(theForm, cName, status) {
	for (i=0,n=theForm.elements.length;i<n;i++){
	  if (theForm.elements[i].name.indexOf(cName) !=-1) {  
	    theForm.elements[i].checked = status;
	  } 
	}
	return false;
}
