/* ============= TOP NAV ============= */
var timeOut=0;
var menuCount=3;

if (document.images)
{
	menuOn = new Array();
	menuOff = new Array();
	menuSel = new Array();
	
	for(i=1;i<=3;i++)
	{
		menuOn[i] = new Image();
		menuOn[i].src = "images/00_shell/top_btn_"+i+"_down.gif";
		menuOff[i] = new Image();
		menuOff[i].src = "images/00_shell/top_btn_"+i+"_up.gif";
		menuSel[i] = new Image();
		menuSel[i].src = "images/00_shell/top_btn_"+i+"_down.gif";
	}
}

isDOM=(document.getElementById)?true:false;
isMSIE=(document.all && document.all.item)?true:false;
isNC4=(document.layers)?true:false;

document.writeln('<style>');
if(isMSIE)
{
	document.writeln('.menu0	{display:inline-block; background: #FFFFFF url(images/00_shell/top_btn_line.gif) right repeat-x; padding:0px 0px 0px 0px;}');
	document.writeln('.menu1	{display:inline-block; color:#333333; background: #FFFFFF; font-family: Arial, Helvetica, sans-serif; font-size: 11px; padding:2px 3px 3px 1px;}');
	document.writeln('.menu2	{display:inline-block; color:#58718C; background: #EBEBEB; font-family: Arial, Helvetica, sans-serif; font-size: 11px; padding:2px 3px 3px 10px; cursor: hand;}');
}
else
{
	document.writeln('.menu0	{display:inline-block; background: #FFFFFF url(images/00_shell/top_btn_line.gif) right repeat-x; padding:0px 0px 0px 0px;}');
	document.writeln('.menu1	{display:block; color:#333333; background: #FFFFFF; font-family: Arial, Helvetica, sans-serif; font-size: 11px; padding:2px 3px 3px 1px;}');
	document.writeln('.menu2	{display:block; color:#58718C; background: #EBEBEB; font-family: Arial, Helvetica, sans-serif; font-size: 11px; padding:2px 3px 3px 1px;}');
}
document.writeln('</style>');

styleSwitch=".style";
layerPostfix="\"]";

if(isNC4)
{
	alert("You are using outdated version of Netscape Navigator that does not support the latest technological features. We are sorry, but our web site cannot be displayed corectly in this browser. We recommend using Internet Explorer 5.5 or higher, Netscape Navigator 6.0 or higher, Mozzila 1.0 or higher.");
	layerRef="document.layers[\"";
	styleSwitch="";
}

if(isMSIE)
{
	layerRef="document.all[\"";
}

if(isDOM)
{
	layerRef="document.getElementById(\"";
	layerPostfix="\")";
}

function hideMenu(num)
{
	divname = 'popup'+num;
	eval(layerRef+divname+layerPostfix+styleSwitch+".visibility=(isNC4?'hide':'hidden')");
	mName = "m"+num;
	if (document.images) document[mName].src = menuOff[num].src;
}

function showMenu(num)
{
	for(i=1;i<=menuCount;i++)
		if (i!=num) hideMenu(i);

	divname = 'popup'+num;
	eval(layerRef+divname+layerPostfix+styleSwitch+".visibility=(isNC4?'show':'visible')");
}

function st(s)
{
	if(!s) s='';
	window.status=s;
}

timeId = '';

function timer(num)
{
	timeId = setTimeout("hideMenu("+num+")",timeOut);
}

function cl()
{
	if(timeId) clearTimeout(timeId);
}

function che(menuId,strId,action)
{
	var divname = 'menu'+menuId+'_'+strId;
	
	cl();
	if(action==1) className = 'menu2';
	else className = 'menu1';
	
	eval(layerRef+"menu"+menuId+"_"+strId+layerPostfix+".className='"+className+"';");
}

function mOn(num)
{
	mName = "m"+num;
	if (document.images) document[mName].src = menuOn[num].src;
	cl();
	showMenu(num);
}

function mOff(num)
{
	mName = "m"+num;
	if (document.images) document[mName].src = menuSel[num].src;
	timeId = setTimeout("hideMenu("+num+")",timeOut);
}

/* ============= MISC ============= */

function openPhotosWin(url,theWidth,theHeight)
{
  var theTop=0;
  if(screen.availHeight>theHeight)
    theTop=(screen.availHeight-theHeight)/2;
  var theLeft=0;
  if(screen.availWidth>theWidth)
    theLeft=(screen.availWidth-theWidth)/2-14;
  var features='height='+theHeight+',width='+theWidth+',top='+theTop+',left='+theLeft+',scrollbars=no,menubar=no,toolbar=no,resizable=no';
  theWin=window.open(url,'',features);
  if(window.navigator.appVersion.indexOf("Mac") != -1)
    theWin.resizeBy(0,20);
}

function divToggle(id){
	var element = document.getElementById(id); 
	if(element.style.display == "none" || !element.style.display) {
		element.style.display = "block"; 
	}else if(element.style.display == "block") { 
		element.style.display = "none"; 
	} 
}

function MM_preloadImages() { 
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

// Script for Flash Clips Show/Hide
function flashToggle(id,show,swfname, swfwidth, swfheight){
	var element = document.getElementById(id); 
	var parent = document.getElementById(id + 'container'); 

	if(show == "yes") {
		element.innerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="' + swfwidth + '" height="' + swfheight + '">'
		  + '<param name="movie" value="' + swfname + '" />'
		  + '<param name="bgcolor" value="#ffffff" />'
		  + '<param name="wmode" value="transparent" />'
		  + '<embed src="' + swfname 
		  //bgcolor="#ffffff" wmode="transparent"
		  + '"bgcolor="#ffffff" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + swfwidth + '" height="' + swfheight + '"></embed></object>';
  		parent.style.display = "block"; 

	} else {
		element.innerHTML = '&nbsp;';
		parent.style.display = "none"; 
	} 
}

// Style Sheet change...  (for games)
function setActiveStyleSheet(title) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      a.disabled = true;
      if(a.getAttribute("title") == title) a.disabled = false;
    }
  }
}

