function getWindowHeight() {
  var myHeight = 0;
  if( typeof( window.innerHeight ) == 'number' ) {
    //Non-IE
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'

    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myHeight = document.body.clientHeight;
  }
  return myHeight;
}

function getWindowWidth() {
  var myWidth = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
  }
  return myWidth;
}

function getScrollY() {
  var scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
  }
  return scrOfY;
}

function getScrollX() {
  var scrOfX = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfX = document.body.scrollLeft;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfX = document.documentElement.scrollLeft;
  }
  return scrOfX;
}

function hide(in_id)
{
	document.getElementById(in_id).style.visibility = "hidden";
}
function show(in_id)
{
	document.getElementById(in_id).style.visibility = "visible";
}
function get_event(e){
	
	if (!e) var e = window.event;

	return e;
	
}

function get_target(e){
	
	var targ;
	
	var e = get_event(e);
	
	if (e.target){
		
		targ = e.target;
		
	}else if (e.srcElement){
		
		targ = e.srcElement;
	
	}
	
	// defeat Safari bug
	if (targ.nodeType == 3) {
	
		targ = targ.parentNode;
	}
	
	return targ;
}

function get_key_code(e){
	
	var e = get_event(e);
	
	var key_code;
	
	if (e.keyCode){
		
		 key_code = e.keyCode;
		 
	}else if (e.which){
		
		key_code = e.which;
		
	}
	
	return key_code;
	
}

function getNextNode(node, name){

	parent = node.parentNode;
	
	children = parent.childNodes;
	
	var look = false;
	
	for(var i = 0; i < children.length; i++){
		
		if(look){
			
			if(children[i].nodeName == name){
			
				return children[i];
			
			}
		}
			
		if(children[i].id == node.id){
			
			look = true;
			
		}	
	}	
}

function getObj(name)
{
	if (document.getElementById && document.getElementById(name)){
		
		this.obj = document.getElementById(name);
		this.style = document.getElementById(name).style;
	
	}else if (document.all){

		this.obj = document.all[name];
		this.style = document.all[name].style;
	
	}else if (document.layers){
		
		this.obj = document.layers[name];
		this.style = document.layers[name];
	}
}

function getFrameObj(name, frame_name)
{
	
	frame_doc = getFrame(frame_name).document;
		
	if (frame_doc.getElementById){
			
		this.obj = frame_doc.getElementById(name);
		this.style = frame_doc.getElementById(name).style;
		
	}else if (frame_doc.all){

		this.obj = frame_doc.all[name];
		this.style = frame_doc.all[name].style;
	
	}else if (frame_doc.layers){
		
		this.obj = frame_doc.layers[name];
		this.style = frame_doc.layers[name];
	}
}

function getFrame(frame_name){
	
	if(window.frames){
		
		return window.frames[frame_name];
	
	}else if(document.frames){
		
		return document.frames(frame_name);
		
	}
}

function findPosX(obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}

function findPosY(obj)
{
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}


function loadXMLDoc(url, processChange) {
	// Internet Explorer


	try { req = new ActiveXObject("Msxml2.XMLHTTP"); }
	catch(e) {
		try { req = new ActiveXObject("Microsoft.XMLHTTP"); }
		catch(oc) { req = null; }
	}
	
	// Mozailla/Safari
	if (req == null && typeof XMLHttpRequest != "undefined") {
		req = new XMLHttpRequest();
	}
	
	// Call the processChange() function when the page has loaded
	if (req != null) {
		
		//alert(url);
		
		req.onreadystatechange = processChange;
		req.open("GET", url, true);
		req.send(null);
	}
}
