var quotes = new Array();
var author = new Array();
quotes[0] = "Tekfi is the most important strategic partner for our organization. They have shown us continuing high-quality work in their projects.";
author[0] = "Auge Bertrand<br/>Vice President of eTic";
quotes[1] = "Because of Tekfi, we were able to offer new services several months ahead of our competitors.";
author[1] = "";
quotes[2] = "I must say that I am very impressed with Tekfi's high quality work and their ability to meet a tide schedule challenge. In addition, they reduce my cost by half.";
author[2] = "";
quotes[3] = "They speak our language and understand our culture. They have been exceeding our earlier expectations since the beginning.";
author[3] = "";

function showReq(sel){
	var selection = sel.value;
	var subForm = document.getElementById(selection);
	if(subForm){
		hideAll();
		subForm.style.display = "";
	}
}
function hideAll(){
	getElem("re_info").style.display = "none";
	getElem("re_email").style.display = "none";
	getElem("re_rfp").style.display = "none";
	getElem("re_team").style.display = "none";
}
function getElem(id){
	return document.getElementById(id);
}
function hl(td,color){
	td.bgColor = color;
}
function showQuotes(idx){
	if(idx < 0 || idx > quotes.length - 1){idx = 0;}
	return quotes[idx];
}
function showAuthor(idx){
	if(idx < 0 || idx > author.length - 1){idx = 0;}
	return author[idx];
}
function validate(formObj){
	errHolderId = "err";
	if(passOrNot(formObj)){
		setErr(errHolderId,"");
		return true;
	} else {
		var msg = "please fill all requires(*).";
		setErr(errHolderId,msg);
		return false;
	}
}

function setErr(id,msg){
	var errHolder = document.getElementById(id);
	if(errHolder)
		errHolder.innerHTML = msg;
	else
		alert(msg);
}

function passOrNot(formObj){
	if(formObj.name == "contactForm"){
		return formObj.first.value&&formObj.last.value&&formObj.email.value;
	}
	if(formObj.name == "partContact"){
		return formObj.first.value&&formObj.last.value&&formObj.email_part.value;
	}
	if(formObj.name == "hrContact"){
		return formObj.first.value&&formObj.last.value&&formObj.email_cv.value;
	}
}
