$(document).ready(function(){
		window.$my =
	{
		// Initialize all the queries you want to use more than once
		submit : $("#submit"),
		login_status : $("#login_status"),
		username : $("#username"),
		password_clear : $("#password-clear"),
		password : $("#password"),
		big_window: $("#big_window"),
		email: $("#email"),
		vemail: $("#vemail"),
		t: $("#t"),
		action: $("#action"),
		gender: $("#gender")
	};
		//alert("Welcome to ArCRA.com!!!");
		$(".rollover_static").mouseover(function(){
			$(this).addClass("rollover_over");
			$(this).mouseout(function(){
				$(this).removeClass("rollover_over");
				//alert("test");
			});
		
		});
		$(".rollover_static").click(function(){
			
			var new_url = '../' + this.id + ".php";
			window.location.href =  new_url;
			
		});
		
    $("#add_user_button").click(function(){
    
        
        var fname = $("#fname").attr("value");
        var lname = $("#lname").attr("value");
        var email = $("#email").attr("value");
        var phone = $("#phone").attr("value");
        var pass = $("#pass").attr("value");
        var ver_pass = $("#ver_pass").attr("value");
        
        //check the fields - will do on server side as well.
        if(fname == '' || lname == '' || email == '' || pass == '' || ver_pass == '' || pass != ver_pass)
        {
            alert("Please make sure you completed the entire form.  Also make sure the passwords match!  Please try again.");
            return false;
        }
        //create the user
        $.post("htaccess.handler.php", 
        { 
            action: "add", 
            fname: fname,
            lname: lname,
            email: email,
            phone: phone,
            pass: pass,
            ver_pass: ver_pass
        },
        function(data){
      
        if(data == "INVALID")
        {
            alert("Please make sure you completed the entire form.  Also make sure the passwords match!  Please try again.");
        } else {
            alert("Your registration has been completed.  You will be notified when your account has been activated.");
            $("#fname").attr("value","");
            $("#lname").attr("value","");
            $("#email").attr("value","");
            $("#phone").attr("value","");
            $("#pass").attr("value","");
            $("#ver_pass").attr("value","");
            //location.reload();
            $("#main_content").html("<div style='font-size:14px'>Thank you for registering!  You will be notified when your account has been activated.</div><div style='font-size:14px'>Please enjoy the rest of our site!</div>");
        }
        });
        
    //end function
    });

//set the current page
var current_page = $("#header").attr("class");
$("#" + current_page).attr("class", "current");
		
});