
function IRFA_goTo( url ) {
	window.location.href = url;
}

function IRFA_roofBar( tableCellRef, hoverFlag ) {
	if ( hoverFlag ) {
		tableCellRef.style.backgroundImage = 'url("http://ziarah.irfaweb.com/images/roofbar_bg2.gif")';
		if ( document.getElementsByTagName ) {
			tableCellRef.getElementsByTagName( 'a' )[0].style.color = '#c00';
		}
	} else {
		tableCellRef.style.backgroundImage = 'url("http://ziarah.irfaweb.com/images/roofbar_bg.gif")';
		if ( document.getElementsByTagName ) {
			tableCellRef.getElementsByTagName( 'a' )[0].style.color = '#333';
		}
	}
}

function IRFA_roofBarClick( tableCellRef, url ) {
	IRFA_roofBar( tableCellRef, 0 );
	IRFA_goTo( url );
}

function IRFA_navBar( tableCellRef, hoverFlag, navStyle ) {
	if ( hoverFlag ) {
		switch ( navStyle ) {
			case 1:
				tableCellRef.style.backgroundColor = '#69c';
				break;
			default:
				if ( document.getElementsByTagName ) {
					tableCellRef.getElementsByTagName( 'a' )[0].style.color = '#c00';
				}
		}
	} else {
		switch ( navStyle ) {
			case 1:
				tableCellRef.style.backgroundColor = '#039';
				break;
			default:
				if ( document.getElementsByTagName ) {
					tableCellRef.getElementsByTagName( 'a' )[0].style.color = '#000';
				}
		}
	}
}

function IRFA_navBarClick( tableCellRef, navStyle, url ) {
	IRFA_navBar( tableCellRef, 0, navStyle );
	IRFA_goTo( url );
}



// used to open popup windows from the dateline
function IRFA_openMap( location )
{
	IRFA_openPopup( location, '620x430', "width=620,height=430,scrollbars=no,resizable=no" );
}


// this is for opening pop-up windows
function IRFA_openPopup( url, name, widgets, openerUrl )
{
	var host = location.hostname;
	window.top.name = "opener";
	var popupWin = window.open( url, name, widgets );
	
	if ( popupWin && popupWin.opener ) {
		if ( openerUrl )
		{
			popupWin.opener.location = openerUrl;
			popupWin.focus();
		}
	}
}


