
function cambiarImagen(file) {
	var img = document.getElementById("idImg");
	img.src = file.value;
	img.width = 70;
}

function OpenPopUp(url, scroll, w, h)
{
	if(w == null || w == 0)w = 770;
	if(h == null || h == 0)h = 550;
    //url.substring(1,1) + "_popUp"
	var dd = new Date();
	
	var availW  = (screen.availWidth-w)/2;
	if(screen.availHeight < 800)var availH = 20;
	else var availH  = 120;//(screen.availHeight-h)/2;
    window.open(url,dd.getTime(), "resizable=yes,width=" + w + ",height=" + h + ",status=yes,scrollbars=" + scroll + ",left=" + availW + " ,top=" + availH);
}
function createCookie(name,value,days)
{
	if (days)
	{
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name)
{
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++)
	{
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function setVisto(id, obj)
{
	obj.getElementById(id).style.display = "block";
	var sp = obj.getElementById("S" + id);
	if(sp!=null){
		sp.innerHTML = "";
	}
}

function confDelete(url, id) {
	if(confirm("Esta seguro que desea eliminar este item?") == true) {
		document.location.href = url + id;
	}
}

