	function isnull(sValue) 
	{
					sValue = String(sValue);
		return (	sValue == '' || sValue == 'null' || sValue == 'undefined'); 
	}// end function isnull
		
	function trim(sValue,sDefault)
	{
			var trm = CStr(sValue);
			var dfl = CStr(sDefault);
	
		trm = trm.replace(/(^\s*)|(\s*$)/g, ""); 
		dfl = dfl.replace(/(^\s*)|(\s*$)/g, ""); 
	
		return trm==""?dfl:trm;
	}// end function trim
		
	function CInt(vValue,vDefault)
	{
		var str	= trim(vValue);
		var strd = trim(vDefault);

			var intg = parseInt(str,10);
			var intd = parseInt(strd,10);

		intd = (isNaN(intd)?0:intd);

		return (isNaN(intg)?intd:intg);
	}// end function CInt	 
	
	function isInt(vle)// +,-, 0-9
	{
		vle	= vle.replace(/,/gi,""); 
		var isint = trim(vle);
		return(isint.match(/^[ ]*[+-]?\d+[ ]*$/)); // integer||null
	}// end function isInt	
	
	function CStr(vValue,vDefault)
	{
		vDefault += "";
		if(vDefault	== "undefined") vDefault = "";
		if(vDefault	== "null")      vDefault = ""; 
		
			vValue	+= "";
		if(vValue	== "undefined") return vDefault;
		if(vValue	== "null")      return vDefault;
		
		return vValue;
	}// end function CStr

var whitespace = " \t\n\r";
function isWhitespace (s)
{   var i;

    // Is s empty?
    if (isEmpty(s)) return true;

    // Search through string's characters one by one
    // until we find a non-whitespace character.
    // When we do, return false; if we don't, return true.

    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);

        if (whitespace.indexOf(c) == -1) return false;
    }

    // All characters are whitespace.
    return true;
}

function isEmpty(s)
{   return ((s == null) || (s.length == 0))
}	

function isEmail (s)
{   if (isEmpty(s)) 
       if (isEmail.arguments.length == 1) return defaultEmptyOK;
       else return (isEmail.arguments[1] == true);
   
    // is s whitespace?
    if (isWhitespace(s)) return false;
    
    // there must be >= 1 character before @, so we
    // start looking at character position 1 
    // (i.e. second character)
    var i = 1;
    var sLength = s.length;

    // look for @
    while ((i < sLength) && (s.charAt(i) != "@"))
    { i++
    }

    if ((i >= sLength) || (s.charAt(i) != "@")) return false;
    else i += 2;

    // look for .
    while ((i < sLength) && (s.charAt(i) != "."))
    { i++
    }

    // there must be at least one character after the .
    if ((i >= sLength - 1) || (s.charAt(i) != ".")) return false;
    else return true;
}//end function isEmail

	function DataCheck()
	{
	    try
	    {
		    if(isnull(trim($get(oURL).value)))
		    {
			    alert("Please fill your website URL!");
			    $get(oURL).focus();
			    return false;
		    }
		    if(isnull(trim($get(oEmail).value)))
		    {
			    alert("Please fill your email address!");
			    $get(oEmail).focus();
			    return false;
		    }
		    if(!isEmail(trim($get(oEmail).value)))
		    {
			    alert ("Please enter a valid email address.")
			    $get(oEmail).focus();
			    return false; 
		    }						
		    return true;
		}
	catch(e)
	{
		alert(e.description)
	}
}	//end function DataCheck()


function GetElement(sID)
{
    return $get(sID);
}