function ShowHideMenu(el)
{
    var childEl = new String(el.id)
    var groupName = new String(el.id);
    childEl = document.getElementById(groupName.replace('Lnk', '') + "Child");
    
    if(childEl.style.display == '')
    {
        childEl.style.display = 'none';
    }else{
            childEl.style.display = '';    
    }
}
function mapLoad(la, lo) 
{
    
   var loc = new GLatLng(la,lo)

   if (GBrowserIsCompatible()) {
       var map = new GMap2(document.getElementById("map"));
       map.setCenter(loc, 12);
       map.addControl(new GSmallMapControl());
       map.addOverlay(new GMarker(loc))
   }
}
var tickerTimeout
var divheight
var divwidth
var outrdivwidth
//### set scrollmode to either 'horizonal' or 'vertical'
var scrollmode = 'horizonal'
//### set continueousmode to true if you are using two divs for seamless playback.
var continueousmode = false;
var intspeedsetting
var divnamesetting

function setupTicker(intSpeed, divname) {
	obj = document.getElementById(divname+"1").style;
	obj.position = "absolute";
	obj.overflow = "hidden";
	obj.top = "0px";
	obj.left = "400px";
	if (continueousmode) {
		obj = document.getElementById(divname+"2").style;
		obj.position = "absolute";
		obj.overflow = "hidden";
		obj.top = "0px";
		obj.left = "0px";
	}
	divheight = parseInt(obj.height);
	divwidth = parseInt(obj.width);
	
	if(document.getElementById(divname+"1").offsetHeight){ 
    	divheight=document.getElementById(divname+"1").offsetHeight;
		divwidth=document.getElementById(divname+"1").offsetWidth;
		//alert(divheight)
		//alert(divwidth)
    } 
    else if(obj.pixelHeight){ 
    	divheight=obj.pixelHeight;
		divwidth=obj.pixelWidth;
		//alert(divheight)
		//alert(divwidth)
    }
	
	outrdivwidth = parseInt(document.getElementById("tickerouterframe").style.width);
	
	setTimeout("moveTicker("+intSpeed+", '"+divname+"');",intSpeed);
}

function moveTicker(intSpeed, divname) {
	intspeedsetting = intSpeed
	divnamesetting = divname
	clearTimeout(tickerTimeout);
	checkwidth(divname);
	if (scrollmode == "vertical") {
		var currentheight = parseInt(document.getElementById(divname+"1").style.top)
		document.getElementById(divname+"1").style.top = (currentheight - 1)+"px"
		if (continueousmode) {
			var currentheight = parseInt(document.getElementById(divname+"2").style.top)
			document.getElementById(divname+"2").style.top = (currentheight - 1)+"px"
		}
	} else {
		var currentleft = parseInt(document.getElementById(divname+"1").style.left)
		document.getElementById(divname+"1").style.left = (currentleft - 1)+"px"
		if (continueousmode) {
			var currentleft = parseInt(document.getElementById(divname+"2").style.left)
			document.getElementById(divname+"2").style.left = (currentleft - 1)+"px"
		}
	}
	
	if (scrollmode == "vertical") {
		if (parseInt(document.getElementById(divname+"1").style.top) < -divheight) {
			//move the top of the div to the bottom of its height
			alert("moving div 1 out of sight");
			document.getElementById(divname+"1").style.top = divheight+"px"
		}
		if (continueousmode) {
			if (parseInt(document.getElementById(divname+"2").style.top) < -(divheight*2)) {
				//move the top of the div to the bottom of its height
				document.getElementById(divname+"2").style.top = 0+"px"
				alert("moving div 2 out of sight");
			}
		}
	} else {
		if (parseInt(document.getElementById(divname+"1").style.left) < -divwidth) {
			//move the top of the div to the bottom of its height
			document.getElementById(divname+"1").style.left = outrdivwidth+"px"
		}
		if (continueousmode) {
			if (parseInt(document.getElementById(divname+"2").style.left) < -divwidth) {
				//move the top of the div to the bottom of its height
				document.getElementById(divname+"2").style.left = 0+"px"
			}
		}
	}
	
	tickerTimeout = setTimeout("moveTicker("+intSpeed+", '"+divname+"');",intSpeed);
}

function checkwidth(divname)
{
	// for fixfox!
	if(document.getElementById(divname+"1").offsetHeight){ 
		divwidth=document.getElementById(divname+"1").offsetWidth;
    } 
    else if(obj.pixelHeight){ 
		divwidth=obj.pixelWidth;
    }
}

function stopscroller()
{
	clearTimeout(tickerTimeout);
}

function startscroller()
{
	tickerTimeout = setTimeout("moveTicker("+intspeedsetting+", '"+divnamesetting+"');",intspeedsetting);
}
