
function mostrar(modulo,posicionx,posiciony){
    document.getElementById(modulo).style.display='block';
    if (posicionx>0)
        document.getElementById(modulo).style.bottom=posicionx+'px';
    if (posiciony>0)
        document.getElementById(modulo).style.right=posiciony+'px';
}

function ocultar(modulo){
    document.getElementById(modulo).style.display='none';
    //$(modulo).hide();
}

function toogle(modulo){
    if(document.getElementById(modulo).style.display == 'none'){
	    document.getElementById(modulo).style.display = 'block';
    }else{
	    document.getElementById(modulo).style.display = 'none';
	    document.getElementById(modulo).innerHTML = '';
    }
}

function toogleContent(container,url,method,pars){
    if(document.getElementById(container).style.display == 'none'){
	    document.getElementById(container).style.display = 'block';
	    getHTMLscript(container,url,method,pars);
    }else{
	    document.getElementById(container).style.display = 'none';
	    document.getElementById(container).innerHTML = '';
    }
}


function isImg(url){
	var urlImgs = /\.jpg|\.jpeg|\.png|\.gif|\.bmp/g;
	var urlType = url.match(urlImgs);	
	if(urlType===null)
		return false;
	return true;
}

function CanviId(count,idPre,id,className_on,className_off) {
	for(var i=1;i<=count;i++){
		var idNow = idPre+i;
		document.getElementById(idNow).className = className_off;
			if(i == id){
			document.getElementById(idNow).className = className_on;
			}
	}
}


function getHTML(container,url,method,pars){

	//alert(url);
	
	var nAleatorio=Math.floor(Math.random()*1000000000); //creamos el número aleatorio
	var new_url = url + '&aleatorio=' + nAleatorio;

	//alert(new_url);

	document.getElementById(container).innerHTML = '<span style="clear:left;width:95%;float:left;padding-top:8px;"><center><img src="../img/ajax-loader.gif"></center></span>';
	var myAjax = new Ajax.Updater(container,new_url,{ method: method, parameters: pars });

}


function getHTMLscript(container,url,method,pars){

	//alert(url);
	
	var nAleatorio=Math.floor(Math.random()*1000000000); //creamos el número aleatorio
	var new_url = url + '&aleatorio=' + nAleatorio;

	//alert(new_url);

	parent.document.getElementById(container).innerHTML = '<span style="clear:left;width:95%;float:left;padding-top:8px;"><center><img src="../img/ajax-loader.gif"></center></span>';
	var myAjax = new Ajax.Updater(container,new_url,{ method: method, parameters: pars, evalScripts: true });

}



function getFormHTML(container,url,method,pars,formid){

	var nAleatorio=Math.floor(Math.random()*1000000000); //creamos el número aleatorio
	var new_url = url + '&aleatorio=' + nAleatorio;
	
	var params = Form.serialize($(formid));

	document.getElementById(container).innerHTML = '<span style="clear:both;width:95%;float:left;"><center><img src="../img/ajax-loader.gif"></center></span>';
	var myAjax = new Ajax.Updater(container,new_url, {asynchronous:true, parameters:params} );

}

function getFormHTMLscript(container,url,method,pars,formid){

	var nAleatorio=Math.floor(Math.random()*1000000000); //creamos el número aleatorio
	var new_url = url + '&aleatorio=' + nAleatorio;
	
	var params = Form.serialize($(formid));

	document.getElementById(container).innerHTML = '<span style="clear:both;width:95%;float:left;"><center><img src="../img/ajax-loader.gif"></center></span>';
	var myAjax = new Ajax.Updater(container,new_url,{ asynchronous:true, parameters: params, evalScripts: true });

}


function getHTMLnoAjax(container,url){

	//alert(url);
	
	var nAleatorio=Math.floor(Math.random()*1000000000); //creamos el número aleatorio
	var new_url = url + '&aleatorio=' + nAleatorio;

	document.getElementById(container).innerHTML = new_url;

}


function news(){
	alert('aaaaaa');
}
