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.");
	}
}

// preload all application images 
// rollOvers pour les images
// Application : class="roll"
window.addEvent('domready', function() {
	//preload images
	var aPreLoad = new Array();
	var aPreLoadi = 0;
	
	//do rollover
	$$('#liste_poser_filles a', '#liste_poser_gars a', '#toiles a').each(function(el){
		//let's preload
		aPreLoad[aPreLoadi] = new Image();
		aPreLoad[aPreLoadi].src = el.href;
		aPreLoadi++;
	});
});

// rollOvers pour les images
// Application : class="roll"
window.addEvent('domready', function() {
	//preload images
	var aPreLoad = new Array();
	var aPreLoadi = 0;
	
	//do rollover
	$$('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.'));
		aPreLoadi++;
	
		el.addEvent('mouseover',function(){
			this.setAttribute('src',this.src.replace('_off.', '_on.'));
		});
	
		el.addEvent('mouseout',function(){
			this.setAttribute('src',this.src.replace('_on.','_off.'));
		});
	});
});

// Shadowbox
Shadowbox.loadSkin('classic', '../_java/shadowbox/skin'); // use the "classic" skin
Shadowbox.loadLanguage('en', '../_java/shadowbox/lang'); // use the English language
Shadowbox.loadPlayer(['iframe', 'img', 'swf'], '../_java/shadowbox/player'); // use img and qt players

window.addEvent('domready', function() {
	var options = {
		animate: false,
		modal: true,
        handleOversize:     'none',
        handleUnsupported:  'remove',
        autoplayMovies:     false
    };

	Shadowbox.init(options);
});


// 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 }) }
		});
	});
});


window.addEvent('domready',function() {
	// On IMG Error
	$$('img').addEvent('error',function() {
		var notification = new Request({
			url: 'ajax-image-error.php',
			method: 'post',
			data: {
				'image': this.get('src'),
				'page': window.location.href
			}
		}).send();
	});
	
	if (typeof sIFR == "function"){
	// This is the preferred "named argument" syntax
		sIFR.replaceElement(named({
			sSelector:"body h1",
			sFlashSrc:"../_files/sifr.swf",
			sColor:"#8cc63f",
			sLinkColor:"#8cc63f",
			sBgColor:"#ffffff",
			sHoverColor:"#8cc63f",
			sWmode: 'transparent',
			nPaddingTop:0,
			nPaddingBottom:0,
			sFlashVars:"textalign=left&amp;offsetTop=2"
		}));
	};
});

