

$(document).ready(function(){
	
	$("#trade_jump").change(function(){
		
		window.location=$(this).attr("value");
		
	});

	
	$("#ml_pop").click(function(){
		
		 window.open("ml.php" ,"New_Window","menubar=no,resizable=no,width=514,height=426");
		
		return false;
	});
	
	
	$(".itxt").click(function(){
		
		
		if($(this).attr("value") == "Your name" || $(this).attr("value") == "E-mail address")
		{
			var _curr = $(this).attr("value");
			
			$(this).attr("value","");
			
			$(this).attr("curr", _curr)
		}
		
	});
	
	$(".itxt").blur(function(){
		
		if($(this).attr("value") == "")
		{
			var _old = $(this).attr("curr");
			
			$(this).attr("value",_old);
		}
		
	});
	
	$("#mlForm").submit(function(){
		
		var _data = "ajaxsubmit=1";
		
	 	_data += "&name=" + $(this).find("#name").attr("value");
		
		_data += "&email=" + $(this).find("#email").attr("value");
		
		var _this = $(this);
		//alert(_data);
		
		$.ajax({
			type: "POST",
			url: "handler.php",
			data: _data,
			success: function(xml){
				if($("Code",xml).text() == "0")
				{
					_this.fadeOut("normal",function(){

						$("#mlForm").parent().append("<p>Thank you for your submission. You have been added to our Email list.");

					});

				} else {
					alert($("Message",xml).text())
				}
			}
		});
		
		
		return false;
		
	});
	
});