/****************************************************************************************
>> FORM VALIDATION << 
*****************************************************************************************/

<!-- Login Form Validation -->

function loginValidation() {
missinginfo = "";

if (document.login._01_UserName.value=="") {
missinginfo += "\n     - User Name";
}

if (document.login._02_Password.value=="") {
missinginfo += "\n     - Password";
}

if (missinginfo != "") {
missinginfo = "Please enter your User Name & Password";
alert(missinginfo);
document.login._01_UserName.focus();
return false;
}
else return true;
}

<!-- RSVP FORM -->

// FUNCTION TO DEFINE AN EMPTY FIELD
function isEmpty(s) {
	  return ((s==null)||(s.length==0));
}

// FUNCTION TO CHECK FORM IS COMPLETED
function checkComplete() {  

		form_complete = 1;
		alert_message = "";
		
	 	// CHECK COMPULSORY FIELDS ARE COMPLETED ** RSVPForm FORM **
		if (isEmpty(window.document.RSVPForm._01_Name.value)) { 
    		alert_message = alert_message + "   - Name\n";
			window.document.RSVPForm._01_Name.focus();
			form_complete = 0;
		}
		
		if (isEmpty(window.document.RSVPForm._02_Company.value)) { 
    		alert_message = alert_message + "   - Company\n";
			form_complete = 0;
		}
		
		checkValidEmail(window.document.RSVPForm._04_Email_Address.value);
		
		if (window.document.RSVPForm._05_Event.selectedIndex==0) { 
    		alert_message = alert_message + "   - Event\n";
			form_complete = 0;
		}
		
  		// PRINT ALERT MESSAGE IF ALL IS NOT CORRECT
	    if (form_complete==0) {
    		alert ("Please enter some details into the following required fields\n" +
				   "\n" +
				   alert_message);
			return false;
		}

  		// IF ALL IS CORRECT THEN GO AHEAD
		else {
			return true;
		}
}

// FUNCTION TO CHECK FOR VALID EMAIL ADDRESS
function checkValidEmail(input) {
  ValidExtentions = new Array('.org', '.com', '.gov', '.edu', '.mil', '.net', '.co');   
  point = input.indexOf("@",0);
  if (point == -1) {
  	form_complete = 0;
	alert_message = alert_message + "   - Email " +
	"   Please enter a valid email address (e.g., user@domain.com)\n";
  }
  else {
    goodemail = 0;
  	for (i=0; i <= 7; i++) {
	  extpoint = input.indexOf(ValidExtentions[i],point);
	  if (extpoint > 0) {goodemail = 1}
	}
    if (goodemail == 0) {
      form_complete = 0;
	  alert_message = alert_message + "   - Email " +
	  "   Please enter a valid email address (e.g., user@domain.com)\n";
	}  
  }
}

<!-- MEMBERS LOGIN FORM -->

// FUNCTION TO DEFINE AN EMPTY FIELD
function isEmpty(s) {
	  return ((s==null)||(s.length==0));
}

// FUNCTION TO CHECK FORM IS COMPLETED
function checkCompleteNewUser() {  

		form_complete = 1;
		alert_message = "";
		
	 	// CHECK COMPULSORY FIELDS ARE COMPLETED
		checkValidEmail(window.document.newUser._01_Email.value);
		window.document.newUser._01_Email.focus();
		
		if (isEmpty(window.document.newUser._02_Login.value)) { 
    		alert_message = alert_message + "   - Login(s)\n";
			form_complete = 0;
		}
		
  		// PRINT ALERT MESSAGE IF ALL IS NOT CORRECT
	    if (form_complete==0) {
    		alert ("Please enter some details into the following required fields\n" +
				   "\n" +
				   alert_message);
			return false;
		}

  		// IF ALL IS CORRECT THEN GO AHEAD
		else {
			return true;
		}
}

// FUNCTION TO CHECK FOR VALID EMAIL ADDRESS
function checkValidEmail(input) {
  ValidExtentions = new Array('.org', '.com', '.gov', '.edu', '.mil', '.net', '.co');   
  point = input.indexOf("@",0);
  if (point == -1) {
  	form_complete = 0;
	alert_message = alert_message + "   - Email " +
	"   Please enter a valid email address (e.g., user@domain.com)\n";
  }
  else {
    goodemail = 0;
  	for (i=0; i <= 7; i++) {
	  extpoint = input.indexOf(ValidExtentions[i],point);
	  if (extpoint > 0) {goodemail = 1}
	}
    if (goodemail == 0) {
      form_complete = 0;
	  alert_message = alert_message + "   - Email " +
	  "   Please enter a valid email address (e.g., user@domain.com)\n";
	}  
  }
}

/****************************************************************************************
>> POP UP WINDOW << 
*****************************************************************************************/

function openpopup(popurl){
var winpops=window.open(popurl,"","width=480,height=500,scrollbars=yes,left=250,top=100")
}

/* NEW DODOSNOMARGIN SCRIPT IS MODIFIED FROM http://www.therotunda.net/code/autosized-popup-window.html */
/* http://regretless.com/dodo/newworld */
function viewPic(img)
{ 	
    picfile = new Image(); 
    picfile.src =(img); 
    fileCheck(img); 
}

function fileCheck(img)
{ 	
    if( (picfile.width!=0) && (picfile.height!=0) )
    { 
        makeWindow(img); 
    }
    else 
    {
        funzione="fileCheck('"+img+"')"; 
        intervallo=setTimeout(funzione,10); 
    }
}

 

function makeWindow(img)
{ 	
    ht = picfile.height;
    wd = picfile.width; 

    var args= "height=" + ht + ",innerHeight=" + ht;
    args += ",width=" + wd + ",innerWidth=" + wd;
    if (window.screen) 
    { 
        var avht = screen.availHeight; 
        var avwd = screen.availWidth;
        var xcen = (avwd - wd) / 2; 
        var ycen = (avht - ht) / 2;
        args += ",left=" + xcen + ",screenX=" + xcen;
        args += ",top=" + ycen + ",screenY=" + ycen + ",resizable=yes"; 	
    }

	popwin=window.open("","_blank",args)
	popwin.document.open()
	popwin.document.write('<html><head><title>'+img+'</title></head><body bgcolor=white scroll=no topmargin=0 leftmargin=0 rightmargin=0 bottomargin=0 marginheight=0 marginwidth=0><div style="position: absolute; top:0px;left:0px"><img src="'+img+'" width="'+wd+'" height="'+ht+'" border="0"></div></body></html>')
	popwin.document.close()

}

// ***************** NEW WINDOW ************************ \\

function GP_AdvOpenWindow(theURL,winName,features,popWidth,popHeight,winAlign,ignorelink,alwaysOnTop,autoCloseTime,borderless) { //v2.0
  var leftPos=0,topPos=0,autoCloseTimeoutHandle, ontopIntervalHandle, w = 480, h = 340;  
  if (popWidth > 0) features += (features.length > 0 ? ',' : '') + 'width=' + popWidth;
  if (popHeight > 0) features += (features.length > 0 ? ',' : '') + 'height=' + popHeight;
  if (winAlign && winAlign != "" && popWidth > 0 && popHeight > 0) {
    if (document.all || document.layers || document.getElementById) {w = screen.availWidth; h = screen.availHeight;}
		if (winAlign.indexOf("center") != -1) {topPos = (h-popHeight)/2;leftPos = (w-popWidth)/2;}
		if (winAlign.indexOf("bottom") != -1) topPos = h-popHeight; if (winAlign.indexOf("right") != -1) leftPos = w-popWidth; 
		if (winAlign.indexOf("left") != -1) leftPos = 0; if (winAlign.indexOf("top") != -1) topPos = 0; 						
    features += (features.length > 0 ? ',' : '') + 'top=' + topPos+',left='+leftPos;}
  if (document.all && borderless && borderless != "" && features.indexOf("fullscreen") != -1) features+=",fullscreen=1";
  if (window["popupWindow"] == null) window["popupWindow"] = new Array();
  var wp = popupWindow.length;
  popupWindow[wp] = window.open(theURL,winName,features);
  if (popupWindow[wp].opener == null) popupWindow[wp].opener = self;  
  if (document.all || document.layers || document.getElementById) {
    if (borderless && borderless != "") {popupWindow[wp].resizeTo(popWidth,popHeight); popupWindow[wp].moveTo(leftPos, topPos);}
    if (alwaysOnTop && alwaysOnTop != "") {
    	ontopIntervalHandle = popupWindow[wp].setInterval("window.focus();", 50);
    	popupWindow[wp].document.body.onload = function() {window.setInterval("window.focus();", 50);}; }
    if (autoCloseTime && autoCloseTime > 0) {
    	popupWindow[wp].document.body.onbeforeunload = function() {
  			if (autoCloseTimeoutHandle) window.clearInterval(autoCloseTimeoutHandle);
    		window.onbeforeunload = null;	}  
   		autoCloseTimeoutHandle = window.setTimeout("popupWindow["+wp+"].close()", autoCloseTime * 1000); }
  	window.onbeforeunload = function() {for (var i=0;i<popupWindow.length;i++) popupWindow[i].close();}; }   
  document.MM_returnValue = (ignorelink && ignorelink != "") ? false : true;
}
