function trim(str) { 
	return str.replace(/(^\s*)|(\s*$)/g,"")
}

function getmyObject(objectId) {
 	if (document.getElementById) 
		return document.getElementById(objectId);
    else {
    	if (document.layers) 
        	return document.layers[objectId];
        else {
        	if (document.all)
            	return document.all(objectId);
        }
    }
}

/* Ouvrir une popup */
function openPopup(_url, _w, _h, _pos, _resize, _scroll, _title) {
	var top = "";
	var left = "";
	var resize = 0;
	var scroll = 0;
			
	switch(_pos) {
		case 'center':
			top = (screen.height - _h)/2;
			left = (screen.width - _w)/2;
			break;
		case 'left' :
			top = (screen.height - _h)/2;
			left = 0;
			break;
		case 'right' :
			top = (screen.height - _h)/2;
			left = (screen.width - _w);
			break;
	}
		
	if(_resize == 'yes')
		resize = 1;
	else
		resize = 0;
		
	if(_scroll == 'yes')
		scroll = 1;
	else
		scroll = 0;
	
	myWin = window.open(_url,_title,'left=' + left + ', top=' + top + ', toolbar=0, location=0, directories=0, status=1, scrollbars=' + scroll + ', resizable=' + resize + ', copyhistory=0, menuBar=0, width=' + _w + ', height=' + _h);
	if(myWin!=null)
	{
		myWin.focus();
	}
	return myWin;
}

function open_w(url)
{
	window.open(url, "page", "toolbar=no, location=no, directories=no, status=yes, scrollbars=yes, resizable=no, copyhistory=no, width=500, height=500, left=50, top=50");
}

function open_sendfriend()
{
	window.open("http://www.destination-surf.com/sendfriend.php", "page", "toolbar=no, location=no, directories=no, status=yes, scrollbars=yes, resizable=no, copyhistory=no, width=506, height=418, left=50, top=50");
}
