function checkMail(str)
{
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (filter.test(str)) { return true }
	else { return false };
}

function MakeEmailLink(str)
{
	
	pos = str.indexOf('href="mailto:');
	
	if (pos > 0) //ya lo hico tinymce
		return str;
	
	str = str.replace(/(([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4}))+/g, '<a href="#">$1</a>');
	
	return str;
}

function checkUrl(str)
{
	var filter  = /^([a-zA-Z0-9_])+$/;
	if (filter.test(str)) { 
		if (str.length > 22)
			return false;
			
		return true }
	else { return false }
}

function trim(str)
{
	if (typeof str == "string")
	{
		return str.replace( /^\s+/g,'').replace(/\s+$/g,'');
	}
	else
		return "";
}

function popUpExterno(URL)
{
	day = new Date();
	id = day.getTime();
	
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1');");
}

function popUpInterno(URL)
{
	day = new Date();
	id = day.getTime();
	
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=840,height=600');");
}

function popUpBoletin(URL)
{
	day = new Date();
	id = day.getTime();
	
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=600,height=600');");
}


function popUpRechazo(URL)
{
	day = new Date();
	id = day.getTime();
	
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=650,height=500');");
}

function popUpFoto(URL, foto_id, spawn) {
	day = new Date();
	id = day.getTime();
	URL = URL + '/evento/foto/' + foto_id+((spawn==1) ? '/?spawn=1' : '/');

	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=750,height=660,left=20,top=20');");
}

function popUpVideo(URL, evento_url, spawn) {
	day = new Date();
	id = day.getTime();
	URL = URL + '/evento/video/' + evento_url +((spawn==1) ? '/?spawn=1' : '/');

	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=750,height=660,left=20,top=20');");
}

function popupAnimacion(){
	day = new Date();
	id = day.getTime();

	URL = 'todopuebla.html';

	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=641,height=626');");
}


function popUpAmigos(URL)
{
	day = new Date();
	id = day.getTime();

	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=500,height=500,left=20,top=20');");
	
}

//=============================================================================
//-----------------------------------------------------------------------------
//- Funciones agregadas por Aarón Pancardo R.

function popUpFotoNoticia(URL) {
	day = new Date();
	id = day.getTime();

	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=750,height=550,left=20,top=20');");

}

function isNumber(num) {
	if(isNaN(num)) {
		return false;
	} else {
		return true;
	}
}

function clona(obj){

    if(obj == null || typeof(obj) != 'object')
        return obj;

    var temp = new obj.constructor();
    for(var key in obj)
        temp[key] = clona(obj[key]);

    return temp;
}