/**
 * Scripts communs à l'ensemble des pages 
 * 
 * @version $Id: public.js 14 2008-07-31 22:42:23Z svnico $
 */

String.prototype.LTrim=new Function("return this.replace(/^\\s+/,'')");
String.prototype.RTrim=new Function("return this.replace(/\\s+$/,'')");
String.prototype.Trim=new Function("return this.replace(/^\\s+|\\s+$/g,'')");

function Defaut(){
	return (confirm('Are you sure you want to reset the values to the default?'));
}
function PopUp(URL,nom,options)
{
	var cv_win;
	cv_win = window.open(URL,nom,options);
	if(cv_win && !cv_win.closed){
		cv_win.focus();
	}
	return;
}

function SetHP() {
	var navig = navigator.appName;
	if (navig == "Microsoft Internet Explorer")
	{
	    if (document.getElementById)
		{
			document.getElementById('home').style.behavior='url(#default#homepage)';
			document.getElementById('home').setHomePage('http://www.koleo.com/');
		}
		else if (document.all)
	    {
			document.all['home'].style.behavior='url(#default#homepage)';
			document.all['home'].setHomePage('http://www.koleo.com/');
		}
	}
}

function VerifierEmail(oChamp) {
	var pos,point,value;
	value=oChamp.value;
	pos=value.indexOf("@")+1;
	if (pos>1) {
		point=value.indexOf(".", pos);
		if (point>pos && point<value.length-1) return true;
	}
	return false;
}

function valideEmail(email) {
	var pos,point;
	pos=email.indexOf("@")+1;
	if (pos>1) {
		point=email.indexOf(".", pos);
		if (point>pos && point<email.length-1) return true;
	}
	return false;
}


// Chargement de la page
$(document).ready(function() {

	// Focus sur le champ de recherche Google
	$("#sbi").focus();

	// Formulaire de profil
	$("#lienDeconnexion").click(function() {
		return confirm('Are you sure you want to sign out?');
	});
	
});
