if(window.navigator.appName == "Microsoft Internet Explorer")
IsIE = true;
else IsIE = false;

function getTop(e){
   var t = e;
   var y = t.offsetTop;
   while (t.offsetParent != null) {
      t = t.offsetParent;
      y += t.offsetTop;
   }
   return y;
}

function getLeft(e){
   var t = e;
   var x = t.offsetLeft;
   while (t.offsetParent != null) {
      t = t.offsetParent;
      x += t.offsetLeft;
   }
   return x;
}

function LoginPopup() 
{
	alert('This function is not implemented yet.');
}


function ShowLoginForm(id,parent){
	var Id = document.getElementById(parent);
	var x = getLeft(Id);
	var y = getTop(Id);
	Id = document.getElementById(id);
	if(Id != null){
		if(IsIE)
		{
			Id.style.display="inline";
		}else{
			Id.style.display="inherit"
		}
		Id.style.left = x - 400;
		show = 1;	
	}
}


	var curr_elem_id = "login_form";
	var hint_elem_id = "hint";
	var docWidth = 0;
	
	function getWidth(){
		docWidth = document.body.clientWidth;
		//alert("Here");
	}
	
	function show_form(){
		var id=document.getElementById(curr_elem_id);
		if(br_v()){
			id.style.display="inline";
			id.style.visibility="visible"
		}
		else {
	    	id.style.display="table";
			id.style.visibility="visible"
	    }
	}
	
	function hide_form(id){
		var id=document.getElementById(id);
		id.style.display = "none";	
	}
	
	function login_form(on_off){
		if(on_off == true){
			show_form();
		}
		else {
			hide_form();
		}
	}
	//-----------------------------------------------------------------
	
	function show_hint(){
	
		var id=document.getElementById(hint_elem_id);
	    var im = document.getElementById("image");
	    var top  = im.offsetHeight + 2;
	    var left = im.offsetWidth + 2;
			for (; im; im = im.offsetParent)
			  {
			    top  += im.offsetTop;
			    left += im.offsetLeft;
			  }
		if(br_v()){
		    id.style.left = left;
			id.style.display="inline";
			id.style.visibility="visible"
		}
		else {
		    id.style.left = left;
		    //id.style.top = y - 930 + document.body.scrollTop;
	    	id.style.display="table";
			id.style.visibility="visible"
	    }
	}
	
	function hide_hint(){
		var id=document.getElementById(hint_elem_id);
		id.style.display = "none";	
	}
	
	function hint(on_off){
		if(on_off == true){
			show_hint();
		}
		else {
			hide_hint();
		}
	}
	
	//-----------------------------------------------------------------	
	function br_v(){
		if(window.navigator.appName == "Microsoft Internet Explorer")
			return true;
		else 
			return false;
	}
