
function spanish(){
	CSSRule('.spanish',{display:''});
	CSSRule('.english',{display:'none'});
	CSSRule('#sSpanish',{color:'#689cd3'});
	CSSRule('#sEnglish',{color:'#bdd8f4'});
	CSSRule('#sSpanish',{textDecoration:'none'});
	CSSRule('#sEnglish',{textDecoration:'underline'});
	createCookie('LANGUAGE','spanish');
	setTitle();
}
function english(){
	CSSRule('.spanish',{display:'none'});
	CSSRule('.english',{display:''});
	CSSRule('#sSpanish',{color:'#bdd8f4',textDecoration:'underline'});
	CSSRule('#sEnglish',{color:'#689cd3',textDecoration:'none'});
	createCookie('LANGUAGE','english');
	setTitle();
}
function setTitle(){
	var lang = readCookie('LANGUAGE')
	document.title = pageTitle[lang];
	$('sSpanish').className = lang == 'spanish' ? 'sel' : 'fLink'; 
	$('sEnglish').className = lang == 'english' ? 'sel' : 'fLink';
	$('about_e').style.visibility = 'hidden';
	$('about_s').style.visibility = 'hidden';
	$('puerto_e').style.visibility = 'hidden';
	$('puerto_s').style.visibility = 'hidden';
	$('events_e').style.visibility = 'hidden';
	$('events_s').style.visibility = 'hidden';
}

function dCookie(){
	eraseCookie('LANGUAGE');
	eraseCookie('language');
}


function photoSwapper(img,box) {
	document.getElementById(box).src = "images/" + img;
}

var timeout	= 500;
var closetimer	= 0;
var ddmenuitem	= 0;

function mopen(id)
{	
	mcancelclosetime();
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
	ddmenuitem = document.getElementById(id);
	ddmenuitem.style.visibility = 'visible';
}
function mclose()
{
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
}
function mclosetime()
{
	closetimer = window.setTimeout(mclose, timeout);
}
function mcancelclosetime()
{
	if(closetimer)
	{
		window.clearTimeout(closetimer);
		closetimer = null;
	}
}



function pullLeaf(id) {
	document.getElementById(id).style.background = "url('images/leaf.gif') no-repeat";
}
function dropLeaf(id) {
	document.getElementById(id).style.background = "";
}



function frontPhoto2(i) {
	$(i).style.zIndex = '+2';
	$(i).style.width = '258px';
	$(i).style.height = '188px';
	$(i).style.marginRight = '-15px';
	$(i).style.marginLeft = '-5px';
	$(i).style.marginBottom = '-30px';
}
function backPhoto2(i) {
	$(i).style.zIndex = '+1';	
	$(i).style.width = '228px';
	$(i).style.height = '158px';
	$(i).style.marginRight = '0px';
	$(i).style.marginLeft = '10px';
	$(i).style.marginBottom = '0px';
}
