function trim(s) 
{
	var i = 0;
	if( s.length > 0 ) 
	{
		while( s.charCodeAt( i ) == 32 || s.charCodeAt( i ) == 10)
			i++;
		if( i > 0 ) s = s.substring( i, s.length );
	}
	i = 0;
	if( s.length > 0 ) 
	{
		while( s.charAt( s.length - i - 1 ) == 32 || s.charAt( s.length - i - 1 ) == 10)
			i++;
		if( i > 0 ) s = s.substring( 0, s.length - i );
	}
	return s;
}

function openWindow(url)
{
	window.open(url,'','width=550,height=365,menubar,resizable,toolbar,titlebar,status,directories,location,scrollbars=yes');
}
function openBox(url)
{
	window.open(url,'','width=550,height=600,dialog=yes,resizable=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no');
}
function openBox2(url)
{
	window.open(url,'','width=550,height=500,dialog=yes,resizable=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no');
}
function openBox1(url)
{
	window.open(url,'','width=550,height=365,dialog=yes,resizable=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no');
}

function openWindow1(url)
{
	window.open(url,'','width=550,height=250,menubar,resizable,toolbar,titlebar,status,directories,location,scrollbars=yes');
}

function switchHideShow(eleHide, eleShow){
	ele_hide = document.getElementById(eleHide);
	ele_show = document.getElementById(eleShow);
	ele_hide.style.display = 'none';
	ele_show.style.display = 'block';
}