/**
 * <p>Description: </p>
 * 
 * @author tianyu * Modification&Comments on 2005-7-28
 * 
 * @version 1.50
 * 
 * <p>Copyright: Copyright (c) 2004 2005</p>
 * <p>Company: 清华同方科技有限公司</p>
 */
		
function DefaultbtnClicked(event, defaultID) {

  var eSrc = null;
  
	//get the clicked element
	if (ie || opera) {
		eSrc = window.event.srcElement;
	}
	else if(ns || safari) {
		eSrc = event.target;
	}

	if (null == eSrc || null == eSrc.tagName ) {
		return false;
	}

  //cancel the submit action
  //caution: it's not work for the mozila firefox (ns || safari)
	if (ie || opera) {
		//alert("ie || opera!");
		  window.event.returnValue=false;
      window.event.cancelBubble = true;
	}
	else if(ns || safari) {
		//alert("ns || safari!");
      event.preventDefault();
      event.stopPropagation();
      
      
	}
	
	//simulate the click event on the default button
	//it's one of the enclosing table's div element
	var aTable = EzUtility.getEnclosingElementByTagName(eSrc,'TABLE');
	if(aTable == null) return false;
	
	var divs = aTable.getElementsByTagName("DIV");
	if(divs == null) return false;
	
	for(i=0;i<divs.length;i++){
		if(divs[i].id==defaultID){

			divs[i].onclick();
			break;
		}
	}

	return false;
}

