//to add in tool bar
function addInToolBar(XMLFilePath, lang) 
{
	window.external.AddSearchProvider(XMLFilePath+"toolbar-"+ lang +".xml");
}

// to add in favorie
function AddFav(path) 
{ 
 title = "IsrooSearch";
 url = path;
	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; }
}

var nbFocus = 1; //global var for the first focus.
//for the first modification
function mykeyup(lang)
{
var f = document.getElementById('f');
var q = f.q;
if (q.value != "")
	q.style.background = 'url(../IMG/background-empty.png) left no-repeat';
 else
	q.style.background = 'url(../IMG/background-'+lang+'.png) left no-repeat';

}

// this function checks is the email is correct
function isEmail(str) {
return (str.lastIndexOf(".") > 2) && (str.indexOf("@") > 0) && (str.lastIndexOf(".") > (str.indexOf("@")+1));
}