function ShowProgress(barref) {
	var windowWidth = 400;
  	var windowHeight = 115;
  	var locX = ( screen.width - windowWidth ) / 2;
  	var locY = ( screen.height - windowHeight ) / 2;

	var windowOptions = "directories=no,location=no,menubar=no,status=no,titlebar=no,toolbar=no,scrollbars=no,resizeable=no,dialog=yes,minimizable=no";
  	var windowFeatures = "width=" + windowWidth
                      + ",height=" + windowHeight
                      + ",screenX=" + locX
                      + ",screenY=" + locY
                      + ",left=" + locX
                      + ",top=" + locY
					  + "," + windowOptions;
 
	strAppVersion = navigator.appVersion;
	window.open (barref, "", windowFeatures)
}
function GetXmlHttpObject() {
	if (window.XMLHttpRequest) {
  		// Code for IE7+, Firefox, Chrome, Opera, Safari
  		return new XMLHttpRequest();
  	}
	if (window.ActiveXObject) {
  		// Code for IE6, IE5
  		return new ActiveXObject("Microsoft.XMLHTTP");
  	}
	return null;
}
function urlExist (url,msgerr) {
	//crea nuovo oggetto XMLHTTP
	var xmlhttp = GetXmlHttpObject();
	if (xmlhttp == null) {
  		alert ("Your browser does not support XMLHTTP!");
  		return false;
  	}

	//check se esiste il link
	xmlhttp.open("HEAD",url,true);
	xmlhttp.onreadystatechange = function() {
		if (xmlhttp.readyState == 4) {
			if (xmlhttp.status == 200) {
				alert (msgerr);
			}
		}
	}
	xmlhttp.send(null);
	//xmlhttp = null;
}
function stopRequest(formID, lang) {
	req = document.getElementById(formID).request.value;
	ie = (navigator.appName == "Microsoft Internet Explorer");

	if (req > 0) {
		document.getElementById(formID).request.value = "0";
		if (ie) { document.execCommand('Stop') } else { window.stop() }
	}
	
	if (req == 2) {
		if (lang == 0) alert ("I file eccedono le dimensioni consentite.")
		else alert ("Maximum file size exceeded.")
	}
}
function closeMe(req,formID) {
	if (req > 0) {
		window.opener.document.getElementById(formID).request.value=req;
	} 
	window.close();
	return true;
}

