//<![CDATA

function centerPopUp(url,name,width,height,scrollbars) {

	str = "";
	str += "resizable=no,";
	str += "scrollbars=" + scrollbars + ",";
	str += "width=" + width + ",";
	str += "height=" + height + ",";

	if ( window.screen ) {
	var ah = screen.availHeight - 30;
	var aw = screen.availWidth - 10;

	var xc = ( aw - width ) / 2;
	var yc = ( ah - height ) / 2;

	str += ",left=" + xc + ",screenX=" + xc;
	str += ",top=" + yc + ",screenY=" + yc;
	}
	window.open(url,name,str);
}

window.addEvent('domready', function() {

	var arVersion = navigator.appVersion.split("MSIE");
	var version = parseFloat(arVersion[1]);

	if(checkFlashVersion) {
		var hasReqestedVersion = DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision);

		if(hasReqestedVersion) {
			flashSupported = true;
		} else {
			flashSupported = false;

		}
		inserisciSWF();
	}

	if(version < 7) pngfix();

	inizializzaMenu();

	for(var i=0; i<document.links.length; i++) {
		if (document.links[i].rel == "external") document.links[i].target = "_blank";
	}

	if(typeof(do_init)=='function') do_init();

	if($('contLogo')) {

		if(pageName != "home") {

			$('contLogo').setStyle('visibility', 'visible');

		} else {

			if(version < 7) {

				$('contLogo').setStyle('background','none');
				$('contLogo').setStyle('filter','none');

			}

		}

	}

});

function inizializzaMenu(){

	if(tags_ = document.getElementsByTagName('ul')) {

		for(i=0; i<tags_.length; i++) {

			if (tags_[i].id == "menu") closeSub(tags_[i]);

		}

	}

}

function closeSub(menu) {

	for (var i=0; i<menu.childNodes.length; i++) {

		if (menu.childNodes[i].nodeName.toLowerCase()=="li") {

			li = menu.childNodes[i];
			li.onmouseover = li.onactivate = li.onfocus = function() { if (this.subMenu) this.subMenu.className = this.subMenu.className.replace(/subMenu-off/g,"subMenu-on"); };
			li.onmouseout = li.ondeactivate = li.onblur = function() { if (this.subMenu) closeSub(this.subMenu); };

			for (j=0; j<li.childNodes.length; j++) {

				if (li.childNodes[j].nodeName.toLowerCase()=="ul" || li.childNodes[j].nodeName.toLowerCase()=="ol") closeSub(li.subMenu = li.childNodes[j]);

			}

		}

	}

	menu.className = menu.className.replace(/\s?subMenu-on/g,"")+" subMenu-off";

}


//]]>
