//
//News
//----------------------------------------------------------------------------------------------------
function normative() {
	window.document.location.href="publicbridge.jsp?GB_METHOD=getCataloguePageNthLevelExploded&GB_CUSTOMIZEDFOR=ISEOSERRATURE_EN&GB_TYPER=ISEOSERRATURE_EN_CERTIFICATI2&GB_LANG=EN&pageIndex=1&sectionCode=27780&subsection1Code=&subsection2Code=&subsection3Code=&subsection4Code=&depth=5&campiEstesiSiNo=1";
}

function prodotti() {
	window.document.location.href="publicbridge.jsp?GB_METHOD=getCataloguePage&GB_CUSTOMIZEDFOR=ISEOSERRATURE_EN&GB_TYPER=ISEOSERRATURE_EN_CATPAGE&GB_LANG=EN&pageIndex=1&sectionCode=31008&subsection1Code=&subsection2Code=&subsection3Code=&subsection4Code=";
}

function finestra(str) {
		searchWin = window.open(str,'finestra','scrollbars=yes,resizable=no,width=670,height=500,status=no,location=no,toolbar=no');
}

function rassegnaStampa() {
    window.document.location.href="publicbridge.jsp?GB_METHOD=getCataloguePage&GB_CUSTOMIZEDFOR=ISEOSERRATURE_EN&GB_TYPER=ISEOSERRATURE_EN_NEWS&GB_LANG=EN&pageIndex=1&sectionCode=16295&subsection1Code=&subsection2Code=&subsection3Code=&subsection4Code=";
}

function foto(img,w,h) {
	window.open('./immagini/' + img, 'foto', 'width=' + w + ',height=' + h);
}

function webapps(lang) {
	if (lang == "IT") {
		window.document.location.href="../iseoserrature/index_it.jsp";
	}
	if (lang == "EN") {
		window.document.location.href="../iseoserrature_en/index_en.jsp";
	}
	if (lang == "ES") {
		window.document.location.href="../iseoserrature_es/index.htm";
	}
}

function dettaglioNews(code) {
    document.searchResultsPageForm.searchText.value = code;
    document.searchResultsPageForm.submit();
}

function ricerca() {
	var searchTextCtrl = document.search.search;
  	var searchTextCtrlValue = searchTextCtrl.value;
    var query = '';

  	if (searchTextCtrlValue == '') {
		alert("Devi specificare qualcosa da cercare prima di avviare una ricerca. ");
		document.search.search.focus();
  	} else {
        query = "(anagraficaprodotti.descrizione_breve like '%" + searchTextCtrlValue + "%' or anagraficaprodotti.descrizione_lunga like '%" + searchTextCtrlValue + "%' or anagraficaprodotti.descrizione_estesa like '%" + searchTextCtrlValue + "%') and anagraficaprodotti_extcampi.campo10 = 'Iseo'";
        query = escape(query);
		window.document.location.href="publicbridge.jsp?GB_METHOD=getSearchResultsPage&GB_CUSTOMIZEDFOR=ISEOSERRATURE_EN&GB_TYPER=ISEOSERRATURE_EN_SRESULTSPAGE&GB_LANG=EN&pageIndex=1&searchText=" + query + "&kindOfSearch=e_where";
  	}
}

function conferma_elimina() {
	if (!confirm ("Attenzione: l'oggetto verrą rimosso!")){
		return false
	}
	   else{
	   return true
	}
}

function fin(str, x, y) {
	xx=x;
	yy=y;
	searchWin = window.open(str,'fin','scrollbars=yes,resizable=yes,width=' + x + ', height=' + y + ',status=no,location=no,toolbar=no');
	searchWin.focus();
	nomeWin=searchWin;
}

PositionX = 5;
PositionY = 5;
defaultWidth  = 500;
defaultHeight = 500;
var AutoClose = true;
if (parseInt(navigator.appVersion.charAt(0))>=4) {
	var isNN=(navigator.appName=="Netscape")?1:0;
	var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;
}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;

function FG_PopUp(imageURL,imageTitle) {
	if (isNN){imgWin=window.open('about:blank','',optNN);}
	if (isIE){imgWin=window.open('about:blank','',optIE);}
	with (imgWin.document){
	writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
	writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
	writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
	writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
	writeln('width=100-(document.body.clientWidth-document.images[0].width);');
	writeln('height=100-(document.body.clientHeight-document.images[0].height);');
	writeln('window.resizeTo(width,height);}');writeln('if (isNN){');
	writeln('window.innerWidth=document.images["George"].width;');writeln('window.innerHeight=document.images["George"].height;}}');
	writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
	if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
	else writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
	writeln('<img name="George" src='+imageURL+' style="display:block"></body></html>');
	close();
	}
}

function goPres(tipo) {
	var Bro_old = (
			(navigator.appVersion.charAt(0)     != '4')        ||
			(navigator.appVersion.substring(0,1) == '4 ')   ||
			(navigator.appVersion.substring(0,2) == '4.0')  ||
			(navigator.appVersion.substring(0,3) == '4.00') ||
			(navigator.appVersion.substring(0,3) == '4.01') ||
			(navigator.appVersion.substring(0,3) == '4.02')
	);
	var Bro_new = !Bro_old;

	if (navigator.appName == 'Microsoft Internet Explorer' && navigator.appVersion.charAt(0) == '4' && (navigator.platform.substring(0,3) == 'Win')) {
			var scw=screen.Width-10;
			var sch=screen.Height-51;
			if (tipo==1)
				woo=window.open ("pag_web/present1.htm", "Pres1", "left=0,top=0,width=" + scw + ",height=" + sch);
			else
				woo=window.open ("pag_web/present2.htm", "Pres2", "left=0,top=0,width=" + scw + ",height=" + sch);
	}
	else if (navigator.appName == 'Netscape' && Bro_new) {
			var swx=screen.width;
			var swh=screen.height;
			if (tipo==1)
				woo=window.open ("pag_web/present1.htm", "Pres1", "screenX=0,screenY=0,outerWidth=" + swx + ",outerHeight=" + swh);
			else
				woo=window.open ("pag_web/present2.htm", "Pres2", "screenX=0,screenY=0,outerWidth=" + swx + ",outerHeight=" + swh);
	}
	else {
			if (tipo==1)
				location="pag_web/present1.htm";
			else
				location="pag_web/present2.htm";
	}
}