/********************************************* 
	Funciones y Utilerias Complementarias JS  
**********************************************/
 
function openModal(eid,url){
	
	var request = $.ajax({
		type : "GET",
		url : url,
		cache: false,
		success : function(data){
			var htm = "";
			htm = "<div style='text-align:right;padding-right:10px;'>"+
			'<a class="closeButton" href="#" onclick="$.unblockUI();return false;">Cerrar</a>'
			+"</div>";
			htm += "<div>"+data+"</div>";
			$.blockUI({ 
				message: htm,
				css :{width:"700px",left:"10%",top:"5%"}
			});
		}
	});
}
function getCssRule(nameClass) {
	var ss = document.styleSheets;

        for (var i=0; i<ss.length; i++) {
            var rules = ss[i].cssRules || ss[i].rules;
            for (var j=0; j<rules.length; j++) {
                if (rules[j].selectorText === nameClass) {
                    return rules[j].style.display;
                }
            } 
	}
}   
 
function insertScript(pathScr){
	var headID = document.getElementsByTagName("head")[0];         
	var newScript = document.createElement('script');
	newScript.type = 'text/javascript';
	newScript.src = pathScr;
	headID.appendChild(newScript);	
}

function insertCSS(pathCSS){
	var headID = document.getElementsByTagName("head")[0];    
	var newCSS = document.createElement('link');
	newCSS.rel = 'stylesheet';
	newCSS.href = pathCSS;
	newCSS.type = 'text/css';
	headID.appendChild(newCSS);	
}

function initGaleria(){
	$(document).ready(function(){
		$("div.slider").nivoSlider({ 
			animSpeed: 500,
			pauseTime: 5000,
			startSlide: 0,
			keyboardNav: false,
			pauseOnHover: true,
			effect: 'fade' 
		});
	}); 	
}
