try{ 
	HTMLElement.prototype.contains = function(node){ 
		if (node == null) 
			return false; 
		if (node == this) 
			return true; 
		else 
			return this.contains(node.parentNode); 
	} 
}catch(E){  }

//Fix for IE getElementsByName//
if(typeof(window.external) != 'undefined'){
	document.getElementsByName = function(name, tag){
		if(!tag){
			tag = 'div';
		}
		var elems = document.getElementsByTagName(tag);
		var res = []
		for(var i=0;i<elems.length;i++){
			att = elems[i].getAttribute('name');
			if(att == name) {
				res.push(elems[i]);
			}
		}
		return res;
	}
}
//-->


function menuTimeout(){
	if(currMenuTrackId != ''){
		menuName = "menu_" + currMenuTrackId;
		document.getElementById(menuName).style.display = "none";
		
	}
	currMenuTrackId = '';
}

function pageSize() {
	var myWidth = 0, myHeight = 0;
	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	}
	  var dims = { "width" : myWidth, "height" : myHeight };
	  return dims;
}

function findPosY(obj)
  {
    var curtop = 0;
    if(obj.offsetParent)
        while(1)
        {
          curtop += obj.offsetTop;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.y)
        curtop += obj.y;
    return curtop;
  }