function checkImageSelected(grid){
	for(var item in igtbl_getGridById(grid).SelectedRows){
		return true;	
	}
	alert("Non hai selezionato nessuna riga");
	return false;
}
function deleteConfirm(){
	if(! confirm("Sei sicuro/a di voler cancellare questo record?")){
		var oGrid = igtbl_getGridById(arguments[0]);
		oGrid.CancelPostBack = true;
		return true;
		
	}
}
function openModal(parameters,style)
{
	if(style==null)
		style = "Status=1;dialogWidth=800px;dialogHeight=600px;scroll=1;center=1;resizable=1";

	var w = window.showModalDialog('../../ModalBase.htm?'+parameters,'',style);
	return w;
}
function openWindow(url, style){
	if(style == null){
		style = "status=0,scrollbars=1,center=1,resizable=1,toolbar=0,location=0,directories=0,menubar=0,width=630,height=620";
	}
	var nw = window.open(url, 'NAWin', style);
}

function getVirtualDir(){
	var temp = self.document.location.pathname;
	
	if(temp.charAt(0)=="/")
		temp = temp.substr(1);
	
	temp = temp.substring(0,temp.indexOf("/"));
	temp ="/"+temp;
	return temp;
}
function checkemail(str){
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
	if (filter.test(str))
		return true;
	else{
		return false;
	}
}
function swProdImage(url,eleid)
{
    document.getElementById(eleid).src = url;
}