function selectController(fObj,sObj){
	if(sObj.checked) selectAll(fObj);
	else deselectAll(fObj);
}
function selectAll(sObj){
	for(i=0;i<sObj.elements.length;i++){
		if(sObj.elements[i].type=="checkbox") sObj.elements[i].checked=true;
	}
	return false;
}
function deselectAll(sObj){
	for(i=0;i<sObj.elements.length;i++){
		if(sObj.elements[i].type=="checkbox") sObj.elements[i].checked=false;
	}
	return false;
}
function selectRadio(sObj,dVal){
	if(sObj==null) return;
	if(isNaN(sObj.length)){
		sObj.checked=true;
		return;
	}
	if(sObj.length>0) sObj[0].checked=true;
	for(i=0;i<sObj.length;i++){
		if(sObj[i].value==dVal){
			sObj[i].checked=true;
			break;
		}
	}
}
function selectList(sObj,dVal){
	for(i=0;i<sObj.length;i++){
		if(sObj.options[i].value==dVal){
			sObj.selectedIndex=i;
			break;
		}
	}
}
function selectCheck(sObj,dVal){
	if(sObj==null) return;
	yesList=',Y,y,YES,Yes,yes,';
	if(yesList.indexOf(',' + dVal + ',')!=-1){
		sObj.checked=true;
	}else{
		sObj.checked=false;
	}
}
function selectCheckD(sObj,dVal){
	if(dVal==null || dVal=="") dVal="Y";
	selectCheck(sObj,dVal);
}
function selectMultiChecks(sObj,dVal){
	if(sObj==null) return;
	stpo=0,enpo=0;
	while(enpo<dVal.length){
		enpo=dVal.indexOf(",",stpo);
		if(enpo==-1) enpo=dVal.length;
		selectMultiCheck(sObj,dVal.substring(stpo,enpo));
		stpo=enpo+1;
	}
}
function selectMultiCheck(sObj,dVal){
	if(sObj==null) return;
	if(isNaN(sObj.length)){
		if(dVal==sObj.value) sObj.checked=true;
	}else{
		for(i=0;i<sObj.length;i++) if(dVal==sObj[i].value) sObj[i].checked=true;
	}
}
function copyFrmList(sObj,dObj){
	dObj.value=sObj.options[sObj.selectedIndex].value;	
}
function copyFrmCheck(sObj,dObj){
	if(sObj.checked) dObj.value=sObj.value;
	else dObj.value="";
}
function checkSelectSel(sObj){
	if(sObj!=null){
		for(i=0;i<sObj.length;i++) if(sObj.options[i].selected) return true;	
	}
	alert('No Item selected');
	return false;
}
function checkCheckSel(sObj){
	if(sObj!=null){
		if(isNaN(sObj.length)) if(sObj.checked) return true;
		if(sObj.length>0){
			for(i=0;i<sObj.length;i++) if(sObj[i].checked) return true;	
		}	
	}
	alert('No Item selected');
	return false;
}
function toDecimal(inVal,precision){
	inVal=inVal+"";
	precision=precision*1;
	var pos=inVal.indexOf(".");
	if(pos!=-1){
		if(precision<1) return inVal.substring(0,pos);
		pos=pos + precision;
		if(pos+1>=inVal.length){
			return inVal;
		}else{
			ret=inVal.substring(0,pos);
			tmp1=inVal.charAt(pos);
			tmp2=inVal.charAt(pos+1);
			if(tmp2*1>5) tmp1=tmp1*1+1;
			ret=ret + tmp1;
			return ret;
		}
	}else{
		return inVal;
	}
}
function popMaxWin(theURL,pTitle){
	wParam="toolbar=yes,location=yes,directories=yes,menubar =yes,scrollbars=yes,status=yes,resizable=1";
	wParam=wParam+",width=" + (screen.width);
	wParam=wParam+",height=" + (screen.height-25);
	nw=createWin(theURL,pTitle,wParam);
	window.nw.moveTo(0,0) 
	return false;
}
function popupWin(theURL,pTitle,wParam){
	createWin(theURL,pTitle,wParam);
	return false;
}
function createWin(theURL,pTitle,wParam){
	newwin=window.open(theURL,pTitle,wParam);
	newwin.focus();
	return newwin;
}
function showhide_menuleft(what){
	if (what.style.display=='none'){
		what.style.display='';
	}else{
		what.style.display='none';
	}
}
function CheckIsIE() 
{ 
    if  (navigator.appName.toUpperCase() == 'MICROSOFT INTERNET EXPLORER')  { return true;} 
    else { return false; } 
} 
function isInList(list,target){
	if(list.indexOf("," + target + ",")!=-1) return true;
	return false;
}
function addSelObj(target, oName, oValue){
	target.options[target.options.length]=new Option(oName,oValue);
}
function cutUnselect(obj){
	var label=obj.options[obj.selectedIndex].text;
	var val=obj.options[obj.selectedIndex].value;
	obj.options.length=0;
	addSelObj(obj,label,val);
}
function confirms(txt) {
	if(!confirm(txt)) return false;
}
function clock() {
	var hours, minutes, seconds, ap;
	var intHours, intMinutes, intSeconds;
	var today;
	
	today = new Date();
	intHours = today.getHours();
	intMinutes = today.getMinutes();
	intSeconds = today.getSeconds();
	
	if (intHours < 10) hours = "0"+intHours;
	else hours = intHours+"";
	if (intMinutes < 10) minutes = "0"+intMinutes;
	else minutes = intMinutes+"";
	if (intSeconds < 10) seconds = "0"+intSeconds;
	else seconds = intSeconds+"";
	
	timeString = hours+":"+minutes+":"+seconds;
	Clock.innerHTML = timeString;
	window.setTimeout("clock();", 100);
}