$(document).ready(function() {
	if((navigator.userAgent.indexOf("MSIE")) != -1) { // USING INTERNET EXPLORER
		$("#newsletter .field").each(function() {
			$(this).attr("value",$(this).attr("placeholder")).css({color:"#cccccc"});
		});

		$("#newsletter .field").focus(function() {
			if($(this).attr("value") == $(this).attr("placeholder")) {
				$(this).attr("value","").css({color:"#000000"});
			}
		});

		$("#newsletter .field").blur(function() {
			if($(this).attr("value") == "") {
				$(this).attr("value",$(this).attr("placeholder")).css({color:"#cccccc"});
			}
		});
		
		$("#newsletter").submit(function() {
			$("#newsletter .field").each(function() {
				if($(this).attr("value") == $(this).attr("placeholder")) {
					$(this).attr("value","");
				}
			});
		});
	}

	$("#newsletter").ajaxForm({
		success:function(rtn) {
			$("#footer1").animate({marginTop:"70px",height:"0"},"fast",function() {
				$(this).hide();
				$("#footer1a").show().animate({marginTop:"20px",height:"50px"},"fast",function() {
					$(this).delay(6000).animate({marginTop:"0",height:"0"},"fast",function() {
						if((navigator.userAgent.indexOf("MSIE")) != -1) { // USING INTERNET EXPLORER
							$("#newsletter .field").each(function() {
								if($(this).attr("value") == "") {
									$(this).attr("value",$(this).attr("placeholder")).css({color:"#cccccc"});
								}
							});
						}

						$(this).hide();
						$("#footer1").show().animate({marginTop:"20px",height:"50px"},"fast");
					});
				});
			});
		}
	});

	$("img.submit").click(function() {
		$(this).animate({opacity:0},100).css({cursor:"default"});
		$("form#search").animate({marginRight:0,opacity:1},400,function() {
			$("#searchfield").focus();
		});
	});
});

