
//Copyright e-Business Systems Limited  www.e-businesssystems.co.uk
//special version modified for se
//se version 1 - 25/08/04


var ebsl_button = new Array();

var ebsl_setup_complete = false;



function ebsl_Button_hilo(high,low)
{
	this.hi = high;
	this.lo = low;
	this.hi_img = new Image();
	this.hi_img.src = ebsl_1004 + high;
	this.lo_img = new Image();
	this.lo_img.src = ebsl_1004 + low;
}


function ebsl_Swap_button(id,on_off)
{
	var i;
	for (i = 0; (document.images[i] != null); i++){
		//alert(document.images[i].src);	//temp
		if (document.images[i].src.indexOf(((on_off == "on") ? ebsl_button[id].lo : ebsl_button[id].hi)) >=0)
		{
			document.images[i].src = ((on_off == "on") ? ebsl_button[id].hi_img.src : ebsl_button[id].lo_img.src);
		}
	}
}


function ebsl_Highlight_on(identity)
{
	if (ebsl_setup_complete){
		ebsl_Swap_button(identity,"on");
	}
}

function ebsl_Highlight_off(identity)
{
	if (ebsl_setup_complete){
		ebsl_Swap_button(identity,"off");
	}
}





function Change_style_attribute(attribute_name,id_name,change_to)
{
	//if ((browsertype.netscape6)||(browsertype.ie5plus)){
	
		eval("document.getElementById('" + id_name + "').style." + attribute_name + " = change_to");
	//}
}


//--------------------
function Visibility_off(k)
{
	//if (ebsl_setup_complete)
	{
		
		Change_style_attribute("visibility",k,"hidden");
	}
}


function Visibility_on(k)
{
	//if (ebsl_setup_complete)
	{
		
		Change_style_attribute("visibility",k,"visible");
		Change_style_attribute("display",k,"");

	}
}



function Ebsl_show_hide(k)
{
    if (document.getElementById && document.getElementsByTagName && document.createTextNode) 
    {
    	var element = document.getElementById(k);
        if (element.style.display == 'block') 
        {
               element.style.display = 'none';
        }
        else 
        {
               element.style.display = 'block';
      	}
    }
 }







function Change_text(id,old_text,new_text)
{
	
	var regexp;
	eval("regexp = /" + old_text + "/g");
	document.getElementById(id).innerHTML = document.getElementById(id).innerHTML.replace(regexp,new_text);
	
}









function Hand_on(id)
{
	id.className= "hand_on";
}



function Hand_off(id)
{
	id.className= "hand_off";
}











function ebsl_Control_setup()
{
	
	ebsl_Setup_buttons();	//this should be in the calling web page
	ebsl_setup_complete = true;
}


