

function toggleLink(id, cnt){
	
	var status = document.getElementById("link_" + id).style.display;
	
	for(i=0;i<cnt;i++){
		document.getElementById("link_" + i).style.display = "none";
	}
	if(status=="none"){
		document.getElementById("link_" + id).style.display = "";
	}
}


var timerID;
function showMenu(id){
	hideAll()
	var menu = document.getElementById('sub'+id);
	menu.style.display = "";
	
	var menu = document.getElementById('nav'+id);
	menu.className = "on";
	
	clearTimeout(timerID);
}
function hideAll(){
	var menu = document.getElementById('sub1');
	menu.style.display = "none";
	var menu = document.getElementById('sub2');
	menu.style.display = "none";
	var menu = document.getElementById('sub3');
	menu.style.display = "none";
	var menu = document.getElementById('sub4');
	menu.style.display = "none";
	var menu = document.getElementById('sub5');
	menu.style.display = "none";
	var menu = document.getElementById('sub6');
	menu.style.display = "none";
	
	var menu = document.getElementById('nav0');
	menu.className = "";
	var menu = document.getElementById('nav1');
	menu.className = "";
	var menu = document.getElementById('nav2');
	menu.className = "";
	var menu = document.getElementById('nav3');
	menu.className = "";
	var menu = document.getElementById('nav4');
	menu.className = "";
	var menu = document.getElementById('nav5');
	menu.className = "";
	var menu = document.getElementById('nav6');
	menu.className = "";
	
	var menu = document.getElementById(homenav);
	menu.className = "on";
	
}
function hideMenu(){
	hideAll()
	var menu = document.getElementById(homesub);
	menu.style.display = "";
	
	clearTimeout(timerID);
}
function timer(sec) {
	seconds=parseInt(sec)
	if(seconds>0) {
		seconds--
		timerID=setTimeout("timer(seconds)",500)
	}else{
		hideMenu();
	}
}








function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  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];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}



function count(field, countfield, maxlimit) {
	if (field.value.length > maxlimit){
		field.value = field.value.substring(0, maxlimit);
	}else {
		target = document.getElementById(countfield);
		target.innerHTML = maxlimit - field.value.length;
	}
}




function WriteFlash(url,width,height,altimage){ 
flash_versions = 20;
var flash = new Object();
flash.installed=false;
flash.version='0.0';
if (navigator.plugins && navigator.plugins.length) {
	for (x=0; x < navigator.plugins.length; x++) {
		if (navigator.plugins[x].name.indexOf('Shockwave Flash') != -1) {
			flash.version = navigator.plugins[x].description.split('Shockwave Flash ')[1];
			flash.installed = true;
			break;
		}
	}
}
else if (window.ActiveXObject) {
	for (x = 2; x <= flash_versions; x++) {
		try {
			oFlash = eval("new ActiveXObject('ShockwaveFlash.ShockwaveFlash." + x + "');");
			if(oFlash) {
				flash.installed = true;
				flash.version = x + '.0';
			}
		}
		catch(e) {}
	}
}
flash.version = parseInt(flash.version);
if ( !flash.installed || flash.version<7) {
document.write('<img src=\"' + altimage + '\" width=\"' + width + '\" height=\"' + height + '\" alt=\'Advertisement\' >');
}else{
	document.write('<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\"'); 
	document.write(' codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\"'); 
	document.write(' width=\"' + width + '\"' + ' height=\"' + height + '\">'); 
	document.write(' <param name=movie value=\"' + url + '\"> <param name=\"quality\" value=\"high\"> <param name=menu value=false> <param name=\"bgcolor\" VALUE=\"#FFFFFF\"><param name=\"wmode\" value=\"transparent\"> '); 
	document.write(' <embed src=\"' + url + '\" quality=\"high\" bgcolor=\"#FFFFFF\" '); 
	document.write(' width=\"' + width + '\"' + ' height=\"' + height + '\" align=\"middle\" wmode=\"transparent\" menu=\"false\"'); 
	document.write(' type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\">'); 
	document.write(' </embed></object>'); 
} 
}




function RowHighlighter( tableIdName, highlightedClassName, eventList) {


	// initialize class variables
	this.containerId            = tableIdName;
	this.tableElement           = document.getElementById(tableIdName);
	this.highlightedClassName   = highlightedClassName;
	this.selectedRow;
	this.selectedRowOriginalClass;
	
	if( this.tableElement == null ) {
		return false;
	}
		
	// Note about copying this.
	// For some reason, browsers complain about using "this" from an anonymous function like
	// the one below.  I think it has something to do with a scoping change when
	// inside of an anonymous function. Thus you have to copt the "this" for use.
	var copyOfThis = this;	
	var action 	= 	function( e ) {
						if( e == null ) {
							e = this.tableElement.ownerDocument.parentWindow.event;
						}
						copyOfThis.mouseover(e);
					}
	
	// add a listener for onmouseover W3C compatable
	if (this.tableElement.addEventListener) {
		for( i=0; i< eventList.length; i++ ) {
			this.tableElement.addEventListener(eventList[i], action, false);
		}
	}
	// add a listener for onmouseover Microsoft IE compatable
	else if (this.tableElement.attachEvent) {
	    for( i=0; i< eventList.length; i++ ) {
			eventName = "on" + eventList[i];
			this.tableElement.attachEvent(eventName, action);
		}
	}
	
	return;
	
}

RowHighlighter.prototype.mouseover = function( e ) {
	
	// what node are we over?
	var el;
	if( e.target != null ) {
		el = e.target;
	}
	else {
		el = e.srcElement;
	}
	
	// Move up the tree to the first TAG type node that is not the TABLE parent
	while ( el != null && el.nodeType!=1 && el.parentNode!=this.tableElement ) {
		el = el.parentNode;
	}
	
	if(el == this.tableElement) {
		return false;
	}
	
	//alert("t");
	
	// get the row we are over
	rowEl = this.getCurrentRow(el);
	
	
	if( rowEl == null ) {
		return false;
	}
	
	// we're in the same row, do nothing
	if( rowEl == this.selectedRow ) {
		return false;
	}
	
	// return the currently highlighted row to its original form
	if( this.selectedRow ) {
		this.selectedRow.className = this.selectedRowOriginalClass;
	}
	
	// store the selected row element and its original class
	this.selectedRow              = rowEl;
	// store the selected row class
	this.selectedRowOriginalClass = rowEl.className;
	
	// highlight the current row
	if(rowEl.className!="button"){
	rowEl.className = this.highlightedClassName;
	}
	return;
	
}

RowHighlighter.prototype.getCurrentRow = function(el) {
	// cruise up to the TR tag
	//names = el.nodeName + " " + el.id + "\n";
	while ( el != null && el.parentNode.parentNode.id!=this.containerId && el.parentNode != null) {
		el = el.parentNode;
		//names = names + el.nodeName + " " + el.id + "\n";
	}	
	//alert(el.nodeName);
	
	return el;
}

startList = function() {
	navRoot = document.getElementById("navul");
	for (i=0; i<navRoot.childNodes.length; i++) {
		node = navRoot.childNodes[i];
		if (node.nodeName=="LI") {
			for (k=0; k<node.childNodes.length; k++) {
				node2 = node.childNodes[k];
				if (node2.nodeName=="A") {
					node2.onfocus=function() {
						openList(this, 1);
					}
					node2.onblur=function() {
						closeList(this, 1);
					}
				}
				if (node2.nodeName=="UL") {
					for (j=0; j<node2.childNodes.length; j++) {
						node3 = node2.childNodes[j];
						if (node3.nodeName=="LI") {
							for (l=0; l<node3.childNodes.length; l++) {
								node4 = node3.childNodes[l];
								if (node4.nodeName=="A") {
									node4.onfocus=function() {
										openList(this, 2);
									}
									node4.onblur=function() {
										closeList(this, 2);
									}
								}
							}
						}
					}
				}
				node.onmouseover=function() {
					openList(this, 0);
				}
				node.onmouseout=function() {
					closeList(this, 0);
				}
			}
		}
	}
}

function openList(id,lvl) {
	switch(lvl){
		case 0:   id.className+=" over"; break
		case 1:   id.parentNode.className+=" over"; break
		case 2:   id.parentNode.parentNode.parentNode.className+=" over"; break
	}
}
function closeList(id,lvl) {
	switch(lvl){
		case 0:   id.className = ""; break
		case 1:   id.parentNode.className = ""; break
		case 2:   id.parentNode.parentNode.parentNode.className = ""; break
	}
}



function showDiv(id){
		document.getElementById(id).className = "flyout over";
}

function hideDiv(id){
		document.getElementById(id).className = "flyout";
}