function GetCookie(name)
{
  //alert("get Cookie "+name);
  var arg = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  //alert(clen);
  while (i < clen) {
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg)
      {return getCookieVal (j);}
    i = document.cookie.indexOf(" ", i) + 1;
    if (i === 0) {break;}
  }
  return null;
}
function getCookieVal(offset)
{
  var endstr = document.cookie.indexOf (";", offset);
  if (endstr == -1)
    {endstr = document.cookie.length;}
    var ttt = unescape(document.cookie.substring(offset, endstr));
    //alert("endstr="+endstr+" ttt="+ttt);
  return unescape(document.cookie.substring(offset, endstr));
}

function SetCookie(name, value, expires, path, domain, secure)
{
	var newCookie = name + "=" + value;
	newCookie = newCookie + ";expires=08/05/2010 00:00:00";
	newCookie = newCookie +	";path=/";
	document.cookie = newCookie;
}
function getElementStyle(obj, cAttribute) {
    //var obj = document.getElementById(elemID);
    //alert("my tag="+obj.tagName);
        var curVal;
	if (obj.currentStyle){
	curVal=eval('obj.currentStyle.'+cAttribute);
	}
	else{
	//if Mozilla/FF
	curVal=eval('document.defaultView.getComputedStyle(obj, null).'+cAttribute);
	}
	//alert('style attribute '+cAttribute+' = ' + curVal);
	return curVal;
} 
function changeColor()
{
	
        var nums = document.getElementById("menu").childNodes.length;
	var menu = document.getElementById("menu");
     
	for(i=0; i<nums; i++)
	{
	var nums2 = menu.childNodes[i].childNodes.length;
	for(n=0; n<nums2; n++)
	{
		if(menu.childNodes[i].childNodes[n].tagName=="A")
		{
		var mylink = menu.childNodes[i].childNodes[n].href;
		var color = getElementStyle(menu.childNodes[i], "color");
		if(mylink==window.location.href)
		{
			document.getElementById("under_menu").style.backgroundColor=color;
			break;
		}
		}
	}
	}
}
function changeBgSettings()
{
        document.getElementById("mainContentLeftMainText").style.background="none";
}
function showbytag(tagname)
{
   $('f_keyvalue').value=alltrim(tagname);
   $('mytag').selected=true;
   view_docs_list();
}
