function hideFormText() {
	var _inputs = document.getElementsByTagName('input');
	var _txt = document.getElementsByTagName('textarea');
	var _value = [];
	
	if (_inputs) {
		for(var i=0; i<_inputs.length; i++) {
			if (_inputs[i].type == 'text' || _inputs[i].type == 'password') {
				
				_inputs[i].index = i;
				_value[i] = _inputs[i].value;
				
				_inputs[i].onfocus = function(){
					if (this.value == _value[this.index])
						this.value = '';
				}
				_inputs[i].onblur = function(){
					if (this.value == '')
						this.value = _value[this.index];
				}
			}
		}
	}
	if (_txt) {
		for(var i=0; i<_txt.length; i++) {
			_txt[i].index = i;
			_value['txt'+i] = _txt[i].value;
			
			_txt[i].onfocus = function(){
				if (this.value == _value['txt'+this.index])
					this.value = '';
			}
			_txt[i].onblur = function(){
				if (this.value == '')
					this.value = _value['txt'+this.index];
			}
		}
	}
}

//if (window.addEventListener)
//	window.addEventListener("load", hideFormText, false);
//else if (window.attachEvent)
//	window.attachEvent("onload", hideFormText);


function popUpImage(theImageURL)
{
	popwin = window.open(theImageURL,'popWin','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=400,height=10');
	popwin.focus();
}

function isEmailValid(strEmail)
{
	var sLength = strEmail.length;
	var atpos=strEmail.indexOf("@");
	var dotpos=strEmail.lastIndexOf(".");
	
	// make sure the email contains no spaces
    if(strEmail.indexOf(' ') >= 0) return false;
    
    validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;
    // search email text for regular exp matches
     if (strEmail.search(validRegExp) == -1)
     {
        return false;
     }
        
	// look for @
    if (atpos<1) return false

    // look for . after @
    if (dotpos<atpos+2) return false

    // there must be at least one character after the .
    if (dotpos+2>=sLength ) return false;
    
    return true;
}




var numeric = "1234567890-."
	function isNumeric (s)
	{
	    for (i = 0; i < s.length; i++)
	    {   
			// Check that current character is numeric.
			var c = s.charAt(i);
		
			if (numeric.indexOf(c) == -1) return false;
	    }
		return true;
	}

