var IE = document.all?true:false;
if (!IE) document.captureEvents(Event.MOUSEMOVE)
    document.onmousemove = getMouseXY;
    
var mouse_position_X = 0;
var mouse_position_Y = 0;
function getMouseXY(e) {
	if (IE) { // grab the x-y pos.s if browser is IE
    	mouse_position_X = event.clientX + document.body.scrollLeft;
        mouse_position_Y = event.clientY + document.body.scrollTop;
	}
	else {  // grab the x-y pos.s if browser is NS
	   mouse_position_X = e.pageX;
	   mouse_position_Y = e.pageY;
    }  
	if (mouse_position_X < 0){mouse_position_X = 0;}
	if (mouse_position_Y < 0){mouse_position_Y = 0;}
	return true;
}


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.x){
        curtop += obj.x;
    }   
    return curtop;
}


function findPositionObj(obj){
    var pos = new Array();
    pos['X'] = findPosX(obj);       
    pos['Y'] = findPosY(obj);
    return pos;
}

function info_text_input_blur(obj_id,val_default)
{
    var obj = document.getElementById(obj_id);
    if(obj.value=='') 
    {
        obj.value = val_default
    }
}

function info_text_input_focus(obj_id,val_default)
{
    var obj = document.getElementById(obj_id);
    if(obj.value==val_default) 
    {
        obj.value = ''
    }
}


function change_visibility_status(id)
{
  if(document.getElementById(id).style.display == 'none')
  {
    document.getElementById(id).style.display = 'inline';    
  }
  else
  {
     document.getElementById(id).style.display = 'none';
  }  
}