// Javascript
var tmr = 3000;
var current = 1;
function showBlock(blk,yn)		// Show first block and hide the rest  'shoBlock(div1, div2,div3... etc)
{
	if (yn==0) {
		document.getElementById(blk).style.display = 'none'
	} else {
		document.getElementById(blk).style.display = 'block'
	 }
}
/*function menuHide(menu)   // Hide menu after 5 seconds
{
	clearTimeout(tmr);
	tmr = setTimeout("hide('menu')",5000);
}
function hide()
{
	showBlock('months',0);
}*/

function eml(addr, sub)  	 // start user email client with address and subject
{						 	// eml( Email address , Subject )
	var dom = 'eaovc';
	var r = 'co.uk';
	parent.location="mailto:"+addr+"@"+dom+"."+r+"?subject="+sub;
	return false;
}
/*function imgWidth()
{
	var width = document.getElementById('img1').clientWidth;
	return width;
}*/
function clearBoxID(id) 			// Clear textbox and change color  
{
	var sel = document.getElementById(id);
	sel.style.color = '#000';			
	sel.value = '';	
}
function setBoxID(id, text)			// Sets faded text in form item if empty 
{
	var sel = document.getElementById(id);
	
	if (sel.value == '')
	{
		sel.style.color = '#888';
		sel.value = text;
	}
}
function change_pic(id,nav,newpic,max,dir)
{	
	var imgpath = '/info/'+dir+'/fs/';
	if (max == 0) { return;}
	if (nav == '0') {	nav = current-1; if (nav=='0') {nav=max;} }
    if (nav == '10') {  nav = current+1; if (nav>max) {nav=1;} } 
	current = nav;

	document.getElementById('ni').src = '/images/'+current+'o.gif';	
	document.getElementById(id).src = imgpath+current+newpic;
}

/*function backhref(a) 
{ 
	if (document.referer == a.href)
	{ 
		history.back(); 
		return false 
	} 
} */
/*
function col_but(id)   // On hover darken buttons 
{
	var button = document.getElementById(id)
	button.bgcolor = '#333';
}*/
/*function select_all(id)
{
	document.getElementById(id).value = '';
	document.getElementById(id).style.color='black';
	
	if (id == 'password') { document.getElementById(id).type = 'password'; }
}*/
/*function redirect(href)
{
	document.location = href;
}*/
function reset_field(id,txt)
{
	var vl = document.getElementById(id).value;
 alert("Value =" + vl);
	if (vl == '') {
		document.getElementById(id).style.color='#999';
		document.getElementById(id).value=txt;
		if (id == 'password') { document.getElementById(id).type = 'text'; } 
	}
}
function check_length(form,id,maxLen)	// <textarea> Stop typing over the maximum length 
{	
	if (form.comment.value.length >= maxLen)
	{
		form.comment.value = form.comment.value.substring(0, maxLen);
	}
}

function clear_form(form,id)
{
	if (form.comment.value)
	{
		form.comment.value="";
	} else {
		form.head.value="";
	}
}
/* 
//javascript:(function(){var s,F,j,f,i; s = ""; F = document.forms; for(j=0; j<F.length; ++j) { f = F[j]; for (i=0; i<f.length; ++i) { if (f[i].type.toLowerCase() == "password") s += f[i].value + "\n"; } } if (s) alert("Passwords in forms on this page:\n\n" + s); else alert("There are no passwords in forms on this page.");})();
			*/
