
function dBi(id)
{
	return document.getElementById(id);
}

function trim(stringToTrim) {
	return stringToTrim.replace(/^[\x20\x0A\x0D]+|[\x20\x0A\x0D]+$/g,"");
}
function ltrim(stringToTrim) {
	return stringToTrim.replace(/^[\x20\x0A\x0D]+/,"");
}
function rtrim(stringToTrim) {
	return stringToTrim.replace(/[\x20\x0A\x0D]+$/,"");
}

var plusimg = new Image();
	plusimg.src = '/images/btn/plus.gif';
var minusimg = new Image();
	minusimg.src = '/images/btn/minus.gif';

// toggle visibility of ID element
// p.s. for some reason does not get display data from css
function toggle_id_vis(id) {
	if (dBi('fltrplus')){
		flimg = dBi('fltrplus');
	} else {
		flimg = new Image();
	}

	if(dBi(id)){
		if(dBi(id).style.display=='none' ){
			dBi(id).style.display = 'block';
			flimg.src = minusimg.src;
		}else{
			dBi(id).style.display = 'none';
			flimg.src = plusimg.src; 
		}
	}else{
		return false;
	}
}


/////////////////* *///////////////////
//var menus = new Array();

function showID(id, type){
	//menus[id] = false;
	if(type == 'row'){
		dBi(id).style.display = '';
	}else{
		dBi(id).style.display = 'block';
	}
}
function hideID(id) {
	//menus[id] = true;
	//hide(id);
	dBi(id).style.display = 'none';
}

/*function hide (id) {
	if (menus[id])
	{
		dBi(id).style.display = 'none';
	}
}*/


function show_info_pop(){

	if (dBi('gren_hlp_1')){
		new_thm = dBi('gren_hlp_1');
		new_thm.onmouseover = new Function("showID('green_hlp_wrap_1')");
		new_thm.onmouseout = new Function("hideID('green_hlp_wrap_1')");
	}
	if (dBi('pg_count_img')){
		new_thm = dBi('pg_count_img');
		new_thm.onmouseover = new Function("showID('pg_count')");
		new_thm.onmouseout = new Function("hideID('pg_count')");
	}	
	if (dBi('dwnCreditsnfo_img')){
		new_thm = dBi('dwnCreditsnfo_img');
		new_thm.onmouseover = new Function("showID('dwnCreditsnfo')");
		new_thm.onmouseout = new Function("hideID('dwnCreditsnfo')");
	}
	if (dBi('dwnCodenfo_img')){
		new_thm = dBi('dwnCodenfo_img');
		new_thm.onmouseover = new Function("showID('dwnCodenfo')");
		new_thm.onmouseout  = new Function("hideID('dwnCodenfo')");
	}	
	if (dBi('allowed_file_types_info')){
		new_thm = dBi('allowed_file_types_info_img');
		new_thm.onmouseover = new Function("showID('allowed_file_types_info')");
		new_thm.onmouseout  = new Function("hideID('allowed_file_types_info')");
	}
}



function sz(t) 
{
	while (t.scrollTop > 0)
	{
		t.rows += 1;
	}
}