
//Preload Images

//Active Images
if (document.images) {

		img1on = new Image();
		img1on.src ="images/rollover/kap_on.gif";
		img2on = new Image();
		img2on.src ="images/rollover/emp_on.gif";
		img3on = new Image();
		img3on.src ="images/rollover/pos_on.gif";
		img4on = new Image();
		img4on.src ="images/rollover/cand_on.gif";
		img5on = new Image();
		img5on.src ="images/rollover/app_on.gif";

		img1off = new Image();
		img1off.src ="images/rollover/kap_off.gif";
		img2off = new Image();
		img2off.src ="images/rollover/emp_off.gif";
		img3off = new Image();
		img3off.src ="images/rollover/pos_off.gif";
		img4off = new Image();
		img4off.src ="images/rollover/cand_off.gif";
		img5off = new Image();
		img5off.src ="images/rollover/app_off.gif";

	}


function imgOn(imgName) {
        if (document.images) {
                document[imgName].src = eval(imgName + "on.src");
        }
}

//Rollover Function 'Roll-off'

function imgOff(imgName) {
        if (document.images) {
                document[imgName].src = eval(imgName + "off.src");

        }
}


// faq box

var messages = new Array();
messages[0] = "<div class='faqBoxHead'>Do I have to be a U.S. citizen to be considered for employment?</div><div class='faqBoxText'>No.  You only need to be ...</div><div class='faqBoxLink'><a href='faq.html#0'>more &raquo;</a></div>";
messages[1] = "<div class='faqBoxHead'>Is there an age requirement?</div><div class='faqBoxText'>While there is no formal age requirement ...</div><div class='faqBoxLink'><a href='faq.html#1'>more &raquo;</a></div>";
messages[2] = "<div class='faqBoxHead'>Do I need a college degree?</div><div class='faqBoxText'>Positions vary greatly, and a college degree ...</div><div class='faqBoxLink'><a href='faq.html#2'>more &raquo;</a></div>";
messages[3] = "<div class='faqBoxHead'>I attended school abroad, does that count?</div><div class='faqBoxText'>Yes. Any extended period ...</div><div class='faqBoxLink'><a href='faq.html#3'>more &raquo;</a></div>";
messages[4] = "<div class='faqBoxHead'>How long are overseas projects, generally?</div><div class='faqBoxText'>Timeframes vary greatly, from ...</div><div class='faqBoxLink'><a href='faq.html#4'>more &raquo;</a></div>";
messages[5] = "<div class='faqBoxHead'>What parts of the world are employers most interested in?</div><div class='faqBoxText'>That changes significantly over time ...</div><div class='faqBoxLink'><a href='faq.html#5'>more &raquo;</a></div>";
messages[6] = "<div class='faqBoxHead'>My background is very general in business, not in any specific industry, is that a problem?</div><div class='faqBoxText'>No. Most employers welcome ...</div><div class='faqBoxLink'><a href='faq.html#6'>more &raquo;</a></div>";
messages[7] = "<div class='faqBoxHead'>I only speak one foreign language fluently.  Is that enough?</div><div class='faqBoxText'>It depends on the language and ...</div><div class='faqBoxLink'><a href='faq.html#7'>more &raquo;</a></div>";
messages[8] = "<div class='faqBoxHead'>I'm concerned about pay and benefits. How will they compare to what I would expect to be offered in the U.S.?</div><div class='faqBoxText'>Most, but not all, are ...</div><div class='faqBoxLink'><a href='faq.html#8'>more &raquo;</a></div>";

/*
messages[0] = "<div class='faqBoxHead'>Do I have to be a U.S. citizen to be considered for employment?</div><div class='faqBoxText'>No.  You only need to be legally residing in the U.S.  You can have dual citizenship or have legal permanent resident status </div><div class='faqBoxLink'><a href='faq.html#0'>more &raquo;</a></div>";
messages[1] = "<div class='faqBoxHead'>Is there an age requirement?</div><div class='faqBoxText'>While there is no formal age requirement, we have found that persons over the age of 23-24 usually have the kind of experience living or working overseas that our clients are seeking. </div><div class='faqBoxLink'><a href='faq.html#1'>more &raquo;</a></div>";
messages[2] = "<div class='faqBoxHead'>Do I need a college degree?</div><div class='faqBoxText'>Positions vary greatly, and a college degree or relevant coursework is nearly always a plus, but it is not a requirement to apply.</div><div class='faqBoxLink'><a href='faq.html#2'>more &raquo;</a></div>";
messages[3] = "<div class='faqBoxHead'>I attended school abroad, does that count?</div><div class='faqBoxText'>Yes. Any extended period you lived overseas is an advantage.</div><div class='faqBoxLink'><a href='faq.html#3'>more &raquo;</a></div>";
messages[4] = "<div class='faqBoxHead'>How long are overseas projects, generally?</div><div class='faqBoxText'>Timeframes vary greatly, from several months to several years depending on the employer and the requirement.</div><div class='faqBoxLink'><a href='faq.html#4'>more &raquo;</a></div>";
messages[5] = "<div class='faqBoxHead'>What parts of the world are employers most interested in?</div><div class='faqBoxText'>That changes significantly over time, but currently we see most needs for U.S. employees in Central and Eastern Europe, Asia and Africa. </div><div class='faqBoxLink'><a href='faq.html#5'>more &raquo;</a></div>";
messages[6] = "<div class='faqBoxHead'>My background is very general in business, not in any specific industry, is that a problem?</div><div class='faqBoxText'>No.  Most employers welcome generalists who can adapt their business skills to new industry areas and assignments. </div><div class='faqBoxLink'><a href='faq.html#6'>more &raquo;</a></div>";
messages[7] = "<div class='faqBoxHead'>I only speak one foreign language fluently.  Is that enough?</div><div class='faqBoxText'>It depends on the language and our clients’ current requirements, which right now are mainly for East European, Asian and African languages and dialects. Note that in parts of Africa and Asia that can include European languages such as French, Dutch and Portuguese. </div><div class='faqBoxLink'><a href='faq.html#7'>more &raquo;</a></div>";
messages[8] = "<div class='faqBoxHead'>I'm concerned about pay and benefits. How will they compare to what I would expect to be offered in the U.S.?</div><div class='faqBoxText'>Most, but not all, are U.S. companies, and they offer compensation and benefits packages designed to U.S. standards. </div><div class='faqBoxLink'><a href='faq.html#8'>more &raquo;</a></div>";
*/

function writeMessage() {
	var randomnumber=Math.floor(Math.random()*(messages.length-1))
	if (document.getElementById) {
		if (messages[randomnumber] != undefined)document.getElementById("faqBoxContent").innerHTML = messages[randomnumber];
	}else { 
		if (messages[randomnumber] != undefined)document.all.faqBoxContent.innerHTML = messages[randomnumber];
	}
}

// Form validation *************************************************************************

var errColor = "#ffdddd";
var focusColor = "#b4e4ff";
var blurColor = "#edf3fd";

function validate_reg(form) {

	var msg = "";
	
	if(!validName(form.firstName.value)){bgChange(form.firstName,errColor);msg += "* First Name\n";} 
	if(!validName(form.lastName.value)){bgChange(form.lastName,errColor);msg += "* Last Name\n";}
	if(!validEmail(form.email.value)){bgChange(form.email,errColor);msg += "* Email\n";}
	if(!validPhone(form.phone.value)){bgChange(form.phone,errColor);msg += "* Phone\n";}
	//if(form.myResume.value==""){bgChange(form.myResume,errColor);msg += "* Upload Resume\n";}
	//if((!form.status[0].checked)&&(!form.status[1].checked)&&(!form.status[2].checked)){msg += "* Work time interest\n";}
	if (msg != "") {
		alert("The following fields were not completed correctly: \n\n" + msg);
		return false;
	} else {
		form.val.value = "1";
		return true;
	}
}

// regexp for international users (not restrictive/us-centric)
function validName(myString) {regExp = /^[A-Z]./i; return(regExp.exec(myString));}
function validEmail(myString) {regExp = /[\w\.\-]{2,}\@[\w\-]{2,}\.[a-z]{2,3}/i; return(regExp.exec(myString));}
function validPhone(myString) {regExp = /^[0-9\(\+][0-9\.\s\-\+\(\)]+$/; return(regExp.exec(myString));}
function validZip(myString) {regExp = /(^\d{5}$)|(^\d{5}-\d{4}$)/; return(regExp.exec(myString));}
function validMonth(myString) {regExp = /(^\d{1,2}$)/; return(regExp.exec(myString));}
function validDay(myString) {regExp = /(^\d{1,2}$)/; return(regExp.exec(myString));}
function validYear(myString) {regExp = /(^\d{4}$)/; return(regExp.exec(myString));}
function validYear(myString) {regExp = /(^2{1}0{1}[0-9]{2}$)/; return(regExp.exec(myString));}

function bgChange(myField,myColor) {if (!document.layers){myField.style.background = myColor;}}
