function mapgoster (el, container, width, height, xOffset, yOffset, y, x, hname){

 if (document.getElementById){
        var e = document.getElementById(el);
        var c = document.getElementById(container);
      
        if (c.style.display == "block"){
            c.style.display="none";
	return false;
        }
		c.style.visibility = 'hidden';
		c.style.display = 'block';
		var box = getDimensions(e);
		var left = box.x, top = box.y;
		if(xOffset) left += xOffset;
		if(yOffset) top += yOffset;
		if(!width) width = c.offsetWidth;
		var bodywidth = document.getElementById('main').offsetWidth;
		if((left+width) > bodywidth) left = (bodywidth - width - 40);
		
        c.style.left = left+'px';
        c.style.top = top+'px';
       // c.style.width =width+'px';
       // c.style.height=height+'px';
	c.style.visibility = 'visible';
 	GMapload(y,x,hname);

     return false;
    } 
}
function hideFrameContainer (container, frame, busyUrl) {
    if (document.getElementById){
        var c=document.getElementById(container);
        var f=document.getElementById(frame);
        c.style.display="none";
    }
}
function showFrameContainer (el, container, frame, url, width, height, xOffset, yOffset, busyUrl){
 
if (document.getElementById){
        var e = document.getElementById(el);
        var c = document.getElementById(container);
        var f = document.getElementById(frame);
    //    if (c.style.display == "block"){
    //        c.style.display="none";
		//	return false;
    //    }
        if (f.src != url) f.src=url;
		// make invisible and set display to block
		// so that we may measure the element
		c.style.visibility = 'hidden';
		c.style.display = 'block';
		var box = getDimensions(e);
		var left = box.x, top = box.y;
		if(xOffset) left += xOffset;
		if(yOffset) top += yOffset;
		if(!width) width = c.offsetWidth;
		var bodywidth = document.body.offsetWidth;
		if((left+width) > bodywidth) left = (bodywidth - width - 40);
        c.style.left = left+'px';
        c.style.top = top+'px';
		    c.style.visibility = 'visible';
        return false;
    } else {
        window.open(url);
    }
}
function getDimensions( elm ) {
	var box = { x:0, y:0, w:0, h:0 };
	if(document.getBoxObjectFor) {
		var boxRef = document.getBoxObjectFor(elm);
		box.x = boxRef.x;
		box.y = boxRef.y;
		box.w = boxRef.width;
		box.h = boxRef.height;
	}
	else if(elm.getBoundingClientRect) {
		var rxIE50 = /MSIE 5\.0/g;
		var boxRef = elm.getBoundingClientRect();
		box.x = boxRef.left;
		box.y = boxRef.top;
		box.w = (boxRef.right - boxRef.left);
		box.h = (boxRef.bottom - boxRef.top);
	
		if(document.compatMode && document.compatMode != 'BackCompat') {
			box.x += document.documentElement.scrollLeft - 2;
			box.y += document.documentElement.scrollTop - 2;
		}
		else if(!gClientIsIE5) {
			box.x += document.body.scrollLeft - 2;
			box.y += document.body.scrollTop - 2;
		}
	}
	else {
		
		box.w = elm.offsetWidth;
		box.h = elm.offsetHeight;
		while(elm) {
			box.x += elm.offsetLeft;
			box.y += elm.offsetTop;
			if(elm.offsetParent) 
				elm = elm.offsetParent;
			else
				break;
		}
	}
	var cc;
	if(cc = document.getElementById('mainbody'))
		box.x -= cc.offsetLeft;
	return box;
}
var gClientIsGecko = (window.controllers) ? true : false;
var gClientIsOpera = (window.opera) ? true : false;
var gClientIsIE    = (document.all && !gClientIsOpera) ? true : false;
var gClientIsIE5   = (gClientIsIE && /MSIE 5\.0/.test(navigator.appVersion)) ? true : false;
var gClientIsMac   = (/Mac/.test(navigator.appVersion)) ? true : false;
function getBrowserWidth(){
  var w = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    w = window.innerWidth;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    w = document.documentElement.clientWidth;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    w = document.body.clientWidth;
  }
  return w;
}

function getBrowserHeight(){
  var h = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    h = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    h = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    h = document.body.clientHeight;
  }
  return h;
}

function showDiv (el, div, alignX, alignY) {
	// (i) popups etc

	if (document.getElementById){
    	var i = document.getElementById(el);
		var c = document.getElementById(div);
        if (c.style.display != "block"){
			
		var box = getDimensions(i);
			var left = box.x, top = box.y;
			c.style.visibility = 'hidden'; 
			c.style.display = "block";    
	
		left += i.offsetWidth;
		top += i.offsetHeight;

	  if(gClientIsIE) {
			left=left-5;
			top=top-128;
			}
        	c.style.left = left+'px';
	        c.style.top = top+'px';
			c.style.visibility = 'visible';
		} else {
			c.style.display="none";
		}
	}
}
function hideDiv (div) {
	if (document.getElementById){
		var c=document.getElementById(div);
		c.style.display="none";
	}
}


