function gtu(u)
{
	wnd = window.open('http://'+u, '_blank');
	wnd.focus();
}


function showMore(id)
{
	var btn_o = document.getElementById('moreOpen'+id).style;
	var btn_h = document.getElementById('moreHide'+id).style;
	var txt = document.getElementById('moreText'+id).style;
	if ( txt.display == 'block' )
	{
		txt.display = 'none';
		btn_h.display = 'none';
		btn_o.display = 'block';
	}
	else
	{
		txt.display = 'block';
		btn_h.display = 'block';
		btn_o.display = 'none';
	}
	//alert(id);
}



/******* top navigation ********/

var timeout         = 200;
var closetimer		= 0;
var ddmenuitem      = 0;

function jsddm_open()
{
	jsddm_canceltimer();
	jsddm_close();
	//ddmenuitem = $(this).find('ul').eq(0).css('display','block');
	ddmenuitem = $(this).find('ul').eq(0).fadeIn(500);
	//ddmenuitem = $(this).find('ul').eq(0).show();
}

function jsddm_close()
{
	if(ddmenuitem) ddmenuitem.hide();
}

function jsddm_timer()
{	closetimer = window.setTimeout(jsddm_close, timeout);}

function jsddm_canceltimer()
{	if(closetimer)
	{	window.clearTimeout(closetimer);
		closetimer = null;}}

document.onclick = jsddm_close;



$(document).ready(function(){

	$('#topnavigation > li').each(function(){
		var pos = $(this).position();
		t = parseInt( pos.top );
		h = parseInt( $(this).children('a').css('height') );
		if ( !h ) { h = 20 };
		tp = ( t + h - 3 ) + 'px';
		//alert(h);return false;
		//var h = parseInt($(this).css('height'));
		//alert(h);
		$(this).children('ul').css('left',pos.left).css('top',tp);
	});
	$('#topnavigation > li').bind('mouseenter',jsddm_open);
	$('#topnavigation > li').bind('mouseleave',jsddm_timer);

});
