function Ajax(file, data, div)
{
	/*alert(data);*/
	 $.ajax({
	    type: "GET",
	    url: file,
	    data: data,
	    cache: false,
	    success: function(html){
	      $("#"+div).html(html);
	    }
	 });
}

function check_user()
{
	var email = $("#formEmail").val();
	if(email != '')
	{
		Ajax("/ajax_files/check_user.php","email=" + email, "newsletter_error");
	}else{
		$("#formEmail").val('enter your email address here');
	}
}

function check_captcha(n1,n2)
{
	var otg = $("#otg").val();
	if(otg != '')
	{
		var result = n1 + n2;
		if(otg == result)
		{
			$("#captcha_error").html("");
			return true;
		}else{
			$("#captcha_error").html("Please input the correct answer of the question!");
			return false;
		}
	}else{
		$("#captcha_error").html("Please enter the answer of the question!");
		return false;
	}
}

function returnvalue()
{
	var error = $("#captcha_error").val();
	if(error != '')
	{
		return false;
	}else{ 
		return true; 
	}
}
function check_name()
{
	var name = $("#formName").val();
	if(name == '')
	{
		$("#formName").val('enter your first name here');
	}
}

function check_fields()
{
	var email = $("#formEmail").val();
	var name = $("#formName").val();
	var error = $("#newsletter_error").html();
	if((email == 'enter your email address here') || (name == 'enter your first name here'))
	{
		$("#formEmail").css("background-image","url(i/top_yellow_background.png)");
		$("#formName").css("background-image","url(i/top_yellow_background.png)");
		/*$("#newsletter_error").html("<img src='i/top_redtext.png' style='margin-top:3px;' border='0'>");*/
		$("#newsletter_error").css('letter-spacing','0.5');
		$("#newsletter_error").html("PLEASE ENTER YOUR EMAIL & FIRST NAME BEFORE CLICKING ON 'SIGN UP'");
		return false;
	}else{
	
			return true;
		
	}
}
function clear_error()
{
	/*$("#newsletter_error").html("");*/
}

function btn_out(){  $("#formSubmit").css("background-image","url(i/top_button_signup_on.gif)"); } 
function btn_over(){ $("#formSubmit").css("background-image","url(i/top_button_signup_off.gif)");  }
function btn_out1(){  $("#btn_up").css("background-image","url(i/box_uparrow_off.gif)"); } 
function btn_over1(){ $("#btn_up").css("background-image","url(i/box_uparrow_on.gif)");  }
function btn_out2(){  $("#btn_down").css("background-image","url(i/box_downarrow_off.gif)"); } 
function btn_over2(){ $("#btn_down").css("background-image","url(i/box_downarrow_on.gif)");  }

//scroll
var s1;
function jmtbScroll(id){
	this.x=10;
	this.id = id;
	this.step = 10;
	this.height = $("div[@id="+id+"]").height();
	this.cHeight = 81;

	this.goDown = function()
	{
		this.x = (this.x+this.step<this.height-this.cHeight) ? this.x+this.step : this.height-this.cHeight;
		$("div[@id="+this.id+"]").css("top",-this.x+"px");
	}
	this.goUp = function()
	{
		this.x = (this.x-this.step>0) ? this.x-this.step : 0;
		$("div[@id="+this.id+"]").css("top",-this.x+"px");
	}
}
function load(){
  s1 = new jmtbScroll("textarea_twitter");
}



