
var UnitCost = new Array(2); //Costs per hour of different types of development

// Offshore unit costs

function InitCosts(){
	UnitCost[0]=new Array(8,10,14,10); //Costs of 1st. type of project: PHP, J2EE without EJB, J2EE with EJB, .NET
	UnitCost[1]=new Array(10,12,16,12); //Costs of 2nd. type of project: PHP, J2EE without EJB, J2EE with EJB, .NET
}

function InitPage(){
	MM_preloadImages('images/box_arrow_r.gif','images/but_contact_r.gif');//This function is defined in rollovercontent.js 
	InitCosts();
}

function ClearCost(formul){
	formul.cost.value="";
}
	
function Trim(string){ 
	return string.replace(/(^\s*)|(\s*$)/g,''); 
} 

function IsInteger(sText){
   var ValidChars = "0123456789";
   var IsNumber=true;
   var Char;

   for (i = 0; i < sText.length && IsNumber == true; i++){ 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1){
         IsNumber = false;
      }
   }
   return IsNumber;
   
}

function Calculate(formul){
	var project;
	var language=parseInt(formul.language.value);
	var hours=parseInt(formul.hours.value);
	if (ValidateForm(formul)){
		if (formul.project[0].checked){
			project=0;
		}else{
			project=1;
		};
		formul.cost.value=UnitCost[project][language]*hours;
	}
	
	
}

