// JavaScript Document

var currFunction = '';

var insideMinHeight = 1220;
var insideHeight = 0;

var currQuestion = 0;
var currJob = 0;

function nothing() {}

var months = new Array();
months[0] = "Janvier";
months[1] = "F&eacute;vrier";
months[2] = "Mars";
months[3] = "Avril";
months[4] = "Mai";
months[5] = "Juin";
months[6] = "Juillet";
months[7] = "Ao&ucirc;t";
months[8] = "Septembre";
months[9] = "Octobre";
months[10] = "Novembre";
months[11] = "D&eacute;cembre";
		
var opacityTimeoutVar = new Array();
opacityTimeoutVar[0] = '';
opacityTimeoutVar[1] = '';
opacityTimeoutVar[2] = '';
opacityTimeoutVar[3] = '';
opacityTimeoutVar[4] = '';

var days = new Array();
days[0] = "Dimanche";
days[1] = "Lundi";
days[2] = "Mardi";
days[3] = "Mercredi";
days[4] = "Jeudi";
days[5] = "Vendredi";
days[6] = "Samedi";

var features = new Array();
features[0] = "feature1";
features[1] = "feature2";
features[2] = "feature3";

var currFeature = 0;
var featureTimeout = '';

array_shuffle(features);

function init() {
	
	//loadMeteo();
	//window.setTimeout("dispTime()",2000);
	
	if (document.getElementById('googleMap')) {
		loadMap();	
	}
	
	if (document.getElementById('pageHeight')) {
		setHeights(0);	
	}
	
}

function array_shuffle(items) {
	var s = [];
	while (items.length) s.push(items.splice(Math.random() * items.length, 1));
	while (s.length) items.push(s.pop());
	return items;
} 

function dispTime() {

	var d = new Date();
	
	var curr_date = d.getDate();
	var curr_day = d.getDay();
	var curr_month = d.getMonth();
	var curr_year = d.getFullYear();
	
	var curr_hours = d.getHours();
	var curr_mins = d.getMinutes();
	var curr_secs = d.getSeconds();
	
	curr_time = 'AM';
	if (curr_hours > 11) {
		curr_hours -= 12;
		curr_time = 'PM';
	}
	
	curr_hours = (curr_hours < 10) ? '0'+curr_hours : curr_hours;
	curr_mins = (curr_mins < 10) ? '0'+curr_mins : curr_mins;
	curr_secs = (curr_secs < 10) ? '0'+curr_secs : curr_secs;
	
	var dispDate = days[curr_day]+', '+curr_date+' '+months[curr_month]+', '+curr_year+'<br />';
	dispDate += curr_hours+':'+curr_mins+':'+curr_secs+' '+curr_time;
	
	document.getElementById('time').innerHTML = dispDate;
	
	window.setTimeout("dispTime()",1000);
	
}

var winW = 0;
var winH = 0;

// Detect if the browser is IE or not.
// If it is not IE, we assume that the browser is NS.
var IE = document.all?true:false

// If NS -- that is, !IE -- then set up for mouse capture
if (!IE) document.captureEvents(Event.MOUSEMOVE)

// Main function to retrieve mouse x-y pos.s

var tempX = 0;
var tempY = 0;

// Temporary variables to hold mouse x-y pos.s
var tempMouseX = 0
var tempMouseY = 0

// Set-up to use getMouseXY function onMouseMove
document.onmousemove = getMouseXY;

// Main function to retrieve mouse x-y pos.s

//setWindowProps();

function getMouseXY(e) {
  if (IE) { // grab the x-y pos.s if browser is IE
	tempMouseX = event.clientX + document.body.scrollLeft
	tempMouseY = event.clientY + document.body.scrollTop
  } else {  // grab the x-y pos.s if browser is NS
	tempMouseX = e.pageX
	tempMouseY = e.pageY
  }  
  // catch possible negative values in NS4
  if (tempMouseX < 0){tempMouseX = 0}
  if (tempMouseY < 0){tempMouseY = 0}  
  // show the position values in the form named Show
  // in the text fields named MouseX and MouseY
  
  if (currFunction != '') {
	
	eval(currFunction);
	
  }
  
  return true
}

function check_email(email) {
	
	ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";
	
	for(i=0; i < email.length ;i++){
		if(ok.indexOf(email.charAt(i))<0){ 
			return (false);
		}	
	}
	
	re = /(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/;
	re_two = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
	if (!email.match(re) && email.match(re_two)) {
		return (-1);		
	} 
	

}

function setHeights(addition) {
	
	var pageHeight = document.getElementById('pageHeight').value*1;
	var height = 0;
	var count = 1;
	
	while (document.getElementById('compLink'+count)) {
		height += document.getElementById('compLink'+count).offsetHeight*1;
		count++;
	}
	
	height += insideMinHeight;
	
	//alert(height + ' ' + pageHeight);
	
	var heightEmpty = 0;
	count = 1;
	
	while (document.getElementById('heightItem'+count)) {
		heightEmpty += document.getElementById('heightItem'+count).offsetHeight*1;
		count++;
	}
	
	height = (height < heightEmpty) ? heightEmpty : height;
	
	insideHeight = height;
	
	if (height > pageHeight) {
	
		document.getElementById('bodyMain').style.height = height+'px';
		document.getElementById('bodyLeft').style.height = height+'px';
		document.getElementById('bodyLeftInside').style.height = (height-62)+'px';
		document.getElementById('bodyRight').style.height = (height-2)+'px';
		if (document.getElementById('bodyMiddle'))
			document.getElementById('bodyMiddle').style.height = (height-2)+'px';
		
	}
	
}

function getScrollOffset() {

	setWindowProps();

	tempX = 0;
	tempY = 0;
	
	if (IE) { // grab the x-y pos.s if browser is IE
		tempX = document.body.scrollLeft;
		tempY = document.body.scrollTop;
	} else {
		tempX = window.pageXOffset;
		tempY = window.pageYOffset;
	}	
	
	// catch possible negative values in NS4
	if (tempX < 0){tempX = 0}
	if (tempY < 0){tempY = 0}
	
	//alert(tempX + " " + tempY); 

}

function check_errors(FormName) {

	var submitOk = 1;
	var anchorName = '';

	if (FormName == 'ContactForm') {
	
		var LastName = document.ContactForm.LastName.value;
		var FirstName = document.ContactForm.FirstName.value;
		var Email = document.ContactForm.Email.value;
		var Comments = document.ContactForm.Comments.value;
		
		document.getElementById('fieldLastName').className = 'field';
		document.getElementById('fieldFirstName').className = 'field';
		document.getElementById('fieldEmail').className = 'field';
		document.getElementById('fieldComments').className = 'formItemTitle';
		
		if (LastName == '') {
			document.getElementById('fieldLastName').className = 'fieldError';
			submitOk = 0;
		}
		
		if (Comments == '') {
			document.getElementById('fieldComments').className = 'formItemTitleError';
			submitOk = 0;
		}
		
		if (FirstName == '') {
			document.getElementById('fieldFirstName').className = 'fieldError';
			submitOk = 0;
		}
		
		if (Email == '') {
			document.getElementById('fieldEmail').className = 'fieldError';
			submitOk = 0;
		} else if (!check_email(Email)) {
			document.getElementById('fieldEmail').className = 'fieldError';
			submitOk = 0;
		}
		
	}

	if (FormName == 'QuestionForm') {
	
		var Email = document.QuestionForm.Email.value;
		var Content = document.QuestionForm.Content.value;
		
		document.getElementById('fieldEmail').className = 'title';
		document.getElementById('fieldContent').className = 'title';
		
		if (Email == '') {
			document.getElementById('fieldEmail').className = 'titleError';
			submitOk = 0;
		} else if (!check_email(Email)) {
			document.getElementById('fieldEmail').className = 'titleError';
			submitOk = 0;
		}
		
		if (Content == '') {
			document.getElementById('fieldContent').className = 'titleError';
			submitOk = 0;
		}
		
	}

	if (FormName == 'JobFormSec') {
		
		anchorName = '#jobForm';
	
		var Title = document.JobFormSec.Title.value;
		var Company = document.JobFormSec.Company.value;
		var Email = document.JobFormSec.Email.value;
		var Content = document.JobFormSec.Content.value;
		
		document.getElementById('fieldTitle').className = 'title';
		document.getElementById('fieldCompany').className = 'title';
		document.getElementById('fieldEmail').className = 'title';
		document.getElementById('fieldContent').className = 'title';
		
		if (Title == '') {
			document.getElementById('fieldTitle').className = 'titleError';
			submitOk = 0;
		}
		
		if (Company == '') {
			document.getElementById('fieldCompany').className = 'titleError';
			submitOk = 0;
		}
		
		if (Email == '') {
			document.getElementById('fieldEmail').className = 'titleError';
			submitOk = 0;
		} else if (!check_email(Email)) {
			document.getElementById('fieldEmail').className = 'titleError';
			submitOk = 0;
		}
		
		if (Content == '') {
			document.getElementById('fieldContent').className = 'titleError';
			submitOk = 0;
		}
		
	}

	if ((FormName.indexOf('JobApplicationForm') != -1)) {
		
		var FormNum = FormName.replace('JobApplicationForm','');
	
		var WebsiteJobId = eval('document.'+FormName+'.WebsiteJobId').value;
		
		anchorName = '#responseForm'+WebsiteJobId;
		
		var FirstName = eval('document.'+FormName+'.FirstName').value;
		var LastName = eval('document.'+FormName+'.LastName').value;
		var Email = eval('document.'+FormName+'.Email').value;
		var Comments = eval('document.'+FormName+'.Comments').value;
		var FileCV = eval('document.'+FormName+'.FileCV').value;
		
		if (WebsiteJobId != 0) {
			document.getElementById('fieldFirstName'+FormNum).className = 'title';
			document.getElementById('fieldLastName'+FormNum).className = 'title';
			document.getElementById('fieldComments'+FormNum).className = 'title';
		}
		document.getElementById('fieldEmail'+FormNum).className = 'title';
		document.getElementById('fieldFileCV'+FormNum).className = 'title';
		
		if (WebsiteJobId != 0) {
			if (FirstName == '') {
				document.getElementById('fieldFirstName'+FormNum).className = 'titleError';
				submitOk = 0;
			}
			
			if (LastName == '') {
				document.getElementById('fieldLastName'+FormNum).className = 'titleError';
				submitOk = 0;
			}
		}
		
		//alert(Email);
		
		if (Email == '') {
			document.getElementById('fieldEmail'+FormNum).className = 'titleError';
			submitOk = 0;
		} else if (!check_email(Email)) {
			document.getElementById('fieldEmail'+FormNum).className = 'titleError';
			submitOk = 0;
		}
		
		if (FileCV == '') {
			document.getElementById('fieldFileCV'+FormNum).className = 'titleError';
			submitOk = 0;
		}
		
		if (WebsiteJobId != 0) {
			if (Comments == '') {
				document.getElementById('fieldComments'+FormNum).className = 'titleError';
				submitOk = 0;
			}
		}
		
	}

	if ((FormName != 'QuestionForm') && (FormName.indexOf('QuestionForm') != -1)) {
		
		var FormNum = FormName.replace('QuestionForm','');
	
		var Email = eval('document.'+FormName+'.Email').value;
		var DisplayName = eval('document.'+FormName+'.DisplayName').value;
		var Content = eval('document.'+FormName+'.Content').value;
		
		document.getElementById('fieldDisplayName'+FormNum).className = 'title';
		document.getElementById('fieldEmail'+FormNum).className = 'title';
		document.getElementById('fieldContent'+FormNum).className = 'title';
		
		if (DisplayName == '') {
			document.getElementById('fieldDisplayName'+FormNum).className = 'titleError';
			submitOk = 0;
		}
		
		if (Email == '') {
			document.getElementById('fieldEmail'+FormNum).className = 'titleError';
			submitOk = 0;
		} else if (!check_email(Email)) {
			document.getElementById('fieldEmail'+FormNum).className = 'titleError';
			submitOk = 0;
		}
		
		if (Content == '') {
			document.getElementById('fieldContent'+FormNum).className = 'titleError';
			submitOk = 0;
		}
		
	}

	if (FormName == 'CompanyForm') {
	
		var LastName = document.CompanyForm.LastName.value;
		var FirstName = document.CompanyForm.FirstName.value;
		var Email = document.CompanyForm.Email.value;
		var Comments = document.CompanyForm.Comments.value;
		
		document.getElementById('fieldLastName').className = 'title';
		document.getElementById('fieldFirstName').className = 'title';
		document.getElementById('fieldEmail').className = 'title';
		document.getElementById('fieldComments').className = 'title';
		
		if (LastName == '') {
			document.getElementById('fieldLastName').className = 'titleError';
			submitOk = 0;
		}
		
		if (FirstName == '') {
			document.getElementById('fieldFirstName').className = 'titleError';
			submitOk = 0;
		}
		
		if (Comments == '') {
			document.getElementById('fieldComments').className = 'titleError';
			submitOk = 0;
		}
		
		if (Email == '') {
			document.getElementById('fieldEmail').className = 'titleError';
			submitOk = 0;
		} else if (!check_email(Email)) {
			document.getElementById('fieldEmail').className = 'titleError';
			submitOk = 0;
		}
		
	}

	if (FormName == 'JobForm') {
	
		var LastName = document.JobForm.LastName.value;
		var FirstName = document.JobForm.FirstName.value;
		var Email = document.JobForm.Email.value;
		var FileCV = document.JobForm.FileCV.value;
		var Comments = document.JobForm.Comments.value;
		
		document.getElementById('fieldLastName').className = 'field';
		document.getElementById('fieldFirstName').className = 'field';
		document.getElementById('fieldEmail').className = 'field';
		document.getElementById('fieldFileCV').className = 'field';
		document.getElementById('fieldComments').className = 'formItemTitle';
		
		if (LastName == '') {
			document.getElementById('fieldLastName').className = 'fieldError';
			submitOk = 0;
		}
		
		if (Comments == '') {
			document.getElementById('fieldComments').className = 'formItemTitleError';
			submitOk = 0;
		}
		
		if (FileCV == '') {
			document.getElementById('fieldFileCV').className = 'fieldError';
			submitOk = 0;
		}
		
		if (FirstName == '') {
			document.getElementById('fieldFirstName').className = 'fieldError';
			submitOk = 0;
		}
		
		if (Email == '') {
			document.getElementById('fieldEmail').className = 'fieldError';
			submitOk = 0;
		} else if (!check_email(Email)) {
			document.getElementById('fieldEmail').className = 'fieldError';
			submitOk = 0;
		}
		
	}

	if (FormName == 'NewsletterForm') {
	
		var LastName = document.NewsletterForm.LastName.value;
		var FirstName = document.NewsletterForm.FirstName.value;
		var Email = document.NewsletterForm.Email.value;
		
		document.getElementById('fieldLastName').className = 'field';
		document.getElementById('fieldFirstName').className = 'field';
		document.getElementById('fieldEmail').className = 'field';
		
		if (LastName == '') {
			document.getElementById('fieldLastName').className = 'fieldError';
			submitOk = 0;
		}
		
		if (FirstName == '') {
			document.getElementById('fieldFirstName').className = 'fieldError';
			submitOk = 0;
		}
		
		if (Email == '') {
			document.getElementById('fieldEmail').className = 'fieldError';
			submitOk = 0;
		} else if (!check_email(Email)) {
			document.getElementById('fieldEmail').className = 'fieldError';
			submitOk = 0;
		}
		
	}

	if (FormName == 'CouponForm') {
	
		var LastName = document.CouponForm.LastName.value;
		var FirstName = document.CouponForm.FirstName.value;
		var Email = document.CouponForm.Email.value;
		
		document.getElementById('fieldLastName').className = 'field';
		document.getElementById('fieldFirstName').className = 'field';
		document.getElementById('fieldEmail').className = 'field';
		
		if (document.CouponForm.City) {
			
			var City = document.CouponForm.City.value;
			var BirthDay = document.CouponForm.BirthDay.value;
			var BirthMonth = document.CouponForm.BirthMonth.value;
			var BirthYear = document.CouponForm.BirthYear.value;
			
			document.getElementById('fieldCity').className = 'field';
			document.getElementById('fieldBirthDate').className = 'field';
			
		}
		
		if (LastName == '') {
			document.getElementById('fieldLastName').className = 'fieldError';
			submitOk = 0;
		}
		
		if (FirstName == '') {
			document.getElementById('fieldFirstName').className = 'fieldError';
			submitOk = 0;
		}
		
		if (document.CouponForm.City) {
		
			if (City == '') {
				document.getElementById('fieldCity').className = 'fieldError';
				submitOk = 0;
			}
			
			if ((BirthDay == 0) || (BirthMonth == 0) || (BirthYear == 0)) {
				document.getElementById('fieldBirthDate').className = 'fieldError';
				submitOk = 0;
			}
			
		}
		
		if (Email == '') {
			document.getElementById('fieldEmail').className = 'fieldError';
			submitOk = 0;
		} else if (!check_email(Email)) {
			document.getElementById('fieldEmail').className = 'fieldError';
			submitOk = 0;
		}
		
		if (document.CouponForm.ConfirmCoupon) {
			if (!document.CouponForm.ConfirmCoupon.checked) {
				document.getElementById('confirmText').style.color = "red";
				submitOk = 0;
			}
		}
		
	}

	if (FormName == 'MemberForm') {
		
		anchorName = '#errorAnchor';
	
		var LastName = document.MemberForm.LastName.value;
		var FirstName = document.MemberForm.FirstName.value;
		var Email = document.MemberForm.Email.value;
		var Telephone = document.MemberForm.Telephone.value;
		var Comments = document.MemberForm.Comments.value;
		
		document.getElementById('fieldLastName').className = 'title';
		document.getElementById('fieldFirstName').className = 'title';
		document.getElementById('fieldEmail').className = 'title';
		document.getElementById('fieldTelephone').className = 'title';
		document.getElementById('fieldComments').className = 'title';
		
		if (LastName == '') {
			document.getElementById('fieldLastName').className = 'titleError';
			submitOk = 0;
		}
		
		if (FirstName == '') {
			document.getElementById('fieldFirstName').className = 'titleError';
			submitOk = 0;
		}
		
		if (Telephone == '') {
			document.getElementById('fieldTelephone').className = 'titleError';
			submitOk = 0;
		}
		
		if (Comments == '') {
			document.getElementById('fieldComments').className = 'titleError';
			submitOk = 0;
		}
		
		if (Email == '') {
			document.getElementById('fieldEmail').className = 'titleError';
			submitOk = 0;
		} else if (!check_email(Email)) {
			document.getElementById('fieldEmail').className = 'titleError';
			submitOk = 0;
		}
		
	}

	if (FormName == 'ContestForm') {
		
		anchorName = '#formAnchor';
	
		var LastName = document.ContestForm.LastName.value;
		var FirstName = document.ContestForm.FirstName.value;
		var Email = document.ContestForm.Email.value;
		var Address = document.ContestForm.Address.value;
		var PostalCode = document.ContestForm.PostalCode.value;
		var City = document.ContestForm.City.value;
		var Country = document.ContestForm.Country.value;
		var Language = document.ContestForm.Language.value;
		var Institution = document.ContestForm.Institution.value;
		var Telephone = document.ContestForm.Telephone.value;
		var Position = document.ContestForm.Position.value;
		var MaritalStatus = document.ContestForm.MaritalStatus.value;
		var ContactTime = document.ContestForm.ContactTime.value;
		var HeardOf = document.ContestForm.HeardOf.value;
		
		document.getElementById('fieldLastName').className = 'title';
		document.getElementById('fieldFirstName').className = 'title';
		document.getElementById('fieldEmail').className = 'title';
		document.getElementById('fieldAddress').className = 'title';
		document.getElementById('fieldPostalCode').className = 'title';
		document.getElementById('fieldCity').className = 'title';
		document.getElementById('fieldCountry').className = 'title';
		document.getElementById('fieldLanguage').className = 'title';
		document.getElementById('fieldInstitution').className = 'title';
		document.getElementById('fieldTelephone').className = 'title';
		document.getElementById('fieldPosition').className = 'title';
		document.getElementById('fieldMaritalStatus').className = 'title';
		document.getElementById('fieldContactTime').className = 'title';
		document.getElementById('fieldHeardOf').className = 'title';
		
		if (LastName == '') {
			document.getElementById('fieldLastName').className = 'titleError';
			submitOk = 0;
		}
		
		if (FirstName == '') {
			document.getElementById('fieldFirstName').className = 'titleError';
			submitOk = 0;
		}
		
		if (Email == '') {
			document.getElementById('fieldEmail').className = 'titleError';
			submitOk = 0;
		} else if (!check_email(Email)) {
			document.getElementById('fieldEmail').className = 'titleError';
			submitOk = 0;
		}
		
		if (Address == '') {
			document.getElementById('fieldAddress').className = 'titleError';
			submitOk = 0;
		}
		
		if (PostalCode == '') {
			document.getElementById('fieldPostalCode').className = 'titleError';
			submitOk = 0;
		}
		
		if (Telephone == '') {
			document.getElementById('fieldTelephone').className = 'titleError';
			submitOk = 0;
		}
		
		if (City == '') {
			document.getElementById('fieldCity').className = 'titleError';
			submitOk = 0;
		}
		
		if (Country == '') {
			document.getElementById('fieldCountry').className = 'titleError';
			submitOk = 0;
		}
		
		if (Language == '') {
			document.getElementById('fieldLanguage').className = 'titleError';
			submitOk = 0;
		}
		
		if (Institution == '') {
			document.getElementById('fieldInstitution').className = 'titleError';
			submitOk = 0;
		}
		
		/*
		if (Position == '') {
			document.getElementById('fieldPosition').className = 'titleError';
			submitOk = 0;
		}
		*/
		
		if (MaritalStatus == '') {
			document.getElementById('fieldMaritalStatus').className = 'titleError';
			submitOk = 0;
		}
		
		if (ContactTime == '') {
			document.getElementById('fieldContactTime').className = 'titleError';
			submitOk = 0;
		}
		
		if (HeardOf == '') {
			document.getElementById('fieldHeardOf').className = 'titleError';
			submitOk = 0;
		}
		
	}
	
	if (submitOk == 1) {
		
		if (eval('document.'+FormName).ajaxFunction) {
			var sendFunction = eval('document.'+FormName).ajaxFunction.value;
			eval(sendFunction+'()');
		} else {
			eval('document.'+FormName).submit();
		}
		
	} else {
		if (anchorName != ''){
			document.location = anchorName;	
		}
	}
	
}

function setWindowProps() {
	
	if (parseInt(navigator.appVersion)>3) {
		if (navigator.appName=="Netscape") {
			winW = window.innerWidth;
			winH = window.innerHeight;
		}
		if (navigator.appName.indexOf("Microsoft")!=-1) {
			winW = (document.body.offsetWidth-21);
			winH = (document.body.offsetHeight-4);
		}
	}
	
}
		
function trim(stringToTrim) {
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}

function loadMeteo() {
	
	ajaxDiv = 'meteo';
	
	sendAjax('ajax.php?meteo=1',processAjax);
	
}

function companyClick(WebsiteId,CompanyId) {

	//popupInit(440);
	
	//ajaxDiv = 'popup';
	
	//sendAjax('ajax.php?companyClick=1&WebsiteId='+WebsiteId+'&CompanyId='+CompanyId,processAjax);
	
}

function setOpacity(divName,value) {
	document.getElementById(divName).style.opacity = value/10;
	document.getElementById(divName).style.filter = 'alpha(opacity=' + value*10 + ')';
}

function displayOpacity(divName,direction,limit,value,counter) {
	
	if (direction == 0) {
		if (value < limit) {
			setOpacity(divName,limit);
			clearTimeout(opacityTimeoutVar[counter]);
		} else {
			setOpacity(divName,value);
			opacityTimeoutVar[counter] = window.setTimeout("displayOpacity('"+divName+"',"+direction+","+limit+","+(value-1)+","+counter+")",50);
		}
	} else {
		if (value > limit) {
			setOpacity(divName,limit);
			clearTimeout(opacityTimeoutVar[counter]);
		} else {
			setOpacity(divName,value);
			opacityTimeoutVar[counter] = window.setTimeout("displayOpacity('"+divName+"',"+direction+","+limit+","+(value+1)+","+counter+")",50);
		}
	}
	
}
	
function dispFeature(featureNum) {
	
	clearTimeout(featureTimeout);
	
	var FeatureCount = features.length;
	
	setOpacity(features[featureNum],0);
	document.getElementById(features[featureNum]).style.visibility = 'visible';
	
	displayOpacity(features[currFeature],0,0,10,0);
	if (currFeature != featureNum) {
		window.setTimeout("document.getElementById('"+features[currFeature]+"').style.visibility = 'hidden'",500);
	}
	displayOpacity(features[featureNum],1,10,0,1);
	currFeature = featureNum;
	
	if (currFeature != (FeatureCount-1)) {
		featureTimeout = window.setTimeout('dispFeature('+(currFeature+1)+')',4000);	
	} else {
		featureTimeout = window.setTimeout('dispFeature(0)',4000);	
	}

}

function addFavorite(url) {
	
	var title = document.title;
	
	if (window.sidebar) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel(title, url,"");
	} else if( window.external ) { // IE Favorite
		window.external.AddFavorite( url, title);
	} else if(window.opera && window.print) { // Opera Hotlist
		return true;
	}
	
}

function dispQuestionAnswer(num) {
	
	if (currQuestion != 0) {
		document.getElementById('questionLink'+currQuestion).style.height = '20px';
		if (currQuestion != num) {
			document.getElementById('questionLink'+num).style.height = '420px';
		} else {
			num = 0;	
		}
	} else {
		document.getElementById('questionLink'+num).style.height = '420px';
	}
	
	currQuestion = num;
	setHeights(0);
	
	document.location = '#answerForm'+num;
	
}

function dispJobForm() {
	
	document.getElementById('jobFormBox').style.height = 'auto';
	document.getElementById('jobFormBox').style.overflow = 'auto';
	
	setHeights(0);
	
}

function hideJobForm() {
	
	document.getElementById('jobFormBox').style.height = '35px';
	document.getElementById('jobFormBox').style.overflow = 'hidden';
	
	document.location = '#jobForm';
	
	setHeights(0);
	
}

function dispJobAppForm() {
	
	document.getElementById('jobAppFormBox').style.height = 'auto';
	document.getElementById('jobAppFormBox').style.overflow = 'auto';
	
	setHeights(0);
	
}

function hideJobAppForm() {
	
	document.getElementById('jobAppFormBox').style.height = '55px';
	document.getElementById('jobAppFormBox').style.overflow = 'hidden';
	
	document.location = '#jobAppForm';
	
	setHeights(0);
	
}

function dispJobApplication(num) {
	
	if (currJob != 0) {
		document.getElementById('jobLink'+currJob).style.height = '20px';
		if (currJob != num) {
			document.getElementById('jobLink'+num).style.height = '620px';
		} else {
			num = 0;	
		}
	} else {
		document.getElementById('jobLink'+num).style.height = '620px';
	}
	
	currJob = num;
	setHeights(0);
	
	document.location = '#responseForm'+num;
	
}
