

/* ======================================= */

function bookmark(title,url) {
	if (window.sidebar) // firefox
		window.sidebar.addPanel(title, url, "");
	else if(window.opera && window.print){ // opera
		var elem = document.createElement('a');
		elem.setAttribute('href',url);
		elem.setAttribute('title',title);
		elem.setAttribute('rel','sidebar');
		elem.click();
	} else if(document.all) { // ie
		window.external.AddFavorite(url, title);
	} else {
		alert('Please press Control-D (for Windows, Linux) or Command-D (for Apple) to bookmark this page');
	}
}
function emailPage(uid) {
	window.open("/Email-Page?UID="+uid,"pop","width=300,height=250,toolbars=0,scrollbars=0");
}
function printPage() {
	window.print();
}
function showEvents(type) {
	document.getElementById('display').value=type;
	document.getElementById('refineSearch').submit();
}

spotlightId = 0;
spotlightTags = Array();
function startSpotlight(json) {
	var list = eval(json);
	for (i = 0; i < list.length; i++) {
		image = new Image();
		image.src=list[i]['Image'];
		image.alt=list[i]['Name'];
		image.border=0;
		spotlightTags[i] = document.createElement('a');
		spotlightTags[i].setAttribute('href', list[i]['URL']);
		spotlightTags[i].setAttribute('title', list[i]['Name']);
		spotlightTags[i].appendChild(image);
	}
	spotlight();
}
function spotlight() {
	if (!document.getElementById('spotlightImage')) document.write('<div id="spotlightImage"></div>');
	div = document.getElementById('spotlightImage');
	if (!spotlightTags[spotlightId]) spotlightId = 0;
	try {id=spotlightId-1;if (id < 0) id = spotlightTags.length-1;div.removeChild(spotlightTags[id]);}catch(e){}
	div.innerHTML = '';
	div.appendChild(spotlightTags[spotlightId++]);
	setTimeout("spotlight()",7000);
}


function fieldClear(obj, color) {
	if(obj.Val) {
		if (obj.value == '') { 
			obj.style.color = color;
			obj.value = obj.Val;
			obj.Val = null;
			obj.first = null;
		} else {
			obj.Val = null;
		}
	} else if (!obj.first) {
		obj.style.color = '#000';
		obj.Val = obj.value;
		obj.value = ''; 
		obj.first = 'true';
	} 
}
jQuery(document).ready(function () {
	jQuery("#nav ul > li > a[href=\""+location.pathname+"\"]").parent().addClass('selected');
	jQuery("#nav ul > li").hover(
		function() {
			jQuery(this).addClass('selected');
		},
		function() {
			jQuery(this).removeClass('selected');
			jQuery("#nav ul > li > a[href=\""+location.pathname+"\"]").parent().addClass('selected');
		}
	);
});

