function css() {
	
	
	if($.browser.msie){
		$('#topnav li, #topnav li div, #menu li').hover( 
			function(){ $(this).addClass('hover'); },
			function(){ $(this).removeClass('hover');
		});
		
	}

		$('#topnav li ul, #menu li div').hover( 
			function(){ $(this).parent('li').addClass('hover'); },
			function(){ $(this).parent('li').removeClass('hover');
		});

}

$(document).ready(css);

// toggle search widget

function toggleSearch() {
    if (document.getElementById('searchwidget').style.display == 'none') {
        document.getElementById('searchwidget').style.display = 'block'
        document.getElementById('searchlink').style.display = 'none'
    } else {
        document.getElementById('searchwidget').style.display = 'none'
        document.getElementById('searchlink').style.display = 'block'
    }
}


// contact form validation

function validate() {

if (document.joinform.namefirst.value=='') {
	alert('Please enter your first name.');
	return false;
	}
if (document.joinform.namelast.value=='') {
	alert('Please enter your last name.');
	return false;
	}
if (document.joinform.email.value=='') {
	alert('Please enter your e-mail address.');
	return false;
	}
if (document.joinform.zip.value=='') {
	alert('Please enter your ZIP/Postal code.');
	return false;
	}
}

// comment form validation

function validatetwo() {

if (document.commentform.author.value=='') {
	alert('Please enter your name.');
	return false;
	}
if (document.commentform.email.value=='') {
	alert('Please enter your e-mail address.');
	return false;
	}
if (document.commentform.text.value=='') {
	alert('Please enter your comments.');
	return false;
	}
}

// toggle visibility for cms pages

function toggle( targetId ){
  if (document.getElementById){
  		target = document.getElementById( targetId );
  			if (target.style.display == "none"){
  				target.style.display = "";
  			} else {
  				target.style.display = "none";
  			}
  	}
}

