function clearText(thefield){
if (thefield.defaultValue==thefield.value)
thefield.value = ""
} 
function check_it(myForm) {
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myForm.mailid.value)){
     if (myForm.password.value.length < 6)
	      {
              alert("password must be greater than 6 character");
				  return false;
         } 
    else {
               return true;
         }
			
} else {
 alert("invalied email id");
 return false;
}
}
function showform() {
var 
			email = $("#email"),
			password = $("#password"),
			allFields = $([]).add(email).add(password),
			tips = $(".validateTips");


function checkLength(o,n,min,max) {

			if ( o.val().length > max || o.val().length < min ) {
				o.addClass('ui-state-error');
				updateTips("Length of " + n + " must be between "+min+" and "+max+".");
				return false;
			} else {
				return true;
			}

		}

function checkRegexp(o,regexp,n) {

			if ( !( regexp.test( o.val() ) ) ) {
				o.addClass('ui-state-error');
				updateTips(n);
				return false;
			} else {
				return true;
			}

		}

//function showform()

			$("#dialog-form").dialog("destroy");
			$('#dialog-form').dialog({
						height: 400,
			width: 480,
			modal: true,
			buttons: {
				'Login / Register ': function() {
					var bValid = true;
					allFields.removeClass('ui-state-error');

					bValid = bValid && checkLength( email,"email",6,80);
					bValid = bValid && checkLength (password,"password",5,16);
					//bValid = bValid && checkRegexp (email,/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.?$/i,"eg: ui@jquery.com");
               bValid = bValid && checkRegexp (email,/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/,"eg: ui@jquery.com");
					bValid = bValid && checkRegexp (password,/^([0-9a-zA-Z])+$/,"Password field only allow : a-z 0-9");
					
					if (bValid) {
					 document.login.submit();

						$(this).dialog('close');
					}

				},

					Cancel: function() {
					$(this).dialog('close');
				}
			},
			
			close: function() {
				allFields.val('').removeClass('ui-state-error');
			}
		
				
			} );
	

}

function show_all_list()
{
	$('#game_list').show("slow");	
	$('#show_all').hide();
	$('#hide_all').show();
}
function hide_all_list()
{
	$('#game_list').hide("slow");	
	$('#hide_all').hide();
	$('#show_all').show();
}




$(document).ready(function(){
/*  $(".share_this").click(function(event){
     alert("Thanks for visiting!");
	  event.preventDefault();
	  $(this).hide("slow");

   });*/

 });