var objMenuCountry = null, objMenuLanguage = null; objNavigation = null;
function doPulldownShow(strMenuID) {

	if(document.getElementById(strMenuID).style.display!='block')
	{
		clearTimeout(objMenuCountry);
		clearTimeout(objMenuLanguage);
		clearTimeout(objNavigation);
		
		if (strMenuID == 'lyrChangecountry')
		{
			if(document.getElementById('lyrChangelanguage'))
			{
				document.getElementById('lyrChangelanguage').style.display = 'none';
			}
			if(isBrowserNS6()) document.getElementById('divNavigation').style.visibility = 'hidden';
		}
		if (strMenuID == 'lyrChangelanguage')
		{
			if(document.getElementById('lyrChangecountry'))
			{
				document.getElementById('lyrChangecountry').style.display = 'none';
			}
			if(isBrowserNS6()) document.getElementById('divNavigation').style.visibility = 'hidden';
		}

		document.getElementById(strMenuID).style.display = 'block';	
	}
	else
	{
		document.getElementById(strMenuID).style.display='none';
		if(isBrowserNS6()) document.getElementById('divNavigation').style.visibility = 'visible';
	}
}

function doPulldownHide(strMenuID) {

	if (strMenuID == 'lyrChangecountry')
	{
		objMenuCountry = setTimeout("document.getElementById('lyrChangecountry').style.display = 'none'", 300);
	}
	
	if (strMenuID == 'lyrChangelanguage')
	{
		objMenuLanguage = setTimeout("document.getElementById('lyrChangelanguage').style.display = 'none'", 300);
	}
}

function doHideMenu(strMenuID) {
	document.getElementById(strMenuID).style.display = 'none';
}

var strULname = '';
function doMenuLearnMoreAbout(strModuleID) {
	
	if (document.getElementById('div_' + strModuleID).style.display=='none')
	{
		strULname = 'ul_' + strModuleID;
						
		document.getElementById('div_' + strModuleID).style.display='block';		
		setTimeout("document.getElementById(strULname).className='learnmoreabout-true'", 1);
	}
	else
	{
		strULname = 'ul_' + strModuleID;		
		document.getElementById('div_' + strModuleID).style.display='none';		
		setTimeout("document.getElementById(strULname).className='learnmoreabout-false';", 1);
	}
	
}

// this function gets the cookie, if it exists
function doGetCookie(name) {
	
	var start = document.cookie.indexOf(name + "=");
	var len = start + name.length + 1;
	if ((!start) && ( name != document.cookie.substring( 0, name.length ) ) )
	{
		return null;
	}
	if ( start == -1 ) return null;
	var end = document.cookie.indexOf( ";", len );
	if ( end == -1 ) end = document.cookie.length;
	return unescape( document.cookie.substring( len, end ) );
}


function doSetCookie(name, value, expires, path, domain, secure) {
	// set time, it's in milliseconds
	var today = new Date();
	today.setTime( today.getTime() );

	// if the expires variable is set, make the correct expires time, the
	// current script below will set it for x number of days, to make it
	// for hours, delete * 24, for minutes, delete * 60 * 24
	
	if ( expires )
	{
		expires = expires * 1000 * 60 * 60 * 24;
	}
	
	var expires_date = new Date( today.getTime() + (expires) );

	document.cookie = name + "=" +escape( value ) +
		( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + 
		( ( path ) ? ";path=" + path : "" ) + 
		( ( domain ) ? ";domain=" + domain : "" ) +
		( ( secure ) ? ";secure" : "" );
}

function doDeleteCookie(name, path, domain) {
	if (doGetCookie( name ) ) document.cookie = name + "=" +
			( ( path ) ? ";path=" + path : "") +
			( ( domain ) ? ";domain=" + domain : "" ) +
			";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}

function doPositionDivs()
{
	if (document.getElementById('lyrChangecountry') != null) {
		document.getElementById('lyrChangecountry').style.left = 604 + document.getElementById('main').offsetLeft;
	}
	if (document.getElementById('lyrChangelanguage') != null) {
		document.getElementById('lyrChangelanguage').style.left = 604 + document.getElementById('main').offsetLeft;
	}
}

function openWindow(strUrl, strWindowName, astrValues, strOptions, strType)
{
	switch(strType)
	{
		case "modal"	:	window.showModalDialog(strUrl, astrValues, strOptions);
							break;
		case "modeless"	:	window.showModelessDialog(strUrl, astrValues, strOptions);
							break;
		case "normal"	:	window.open(strUrl, strWindowName, strOptions);
							break;
		default			:	window.open(strUrl, strWindowName, strOptions);
							break;
	}
}



function insertFile(strFileLink, strFileName, strIcon)
{
	strImage = "<span>" +
	"<img src=\"" + strIcon + "\" border=\"0\">&nbsp;" +
	"<a href='" + strFileLink + "'><span>" + strFileName + "</span></a></span>";
	window.opener.document.idEdit.document.body.innerHTML = window.opener.document.idEdit.document.body.innerHTML + strImage;
	window.close();
}

function toggleDiv(strDivID)
{
	if(document.getElementById(strDivID).style.display=='none')
	{
		document.getElementById(strDivID).style.display='block';
	}
	else
	{
		document.getElementById(strDivID).style.display='none';
	}
}

function showDiv(strDivID)
{
	document.getElementById(strDivID).style.display='block';
}

function hideDiv(strDivID)
{
	document.getElementById(strDivID).style.display='none';
}
