/***************************************************************
*  Copyright notice
*
*  (c) 2010 Objectif Plein Emploi asbl <webmaster@ope.lu>
*  All rights reserved
*
*  This script is free software; you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation; either version 2 of the License, or
*  (at your option) any later version.
*
*  The GNU General Public License can be found at
*  http://www.gnu.org/copyleft/gpl.html.
*
*  This script is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*  This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/

function initAjax() {
	var xmlHttp;
		try {
			// Firefox, Opera 8.0+, Safari
			xmlHttp=new XMLHttpRequest();
		}
		catch (e) {
		// Internet Explorer
		try {
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e) {
			try {
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e) {
				alert("Your browser does not support AJAX!");
				return false;
			}
		}
	}
	return xmlHttp;
}

function movieReload() {
	var xmlHttp = initAjax();
	xmlHttp.onreadystatechange=function() {
		if(xmlHttp.readyState==4) {
			var div = document.getElementById('animateBanner');
			div.innerHTML = xmlHttp.responseText;
		}
	}
	xmlHttp.open("GET",'res/reloadMovie.txt',true);
	xmlHttp.send(null);
}

function movieReloadBig() {
	var xmlHttp = initAjax();
	xmlHttp.onreadystatechange=function() {
		if(xmlHttp.readyState==4) {
			var div = document.getElementById('animateBannerBig');
			div.innerHTML = xmlHttp.responseText;
		}
	}
	xmlHttp.open("GET",'res/reloadMovieBig.txt',true);
	xmlHttp.send(null);
}

function selectText(theField) {
	var tempval=eval("document."+theField)
	tempval.focus()
	tempval.select()
}

function replace() {
	document.getElementById('foo').innerHTML = "Hello, <b>AJAX</b> world!";
}

