/*function hideForm() {
	document.getElementById('subform').style.display = 'none';
	YAHOO.util.Event.addListener('formlink','click',showForm);
}

function showForm(e) {
	YAHOO.util.Event.preventDefault(e);
	document.getElementById('subform').style.display = '';
}

*/

function swapimage() {
	
	offimg = this.src;
	//split the path
	aImg = offimg.split('/');
	
	//get the final item (the image name)
	imgname = aImg[(aImg.length)-1];
	
	//split the image to get the file ext.
	abody = imgname.split('.');
	imgbody = abody[0];
	
	if (imgbody.indexOf('_r')>0) {
		imgbody = imgbody.substring(0,imgbody.length-2);
		
		newimg = imgbody +'.'+abody[1];
	} else {
		newimg = imgbody +'_r.'+abody[1];
	}
	aImg[(aImg.length)-1] = newimg;
	
	onimg = aImg.join('/');
	
	this.src = onimg;
	
	
}

function printme() {
	window.print();
}

function bookmarkme() {
	url = location.href;
	title = window.title;
	if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
  		window.external.AddFavorite(url,title);
  	} else if (navigator.appName == "Netscape") {
    	window.sidebar.addPanel(title,url,"");
  	} else {
    	alert("Press CTRL-D (Netscape) or CTRL-T (Opera) to bookmark");
  	}
}

function access() {
	// apply the rollover states
	// get all images which need a rollver state
	thelist = document.getElementById('access-nav');
	items = thelist.getElementsByTagName('img');
	for(i=0;i<items.length;i++) {
		
		YAHOO.util.Event.addListener(items[i],'mouseover',swapimage);
		YAHOO.util.Event.addListener(items[i],'mouseout',swapimage);
		if(items[i].id == 'printme'){
			YAHOO.util.Event.addListener(items[i],'click',printme);
		}
		if(items[i].id == 'bookmarkme'){
			YAHOO.util.Event.addListener(items[i],'click',bookmarkme);
		}
	}
}

function searchbutton() {
	
	sbut = document.getElementById('search-button');
	YAHOO.util.Event.addListener(sbut,'mouseover',swapimage);
	YAHOO.util.Event.addListener(sbut,'mouseout',swapimage);
}

function backlink() {
	var backdiv = document.getElementById('backlink');
	
	backdiv.innerHTML = '<a href="javascript:history.back()">&lt; back</a>';
}


YAHOO.util.Event.onAvailable('access', access);
YAHOO.util.Event.onAvailable('search-form', searchbutton);
YAHOO.util.Event.onAvailable('backlink', backlink);