function getLeft(width) {
	return (getWindowWidth() - width)/2;
}

function getTop(height) {
	return (getWindowHeight() - height)/2;
}

function getWindowWidth() {
	if (parseInt(navigator.appVersion)>3) {
		if(navigator.appName=="Netscape")
			return window.innerWidth;
		if (navigator.appName.indexOf("Microsoft")!=-1)
		return document.body.offsetWidth;
	}
}

function getWindowHeight() {
	if (parseInt(navigator.appVersion)>3) {
		if(navigator.appName=="Netscape")
			return window.innerHeight;
		if (navigator.appName.indexOf("Microsoft")!=-1)
			return document.body.offsetHeight;
	}
}

function popUpWindow(URLStr, left, top, width, height) {
    var popUpWin = 0;
    if (popUpWin) {
        if (!popUpWin.closed) {
            popUpWin.close();
        }
    }
    popUpWin = open(URLStr, "popUpWin", "toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbars=1,resizable=yes,copyhistory=yes,width=" + width + ",height=" + height + ",left=" + left + ", top=" + top + ",screenX=" + left + ",screenY=" + top + "");
}

function popUpWindowNoResize(URLStr, left, top, width, height) {
    var popUpWin = 0;
    if (popUpWin) {
        if (!popUpWin.closed) {
            popUpWin.close();
        }
    }
    popUpWin = open(URLStr, "popUpWin", "toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbars=0,resizable=no,copyhistory=yes,width=" + width + ",height=" + height + ",left=" + left + ", top=" + top + ",screenX=" + left + ",screenY=" + top + "");
}

function closePopUpNoResize() {
	window.close();
	
	/*var popUpWin = 0;
	if (popUpWin) {
        if (!popUpWin.closed) {
            popUpWin.close();
        }
    }*/
}

function getCookie(Name) {

			var search = Name + "="

			if (document.cookie.length > 0) { // if there are any cookies

			offset = document.cookie.indexOf(search)

			if (offset != -1) { // if cookie exists

			offset += search.length

			// set index of beginning of value

			end = document.cookie.indexOf(";", offset)

			// set index of end of cookie value

			if (end == -1)

			end = document.cookie.length

			return unescape(document.cookie.substring(offset, end))

			}

			} }
			
			function getQueryString() { var query = window.location; return query;}			

			function getQueryVariable(variable) { var query = window.location.search.substring(1); var vars = query.split("&"); for (var i=0;i < vars.length;i++) { var pair = vars[i].split("="); if (pair[0] == variable) { return pair[1]; } } }

			function abbonati(url) { gal=window.open(url,'Abbonamenti','scrollbars=yes, toolbar=no,location=no,directories=no,status=yes,menubar=no,width=660,height=480'); }
			function apripopup(url)
			{
			gal=window.open(url,'','scrollbars=yes, toolbar=no,location=no,directories=no,status=yes,menubar=no,width=820,height=820');
			}		
			function apripopup2(url)
			{
			gal=window.open(url,'','scrollbars=yes, toolbar=no,location=no,directories=no,status=yes,menubar=no,width=1044,height=820');
			}		

	
	
/********** MENU A TENDINA WEBRADIO *************/
function MM_jumpMenu(targ,selObj,restore){ //v3.0
	eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	if (restore) 
	  	selObj.selectedIndex=0;
}
	
