//===================================================
    function flip_menu(obj){
      //alert(obj.style.backgroundImage)
        var b=obj.className;
        if (b=="mmenu_off"){
            obj.className="mmenu_on";
        }else if(b=="mmenu_on"){
            obj.className="mmenu_off";
        }else if(b=="mmenu_sel"){
            obj.className="mmenu_unsel";
        }else if (b=="smenu_off"){
            obj.className="smenu_on";
        }else if(b=="smenu_on"){
            obj.className="smenu_off";
        }

    }

	
	//===================================================
	function flipcolor(obj)
	{
		var b=obj.className;
		if (b=="colflip1"){
		obj.className="colflip31";
		}else if(b=="colflip2"){
		obj.className="colflip32";
		}
		else if(b=="colflip32"){
		obj.className="colflip2";
		}
		else if(b=="colflip31"){
		obj.className="colflip1";
		}

		else if(b=="colflip1light"){
		obj.className="colflip2light";
		}
		else if(b=="colflip2light"){
		obj.className="colflip1light";
		}
		
		if (b=="clickbar1"){
		obj.className="clickbar2";
		}else if(b=="clickbar2"){
		obj.className="clickbar1";
		}
	}
	
	
	
	
	
	
	
	
	
	
	//===================================================
	function openWin( windowURL, windowName, windowFeatures ) { 
		return window.open( windowURL, windowName, windowFeatures ) ; 
	}
//===================================================
	function smallwindow(str)
	{
		var leftVal = (screen.width-300) / 2;
		var topVal = (screen.height-200) / 2;
		
		var newWindow = window.open( str, null, 'width=300,height=200,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=0,top='+topVal+',left='+leftVal+'' );
		newWindow.focus();
	     	return false;
	}
//===================================================
	function smallwindow_sized(str,xwidth,xheight,label)
	{
		var leftVal = (screen.width-xwidth) / 2;
		var topVal = (screen.height-xheight) / 2;

		newWindow = window.open( str, label, 'width='+xwidth+',height='+xheight+',toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=1,resizable=1,left='+leftVal+',top='+topVal+'' );
		newWindow.focus();
	     	return false;
	}
//===================================================
function IsNumeric(strString)
   //  check for valid numeric strings
   {
   var strValidChars = "0123456789";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;

   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
   }

//===================================================
	function myFill(name,value){
		var fox = document.getElementById(name)
		fox.value = value
	}
//===================================================
	function myGet(name){
		var fox = document.getElementById(name)
		var x
        if (fox.value=='undefined'){
            x="";
        }
		else if (fox.value==""){
            x="";
        }
		else{
            x=fox.value;
        }
		return x
	}
//===================================================
	function myGetX(name){
		var fox = document.getElementById(name)
		return fox
	}
//======================================================
function myShowHide(objID,show){
		var objCT=myGetX(objID);
		
		show = typeof(show) != 'undefined' ? show : -1;
		
		if (show==-1){
			if (objCT.style.display==""){
				objCT.style.display="none";
			}else{
				objCT.style.display="";
			}
		}else if(show==1){
			objCT.style.display="";
		}else{
			objCT.style.display="none";
		}
}
	
	
	
	

	
	
	


//===================================================
	function DisableAllInput(xdisable){
		var xDoc = document.body.getElementsByTagName("input");
		var xSel = document.body.getElementsByTagName("select");
		var i=0
		var s=""
		//disable all textbox, checkbox
		for (i=0;i<xDoc.length;i++){
			if (xDoc.item(i).getAttribute("type") != "submit"){
				xDoc.item(i).disabled=xdisable;
			}
		}
		//disable all select
		for (i=0;i<xSel.length;i++){
				xSel.item(i).disabled=xdisable;
		}
		return true
	}

//===================================================
	function openFormInNewWindow(frm, wname){
	  //var aWindow = window.open('', wname,  'scrollbars=yes,menubar=yes,resizable=yes,toolbar=no,width=400,height=400');
		
		var leftVal = (screen.width-300) / 2;
		var topVal = (screen.height-200) / 2;
		
		var aWindow = window.open( '', wname, 'width=300,height=200,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=0,top='+topVal+',left='+leftVal+'' );
		if (!aWindow.opener) aWindow.opener = self;

	  frm.target = wname;
	  frm.submit();
	}
	
//======================================================
// return the value of the radio button that is checked
// return an empty string if none are checked, or
// there are no radio buttons
function getCheckedValue(radioObj) {
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}
