 function frmValidation(frm)
		{ 
		txtEmail=frm['textindexmail']   ;
		 if(!validateEmail(txtEmail))	
			{
			txtEmail.focus();
			return false;
			}
		else
			{
			return true;
			}
		}
   
      

   function trim(s)
   {
  	return s.replace(/^\s+|\s+$/, '');
   }
   
 
 
 
function validateEmail(fld) {
    var error="";
    var tfld = trim(fld.value);                        // value of field with whitespace trimmed off
    var emailFilter = /^[^@]+@[^@.]+\.[^@]*\w\w$/ ;
    var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/ ;
   
    if (fld.value == "") {
        
        error = "You didn't enter an email address.\n";
    } else if (!emailFilter.test(tfld)) {              //test email for illegal characters
       
        error = "Please enter a valid email address.\n";
    } else if (fld.value.match(illegalChars)) {
      
        error = "The email address contains illegal characters.\n";
    } else {
       return true;
    }
    alert(error);
	return false;
}

function myPopup(url) {
     

    var width = 500;
    var height = 500;
    var left = parseInt((screen.availWidth/2) - (width/2));
    var top = parseInt((screen.availHeight/2) - (height/2));
    var windowFeatures = "width=" + width + ",height=" + height + ",status,resizable,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
    var url_open = "http://www.argentexmining.com/disclaimer.php?q="+url; 	
    myWindow = window.open(url_open, "Disclaimer", windowFeatures);



}

function myExternalPopup(url) {
    var width = 500;
    var height = 500;
    var left = parseInt((screen.availWidth/2) - (width/2));
    var top = parseInt((screen.availHeight/2) - (height/2));
    var windowFeatures = "width=" + width + ",height=" + height + ",status,resizable,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
    var url_open = "http://www.argentexmining.com/disclaimer_ext.php?q="+url; 	
    myWindow = window.open(url_open, "Disclaimer", windowFeatures);

}

function myPopup_ext_notes(url) {
     

    var width = 600;
    var height = 650;
    var left = parseInt((screen.availWidth/2) - (width/2));
    var top = parseInt((screen.availHeight/2) - (height/2));
    var windowFeatures = "width=" + width + ",height=" + height + ",status,resizable,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
    var url_open = "http://www.argentexmining.com/disclaimer_ext_note.php?q="+url; 	
    myWindow = window.open(url_open, "Disclaimer", windowFeatures);

}

