/*
 * Filename : custom.js
 * Created on : 6-dic-2011, 8.38.07
 * Author : Alberto Tocci (alberto.tocci@gmail.com)
 * 
 * Description:
 * Custom Js functions 
 * 
 */

$.fn.clearSelect = function() {
    $(this)
        .find('option')
        .remove()
        .end();
    return $(this);
}

function isEmail(string) {
    if (string.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
        return true;
    else
        return false;
}

function isValidURL(string) {
    if (string.search(/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/) != -1)
        return true;
    else
        return false;
}

