function ajax(obj,destino,dominio){
	
	var aux = obj.href.split(dominio + '/');
	hash = aux[1];
	
	$("#"+destino).html('<p align="center"><img src="images/cargando.gif" /></p>');
	$("#"+destino).load(
						
						obj.href + "?ajax=on",
						function(){
							hash = hash.replace(/^.*#/, '');
							$.history.load(hash);
							cargar_abanico();
							return false;
						});
}


function cargar_abanico(){
	$("div.scrollable").scrollable({
		size: 1,
		items: '#thumbs',  
		hoverClass: 'hover'
	});	
}

function modalbox(obj){

	Floatbox(obj.href);
}



//function estado_inicial_url(){
	//alert("hash: " + window.location.hash);
//}

function over(over,renglon){
    hijo = jQuery(renglon).children();
    for(i=0;i<hijo.length;i++){
        if(over)
            hijo[i].className="celda_contenido_over";
        else
            hijo[i].className="celda_contenido";
    }
}

function overDestinatario(over,renglon){
    hijo = jQuery(renglon).children();
    for(i=0;i<hijo.length;i++){
        if(over)
            hijo[i].className="celda_destinatario_over";
        else
            hijo[i].className="celda_destinatario";
    }
}

function AnimarMensaje(){
	//setTimeout('jQuery("#div_msg").fadeOut("normal")',500);   
	//setTimeout('jQuery("#div_msg").fadeIn("normal")',1000); 
	setTimeout('jQuery("#div_msg").slideUp("slow")',2000);

}

function getCiudades(combo_pais,combo_ciudad){
    sel = combo_pais.options[combo_pais.selectedIndex].value;
    obj = document.getElementById(combo_ciudad);
    obj.options.length = 0;
    obj.options[obj.options.length] = new Option('','');
    if(sel!="")
        jQuery.getScript('getCiudades.php?id_pais=' + sel);
}


function getPos(obj) {
    var output = new Object();
    var mytop=0, myleft=0;
    while( obj) {
        mytop+= obj.offsetTop;
        myleft+= obj.offsetLeft;
        obj= obj.offsetParent;
    }
    output.left = myleft;
    output.top = mytop;
    return output;
}

function getCheckedValue(radioObj) {
	if(!radioObj)
		return "";
	
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) 
			return radioObj[i].value;
	}
	return "";
}