
<!--

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

var current = "";

function show(name)
{
current = name;
var tip = document.getElementById(name);

if (tip)
{
//var flyimg = eval('document.all.img' + name);
tip.style.visibility = "visible";
}
}

function hide(name)
{
var tip = document.getElementById(name);
if (tip)
{
tip.style.visibility = "hidden";
current="";
}
}

/* Function highlights left nav section when subnavs are chosen */
function highlight(id){

var x = document.getElementById(id);

if (x)
{
x.style.color = "#FA9A00";
x.onmouseout = "";
x.onmouseover = "";

}
}

/* Highlight function invoked and defined on a per-page basis */
//highlight('nav1')

function showLeftNav(num)
{
//alert("num="+num)
	for(i=1;i<7;i++)
	{
		//a = eval("document.all.LN" + i)
		a = document.getElementById("LN" + i);
		//alert("i="+i)
		
		if(i==num)
		{
			a.style.display='block';
		}else{
			a.style.display='none';
		}
	}
	
	
}


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

/* Swap between languages */
function swapLanguage() {
	if (document.all.Chn.style.display=="block") {
		document.all.LangTxt.innerText="Chinese";
		document.all.Chn.style.display="none";
		document.all.Eng.style.display="block";
	} else {
		document.all.LangTxt.innerText="English";
		document.all.Chn.style.display="block";
		document.all.Eng.style.display="none";
	}
}

var nn4 = (document.layers) ? true : false
var ie = (document.all) ? true : false
var dom = (document.getElementById && !document.all) ? true : false

function getIEClipValues(str) {
  var clip = new Array();
  var i;

  // Parse out the clipping values for IE layers.

  i = str.indexOf("(");
  clip[0] = parseInt(str.substring(i + 1, str.length), 10);
  i = str.indexOf(" ", i + 1);
  clip[1] = parseInt(str.substring(i + 1, str.length), 10);
  i = str.indexOf(" ", i + 1);
  clip[2] = parseInt(str.substring(i + 1, str.length), 10);
  i = str.indexOf(" ", i + 1);
  clip[3] = parseInt(str.substring(i + 1, str.length), 10);
  return(clip);
}

function getClipLeft(layer) {
  if (nn4)
    return(layer.clip.left);
  else {
    var str =  layer.style.clip;
    if (!str)
      return(0);
    var clip = getIEClipValues(layer.style.clip);
    return(clip[3]);
  }
  return(-1);
}

function getClipTop(layer) {
  if (nn4)
    return(layer.clip.top);
  else {
    var str =  layer.style.clip;
    if (!str)
      return(0);
    var clip = getIEClipValues(layer.style.clip);
    return(clip[0]);
  }
  return(-1);
}

function getClipRight(layer) {
  if (nn4)
    return(layer.clip.right);
  else {
    var str =  layer.style.clip;
    if (!str)
      return(layer.style.pixelWidth);
    var clip = getIEClipValues(layer.style.clip);
    return(clip[1]);
  }
  return(-1);
}

function getClipBottom(layer) {
  if (nn4)
    return(layer.clip.bottom);
  else {
    var str =  layer.style.clip;
    if (!str)
      return(layer.style.pixelHeight);
    var clip = getIEClipValues(layer.style.clip);
    return(clip[2]);
  }
  return(-1);
}

function browser(id){
  if(nn4) {
  path = document.layers[id]
  }
  else if(ie) {
  path = document.all[id]
  } 
  else {
  path = document.getElementById(id)
  }
return path  //return the path to the css layer depending on which browser is looking at the page
}

var topVal=0; //set these vars as global so they are not reset for each setTimeout call to the function 
var rightVal=0;
var bottomVal=0;
var leftVal=0;
var currDrop='n';

function slideDown(id,y){
var layer = browser(id)	// get layer path from global browser function
var currPos = (nn4) ? layer.top : parseInt(layer.style.top)
topVal = getClipTop(layer)
rightVal = getClipRight(layer)
bottomVal = getClipBottom(layer)
leftVal = getClipLeft(layer)

	if(currPos < y){
	currPos += 10
	
		if(nn4){	
		layer.top = currPos	
		}
		else{
		layer.style.top = currPos
		}
		
		if(nn4){
		layer.clip.top -= 10
		}
		else{
		topVal -= 10
		layer.style.clip="rect("+topVal+"px "+rightVal+"px "+bottomVal+"px "+leftVal+"px)";
		}
		
	setTimeout("slideDown('" + id + "'," + y+ ")",10)
	}
}

function slideUp(id,y){
var layer = browser(id)	// get layer path from global browser function
var currPos = (nn4) ? layer.top : parseInt(layer.style.top)
var currHeight = (nn4) ? layer.height : parseInt(layer.style.height)
topVal = getClipTop(layer)
rightVal = getClipRight(layer)
bottomVal = getClipBottom(layer)
leftVal = getClipLeft(layer)

	if(currPos > y - currHeight){
	currPos -= 10
	
		if(nn4){	
		layer.top = currPos	
		}
		else{
		layer.style.top = currPos
		}
		
		if(nn4){
		layer.clip.top += 10
		}
		else{
		topVal += 10
		layer.style.clip="rect("+topVal+"px "+rightVal+"px "+bottomVal+"px "+leftVal+"px)";
		}
		
	setTimeout("slideUp('" + id + "'," + y+ ")",10)
	}
}

function clipValue(id) {
var layer = browser(id)

	if(nn4){
	topdiv = layer.clip.top
	rightdiv = layer.clip.right
	bottomdiv = layer.clip.bottom
	leftdiv = layer.clip.left
	rectVal = topdiv +","+ rightdiv +","+ bottomdiv +","+ leftdiv
	return rectVal
	}
	else{
	rectVal = layer.style.clip
	return rectVal
	}
}

/* Swap Images */
function swapimg(lay1, imgname, imgurl) {
	if (imgname != 'nava0') {
		if (nn4) document.layers[lay1].document.images[imgname].src = '/images/'+imgurl+'.gif';
		if (ie) document.images[imgname].src = '/images/'+imgurl+'.gif';
		if (dom) document.getElementById(imgname).src='/images/'+imgurl+'.gif';
	}
}

function drop(id) {
	if (currDrop == 'n') {
		slideDown(id,113)
		currDrop = id;
	}
	else {
		if (currDrop == id) {
			slideUp(id,8)
			currDrop = 'n';
		}
		else {
			slideUp(currDrop,8)
			slideDown(id,113)
			currDrop = id;
		}
	}
}

//-->
