//random headers
var theImages = new Array()

theImages[0] = '../images/TBP-01.jpg'
theImages[1] = '../images/TBP-02.jpg'
theImages[2] = '../images/TBP-03.jpg'
theImages[3] = '../images/TBP-04.jpg'
theImages[4] = '../images/TBP-05.jpg'
theImages[5] = '../images/TBP-06.jpg'
theImages[6] = '../images/TBP-07.jpg'
theImages[7] = '../images/TBP-08.jpg'
theImages[8] = '../images/TBP-09.jpg'
theImages[9] = '../images/TBP-10.jpg'
theImages[10] = '../images/TBP-11.jpg'

var j = 0
var p = theImages.length;

var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write('<img src="'+theImages[whichImage]+'">');
}

//nav
function changeStyleById(id){
	if (document.getElementById){
		var nodeObj = document.getElementById(id);
		//nodeObj.style.display = 'none';
		if (nodeObj.style.display == 'none'){
			nodeObj.style.display = 'block';
		}else if(nodeObj.style.display == 'block'){
			nodeObj.style.display = 'none';
		}else{
			nodeObj.style.display = 'block';
		}
	}
}

function popUp(link, width, height) {
   winStats='toolbar=yes,location=no,directories=no,menubar=no,scrollbars=yes'
   if (navigator.appName.indexOf("Microsoft")>=0) {
	  winStats+=',left=50,top=100,width=' + width + ',height=' + height
	}else{
	  winStats+=',screenX=50,screenY=100,width=' + width + ',height=' + height
	}
   win=window.open(link,"",winStats)
}

function obfuscate_email(user, url, domain, showPrefix){
    var prefix = '';
    if(showPrefix != null) prefix = 'mailto:';
    return prefix + user + '@' + url + '.' + domain;
}

function validate(form)
{
	var string = form.fields.value;
	var fields = string.split(',');
	
	for(i=0; i<fields.length; i++)
	{
		var field = form[fields[i]];
		//field.type
		
		if(field.value == '')
		{
			alert('Please complete all required fields');
			return false;
		}
	}
	
	return true;
}
