function MenuItemManage(obj, n)
{
	if(n==1)
	{
		obj.className = "MenuItemOver";
	}
	else
	{
		obj.className = "MenuItem";
	}
}
function MenuItemManageSelected(obj, n)
{
	if(n==1)
	{
		obj.className = "MenuItemOver";
	}
	else
	{
		obj.className = "MenuItemSelected";
	}
}
function SubMenuItemManage(obj, n)
{
	if(n==1)
	{
		obj.className = "SubMenuItemOver";
	}
	else
	{
		obj.className = "SubMenuItem";
	}
}
function CenterWinLeft(W)
{
	var res = (screen.availWidth - W*1) / 2;
	return res;
}

function CenterWinTop(H)
{
	var res = (screen.availHeight - H*1) / 2;
	return res;
}

function SelVoce(s, objSelect, bIgnoraMaiuscoleMinuscole)
{
	
	if(s == null)
		return false;
	
	if(bIgnoraMaiuscoleMinuscole == null)
		{bIgnoraMaiuscoleMinuscole = false;}
		
	var n = objSelect.length;

	if(bIgnoraMaiuscoleMinuscole)
	{
		for (var i = 0; i < n; i++) {
			if(objSelect.options[i].value.toLowerCase() == s.toLowerCase())
			{
				objSelect.options[i].selected = true;
				return true;
			}
		}
	}
	else
	{
		for (var i = 0; i < n; i++)
		{
			if(objSelect.options[i].value == s)
			{
				objSelect.options[i].selected = true;
				return true;
			}
		}
	}
	
	return false;
}

function GetValue(obj) {
    if (obj.selectedIndex > -1) {
        return obj.options[obj.selectedIndex].value;
    }
    else {
        return "";
    }
}

function GetText(obj) {
    if (obj.selectedIndex > -1) {
        return obj.options[obj.selectedIndex].text;
    }
    else {
        return "";
    }
}

function Contatto(sSubject)
{
	var s = document.location.href;
	var a = s.split('/');
	s = a[a.length-1];
	
	var sURLBack = s;
	//alert(sURLBack);
	document.location.href = "contatti.asp?sSubject=" + sSubject + "&sURLBack=" + sURLBack;
}
function OrdinaCD(cd)
{
	var s = document.location.href;
	var a = s.split('/');
	s = a[a.length-1];
	var sURLBack = s;
	var sSubject = "Ordine CD: " + cd
	document.location.href = "contatti.asp?sSubject=" + sSubject + "&sURLBack=" + sURLBack + "&ordina_cd=true";
}
function MostraImmagine(url, title)
{
	var sURL = "immagine.asp?title=" + title + "&ImageURL=" + url;
	var sWidth = 400;
	var sHeight = 200;
	var wImage = window.open(sURL,"","width=" + sWidth + ",height=" + sHeight + ",left=" + CenterWinLeft(sWidth) + ",top=" + CenterWinTop(sHeight) + ",menubar=no,location=no,status=yes,scrollbars=no,directories=no,toolbar=no,resizable");
}
function ShowHide(obj, sShow, sHide) {
    if (sShow != null && sHide != null) {
        if (obj.innerHTML == sHide) {
            obj.innerHTML = sShow;
        }
        else {
            obj.innerHTML = sHide;
        }
    } else {
        if (obj.style.display == '') {
            obj.style.display = 'none';
        }
        else {
            obj.style.display = '';
        }
    }
}
