function GoogleMap(l1,l2,cap)
{
	pop("http://maps.google.com/maps?f=q&hl=en&q=" + l1 + "," + l2 + "+(" + cap + ")&ie=UTF8&om=1&z=14&ll=" + l1 + "," + l2 + "&spn=0.034449,0.066776","gmap");
}
function losefocus(itm)
{
	itm.blur();
}
function pop(link,nam)
{
	var w;
	w=window.open(link,nam,"height=650,width=900,top=1,left=1,location=no,status=no,titlebar=no,resizable=yes",true);
	w.focus();
}
function hidediv(div)
{
	var sd=document.getElementById(div);
	if(sd)
	{
		sd.style.visibility="hidden";
		sd.style.display="block";
		sd.style.overflow="hidden";
		sd.style.height="1px";
		sd.style.width="1px";
		sd.style.position="absolute";
	}
}
function showdiv(div)
{
	var sd=document.getElementById(div);
	if(sd)
	{
		sd.style.visibility="visible";
		sd.style.display="inline";
		sd.style.overflow="";
		sd.style.height="";
		sd.style.width="";
		sd.style.position="";
	}
}
function showdivpos(div,t,l)
{
	showdiv(div);
	var sd=document.getElementById(div);
	if(sd)
	{
        sd.style.left=l+"px";
        sd.style.top=t+"px";
	}
}

function getValue(id)
{
	var returnValue="";
	var idType=id.substring(0,3);
	var g=document.getElementById(id);
	if(g)
	{
		if(idType=="txt")
		{
			returnValue=g.value;
		}
		if(idType=="sel")
		{
			try
			{
				returnValue=g.options[g.selectedIndex].value;
			}
			catch(exp)
			{
				returnValue="";
			}
		}
		if(idType=="chk")
		{
			returnValue=(g.checked)?1:0;
		}
		if(idType=="rdo")
		{
			returnValue=(g.checked)?1:0;
		}
	}
	//alert(id + " : " + returnValue);
	return returnValue;
}

function setMenuScroll(ht)
{
	if(document.getElementById("tcMenu") && ht.length>0)
	{
		document.getElementById("tcMenu").scrollTop=document.getElementById("tcMenu").scrollHeight*ht;
	}
}
function nav(link)
{
	window.location=link;
}
function setFocus(id)
{
	var g=document.getElementById(id);
	if(g)
	{
		g.focus();
	}
}


var bo_ns_id = 0;


function startIeFix(){
  if(isIE()){
    document.write('<div id="bo_ns_id_' + bo_ns_id + '"><!-- ');
  }
}


function endIeFix(){
  if(isIE()){
    document.write('</div>');
    var theObject = document.getElementById("bo_ns_id_" + bo_ns_id++);
    var theCode = theObject.innerHTML;
    theCode = theCode.substring(4 ,9+theCode.indexOf("</object>"))
    document.write(theCode);
  }
}

function isIE(){
  // only for Win IE 6+
  // But not in Windows 98, Me, NT 4.0, 2000
  var strBrwsr= navigator.userAgent.toLowerCase();
  if(strBrwsr.indexOf("msie") > -1 && strBrwsr.indexOf("mac") < 0){
    if(parseInt(strBrwsr.charAt(strBrwsr.indexOf("msie")+5)) < 6){
      return false;
    }
    if(strBrwsr.indexOf("win98") > -1 ||
       strBrwsr.indexOf("win 9x 4.90") > -1 ||
       strBrwsr.indexOf("winnt4.0") > -1 ||
       strBrwsr.indexOf("windows nt 5.0") > -1)
    {
      return false;
    }
    return true;
  }else{
    return false;
  }
}

/*  AJAX START */
function SubmitGrade(enc)
{
	Ajax.AjaxClasses.AddGrade(enc,GetGradeResult);
}
function GetGradeResult(res) 
{
    if(res.value!=null)
    {
		if(res.value.length==2)
		{
			if(document.getElementById("grd" + res.value[0]))
			{
				document.getElementById("grd" + res.value[0]).innerHTML=res.value[1];
			}
		}	
    }
}
/*  AJAX END */