/**
  * class Utils
  */

Utils = function ()
{
  this._init ();
}


/**
 * _init sets all LocalitaManager attributes to their default value. Make sure to call this
 * method within your class constructor
 */
Utils.prototype._init = function ()
{
	this.isIE = false;

	if(navigator.appVersion.indexOf("MSIE") != -1){
		this.isIE = true;
	}

}

Utils.prototype.switchDivVisibility = function(idDiv){
	try{
		var obj = document.getElementById(idDiv);
		if(obj.style.display == "block"){
			obj.style.display = "none";
			obj.style.visibility = "hidden";
		}
		else{
			obj.style.display = "block";
			obj.style.visibility = "visible";
		}
	}
	catch(ex){
		//console.log("Errore generato: " + ex.toString());
	}
}

Utils.prototype.popUp = function(imgURL, windowName, height, width){
	try{
	  //config.getBaseURL() + 
	  var URLInfo = 'ingrandimento.html';
	  var windowName = windowName;
	  var windowHeight = height;
	  var windowWidth = width;
	  var scrollbars = 1;
	  var windowTop = (screen.height - windowHeight) / 2;
	  var windowLeft = (screen.width - windowWidth) / 2;
	
	  window.open(URLInfo + "?imgURL=" + imgURL, windowName, 'width=' + windowWidth + ',height=' + windowHeight + ',top=' + windowTop + ',left=' + windowLeft + ',scrollbars=' + scrollbars);
	}
	catch(ex){
		alert("Error: " + ex.toString());
	}
}
