
function openpop(url,w,h){
            var iWidth=w; 
            var iHeight=h;
            var iTop=(window.screen.height-iHeight)/2;
            var iLeft=(window.screen.width-iWidth)/2;
            window.open(
url,"Detail","Scrollbars=no,Toolbar=no,Location=no,Resizable=yes,Width="+iWidth+" ,Height="+iHeight+",top="+iTop+",left="+iLeft
            ); 
}
function popwin(url,w,h){
    var iWidth=w; 
    var iHeight=h;
    var iTop=(window.screen.height-iHeight)/2;
    var iLeft=(window.screen.width-iWidth)/2;
    window.open(
url,"Detail","Scrollbars=yes,Toolbar=no,Location=no,Resizable=yes,Width="+iWidth+" ,Height="+iHeight+",top="+iTop+",left="+iLeft
    ); 
}
function dialog(url,w,h) { 
            var iWidth=w; 
            var iHeight=h;
            var iTop=(window.screen.height-iHeight)/2;
            var iLeft=(window.screen.width-iWidth)/2;
            window.showModalDialog(
url,window,"dialogHeight: "+iHeight+"px;dialogWidth: "+iWidth+"px;dialogTop: "+iTop+"; dialogLeft: "+iLeft+"; resizable: yes; status: no;scroll:yes");
          }
function  onClose(){   
                    window.dialogArguments.location.href=window.dialogArguments.location.href;                 
                    window.close();   
          }   

function getCheckedCheckbox(nameOfCheckBox)
{	var   b=new Array();   
	var theCheckboxInputs=document.getElementsByName(nameOfCheckBox);
	for (var i=0;i<theCheckboxInputs.length;i++)
	{
		if(theCheckboxInputs[i].checked) 
		 {   
		  if(theCheckboxInputs[i].value!=""){		 
          b.push(theCheckboxInputs[i].value); }  
         }  		     
	}
	  return b;
}
function getOrder(nameOfCheckBox)
{	var   b=new Array();   
	var theCheckboxInputs=document.getElementsByName(nameOfCheckBox);
	for (var i=0;i<theCheckboxInputs.length;i++)
	{
		if(theCheckboxInputs[i].checked) 
		 {   
		  if(theCheckboxInputs[i].value!=""){		 
          b.push(theCheckboxInputs[i].value); }  
         }  		     
	}
	  return b;
}
function getCheckedOneCheckbox(nameOfCheckBox)
{	var   b=new Array();   
	var theCheckboxInputs=document.getElementsByName(nameOfCheckBox);
	for (var i=0;i<theCheckboxInputs.length;i++)
	{
		if(theCheckboxInputs[i].checked) 
		 {   
		  if(theCheckboxInputs[i].value!=""){		 
          b.push(theCheckboxInputs[i].value); }  
         }  		     
	}
	  return b;
}
var flag=false; 
function SelectAll(nameOfCheckBox) {
flag = !flag; 
var theCheckboxInputs=document.getElementsByName(nameOfCheckBox);
for(var i=0;i<theCheckboxInputs.length;i++)
 theCheckboxInputs[i].checked=flag;
} 
function $(pKey){ return document.getElementById(pKey);  }
function add_file(form){
      var n = $(form).children.length+1;      
      var div = document.createElement('div');
      var temp = document.createElement('input');
      $(form).appendChild(div);     
      temp.setAttribute('type','file');
      temp.style.display='none';     
      temp.onchange=function()
      {div.innerHTML += "<li>"+temp.value+
"  <span onclick='delete_file(this.parentElement.parentElement);' style='cursor:hand;color:blue;'>Delete</span></li>";};
      var inpHTML ="<font style='font-size:12px;padding-left:64px;'>&nbsp;"+"&nbsp;<input style='font-size:12px;' size=28 type=file name=uploadFile["+ n + "].file></font>";
      div.innerHTML += inpHTML;
      }
      function delete_file(pNode){
      $(form).removeChild(pNode);
   }
   
function SelectDate(ctrlobj, event) {
	var isMSIE = (navigator.appName == "Microsoft Internet Explorer");  //??????????
	showx = event.screenX;
	showy = event.screenY;
	if (isMSIE) {
		showx = showx - event.offsetX - 4 - 168;
		showy = showy - event.offsetY + 20; // + deltaY;
	} else {
		showx = showx - event.layerX - 4 - 168;
		showy = showy - event.layerY + 20; // + deltaY;
	}
        //alert(showx);
	newWINwidth = 210 + 4 + 18;
	if (isMSIE) {
		var retval = window.showModalDialog("SelectDate.jsp", "", "dialogWidth:200px;dialogHeight:250px;dialogLeft:" + showx + "px; dialogTop:" + showy + "px;Resizable:0;help=no;status:No;center:yes;scroll:no");
		if (retval != null) {
			ctrlobj.value = retval;
		}
	} else {
		tmpobj = ctrlobj;
		var win = window.open("SelectDate.jsp", "gekPopup", "top=" + showy + "px,left=" + showx + "px,scrollbars=no,dialog=yes,modal=yes,width=250px,height=250px,resizable=no"); 
        //eval('try { win.resizeTo(width, height); } catch(e) { }'); 
		win.focus();
	}
}

function showDiv(id){
  var div = document.getElementById(id);
  div.style.display="";}
function hideDiv(id){ 
  var div = document.getElementById(id);
  div.style.display="none";}