var SAY5_COMMON_JS_LOADED = 1;

var SAY5_List = {

	sync_list : function (from,to)
	{
		to.value = from.value;
	}

}

function say5_confirm(text)
{
	if(confirm(text))
	{
		return true;
	}
	return false;
}


function say5_get_viewport_height()
{
	var viewportheight;
	// the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
	if (typeof window.innerHeight != 'undefined')
	{
		viewportheight = window.innerHeight
	}
 
	// IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)
	else if (typeof document.documentElement != 'undefined' 
			&& typeof document.documentElement.clientHeight != 'undefined' 
			&& document.documentElement.clientHeight != 0)
	{
		viewportheight = document.documentElement.clientHeight
	}
 
	// older versions of IE
	else
	{
		viewportheight = document.getElementsByTagName('body')[0].clientHeight
	}
	return(viewportheight);
}

function say5_hook_on_body_start()
{
	if(typeof(say5_on_body_start)=='function')
	{
		say5_on_body_start();
	}
}
function say5_hook_on_body_end()
{
	if(typeof(say5_on_body_end)=='function')
	{
		say5_on_body_end();
	}
}

function say5_browser()
{
	if(navigator.appName.indexOf('Microsoft')!=-1)
	{
		return('IE');
	}
	else
	{
		return('MOZ');
	}
}

function say5_draw_graph(id,percent)
{
	var gr = document.getElementById(id);
	NewRow = gr.insertRow(-1);
	if(percent>0)
	{
		Cell1 = document.createElement('TD');
		Cell1.id='t1';
		Cell1.width=Math.min(percent,60)+"%";
		NewRow.appendChild(Cell1);
	}
	if(percent>60)
	{
		Cell2 = document.createElement('TD');
		Cell2.id='t2';
		Cell2.width=Math.min((percent-60),20)+"%";
		NewRow.appendChild(Cell2);
	}
	if(percent>80)
	{
		Cell3 = document.createElement('TD');
		Cell3.id='t3';
		Cell3.width=Math.min((percent-80),20)+"%";
		NewRow.appendChild(Cell3);
	}
	
	if(percent<100)
	{
		Cell4 = document.createElement('TD');
		Cell4.id='t4';
		Cell4.width=(100-percent)+"%";
		NewRow.appendChild(Cell4);
	}	
}

function say5_draw_graph_write(percent)
{
	var RV = '';
	if(percent>0)
	{
		RV = RV+'<td id="t1" style="width:'+Math.min(percent,60)+'%"><td>';
	}
	if(percent>60)
	{
		RV = RV+'<td id="t2" style="width:'+Math.min((percent-60),20)+'%"><td>';
	}
	if(percent>80)
	{
		RV = RV+'<td id="t3" style="width:'+Math.min((percent-80),20)+'%"><td>';
	}
	
	if(percent<100)
	{
		RV = RV+'<td id="t4" style="width:'+(100-percent)+'%"><td>';
	}	
	return(RV);
}

