function trim(string)
{
    string = string.toString();
    return string.replace(/(^\s*)|(\s*$)/g,'');
}

function padleft(val, ch, num)
{
    var re = new RegExp(".{" + num + "}$");
    var pad = "";
    if (!ch) ch = " ";
    do  {
        pad += ch;
    }while(pad.length < num);
    return re.exec(pad + val);
}

function padright(val, ch, num){
    var re = new RegExp("^.{" + num + "}");
    var pad = "";
    if (!ch) ch = " ";
    do {
        pad += ch;
    } while (pad.length < num);
    return re.exec(val + pad);
}

function validarEmail(email)
{
    if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email)){
        return true;
    }
    else
    {
        return false;
    }
}

	function cargarCanal(clase, codigo){
		
		//$('#tab3 iframe').attr('src', url);
//		$('#divIframe').html('<object width="620" height="385"><param name="movie" value="http://www.youtube.com/v/'+codigo+'?fs=1&amp;hl=en_US&amp;rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/'+codigo+'?fs=1&amp;hl=en_US&amp;rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="620" height="385"></embed></object>');
		$('#divIframe').html('<object width="620" height="385"><param name="movie" value="http://www.youtube.com/cp/'+codigo+'"></param><embed src="http://www.youtube.com/cp/'+codigo+'" type="application/x-shockwave-flash" width="620" height="385"></embed></object>');
		$('.canales_links a').removeClass('canal_selected');
		$('.'+clase).addClass('canal_selected');
	}
	
	
