﻿     function poptastic(url){
     var w = 800;
     var h = 600;
            var left = (screen.width/2)-(w/2);
            var top = (screen.height/2)-(h/2);
	       newwindow = window.open (url,'Rules', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
	        if (window.focus) {newwindow.focus()}
        }
        
        	// validation utilities
	function IsValidPostalCode(s)
	{
		r = /^[abceghjklmnprstvxyABCEGHJKLMNPRSTVXY][0-9][abceghjklmnprstvwxyzABCEGHJKLMNPRSTVWXYZ] {0,1}[0-9][abceghjklmnprstvwxyzABCEGHJKLMNPRSTVWXYZ][0-9]$/i;
		return r.test(s);
	}
	function IsValidZIPcode(s)
	{
		r = /^[0-9]{5}([- /]?[0-9]{4})?$/i;
		return r.test(s);
	}
	function IsValidEmailAddress(s)
	{
		if (s.length == 0) 
		{
			return false;
		}
		// hack test for an apostrophe as the first character
		if (s.substring(0,1) == "'")
		{
			return false;
		}
		// hack test for occurance of '@
		if (s.indexOf("'@") >= 0) 
		{
			return false;
		}
		var filter  = /^([a-zA-Z0-9_&'\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
		return filter.test(s);
	}