function rollOver (obj, newSrc) {
	var nome = obj.name;
	document.images('Img' + nome).src = newSrc;
}

function swapImg (name, actSrc, newSrc){

	var src = document.images(name).src;
	
	if (src.search(actSrc) != -1){
		 document.images(name).src = newSrc;
	}
	if (src.search(newSrc) != -1){
		 document.images(name).src = actSrc;
	}
}

function dgClock(){

}

function expTree(obj) {
	var name		= obj.name;
	var stDiv		= eval('div' + name).style.display;
	if (stDiv == 'none') {
		eval('div' + name).style.display = '';
	}
	else {
		eval('div' + name).style.display = 'none';
	}
}

function stampa(obj) {
	if (obj) {
	obj.focus();
	obj.print();
	}
	else {
		alert('Impossibile stampare il documento.');
	}
}

function salva(path) {
	var save;
	save = true;
	
	if (path == null | path == '') {
		save = false;
	}
	
	if (path != null && path.search('.asp' ) != -1 ) {
		if ( path.search('downloadmenu.asp') != -1 )
		{
			document.location.href = '/templates/downloadmenu.asp?path=' + path;
			return
		}
		else
		{
			save = false;
		}
		
	}
	
	if (!save) {
		alert('Impossibile salvare questo documento.');
	}
	else {
		//alert(path);
		document.location.href = 'download.asp?path=' + path;
	} 
}


function openWin (url, name, width, height) {
	var parms;
	//parms = 'fullscreen,height=' + height + ',width=' + width + ',dependent=yes,titlebar=no'
	parms = 'height=' + height + ',width=' + width + ',dependent=yes,titlebar=no,status=no,scrollbars=no'
	popWin = window.open(url, name, parms);
	//popWin.resizeTo(width,height);
	//popWin.moveTo(200,160);
}

function popWin (url, name, width, height, titlebar, status, scrollbars) {
	var parms;
	// titlebar=yes/no, status=yes/no, scrollbars=yes/no
	
	parms = 'height=' + height + ',width=' + width + ',dependent=yes,titlebar=' + titlebar + ',status=' + status + ',scrollbars=' + scrollbars
	popWin = window.open(url, name, parms);
	//popWin.resizeTo(width,height);
	//popWin.moveTo(200,160);
}


// apre un pop up fisso
function openWindow(url) {
    	popUpWin = window.open(url,'giftwrap','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=310,height=270,screenX=300,screenY=100,left=300,top=100');
}

// apre un pop up fisso per l'immagine del prodotto grande
// e' una ridondanza ma purtroppo quella pagina da un errore insolito 
// se si utilizza la funzione popWin, che e'certo meno rigida
function openWindowProdotto(url) {
    	popUpWin = window.open(url,'giftwrap','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=370,height=380,screenX=300,screenY=100,left=300,top=100');
}





