<!--
var isload = false;
var active = false;
	
	function ImageLoad(){	
		browser = navigator.appName;
		ver = parseInt(navigator.appVersion);
		active = ((browser == "Netscape") && (ver >= 3)) || ((browser == "Microsoft Internet Explorer") && (ver >= 4));
	 	if (active){			
			
			or_minus = new Image;
			or_minus.src = "Images/or_minus.gif";				
			
			sr_minus = new Image;
			sr_minus.src = "Images/sr_minus.gif";				
			
			pr_plus = new Image;
			pr_plus.src = "Images/pr_plus.gif";
			pr_minus = new Image;
			pr_minus.src = "Images/pr_minus.gif";	
			
			ur_plus = new Image;
			ur_plus.src = "Images/ur_plus.gif";
			ur_minus = new Image;
			ur_minus.src = "Images/ur_minus.gif";	
			
			isload = true;			
		}
	
	}
	
	function LoginTo(thisform){
		var logname = thisform.loginname.options[thisform.loginname.selectedIndex].value;		
		var	linkto = "default_" + logname + ".htm"   ;		
		location.href = linkto;
	}

	function ShowLinkPR(img){		
		var ns4 = (document.layers)? true:false;
		var ie4 = (document.all)? true:false;	
			
		if(ns4){			
			if (document.subpr.display == ""){				
				document.subpr.display = "none" ;
				if (active && isload){						
					document[img].src = eval(img + "_plus.src");	
				}	
			}
			else{			
				document.subpr.display = "";
				if (active && isload){			
				document[img].src = eval(img + "_minus.src");						
				}	
			}	
		}else{
			if (subpr.style.display == ""){				
				subpr.style.display = "none" ;
				if (active && isload){						
					document[img].src = eval(img + "_plus.src");					
				}	
			}
			else{			
				subpr.style.display = "";
				if (active && isload){			
					document[img].src = eval(img + "_minus.src");							
				}	
			}	
		}
	}	
	
	function ShowLinkUR(img){	
			
		var ns4 = (document.layers)? true:false;
		var ie4 = (document.all)? true:false;	
			
		if(ns4){			
			document.layers[subur].visibility = "hide";			
		}
	}	
	
	function OpenNewWin(newpage){
		//window.open(newpage, "", "location, scrollbars, status, height=350, width=450, top=50, left=50 "); 
		window.open(newpage, "", "width=400,height=350,top=100,left=300");
		//window.open("", "win", "width=300,height=200")
	}
	
	function ToInvoice(page){
		location.href = page;
	}
	
	function ToPage(page){
		location.href = page;
	}
	
	function LogOff(){		
		var logout = confirm("Are you sure you want to log off?")	
		if(logout){
			//window.close();
			location.href = "default.asp";			
		}
	}
	
	function DeleteIt(deletepage){
		var suredelete = confirm("Are you sure you want to delete this item?")	
		if(suredelete){
			//window.close();
			location.href = deletepage;			
		}
	}
	
	function PrintIt(thisform){
		thisform.submit();
	}
	
	function CloseIt(){
		window.close();
	}
	
	function GetFocus(thisfield){
		thisfield.focus();
	}
	
	function IsBlank(thisfield){
		if(thisfield.value == "" || thisfield.value == null ){
			alert("Please input in the blank field.")
			thisfield.focus();
			return false;
		}else{
			return true;
		}			 
	}
	
	function ValidDate(mfieldname, dfieldname, yfieldname){
		var selectmon, selectday, selectyear;			
		selectmon = mfieldname.options[mfieldname.selectedIndex].value;
		selectday = dfieldname.options[dfieldname.selectedIndex].value;
		selectyear = yfieldname.options[yfieldname.selectedIndex].value;
		if(selectmon == 2 || selectmon == 4 || selectmon == 6 || selectmon == 9 || selectmon == 11){
			if(selectmon == 2){
				if(selectyear >= 35 && selectyear <= 99){						
					yr = 1900 + parseInt(selectyear); 
				}else{
					yr = 1900 + parseInt(selectyear);
				}	
				if(yr % 4 == 0){
					if(selectday > 29 ){
					alert("invalid day for selected month");
					dfieldname.focus();
					return;
					}
				}else{
					if(selectday > 28 ){
					alert("invalid day for selected month");
					dfieldname.focus();
					return;
					}
				} 	
			}else{						
				if(selectday == 31){
					alert("Invalid day for selected month");
					dfieldname.focus();		
					return;
				}	
			}
			return true; 
		}else{
			return true;
		} 		
	}
	
	function ValidDateSeries(mfieldname, dfieldname, yfieldname){
		var count;
		var selectmon, selectday, selectyear;	
		count = mfieldname.length;		
		selectmon = new Array(count);	
		selectday = new Array(count);	
		selectyear = new Array(count);	
			for(var j = 0; j <	count; j++){
				selectmon[j] = mfieldname[j].options[mfieldname[j].selectedIndex].value;
				selectday[j] = dfieldname[j].options[dfieldname[j].selectedIndex].value;
				selectyear[j] = yfieldname[j].options[yfieldname[j].selectedIndex].value;
				//alert("Hi " +j+ " " +selectday[j]);
				if(selectmon[j] == 2 || selectmon[j] == 4 || selectmon[j] == 6 || selectmon[j] == 9 || selectmon[j] == 11){
					if(selectmon[j] == 2){	
						if(selectyear[j] >= 35 && selectyear[j] <= 99){						
							yr = 1900 + parseInt(selectyear[j]); 
						}else{
							yr = 1900 + parseInt(selectyear[j]);
						}	
						if(yr % 4 == 0){
							if(selectday[j] > 29 ){
							alert("invalid day for selected month");
							dfieldname[j].focus();
							return;
							}
						}else{
							if(selectday[j] > 28 ){
							alert("invalid day for selected month");
							dfieldname[j].focus();
							return;
							}
						} 						
					}else{						
						if(selectday[j] == 31){
							alert("Invalid day for selected month");
							dfieldname[j].focus();		
							return;
						}						
					}
					return true; 
				}					
			}	
			return true; 		
	} 
	
	function CheckNum(inputval, lb, ub){
		var rateval, ratestr;
		rateval = inputval.value;		
		if(rateval != ""){		
			if(rateval > lb && rateval < ub){
				ratestr = inputval.value.toString();								
				for(var j = 0; j < ratestr.length; j++){				
					var onechar = ratestr.charAt(j);				
					if(onechar < "0" || onechar > "9"){						
						if(onechar != "."){
							alert("Invalid value for the following focus field");	
							inputval.focus();						
							return;
						}
					}
				}	
			}else{
				alert("This input is not in the acceptable range, please check again");
				inputval.focus();						
				return;
			}   
		}	
		return true;
	}		
	
	
	function CheckNumSeries(inputval, lb, ub){
		var inputstr, count;
		count = inputval.length;		
		inputstr = new Array(count);
		for(var j = 0; j < count; j++){
			input = inputval[j].value;	
			if(input != ""){ 		
				if(input > lb && input < ub){								
					inputstr[j] = inputval[j].value.toString();					
					for(var k = 0; k < inputstr[j].length; k++){
						var onechar = inputstr[j].charAt(k);						
						if(onechar < "0" || onechar > "9"){
							if(onechar != "."){
								alert("Invalid value for the following focus field");	
								inputval[j].focus();						
								return;
							}
						} 
					}						
				}else{
					alert("This input is not in the acceptable range, please check again");
					inputval[j].focus();						
					return;
				}
			}	 
		}
		return true;
	}
	
	function CheckEmpHours(emp, hour){
		var empinput, hoursinput, count;	
		count = emp.length;			
		empinput = new Array(count);
		hoursinput = new Array(count);	
		for(var j = 0; j < count; j++){
			empinput[j] = emp[j].options[emp[j].selectedIndex].value;
			hoursinput[j] = hour[j].value;			
			if(empinput[j] == "" && hoursinput[j] != ""){
				alert("Please select consultant");
				emp[j].focus();
				return;
			}else{
				if(empinput[j] != "" && hoursinput[j] == ""){
					alert("Please input number of hours");
					hour[j].focus();
					return;	
				}	
			}
		}	
		return true;
	}
	
	function CheckNumAmount(num, amount){
		var numinput, amountinput, count;	
		count = num.length;			
		numinput = new Array(count);
		amountinput = new Array(count);	
		for(var j = 0; j < count; j++){
			numinput[j] = num[j].value;
			amountinput[j] = amount[j].value;			
			if(numinput[j] == "" && amountinput[j] != ""){
				alert("Please input check number");
				num[j].focus();
				return;
			}else{
				if(numinput[j] != "" && amountinput[j] == ""){
					alert("Please input check amount");
					amount[j].focus();
					return;	
				}	
			}
		}	
		return true;
	}
	
	
	//This function is used to validate invoice form in invoice_form.asp
	function ValAddInv(thisform){				
		if(IsBlank(thisform.inv_attn) && ValidDate(thisform.psmonth, thisform.psday, thisform.psyear) && ValidDate(thisform.pemonth, thisform.peday, thisform.peyear) &&
			ValidDate(thisform.fieldmonth, thisform.fielddate, thisform.fieldyear)	&& 	ValidDateSeries(thisform.bmonth, thisform.bday, thisform.byear) &&
			ValidDateSeries(thisform.emonth, thisform.eday, thisform.eyear) && CheckEmpHours(thisform.namelist, thisform.hours) && CheckNumSeries(thisform.hours, 0, 1000)){		
			thisform.submit();	
		}else{
			return;
		}				
	}
	
	
	function CheckDesc(thisform){
		if(IsBlank(thisform.inv_pmdescription)){
			thisform.submit();
		}else{
			return;
		}	
	}
	
	//This function is used to validate payment form in payment_form.asp
	function ValPayment(thisform){
		if(CheckNumAmount(thisform.pm_checkno, thisform.pm_amount) && ValidDateSeries(thisform.pmmonth, thisform.pmday, thisform.pmyear) && CheckNumSeries(thisform.pm_amount, 0, 99999)){
			thisform.submit()
		}else{
			return;
		} 
	}
	
	//This function is used to validate employee form in employee_form.asp
	function ValEmpFull(thisform){
		if(IsBlank(thisform.emp_name) && IsBlank(thisform.emp_firstname) && IsBlank(thisform.emp_lastname)
		 && ValidDate(thisform.fieldmonth, thisform.fielddate, thisform.fieldyear) &&  CheckNum(thisform.emp_cost, 0, 1000) && CheckNum(thisform.emp_billrate, 0, 1000)){
			thisform.submit();
		}else{
			return;
		}
	}
	
	function ValEmpDef(thisform){
		if(IsBlank(thisform.emp_name) && IsBlank(thisform.emp_firstname) && IsBlank(thisform.emp_lastname)
		 && ValidDate(thisform.fieldmonth, thisform.fielddate, thisform.fieldyear)){
			thisform.submit();
		}else{
			return;
		}
	}
	
	
	
//*************This function is for checking the blank field in std_form.asp******************		
	function ValReportName(thisform){
		if(IsBlank(thisform.criteria_name)){		
			thisform.submit();
		}else{
			return;
		}
	}
//************************************End Function *********************************************	
	
	
//*************This function is for checking the blank field in qa_form.asp******************	
	function ValQA(thisform){
		if(IsBlank(thisform.qa_subject) && IsBlank(thisform.qa_desc)){		
			thisform.submit();
		}else{
			return;
		}
	}
//*************************************End Function *********************************************	


	
 //********************This following section is for help tips ********************************
      /* Browser sniffing */
      var isIE4up = (document.all)? true: false;
      var isNN4up = (document.layers)? true: false;
     
      /* DOM Initialization */
      var docObj = (isIE4up)? 'document.all' : 'document';
      var styObj = (isIE4up)? '.style' : '';

      function genericDOM(elemID) {
         if (isIE4up||isNN4up) {
            layerObj = eval(docObj + '.' + elemID + styObj);
         }
         return layerObj
      }


      /* Shows and hides the pop-up box */
      function popUpHelp(e, elem) {
         var objDOM = genericDOM(elem);
         var state = objDOM.visibility;
         if (state == "visible" || state == "show") {
            objDOM.visibility = "hidden";
         } else {
             if (isNN4up) {
                topLoc = eval(e.pageY + 5);
                leftLoc = eval(e.pageX - 130);
             }
             if (isIE4up) {
                topLoc = eval(event.y + 5);
                leftLoc = eval(event.x - 130);
             }
             if (leftLoc < 5) {           
                leftLoc = 5;
             }
             objDOM.top = topLoc;
             objDOM.left = leftLoc;
             objDOM.visibility = "visible";
         }
      }
//*********************** End Help Tips ************************************
	
//-->	
