/*<CUSTOM>*/

function clearsearchbox() {
	if(document.getElementById('searchinput').value == "search"){
		document.getElementById('searchinput').value = '';
	}
}

function settextsize() {
	// Searches for existance of cookie
	var starter = document.cookie.indexOf("TEXTSIZE=");
	var ender = document.cookie.indexOf("ENDTEXTSIZE");
	var size = document.cookie.substring(starter+9,ender);

	/*if the cookie wasn't found (text sizing never having been done before), 
	output the bog-standard stylesheet html tag  */
	if (starter < 0) {
		//alert('no cookie');
		document.getElementById('bodycss').href='/css/front/body.css';
	}
	/*Otherwise, if the cookie IS found, load the correct size.*/
	else {
		//alert('/css/front/body' +size+ '.css');
		document.getElementById('bodycss').href='/css/front/body' +size+ '.css';
	}
}

function textsizer(the_size){
	
	//if there is no size specified, set small cookie
	if(the_size==""){
	var the_cookie ="TEXTSIZE=ENDTEXTSIZE; path=/";
	document.cookie = the_cookie;
	document.getElementById('bodycss').href='/css/front/body.css';
	}
	
	if (the_size=="med"){
		//set medium cookie
		var the_cookie ="TEXTSIZE=medENDTEXTSIZE; path=/";
		document.cookie = the_cookie;
		document.getElementById('bodycss').href='/css/front/bodymed.css';
	}
	
	if (the_size=="lrg"){
		//set large cookie
		var the_cookie ="TEXTSIZE=lrgENDTEXTSIZE; path=/";
		document.cookie = the_cookie;
		document.getElementById('bodycss').href='/css/front/bodylrg.css';
	}
}

$(function(){
	$('#right-column-content img[@alt="tell a friend"]').before('<img src="/display_images/icon_print.gif" width="14" height="12" alt="Print this page" style="margin-right:4px;" /> <a href="#" onclick="javascript: print();return false;">Print this page</a><span style="color:white;">|</span><br />');	
	
	//links opening in new windows
	$('a[@rel=popup]').click(function(){
		window.open($(this).attr("href"));
		return false;
	});
});

