function openWin(URL) {
	aWindow = window.open(URL,'thewindow','width=600,height=700,location=no,resizable=yes,scrollbars=yes,screenX=20,screenY=20,top=20,left=20');
}

function DoNav(theUrl)
{
	document.location.href = theUrl;
}


$(document).ready(function() {
  $("#NewUser").validate({
	rules: {
		UserName: {
			required: true,
			minlength: 4,
			maxlength: 20
		},
		Pass1: {
			required: true,
			minlength: 5
		},
		Pass2: {
			required: true,
			minlength: 5,
			equalTo: "#Pass1"
		},
		Email: {
			required: true,
			email: true
		}
	},
	messages: {
		UserName: {
			required: "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=#FF0000>Please enter a username</font>",
			minlength: "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=#FF0000>Your username must consist of at least 4 characters</font>",
			maxlength: "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=#FF0000>Your username must be no more than 20 characters</font>"				
		},
		Pass1: {
			required: "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=#FF0000>Please provide a password</font>",
			minlength: "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=#FF0000>Your password must be at least 5 characters long</font>"
		},
		Pass2: {
			required: "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=#FF0000>Please provide a password</font>",
			minlength: "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=#FF0000>Your password must be at least 5 characters long</font>",
			equalTo: "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=#FF0000>Please enter the same password as above</font>"
		},
		Email: "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=#FF0000>Please enter a valid email address</font>"
	  }
  });
});
	
	
	
	
	
    $(document).ready(function() {
      $("#Login").validate({
   		rules: {
			LOGIN: {
				required: true
			},
			PWD: {
				required: true
			}
		},
		messages: {
			LOGIN: {
				required: "<br /><font color=#FF0000>Please enter a username</font>"
			},
			PWD: {
				required: "<br /><font color=#FF0000>Please provide a password</font>"
			}
		  }
      });
    });

$(document).ready(function() {
      $("#ForgotPass").validate({
   		rules: {
			FORGOTEMAIL: {
				required: true,
				email: true
			}
		},
		messages: {
			FORGOTEMAIL: "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=#FF0000>Please enter a valid email address</font>"
		  }
      });
    });

$(document).ready(function() {
      $("#ShoutBox").validate({
   		rules: {
			SHOUT: {
				required: true
			}
		},
		messages: {
			SHOUT: "<br /><font color=#FF0000>Please enter something.</font>"
		  }
      });
    });

$(document).ready(function() {
      $("#contactUs").validate({
   		rules: {
			from: {
				required: true,
				email: true
			},
			subject: {
				required: true
			},
			comment: {
				required: true
			}
		},
		messages: {
			from: "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=#FF0000>Please enter a valid email address</font>",
			subject: "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=#FF0000>Please enter a subject</font>",
			comment: "<br /><br /><font color=#FF0000>Please enter a comment</font>"		
		  }
      });
    });

$(document).ready(function() {
      $("#CreateMini").validate({
   		rules: {
			mlName: {
				required: true,
				minlength: 3,
				maxlength: 10
			}

		},
		messages: {
			mlName: {
				required: "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=#FF0000>Please enter a mini league name</font>",
				minlength: "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=#FF0000>Mini league name must consist of at least 3 characters</font>",
				maxlength: "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=#FF0000>Mini league name must be less than 10 characters</font>"
			}
	
		  }
      });
    });

$(document).ready(function() {
      $("#MiniChangePwd").validate({
   		rules: {
			MLPassW1: {
				required: true
			},
			MLPassWCheck: {
				required: true,
				equalTo: "#MLPassW1"
			}
		},
		messages: {
			MLPassW1: {
				required: "<br /><font color=#FF0000>Please provide a password</font>"
			},
			MLPassWCheck: {
				required: "<br /><font color=#FF0000>Please provide a password</font>",
				equalTo: "<br /><font color=#FF0000>Please enter the same password</font>"
			}
		  }
      });
    });

$(document).ready(function() {
      $("#SendMsg").validate({
   		rules: {
			from: {
				TGTUSER: true
			},
			SUBJECT: {
				required: true
			},
			MESSAGE: {
				required: true
			}
		},
		messages: {
			TGTUSER: "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=#FF0000>Please enter a valid user</font>",
			SUBJECT: "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color=#FF0000>Please enter a subject</font>",
			MESSAGE: "<br /><br /><font color=#FF0000>Please enter a message</font>"		
		  }
      });
    });

$(document).ready(function() {
      $("#UpdPro").validate({
   		rules: {
			EMAIL: {
				required: true,
				email: true
			}
		},
		messages: {
			EMAIL: "<br /><font color=#FF0000>Please enter a valid email address</font>"
		  }
      });
    });

$(document).ready(function() {
      $("#ChangePassW").validate({
   		rules: {
			CPwD1: {
				required: true,
				minlength: 5
			},
			CPwD2: {
				required: true,
				minlength: 5,
				equalTo: "#CPwD1"
			}
		},
		messages: {
			CPwD1: {
				required: "<br /><font color=#FF0000>Please provide a password</font>",
				minlength: "<br /><font color=#FF0000>Your password must be at least 5 characters long</font>"
			},
			CPwD2: {
				required: "<br /><font color=#FF0000>Please provide a password</font>",
				minlength: "<br /><font color=#FF0000>Your password must be at least 5 characters long</font>",				
				equalTo: "<br /><font color=#FF0000>Please enter the same password</font>"
			}
		  }
      });
    });

$(document).ready(function() {
      $("#MiniInvite").validate({
   		rules: {
			emailaddys: {
				required: true
			}
		},
		messages: {
			emailaddys: {
				required: "<br /><font color=#FF0000>Please provide at least one email address to invite.</font>"
			}
		  }
      });
    });

	jQuery().ready(function(){
		// simple accordion
		jQuery('#about').accordion({
			autoheight: false
		});
		
		// bind to change event of select to control first and seconds accordion
		// similar to tab's plugin triggerTab(), without an extra method
		var accordions = jQuery('#about');
		
		jQuery('#switch select').change(function() {
			accordions.accordion("activate", this.selectedIndex-1 );
		});
		jQuery('#close').click(function() {
			accordions.accordion("activate", -1);
		});
		jQuery('#switch2').change(function() {
			accordions.accordion("activate", this.value);
		});
		jQuery('#enable').click(function() {
			accordions.accordion("enable");
		});
		jQuery('#disable').click(function() {
			accordions.accordion("disable");
		});
		jQuery('#remove').click(function() {
			accordions.accordion("destroy");
			wizardButtons.unbind("click");
		});
	});
