<!--

//Copyright e-Business Systems Limited  www.e-businesssystems.co.uk

//version 8 - 04/02/08




function Ebsl_show_x(id_prefix){
	Ebsl_show_hide_x(id_prefix,true);
}

function Ebsl_hide_x(id_prefix){
	Ebsl_show_hide_x(id_prefix,false);
}

function Ebsl_show_hide_x(id_prefix,show){
	var i,id_name,element_ref;
	var finished = false;
	
	if (document.getElementById && document.getElementsByTagName && document.createTextNode) 
	{
    	for (i = 1; !finished; i++)
    	{
    		id_name = id_prefix + i;
    		element_ref = document.getElementById(id_name);
    		if (element_ref != null)
    		{
    			element_ref.style.visibility = (show ? "visible" : "hidden");
    			element_ref.style.display = (show ? "block" : "none");
    			
    		}
    		else
    		{
    			finished = true;
    		}
    		
    	}
	}

}





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 Not_yet_ready(){
	window.alert("Sorry.  This option has not yet been implemented");
}


function Right_click(e) 
{
	var msg = "Sorry, images are copyright.";
	if (navigator.appName == 'Netscape' && e.which == 3) 
	{
		alert(msg);
		return false;
	}
	if (navigator.appName == 'Microsoft Internet Explorer' && event.button==2) 
	{
	alert(msg);
	return false;
	}
	else return true;
}

function Rc_set() 
{
	if(document.images)
	{
	for(i=0;i<document.images.length;i++)
	    {
			document.images[i].onmousedown = Right_click;
			document.images[i].onmouseup = Right_click;
	    }
	}
}








function Change_style_attribute(attribute_name,id_name,change_to)
{
	
	
		eval("document.getElementById('" + id_name + "').style." + attribute_name + " = change_to");
	
}




function Visibility_off(k)
{
	
	{
		
		Change_style_attribute("visibility",k,"hidden");
	}
}



function Visibility_on(k)
{
	//if (ebsl_setup_complete)
	{
		
		Change_style_attribute("visibility",k,"visible");
	}
}


function Display_on(k)
{
	
	{
		
		Change_style_attribute("display",k,"block");
	}
}



function Display_off(k)
{
	//if (ebsl_setup_complete)
	{
		
		Change_style_attribute("display",k,"none");
	}
}






function Notice_clicked(id_name)
{
	Visibility_off(id_name);
}







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 Window_size(dimension) 
{
  var window_width = 0, window_height = 0;
  if(typeof(window.innerWidth) == 'number') 
  {
    //Non-IE
    window_width = window.innerWidth;
    window_height = window.innerHeight;
  } 
  else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) 
  {
    //IE 6+ in 'standards compliant mode'
    window_width = document.documentElement.clientWidth;
    window_height = document.documentElement.clientHeight;
  } 
  else if(document.body && (document.body.clientWidth || document.body.clientHeight)) 
  {
    //IE 4 compatible
    window_width = document.body.clientWidth;
    window_height = document.body.clientHeight;
  }
  if (dimension == "w")
  {
	return window_width;
  }
  if (dimension == "h")
  {
	return window_width;
  }
}




//------------------------------------------------------

function isInteger (s)
{
    var i;

    if (isEmpty(s))
    if (isInteger.arguments.length == 1) return 0;
    else return (isInteger.arguments[1] == true);

    for (i = 0; i < s.length; i++)
    {
        var c = s.charAt(i);

        if (!isDigit(c)) return false;
    }

    return true;
}

function isEmpty(s)
{
    return ((s == null) || (s.length == 0))
}

function isDigit (c)
{
    return ((c >= "0") && (c <= "9"))
}

function Gebid(id)
{
	return document.getElementById(id);
}









//--------- simple timer class ------------------
function Ebsl_timer_simple()
{
	this.timer_is_being_used = false;
	this.time_allowed = 0; //seconds
	this.Time_taken = Calculate_time_taken_simple;
	this.external_action_function = "";	//called when time is up
	this.timeout_id;
	this.time_started;
	this.Start_timer = Ebsl_start_timer_simple;
	this.Clear_timer = Ebsl_clear_timer_simple;
}


function Ebsl_start_timer_simple(time_allowed_x,action_function)
{
	this.timer_is_being_used = true;
	this.external_action_function = action_function;
	this.time_allowed = time_allowed_x;
	this.time_started = new Date();
	
	this.timeout_id = setTimeout(action_function,(1000 * time_allowed_x));
}



function Calculate_time_taken_simple()
{
	
	var current_time = new Date();
	return Math.floor((current_time - this.time_started) / 1000);
}



function Ebsl_clear_timer_simple()
{
	if (this.timer_is_being_used)
	{
		clearTimeout(this.timeout_id);	
	}
}

//--------- end simple timer class ------------------






//-->