function popUp(url,w,h) {
	window.open(url, 'popupWin', 'top=15,left=15,width=' + w + ',height=' + h).focus();
}
function popUpResize(url,w,h) {
	window.open(url, 'popupWin', 'top=15,left=15,resizable,scrollbars,width=' + w + ',height=' + h).focus();
}

function checkSize()  {
	window.resizeTo(document.images[0].width + 10, document.images[0].height + 30); window.focus();
}

function goBack() {
	history.back(-1)
}
	
function alertDelete() {
	return(confirm('Attenzione! La cancellazione non puņ essere annullata, vuoi procedere?'));
}

function checksize2()  {
	if (document.images[0].complete) {
		window.resizeTo(document.images[0].width+10,document.images[0].height+30); window.focus();
	} else {
		setTimeout('check()',250)
		}
}

function zoom(file, tit) {
	var ww = 530;
	var wh = 420;
	var l = (screen.width/2)-(ww/2);
	var t = (screen.height/2)-(wh/2);
	var path = ''
	if (location.href.indexOf('server-asp') != -1) {
		path = '/www.protech.it'
	}
	window.open(''+ path +'/pop_video.html?file=' + file + '&tit=' + tit, 'pop_video', 'status, top=' + t + ',left=' + l + ',width=' + ww + ',height=' + wh).focus();
}

function showDiv(link, w, h) {
	Lightview.show({ href: link, rel: 'iframe', options: { width: w, height: h }});
}

function img(id) {
	if (document.getElementById(""+ id +"") != "") {
		img_var = document.getElementById(""+ id +"").src;
		if (img_var.indexOf("1") > -1) {
			img_var = img_var.replace("1", "2");
			//alert(img_var);
			document.getElementById(""+ id +"").src = img_var
		}
	}
}

function imgOut(id) {
	if (document.getElementById(""+ id +"") != "") {
		img_var = document.getElementById(""+ id +"").src;
		if (img_var.indexOf("2") > -1) {
			img_var = img_var.replace("2", "1");
			document.getElementById(""+ id +"").src = img_var
		}
	}
}

function RefreshImage(valImageId) {
	var objImage = document.images[valImageId];
	if (objImage == undefined) {
		return;
	}
	var now = new Date();
	objImage.src = objImage.src.split('?')[0] + '?x=' + now.toUTCString();
}

