/*
	global function for use of all moduls

*/
// opoup new window
function openWin(url,name,param){
	newWin = window.open(url, name, param);
}

function closeWin()
{
	window.close();
}

// clear space form both side of string
function ltrim ( s ){
	return s.replace( /^\s*/, "" )
}
function rtrim ( s ){
	return s.replace( /\s*$/, "" );
}
function trim ( s ){
	return rtrim(ltrim(s));
}

// anchor to the top of the page
function scrollPage(x,y){
	window.scrollTo(x,y);
}

function open_window2 (mode, action, ext_add_type, extra_params)
{
	var buf = "\
		<html><body onload='ext_form.submit()'>\
		<form id='ext_form' method='post' target='_self' action='' onsubmit='return false;'>\
			<input type='hidden' name='langId' value='" + _var_lang_ + "'>\
			<input type='hidden' name='mod' value='" + mode + "'>\
			<input type='hidden' name='act' value='" + action + "'>\
			<input type='hidden' name='ext_add_type' value='" + ext_add_type + "'>\
			" + unescape(extra_params) + "\
		</form>\
		</body></html>";
	
	Win1=window.open( '' , 'Window1' , 'resizable,height=400,width=400' ); 
	Win1.document.writeln(buf); 
	Win1.location.reload();
}
