var this_url = this.location.href.replace(/([^\?]*)\?(.*)$/,'$1');

debug=0;
if(this.location.href.search(/test/) != -1){
	debug=1;
}
//************ highlight_menus *******************
function highlight_menus()
{ 
    var main_menu_obj = getObj('main_menu');    
    
    //var page_link_obj = getObj('page_link');
    //var page_link_url;
    //if(page_link_obj) page_link_url = page_link_obj.getElementsByTagName('A')[0];
    //if(page_link_url) page_link_url = page_link_url.href;

    if(main_menu_obj){
        var a_col = main_menu_obj.getElementsByTagName('A');
        for(i=0;i<a_col.length;i++)
            //if(a_col[i].href == (page_link_url ? page_link_url : this_url)){
            if(a_col[i].href == this_url){
            	if(debug) alert(this_url);
                img = a_col[i].getElementsByTagName('IMG')[0];
                if(img){
                    change_to_mouseover(img,0);
                    break;
                }
            }
    }
}

//*********************************************
function change_to_mouseover(obj,enable_onclick)
{
    if(obj.onmouseover) obj.onmouseover();
    obj.onmouseout = null;
    if(!enable_onclick){
        obj.style.cursor = 'default';
      obj.onclick=function(){return false;};
  }
}

//*********************************************
var loaded = false;
var id_obj;

function showme(el, id, opacStart, opacEnd, millisec) {

	id_obj = getObj(id);
	if(!loaded || !id_obj || id_obj.style.opacity!=0) return;
	
	el.onmousemove = null;
	
    //speed for each frame
    var speed = Math.round(millisec / 128);
    var timer = 0;

    //determine the direction for the blending, if start and end are the same nothing happens
    if(opacStart > opacEnd) {
        for(i = opacStart; i >= opacEnd; i--) {
            setTimeout("changeOpac(" + i + ",id_obj)",(timer * speed));
            timer++;
        }
    } else if(opacStart < opacEnd) {
        for(i = opacStart; i <= opacEnd; i++)
            {
            setTimeout("changeOpac(" + i + ", id_obj )",(timer * speed));
            timer++;
        }
    }
}

//change the opacity for different browsers
function changeOpac(opacity, obj) {
    var object = obj.style;
		var opac = opacity / 128;
    object.opacity = (opac);
    object.MozOpacity = (opac);
    object.KhtmlOpacity = (opac);
    object.filter = "alpha(opacity=" + opacity + ")";
} 

//*********************************************
function getObj(obj_name)
{
    return document.getElementById ? document.getElementById(obj_name) : eval(obj_name);
}

