	//variables used to center pop-up windows
	var width = screen.width;
	var height = screen.height;
	var popUpWidth = 0;
	var popUpHeight = 0;
	var positionTop = 0;
	var positionLeft = 0;
	
	function openWindow(pageURL,windowName,pWidth,pHeight,pResize,pScrollbars,pStatus)
	{
	 	positionTop = ((height/2) - (pHeight/2));
	 	positionLeft = ((width/2) - (pWidth/2));
	 	popup=window.open(pageURL,windowName, config='width=' + pWidth + ',height=' + pHeight + ',left=' + positionLeft + ',top=' + positionTop + ',resizable=' + pResize + ',menubar=0,location=0,directories=0,toolbar=0,scrollbars=' + pScrollbars + ',status=' + pStatus);
	}

	/*Registration form*/	
	function checkEMail()
	{
	   
	  //for email validation
	  var emailaddress=document.registerform.email.value;
	  //alert(emailaddress);
	  var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
	  //alert(filter.test(emailaddress))
	  if (filter.test(emailaddress))
	  {
	  	//document.registerform.submit();
	    return true;
	  }
	  else
	  {
	     alert("Please input a valid email address!")
		 document.registerform.email.focus();
	     return false;
	  }
	  
	}	
	
	
	function checkSelections()
		{	
			var st = document.registerform.bstate.value;
				
			if(st == 0)
			{
			  	alert('You must select a State');
				document.registerform.bstate.focus();
				return false;
			}
			
			checkEMail();
			return checkUserType();
		}
		
	function checkUserType()
	{
	
		var isSCSGmem = document.registerform.isSCGMember.value;

		var val='';
				
		if(isSCSGmem == 'not_selected')
			{
			  	alert('Are you an SCSG member?');
				document.registerform.isSCGMember.focus();
				return false;
			}
			
			
		for (var i=0; i < document.registerform.utype.length; i++)
	    {
	    if (document.registerform.utype[i].checked)
	      {
	      	val = document.registerform.utype[i].value;
	      }
	    }
		
	    if (val.length == 0)
	    {
	   	 alert('Please indicate if you are a SCSG Member, Non-Member,\n Allied Healthcare Professional or a Fellow');

		 return false;
	    }
	    else
	    {
	   	 return true;
	    }
	}

