$(document).ready(function() {
	$('#ie6').fadeIn('slow');
	$('#close_link').click(function(){
		$('#ie6').fadeOut('slow');
	});

	var search = $('#s');
	default_text = search.val();
	search.focus(function() {
		if ($(this).val() === default_text) {
			$(this).val('');
			$(this).css('background-color', '#ffa');
			$('#top_menu_search').css('background-color', '#ffa');
		}
	});
	search.blur(function() {
		if ($(this).val() === '') {
			$(this).val(default_text);
			$(this).css('background-color', '#fff');
			$('#top_menu_search').css('background-color', '#fff');
		}
	});
	
});

function checkEmail(){
	if( document.myform.IFMK_RequiredFields.value.indexOf('EMAIL')>=0 ){
		if( document.myform.EMAIL.value==undefined || !document.myform.EMAIL.value.match(/^[\w!#$%&'*+\-/=?^_`{|}~]+(\.?[\w!#$%&'*+\-/=?^_`{|}~]+)*@([\w\-]+\.)+[\w\-]+$/) ) {
			alert("Please enter a correct e-mail.");
			document.myform.EMAIL.select();
			return false;
		}
	}
	else {
		if( document.myform.EMAIL.value!='' && document.myform.EMAIL.value!=undefined && !document.myform.EMAIL.value.match(/^[\w!#$%&'*+\-/=?^_`{|}~]+(\.?[\w!#$%&'*+\-/=?^_`{|}~]+)*@([\w\-]+\.)+[\w\-]+$/) ) {
			alert("Please enter a correct e-mail.");
			document.myform.EMAIL.select();
			return false;
		}
	}
	return true;
}
