function switchLang(langID) {
	currentURL = window.location.href;
	currentURL = currentURL.replace("?option=sendemail","");
	if (langID == 4105) { 
		location.href=currentURL.replace("_f.", "_e.");
	} else {
		location.href=currentURL.replace("_e.", "_f.");
	}
}

// rollOvers pour les images
// Application : class="roll"
var frmValidateListening;
window.addEvent('domready', function() {
	//preload images
	var aPreLoad = new Array();
	var aPreLoadi = 0;
	
	$$('img.roll', 'input.roll').each(function(el){

		//let's preload
		aPreLoad[aPreLoadi] = new Image();
		aPreLoad[aPreLoadi].src = el.src.replace(el.src.replace(/_off([_\.])/, '_on$1'));
		aPreLoadi++;

		el.addEvent('mouseover',function(){
			this.setAttribute('src',this.src.replace(/_off([_\.])/, '_on$1'));
		});
		el.addEvent('mouseout',function(){
			this.setAttribute('src',this.src.replace(/_on([_\.])/, '_off$1'));
		});
	});

	// Contact form validator
	if($('listening_form') != null) {
		var isRequired = new InputValidator('required', {errorMsg: "TEST"});
		myFormValidator = new Form.Validator($('listening_form'), {
				stopOnFailure: true,
				serial: false,
				useTitles: true,
				evaluateOnSubmit: false,
				onFormValidate: function(passed, form, event) {
					if (passed) {
						return true;
						form.submit();
					} else {
						alert('Please make sure that all fields have been filled and that the email address you entered is valid.');
						return false;
					}
				}
		});
	}
	
});
function frmValidateListening() {
		var a = confirm('Do not provide any confidential information until you have entered into an retainer agreement with the firm. Until such agreement is made, you are not a client of the firm, and you acknowledge and agree that the firm may have no duty to keep confidential information that you provide.');
		if(a) {
			return myFormValidator.validate();
		} else {
			return false;
		}
}



// rollOvers for Text
// Application : class="rollText"
window.addEvent('domready',function() {
	$$('.rollText').each(function(el){
		var original = el.getStyle('color');
		var morph = new Fx.Morph(el,{ 'duration':'300' });
		el.addEvents({
			'mouseenter' : function() { morph.start({ 'color':'#ff8c00' }) },
			'mouseleave' : function() { morph.start({ 'color': original }) }
		});
	});
});
