function changeImage(object, value){
	object.setAttribute('src',value);
}

function changeImageByid(id, value){
	document.getElementById(id).setAttribute('src',value);
	window.location.pathname
}

function popup(url,width,height,name,value){	
	window.open(url+'?'+name+'='+value,'_blank','width='+width+',height='+height+',top='+((screen.height - height) / 2)+',left='+((screen.width - width) / 2)+',scrollbars=yes, dependent=yes,resizable=yes,modal=yes')
}	

function prova(){
	alert(	window.location.pathname);
}

function setInitialFocus(){	
	var pagename="";
	pagename = document.URL.split("/")[document.URL.split("/").length-1];
	pagename = pagename.split(".")[0];;
	
	// Caso particolare: login nel menu di sinistra nella homepage
	var object = document.getElementById('main:initialFocus');
	
	// Caso particolare: login nel menu di sinistra nella sezione supporto
	if (object==null)
		object = document.getElementById('customers:initialFocus');
	
	if (object==null)
		object = document.getElementById("" +pagename+":initialFocus");
	
	if (object!=null){
		object.focus();
		object.select();
	}	
}

function clearInputText(object,text){
	if (object.value==text){
		object.value='';
		}
}

function resetInputText(object,text){
	if (object.value==''){
		object.value=text;
		}
}
	
function newBrowserTab(url){
	//var browser = top.document.getElementById("content");
	//var tab = browser.addTab(url);
	//alert('p');
	//var browserWindow = kWindowMediator.getMostRecentWindow("navigator:browser");
	//var browser = browserWindow.getBrowser();
	//var tab = browser.addTab("http://www.google.com");
}

function getDownloadPath() {
var frm = document.forms[0];
var Shell = new ActiveXObject("Shell.Application");
alert(Shell);
var Folder = new Object;

Folder = Shell.BrowseForFolder(0, "Choose a download folder", 0);

var FolderItem = new Object;
FolderItem = Folder.Items().Item();

document.all.item("lblFilepath").InnerText = FolderItem.Path;
frm.lblFilepath.Text = FolderItem.Path;
}

function setStyleDisplay(id, value){
	document.getElementById(id).style.display=value;
}

function getStyleDisplay(id){
	return document.getElementById(id).style.display;
}