function validate_email(obj)
{
	var myRegex = new RegExp("^[a-zA-Z^0-9^_^\.\+^-]+@([a-zA-Z^0-9]+[a-zA-Z^0-9^_^\.^-]{1,}\.)+[a-zA-Z]{2,4}$");
	if (!obj.match(myRegex)) {
		return false;
	}
	return true;
}

function validate_phone(obj)
{
	var newObj  = obj;
	if ( obj != '' ) {
		for (i=0;i < newObj.length; i++) {
			newObj  = newObj.replace(' ','');
			newObj  = newObj.replace('-','');
			newObj  = newObj.replace('+','');
			newObj  = newObj.replace('/','');
			newObj  = newObj.replace('.','');
		}
	}

	if ( newObj > 100000 && newObj < 99999999999999)
	    return true;
 	return false;

}

function is_radio_selected( obj )
{
	for ( i = 0; i < obj.length; i++ )
		if ( obj[i].checked ) return true;
	return false;
}

function radio_value( obj )
{
	for (i = 0; i < obj.length; i++ ) {
		if ( obj[i].checked )
		    return obj[i].value;
	}
	return '';
}


function no_space( obj )
{
	if ( obj != '' ) {
		var newObj  = obj.replace(' ','');
		for (i=0;i < newObj.length; i++) {
			newObj  = newObj.replace(' ','');
		}
		obj = newObj;
	}
	return obj;
}


function urlencode( urlstring )
{
	var string 			= escape( urlstring );
	var encoded_string  = string.replace("+","%2B");
	for (i=0;i < string.length; i++) {
		encoded_string  = encoded_string.replace("+","%2B");
		encoded_string  = encoded_string.replace("/","%2F");
	}
	return encoded_string;
}

