function clickclear(fieldName)
{
	if (fieldName.value == "Search jobs & careers") 
	{
		fieldName.value = "";
	}
}

function bookmarkPage()
{
         if (document.all)
        {
             // For IE
             window.external.AddFavorite(location.href, document.title);
         }
        else if (window.sidebar)
       {
             // For Firefox
             window.sidebar.addPanel(document.title, location.href, "");
        }
}





	function submitMonthYear() {
		document.monthYear.method = "post";
		document.monthYear.action = 
			"index.php?month=" + document.monthYear.month.value + 
			"&year=" + document.monthYear.year.value;
		document.monthYear.submit();
	}
	
	function postMessage(day, month, year) {
		eval(
		"page" + day + " = window.open('eventform.php?d=" + day + "&m=" + 
		month + "&y=" + year + "', 'postScreen', 'toolbar=0,scrollbars=1," +
		"location=0,statusbar=0,menubar=0,resizable=1,width=750,height=600');"
		);
	}
	
	function openPosting(pId) {
		eval(
		"page" + pId + " = window.open('http://"+window.location.hostname+"/events/eventdisplay.php?id=" + pId + 
		"', 'mssgDisplay', 'toolbar=0,scrollbars=1,location=0,statusbar=0," +
		"menubar=0,resizable=1,width=460,height=600');"
		);
	}
	
	function loginPop(month, year) {
		eval("logpage = window.open('login.php?month=" + month + "&year=" + 
		year + "', 'mssgDisplay', 'toolbar=0,scrollbars=1,location=0," +
		"statusbar=0,menubar=0,resizable=1,width=750,height=600');"
		);
	}
	
	
function lookup() {

// eNewsletter signup AJAX

$('#suggestions').hide();
	
	// Form fields defined for POST
	var newsletterEmail = $("#newsletterEmail").val();
	var newsletterFirstname = $("#newsletterFirstname").val();
	
	// Reset border colours
	$('#newsletterEmail').css("border","1px solid green");
	$('#newsletterEmail').css("background-color","#FFFFFF");
	$('#newsletterFirstname').css("border","1px solid green");
	$('#newsletterFirstname').css("background-color","#FFFFFF");
	$('#inputError').hide();

        $.post("http://news.s15236403.onlinehome-server.info/wp-content/themes/icm/checkNewsletter.php", {newsletterEmail: ""+newsletterEmail+"", newsletterFirstname:""+newsletterFirstname+""}, function(data){
            if(data.length >0) {
                
                //$('#suggestions').html(data);
				var fieldName = data;
				var fieldNames=fieldName.split(";");
				
				
				for (var i = 0, item; item = fieldNames[i++];)
				{
					if(item=='dup')
					{
						$('#suggestions').fadeIn(1000);
						$('#suggestions').html("Email address already registered.");
					}
					
					if(item=='newsletterEmail')
					{
						$('#suggestions').fadeIn(1000);
						$('#suggestions').html("Please check your email address.");
					}
					
					if(item=='newsletterFirstname')
					{
						$('#suggestions').fadeIn(1000);
						$('#suggestions').html("Please check your first name.");
					}
				
					$('#'+item+'').css("border","1px solid red");
					$('#'+item+'').css("background-color","#fdf5f5");
				}
				
				
				
            }
			else
			{
				$('#newsletterFields').fadeOut(500);
				$('#suggestions').fadeIn(1000);
                $('#suggestions').html("<div id=\"enewsThanks\">Thank you for signing up to receive the ICM eNewsletter.</div>");
				$('#newsletterFields').css("position","absolute");
			}
        });
    }