// Incomedia WebSite X5 2007. All rights reserved.
var imBrw_op=window.opera;
var imBrw_ie=document.all && !imBrw_op;
var imBrw_ns=document.getElementById && !imBrw_ie;
var imEffectEnabled = /MSIE [678]/.test(navigator.userAgent) && navigator.platform == "Win32";
var imHoverToEnable = /MSIE (5\.5)|[6]/.test(navigator.userAgent) && navigator.platform == "Win32";
var mbTipOk = false;
var en_div = 0; //per la cartolina animata
function imGetLayer(sName) {return document.all?document.all[sName]:document.getElementById?document.getElementById(sName) : "";}
function imIEBody(){return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body}
function imOpenLocation(sNewLocation){
document.location = sNewLocation;
}
function imGetParameter(sParamName) {
var sQueryString = "";
var iStart = 0;
var iEnd = 0;
if (window.top.location.search != 0)
sQueryString = unescape(window.top.location.search);
sParamName = sParamName + "=";
if (sQueryString.length > 0) {
iStart = sQueryString.indexOf(sParamName);
if ( iStart != -1 ) {
iStart += sParamName.length;
iEnd = sQueryString.indexOf("&",iStart);
if (iEnd == -1)
iEnd = sQueryString.length;
return sQueryString.substring(iStart,iEnd);
}
return null;
}
}
document.onmouseover=imTipMove;
function imTipShow(oLink,sTitle,iWidth,sImage,sBackColor,sForeColor,sBorderdColor,iTextSize,bDoFade) {
if (imBrw_ns||imBrw_ie){
var oTip=imGetLayer("imToolTip");
oLink.title = '';
if (sImage != "") sImage = "<img src=\"" + sImage + "\" /><br />";
sStyle = (sImage == "") ? "text-align: left; white-space: nowrap;": "text-align: center; width: "+iWidth+"px;";
oTip.innerHTML = "<div><div style=\"padding: 3px; background-color: " +sBackColor+ "; color: " +sForeColor+ "; border: 1px solid " +sBorderdColor+"; font: "+(iTextSize*2+6)+"pt Tahoma, Arial; "+sStyle+"\">" + sImage + sTitle +"</div></div>";
mbTipOk=true;
if (imBrw_ie || imBrw_ns || imBrw_op) {
iFadeStep=0;
if (bDoFade) imTipDoFade();
}
}
return false;
}
function imTipHide(){
if (imBrw_ns||imBrw_ie){
var oTip=imGetLayer("imToolTip");
mbTipOk=false;
oTip.style.visibility='hidden';
oTip.style.left='-1000px';
}
}
function imTipMove(e){
if (mbTipOk) {
var oTip=imGetLayer("imToolTip");
var offsetxpoint=-60;
var offsetypoint=20;
var curX=(imBrw_ns)? e.pageX : event.clientX + imIEBody().scrollLeft;
var curY=(imBrw_ns)? e.pageY : event.clientY + imIEBody().scrollTop;
var rightedge=imBrw_ie&&!imBrw_op? imIEBody().clientWidth-event.clientX-offsetxpoint : window.innerWidth-e.clientX-offsetxpoint-20;
var bottomedge=imBrw_ie&&!imBrw_op? imIEBody().clientHeight-event.clientY-offsetypoint : window.innerHeight-e.clientY-offsetypoint-20;
var leftedge=(offsetxpoint<0)? offsetxpoint*(-1) : -1000;
if (rightedge<oTip.offsetWidth)
oTip.style.left=imBrw_ie? imIEBody().scrollLeft+event.clientX-oTip.offsetWidth+"px" : window.pageXOffset+e.clientX-oTip.offsetWidth+"px";
else if (curX<leftedge)
oTip.style.left="5px";
else
oTip.style.left=curX+offsetxpoint+"px";
if (bottomedge<oTip.offsetHeight)
oTip.style.top=imBrw_ie? imIEBody().scrollTop+event.clientY-oTip.offsetHeight-offsetypoint+"px" : window.pageYOffset+e.clientY-oTip.offsetHeight-offsetypoint+"px";
else
oTip.style.top=curY+offsetypoint+"px";
oTip.style.visibility="visible";
}
}
function imTipDoFade(){
if (iFadeStep<=100){
var oTip=imGetLayer("imToolTip");
iFadeStep+=15;
if(imBrw_ie)
oTip.style.filter = "alpha(opacity=" + iFadeStep + ")";
else
oTip.style.opacity = iFadeStep/100;
oTime=setTimeout('imTipDoFade()', 50);
}
}
function imOnload() {
if (document.getElementById("imMnMn") != null) {
if (document.getElementsByTagName) {
if (imHoverToEnable) {
var oList = document.getElementById("imMnMn").getElementsByTagName("LI");
for (var i=0; i<oList.length; i++) {
oList[i].onmouseover=function() {this.className+=" iehover";}
oList[i].onmouseout=function() {this.className=this.className.replace(new RegExp(" iehover\\b"), "");}
}
}
var objs = document.getElementsByTagName("object");
for (i=0; i<objs.length; i++) {
if (objs[i].name == 'imFlash') {objs[i].outerHTML = objs[i].outerHTML;}
}
}
}
}
if (window.attachEvent) window.attachEvent("onload", imOnload);
function imPreloadImages(sImgNames) {
sNames = sImgNames.split(",");
for(iList = 0 ; iList < sNames.length ; iList++) {
var oImg = new Image();
oImg.src = sNames[iList];
}
}
function imFormatInt(i) {
if (i<10) i='0'+i;
return i;
}
function imShowHour() {
var now=new Date();
imGetLayer("imHour").innerHTML = now.getHours()+':'+imFormatInt(now.getMinutes())+':'+imFormatInt(now.getSeconds())+' ';
setTimeout(imShowHour,1000);
}
function imShowDate(sDay,sMonth,iMode) {
var now=new Date();
if (iMode == 0)
document.write(sDay.substr(now.getDay()*3,3)+' '+now.getDate()+' '+sMonth.substr(now.getMonth()*3,3)+', '+now.getFullYear());
else
document.write(sDay.substr(now.getDay()*3,3)+', '+sMonth.substr(now.getMonth()*3,3)+' '+now.getDate()+' '+now.getFullYear());
}
function imPopUpWin(sUrl,w,h,cb,sb){
if (cb=='yes')
sProp='';
else {
if ((w==-1) || (h==-1)) {
sProp= 'width='+screen.width+',height='+screen.height+',top=0,left=0,scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
} else {
l=(screen.width)?(screen.width-w)/2:100;
t=(screen.height)?(screen.height-h)/2:100;
sProp='width='+ w +',height='+ h +',top='+ t +',left='+ l +',scrollbars='+ sb +',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
}
}
oWin=window.open(sUrl,'',sProp);
oWin.focus();
}
var msSSTrans = new Array(50);
msSSTrans[0] = "BasicImage(grayscale=0, xray=0, mirror=0, invert=0, opacity=1, rotation=0)";
msSSTrans[1] = "rnd";
msSSTrans[2] = "Barn(motion='out',orientation='vertical')";
msSSTrans[3] = "Barn(motion='out',orientation='horizontal')";
msSSTrans[4] = "Barn(motion='in',orientation='vertical')";
msSSTrans[5] = "Barn(motion='in',orientation='horizontal')";
msSSTrans[6] = "Blinds(Bands=2,direction='up')";
msSSTrans[7] = "Blinds(Bands=2,direction='down')";
msSSTrans[8] = "Blinds(Bands=2,direction='left')";
msSSTrans[9] = "Blinds(Bands=2,direction='right')";
msSSTrans[10] = "Blinds(Bands=15,direction='up')";
msSSTrans[11] = "Blinds(Bands=15,direction='down')";
msSSTrans[12] = "Blinds(Bands=15,direction='left')";
msSSTrans[13] = "Blinds(Bands=15,direction='right')";
msSSTrans[14] = "Checkerboard(Direction='up',SquaresX=4,SquaresY=4)";
msSSTrans[15] = "Checkerboard(Direction='down',SquaresX=4,SquaresY=4)";
msSSTrans[16] = "Checkerboard(Direction='left',SquaresX=4,SquaresY=4)";
msSSTrans[17] = "Checkerboard(Direction='right',SquaresX=4,SquaresY=4)";
msSSTrans[18] = "Checkerboard(Direction='up',SquaresX=50,SquaresY=12)";
msSSTrans[19] = "Checkerboard(Direction='down',SquaresX=50,SquaresY=12)";
msSSTrans[20] = "Checkerboard(Direction='left',SquaresX=50,SquaresY=12)";
msSSTrans[21] = "Checkerboard(Direction='right',SquaresX=50,SquaresY=12)";
msSSTrans[22] = "Fade(Overlap=1.00)";
msSSTrans[23] = "Fade(Overlap=0.00)";
msSSTrans[24] = "GradientWipe(GradientSize=0.00,wipestyle=0,motion='forward')";
msSSTrans[25] = "GradientWipe(GradientSize=0.00,wipestyle=0,motion='reverse')";
msSSTrans[26] = "GradientWipe(GradientSize=0.00,wipestyle=1,motion='forward')";
msSSTrans[27] = "GradientWipe(GradientSize=0.00,wipestyle=1,motion='reverse')";
msSSTrans[28] = "GradientWipe(GradientSize=0.75,wipestyle=0,motion='forward')";
msSSTrans[29] = "GradientWipe(GradientSize=0.75,wipestyle=0,motion='reverse')";
msSSTrans[30] = "GradientWipe(GradientSize=0.75,wipestyle=1,motion='forward')";
msSSTrans[31] = "GradientWipe(GradientSize=0.75,wipestyle=1,motion='reverse')";
msSSTrans[32] = "Iris(irisstyle='PLUS',motion='out')";
msSSTrans[33] = "Iris(irisstyle='PLUS',motion='in')";
msSSTrans[34] = "Iris(irisstyle='DIAMOND',motion='out')";
msSSTrans[35] = "Iris(irisstyle='DIAMOND',motion='in')";
msSSTrans[36] = "Iris(irisstyle='CIRCLE',motion='out')";
msSSTrans[37] = "Iris(irisstyle='CIRCLE',motion='in')";
msSSTrans[38] = "Iris(irisstyle='CROSS',motion='out')";
msSSTrans[39] = "Iris(irisstyle='CROSS',motion='in')";
msSSTrans[40] = "Iris(irisstyle='SQUARE',motion='out')";
msSSTrans[41] = "Iris(irisstyle='SQUARE',motion='in')";
msSSTrans[42] = "Iris(irisstyle='STAR',motion='out')";
msSSTrans[43] = "Iris(irisstyle='STAR',motion='in')";
msSSTrans[44] = "RadialWipe(wipestyle='CLOCK')";
msSSTrans[45] = "RadialWipe(wipestyle='WEDGE')";
msSSTrans[46] = "RadialWipe(wipestyle='RADIAL')";
msSSTrans[47] = "Wheel(spokes=2)";
msSSTrans[48] = "Wheel(spokes=4)";
msSSTrans[49] = "Wheel(spokes=10)";
msSSTrans[50] = "RandomBars(orientation='horizontal')";
msSSTrans[51] = "RandomBars(orientation='vertical')";
msSSTrans[52] = "RandomDissolve(duration=1)";
msSSTrans[53] = "Slide(slidestyle='HIDE',Bands=1)";
msSSTrans[54] = "Slide(slidestyle='SWAP',Bands=1)";
msSSTrans[55] = "Slide(slidestyle='PUSH',Bands=1)";
msSSTrans[56] = "Slide(slidestyle='HIDE',Bands=2)";
msSSTrans[57] = "Slide(slidestyle='SWAP',Bands=2)";
msSSTrans[58] = "Slide(slidestyle='PUSH',Bands=2)";
msSSTrans[59] = "Slide(slidestyle='HIDE',Bands=10)";
msSSTrans[60] = "Slide(slidestyle='SWAP',Bands=10)";
msSSTrans[61] = "Slide(slidestyle='PUSH',Bands=10)";
msSSTrans[62] = "Spiral(GridSizeX=8,GridSizeY=8)";
msSSTrans[63] = "Spiral(GridSizeX=16,GridSizeY=16)";
msSSTrans[64] = "Zigzag(GridSizeX=6,GridSizeY=6)";
msSSTrans[65] = "Zigzag(GridSizeX=12,GridSizeY=12)";
msSSTrans[66] = "Stretch(stretchstyle='HIDE')";
msSSTrans[67] = "Stretch(stretchstyle='PUSH')";
msSSTrans[68] = "Stretch(stretchstyle='SPIN')";
msSSTrans[69] = "Strips(motion='rightdown')";
msSSTrans[70] = "Strips(motion='leftdown')";
msSSTrans[71] = "Strips(motion='rightup')";
msSSTrans[72] = "Strips(motion='leftup')";
msSSTrans[73] = "Pixelate(MaxSquare=5)";
msSSTrans[74] = "Pixelate(MaxSquare=50)";
msSSTrans[75] = "Inset()";
var msImgList = new Array();
var miImgW = new Array();
var miImgH = new Array();
var miSSDelay = new Array();
var miSSEffect = new Array();
var msSSDescr = new Array();
var msSSLink = new Array();
var miSSCount = new Array();
var moSSTime = new Array();
function imSSLoad(iID,oImgData) {
msImgList[iID] = new Array();
miImgW[iID] = new Array();
miImgH[iID] = new Array();
miSSEffect[iID] = new Array();
miSSDelay[iID] = new Array();
msSSDescr[iID] = new Array();
msSSLink[iID] = new Array();
for(i=0;i<oImgData.length;i++){
msImgList[iID][i+1] = "slideshow/"+oImgData[i][0];
miImgW[iID][i+1] = oImgData[i][1];
miImgH[iID][i+1] = oImgData[i][2];
miSSDelay[iID][i+1] = oImgData[i][3]*1000;
miSSEffect[iID][i+1] = oImgData[i][4];
msSSDescr[iID][i+1] = oImgData[i][5];
msSSLink[iID][i+1] = oImgData[i][6];
}
if(!miSSCount[iID]) miSSCount[iID]=1;
}
function imDoTrans(iID,iStep) {
iLast = msImgList[iID].length-1;
miSSCount[iID]=(miSSCount[iID]+iStep);
if (miSSCount[iID] == iLast + 1) miSSCount[iID] = 1;
if (miSSCount[iID] == 0) miSSCount[iID] = iLast;
var div_Descr=imGetLayer("imSSDescr_"+iID);
var div_Main=imGetLayer("imSSBackg_"+iID);
var div_Image=imGetLayer("imSSImage_"+iID);
if (imEffectEnabled) {
if (miSSEffect[iID][miSSCount[iID]] == 1)
iSSEffectType = Math.floor(Math.random()*73) + 2;
else
iSSEffectType = miSSEffect[iID][miSSCount[iID]];
div_Main.style.filter="progid:DXImageTransform.Microsoft."+msSSTrans[iSSEffectType];
div_Main.filters.item(0).Apply();
}
div_Descr.innerHTML=msSSDescr[iID][miSSCount[iID]];
div_Image.src = msImgList[iID][miSSCount[iID]];
iHeight=parseInt(msSSDescr[iID][miSSCount[iID]]==''?0:div_Descr.offsetHeight);
iTop=parseInt((div_Main.offsetHeight-miImgH[iID][miSSCount[iID]]-iHeight)/2);
div_Image.style.top=iTop+'px';
div_Descr.style.top=iTop+miImgH[iID][miSSCount[iID]]+'px';
div_Image.style.left=parseInt((div_Main.offsetWidth-miImgW[iID][miSSCount[iID]])/2)+'px';
if (imEffectEnabled) div_Main.filters.item(0).Play();
if(msSSLink[iID][miSSCount[iID]] != "#")
div_Image.style.cursor = 'pointer';
else
div_Image.style.cursor = 'default';
iNext = miSSCount[iID]+1
if (iNext <= iLast) {
oImg = new Image();
oImg.src = msImgList[iID][iNext];
}
}
function imLink(iID){
if(msSSLink[iID][miSSCount[iID]] != "#")
location = msSSLink[iID][miSSCount[iID]];
}
function imDoAuto(iID) {
imDoTrans(iID,1);
iAutoDelay=miSSDelay[iID][miSSCount[iID]];
moSSTime[iID]=setTimeout("imDoAuto("+iID+")", iAutoDelay);
}
function imSSPlay(iID,Auto,iBtnType) {
if (Auto == 1) {
miSSCount[iID]=1;
iAutoDelay=miSSDelay[iID][miSSCount[iID]];
moSSTime[iID]=setTimeout("imDoAuto("+iID+")", iAutoDelay);
}
else {
cmd_Auto = imGetLayer('imssPlay_' + iID);
if (cmd_Auto.alt == 'Pause') {
cmd_Auto.alt='Play';
cmd_Auto.src='res/ss_play'+iBtnType+'.gif';
clearTimeout(moSSTime[iID]);
}
else {
cmd_Auto.alt='Pause';
cmd_Auto.src='res/ss_pause'+iBtnType+'.gif';
imDoTrans(iID, 1);
iAutoDelay=miSSDelay[iID][miSSCount[iID]];
moSSTime[iID]=setTimeout("imDoAuto("+iID+")", iAutoDelay);
}
}
}
function imFilterCheck(oEvent,expr){
if (imEffectEnabled)
iKey = oEvent.keyCode;
else
iKey = oEvent.which;
sKey = String.fromCharCode(iKey);
if (expr.test(sKey))
return true;
else
return false;
}
function imKeyFilter(iType, oEvent){
if (iType == 0)
expr = /[\d\n\b]/;
else if (iType == 1)
expr = /[\d\n\b\- ]/;
else if (iType == 2)
expr = /[\d\n\b\/\.]/;
return imFilterCheck(oEvent,expr);
}
var iMMCurPos=0;
var iMMEnd = 0;
var iMMEndDisplace = 0;
var oMMTime = null;
var imMMVel=0;
var iMMHeaderSize = 0;
var iMMFooterSize = 0;
var iMMTimerInt = 0;
function imGetOffset(sName) {return imGetLayer(sName).offsetHeight ?
imGetLayer(sName).offsetHeight :
imGetLayer(sName).style.pixelHeight ?
imGetLayer(sName).style.pixelHeight : 0;
}
function imMMScrollMenu(){
if (document.documentElement && document.documentElement.scrollTop)
iMMEnd = document.documentElement.scrollTop > iMMHeaderSize ?
document.documentElement.scrollTop - iMMHeaderSize :
0;
else if (document.body && document.body.scrollTop)
iMMEnd = document.body.scrollTop > iMMHeaderSize ?
document.body.scrollTop - iMMHeaderSize :
0;
else
iMMEnd = 0;
if(iMMCurPos > iMMEnd)
iMMEndDisplace = -(imMMVel-1);
else if (iMMCurPos < iMMEnd)
iMMEndDisplace = (imMMVel-1);
iMMCurPos += ((iMMEnd - iMMCurPos + iMMEndDisplace)/imMMVel);
iMMCurPos = parseInt(iMMCurPos);
imGetLayer("imMnMn").style.paddingTop = iMMCurPos + 'px';
if (iMMCurPos == iMMEnd){
clearTimeout(oMMTime);
oMMTime = null;
}
else{
clearTimeout(oMMTime);
oMMTime = setTimeout("imMMScrollMenu()", iMMTimerInt);
}
}
function imMMMenu(){
if(!oMMTime)
oMMTime = setTimeout("imMMScrollMenu()", iMMTimerInt);
}
function imMMInit(iMMVel){
iMMHeaderSize = imGetLayer("imMenuMain").offsetTop;
iMMFooterSize = imGetLayer("imFooter").offsetTop;
imMMVel = iMMVel;
iTimerInt = 5;
iMMCurPos = 0;
imGetLayer("imMnMn").style.paddingTop = iMMCurPos + 'px';
window.onscroll = imMMMenu;
}
function imZIZoom(sImage,iHeight,iWidth,sDescr) {
var imZIdiv_Backg = imGetLayer("imZIBackg");
var imZIdiv_Image = imGetLayer("imZIImage");
var imZIyScroll;
var imZIwindowHeight;
if (window.innerHeight && window.scrollMaxY)
imZIyScroll = window.innerHeight + window.scrollMaxY;
else if (document.body.scrollHeight > document.body.offsetHeight)
imZIyScroll = document.body.scrollHeight;
else
imZIyScroll = document.body.offsetHeight;
if (self.innerHeight)
imZIwindowHeight = self.innerHeight;
else if (document.documentElement && document.documentElement.clientHeight)
imZIwindowHeight = document.documentElement.clientHeight;
else if (document.body)
imZIwindowHeight = document.body.clientHeight;
imZIpageHeight = imZIyScroll < imZIwindowHeight ? imZIwindowHeight : imZIyScroll;
if (self.pageYOffset)
imZIyScroll = self.pageYOffset;
else if (document.documentElement && document.documentElement.scrollTop)
imZIyScroll = document.documentElement.scrollTop;
else if (document.body)
imZIyScroll = document.body.scrollTop;
imZIdiv_Backg.style.top = '0px';
imZIdiv_Backg.style.height = (imZIpageHeight + 'px');
imZIdiv_Backg.style.zIndex = '2000';
var imZIImageTop = imZIyScroll + ((imZIwindowHeight - 35 - iHeight) / 2);
var div_Descr = "";
if (sDescr!="") div_Descr = "<div id=\"imZICaption\">" + sDescr + "</div>";
imZIdiv_Backg.innerHTML = "<div id=\"imZIImage\" style=\"margin-top:" + ((imZIImageTop < 0) ? "0px" : imZIImageTop) + "px" + "; width: " + (iWidth + 14) + "px\"><img src=\"" + sImage + "\" width=\"" + iWidth + "\" height=\"" + iHeight + "\" />" + div_Descr + "</div>";
imZIdiv_Backg.style.display = "block";
}
function imZIHide(){
imGetLayer("imZIBackg").style.display = "none";
imGetLayer("imZIImage").innerHtml = "";
}
var moFGTime = null;
var mFGMoving = new Array();
function imFGClickLR(iFGIndex,iFGBkSize,iFGEndBlock,iFGMaxBlock,iFGSpeed,iFGDir){
var oFGObj = imGetLayer("imFGImgList_" + iFGIndex);
var imiLeft = parseInt(oFGObj.style.left);
iFGEndBlock = iFGEndBlock <= iFGMaxBlock ? iFGEndBlock < 0 ? 0 : iFGEndBlock : iFGMaxBlock;
if(Math.abs(imiLeft) == iFGEndBlock*iFGBkSize){
mFGMoving[iFGIndex] = null;
return;
}
if(mFGMoving[iFGIndex] && mFGMoving[iFGIndex] != iFGDir)
return;
else
mFGMoving[iFGIndex] = iFGDir;
if(Math.abs(imiLeft) < iFGEndBlock*iFGBkSize && iFGDir==1){
if(Math.abs(imiLeft - iFGSpeed) > iFGEndBlock*iFGBkSize )
iFGSpeed = imiLeft+iFGEndBlock*iFGBkSize;
oFGObj.style.left = imiLeft - iFGSpeed + "px";
setTimeout("imFGClickLR(" + iFGIndex + "," + iFGBkSize + "," + iFGEndBlock + "," + iFGMaxBlock + "," + iFGSpeed + "," + iFGDir + ")",40);
}
else if(Math.abs(imiLeft) > iFGEndBlock*iFGBkSize && imiLeft <= 0 && iFGDir==2){
if(Math.abs(imiLeft + iFGSpeed) < iFGEndBlock*iFGBkSize || (imiLeft + iFGSpeed) > iFGEndBlock*iFGBkSize)
iFGSpeed = Math.abs(imiLeft)-iFGEndBlock*iFGBkSize;
oFGObj.style.left = imiLeft + iFGSpeed + "px";
setTimeout("imFGClickLR(" + iFGIndex + "," + iFGBkSize + "," + iFGEndBlock + "," + iFGMaxBlock + "," + iFGSpeed + "," + iFGDir + ")",40);
}
}
function imFGClickUD(iFGIndex,iFGBkSize,iFGEndBlock,iFGMaxBlock,iFGSpeed,iFGDir){
var oFGObj = imGetLayer("imFGImgList_" + iFGIndex);
var imiTop = parseInt(oFGObj.style.top);
//set bound
iFGEndBlock = iFGEndBlock <= iFGMaxBlock ? iFGEndBlock < 0 ? 0 : iFGEndBlock : iFGMaxBlock;
if(Math.abs(imiTop) == iFGEndBlock*iFGBkSize){
mFGMoving[iFGIndex] = null;
return;
}
if(mFGMoving[iFGIndex] && mFGMoving[iFGIndex] != iFGDir)
return;
else
mFGMoving[iFGIndex] = iFGDir;
if(Math.abs(imiTop) < iFGEndBlock*iFGBkSize && iFGDir==2){
if(Math.abs(imiTop - iFGSpeed) > iFGEndBlock*iFGBkSize )
iFGSpeed = parseInt((imiTop+iFGEndBlock*iFGBkSize));
oFGObj.style.top = imiTop - iFGSpeed + "px";
setTimeout("imFGClickUD(" + iFGIndex + "," + iFGBkSize + "," + iFGEndBlock + "," + iFGMaxBlock + "," + iFGSpeed + "," + iFGDir + ")",40);
}
else if(Math.abs(imiTop) > iFGEndBlock*iFGBkSize && imiTop <= 0 && iFGDir==1){
if(Math.abs(imiTop + iFGSpeed) < iFGEndBlock*iFGBkSize || (imiTop + iFGSpeed) > iFGEndBlock*iFGBkSize)
iFGSpeed = parseInt((Math.abs(imiTop)-iFGEndBlock*iFGBkSize));
oFGObj.style.top = imiTop + iFGSpeed + "px";
setTimeout("imFGClickUD(" + iFGIndex + "," + iFGBkSize + "," + iFGEndBlock + "," + iFGMaxBlock + "," + iFGSpeed + "," + iFGDir + ")",40);
}
}
function imFGMove(iFGIndex,iFGSpeed,iFGType,iFGCmd){
clearTimeout(moFGTime);
if(iFGType < 1 || iFGType > 4)
return;
var imDataObj = imGetLayer("imFGImgList_" + iFGIndex);
var imDataCont = imGetLayer("imFGImgCont_" + iFGIndex);
var imiLeft = parseInt(imDataObj.style.left);
var imiTop = parseInt(imDataObj.style.top);
var imiSize = imGetLayer("imFGItem_" + iFGIndex + "_" + 1 ).offsetHeight;
var imiTWBlock = parseInt(imDataObj.offsetWidth/imiSize);
var imiTHBlock = parseInt(imDataObj.offsetHeight/imiSize);
switch(iFGType){
case 1:{
if (imiLeft - iFGSpeed >= imDataCont.offsetWidth - imDataObj.offsetWidth)
switch(iFGCmd){
case 0:
if(mFGMoving[iFGIndex])
return;
imDataObj.style.left = imiLeft - iFGSpeed + "px";
break;
case 1:
imFGClickLR(iFGIndex,imiSize,parseInt(Math.abs(imiLeft/imiSize)+1),
imiTWBlock-parseInt(imDataCont.offsetWidth/imiSize),
iFGSpeed,1);
return;
default:
imFGClickLR(iFGIndex,imiSize,
parseInt(Math.abs(imiLeft/imiSize)+parseInt(imDataCont.offsetWidth/imiSize)),
imiTWBlock-parseInt(imDataCont.offsetWidth/imiSize),
iFGSpeed,
1);
return;
}
break;
}
case 2 :{
if (imiLeft + iFGSpeed < 0)
switch(iFGCmd){
case 0:
if(mFGMoving[iFGIndex])
return;
imDataObj.style.left = imiLeft + iFGSpeed + "px";
break;
case 1 :
imFGClickLR(iFGIndex,imiSize,parseInt(Math.abs(imiLeft/imiSize)),
imiTWBlock-parseInt(imDataCont.offsetWidth/imiSize),
iFGSpeed,2);
return;
default:
imFGClickLR(iFGIndex,imiSize,
parseInt(Math.abs(imiLeft/imiSize)-parseInt(imDataCont.offsetWidth/imiSize)),
imiTWBlock-parseInt(imDataCont.offsetWidth/imiSize),
iFGSpeed,
2);
return;
}
else
imDataObj.style.left = 0;
break;
}
case 3 :{
if (imiTop + iFGSpeed < 0)
switch(iFGCmd){
case 0 :
if(mFGMoving[iFGIndex])
return;
imDataObj.style.top = imiTop + iFGSpeed + "px";
break;
case 1 :
imFGClickUD(iFGIndex,imiSize,parseInt(Math.abs(imiTop/imiSize)),
imiTHBlock-parseInt(imDataCont.offsetHeight/imiSize),
iFGSpeed,1);
return;
default :
imFGClickUD(iFGIndex,imiSize,
parseInt(Math.abs(imiTop/imiSize)-parseInt(imDataCont.offsetHeight/imiSize)),
imiTHBlock-parseInt(imDataCont.offsetHeight/imiSize),
iFGSpeed,
1);
return;
}
else{
imDataObj.style.top = 0;
return;
}
break;
}
case 4 :{
if (imiTop - iFGSpeed >= imDataCont.offsetHeight - imDataObj.offsetHeight)
switch(iFGCmd){
case 0 :
if(mFGMoving[iFGIndex])
return;
imDataObj.style.top = imiTop - iFGSpeed + "px";
break;
case 1 :
imFGClickUD(iFGIndex,imiSize,parseInt(Math.abs(imiTop/imiSize))+1,
imiTHBlock-parseInt(imDataCont.offsetHeight/imiSize),
iFGSpeed,2);
return;
default:
imFGClickUD(iFGIndex,imiSize,
parseInt(Math.abs(imiTop/imiSize)+parseInt(imDataCont.offsetHeight/imiSize))+1,
imiTHBlock-parseInt(imDataCont.offsetHeight/imiSize),
iFGSpeed,
2);
return;
}
}
}
moFGTime = setTimeout("imFGMove(" + iFGIndex + "," + iFGSpeed + "," + iFGType + "," + iFGCmd + ")", 50);
}
function imFGShow(iIndex,sImageSrc,iImageH,iDescH,sDescr,sLink,iEffect){
var div_FGMain = imGetLayer("imFGMain_" + iIndex);
if (imEffectEnabled && iEffect != 0) {
if (iEffect == 1) iEffect = Math.floor(Math.random()*73) + 2;
div_FGMain.style.filter="progid:DXImageTransform.Microsoft."+msSSTrans[iEffect];
div_FGMain.filters.item(0).Apply();
}
var iTop = parseInt((div_FGMain.offsetHeight-iImageH-iDescH)/2);
var div_Descr = (iDescH == 0) ? "" : "<div id=\"imFGDescr_" + iIndex + "\" style=\"top: " + (iTop + iImageH) + "px\">" + sDescr + "</div>";
div_FGMain.innerHTML = "<img src=\"imagebrowser/"+sImageSrc+"\" style=\"margin-top: " + iTop + "px\"/>" + div_Descr;
if (sLink!="#") {
div_FGMain.onclick= function onclick(event) {location = sLink};
div_FGMain.style.cursor="pointer";
} else {
div_FGMain.onclick="";
div_FGMain.style.cursor="default";
}
if (imEffectEnabled && iEffect != 0) div_FGMain.filters.item(0).Play();
}
function imMapSwap(oLI) {
if(oLI.className == 'imMap_closed')
oLI.className = 'imMap_open';
else
oLI.className = 'imMap_closed';
}
function imMapExpAll() {
var a = document.getElementsByTagName('li');
for(var i = 0; i < a.length; i++)
if(a[i].className == 'imMap_closed')
a[i].className = 'imMap_open';
}
function imMapCmpAll() {
var a = document.getElementsByTagName('li');
for(var i = 0; i < a.length; i++)
if(a[i].className == 'imMap_open')
a[i].className = 'imMap_closed';
}
//aggiunte del 10/11/2007
function show_preview(foto_n, text)
{
fixed_txt = document.getElementById("fixed_text")
img_txt = document.getElementById("img_text")
if (imEffectEnabled)	foto_n.filters(0).apply()
foto_n.style.visibility = "visible";
fixed_txt.style.display='none';
foto_n.style.display = "";
if (imEffectEnabled)	foto_n.filters(0).play()
fixed_txt.style.visibility = "hidden"
img_txt.innerHTML = "<b>"+text+"</b>";
img_txt.style.visibility = "visible"
}
function hide_preview(foto_n)
{
fixed_txt = document.getElementById("fixed_text")
img_txt = document.getElementById("img_text")
foto_n.style.display = "none"
fixed_txt.style.display="";
img_txt.innerHTML = "";
if (imEffectEnabled) fixed_txt.filters(0).apply()
fixed_txt.style.visibility = "visible"
if (imEffectEnabled) fixed_txt.filters(0).play()
}
//aggiunte del 23/11/2007, funzione per le pagine clienti e lavori(toggle visibilità tabelle)
function toggle(id)
	{
	if(id.indexOf('item')!=0) return;
	for (var i=1; i<6; i++)
		{
		if (parseInt(id.substr(4,1))==i)
			{
			l = "li_" + id;
			img = "img_" + id;
			lElement = document.getElementById(l);
			imgElement = document.getElementById(img);
			liElement = document.getElementById(id);
			if (lElement)
				{
				if (lElement.className == 'closed')
					{
					lElement.className = "open";
					imgElement.src = "res/imopen.gif";
					liElement.title = "Fai clic per chiudere questo oggetto"
					}
				else
					{
					lElement.className = "closed";
					imgElement.src = "res/imclosed.gif";
					liElement.title = "Fai clic per aprire questo oggetto"
					}
				}
			}
		else
			{
			lElement = document.getElementById("li_item" + i);
			imgElement = document.getElementById("img_item" + i);
			liElement = document.getElementById("item" + i);
			if (lElement)
				{
				if (lElement.className == 'open')
					{
					lElement.className = "closed";
					imgElement.src = "res/imclosed.gif";
					liElement.title = "Fai clic per aprire questo oggetto"
					}
				}
			}
		}
	}

//aggiunte del 04/08/2009, funzione per le pagine clienti e lavori(chiude o apre tutte le tabelle)
function close_open_all(bclose)
	{
	for (var i=1; i<6; i++)
  	 {
	   l = "li_item" + i;
	   img = "img_item" + i;
	   lElement = document.getElementById(l);
	   imgElement = document.getElementById(img);
	   liElement = document.getElementById('item'+i);
	   if (!lElement) return;
	   if(bclose)
        {
				if (lElement.className == 'open')
					{
					lElement.className = "closed";
					imgElement.src = "res/imclosed.gif";
					liElement.title = "Fai clic per aprire questo oggetto"
					}
        }
	     else
        {
				if (lElement.className == 'closed')
					{
					lElement.className = "open";
					imgElement.src = "res/imopen.gif";
					liElement.title = "Fai clic per chiudere questo oggetto"
					}
        }
     }  
  }



//aggiunte del 04/12/2007, funzioni per visualizzare una 'cartolina animata'(necessari dei div e img nella pagina)
// il 23/07/2009 è stata aggiunta la var running poiché nel funzionamento manuale, se si cliccava una seconda immagine mentre..
// .. un'altra si stava ingrandendo, questa riempiva tutto lo schermo e l'animazione era completamente fuori controllo
var running = false;
function zoom_me(div_id)
	{
//	tdiv = eval("div" + div_id) commentati perché non funziona con browser firefox
//	curr_im = eval("im_" + div_id)
	tdiv = document.getElementById("div" + div_id)
	curr_im = document.getElementById("im_" + div_id)
	im_descr = document.getElementById("div17")
	if (curr_im.style.height=="158px")
		{
		tdiv.style.zIndex=10
		tdiv.style.left=div_old_x
		tdiv.style.top=div_old_y
		curr_im.style.height="38px"
		curr_im.style.width="38px"
		im_descr.innerHTML=""
		}
	else
		{
		div_old_x = tdiv.style.left
		div_old_y = tdiv.style.top
		tdiv.style.zIndex=100
		curr_im.style.height="38px"
		curr_im.style.width="38px"		
		t_2=setInterval('ingrand(curr_im,tdiv)', 10)
		im_descr.innerHTML=curr_im.title
		}
	}

function zoom_fromclick(div_id)
	{
	im_pause=document.getElementById("cart_pause");
	if(running) return false;
	if(im_pause.style.display=="inline") return false;
	tdiv = document.getElementById("div" + div_id);
	curr_im = document.getElementById("im_" + div_id);
	im_descr = document.getElementById("div17")
	if (curr_im.style.height=="158px")
		{
		tdiv.style.zIndex=10;
		tdiv.style.left=div_old_x;
		tdiv.style.top=div_old_y;
		curr_im.style.height="38px";
		curr_im.style.width="38px";
		im_descr.innerHTML="";
		}
	else
		{
		div_old_x = tdiv.style.left;
		div_old_y = tdiv.style.top;
		tdiv.style.zIndex=100;
		curr_im.style.height="38px";
		curr_im.style.width="38px";
		t_2=setInterval('ingrand(curr_im,tdiv)', 10);
		running = true;
		im_descr.innerHTML=curr_im.title;
		}
	}

function vai()
	{
	i = Math.round(15*Math.random()) + 1;
	zoom_me(i);
	clearInterval(t_1);
	t_1=setInterval('rivai(i)', 4000);
	}

function rivai(i)
	{
	clearInterval(t_1);
	zoom_me(i);
	t_1=setInterval('vai()', 1000);
	}

function ingrand(c_img,c_div)
	{
	n_div=parseInt(c_div.id.substr(3))-1
	var scarto_x = new Array(15);
	var scarto_y = new Array(15);
	scarto_x =[0,2,4,6,0,2,4,6,0,2,4,6,0,2,4,6]
	scarto_y =[0,0,0,0,2,2,2,2,4,4,4,4,6,6,6,6]
	c_img.style.width=parseInt(c_img.style.width) + 6 + "px";
	c_img.style.height=parseInt(c_img.style.height) + 6 + "px";
	c_div.style.left=(parseInt(c_div.style.left)-scarto_x[n_div])+"px";
	c_div.style.top=(parseInt(c_div.style.top)-scarto_y[n_div])+"px";
	if (parseInt(c_img.style.width)>=158)
		{
		clearInterval(t_2);
		running = false;
		}
	}

function cart_go(b_action)
	{
	im_pause=document.getElementById("cart_pause");
	im_play=document.getElementById("cart_play");
  im_descr = document.getElementById("div17")
	
	try 
		{
		if(curr_im.style.height>="158px")
			{
			tdiv.style.zIndex=10;
			tdiv.style.left=div_old_x;
			tdiv.style.top=div_old_y;
			curr_im.style.height="38px";
			curr_im.style.width="38px";
			im_descr.innerHTML="";
			}
		}
	catch(e)
		{
		//return false;
		}
	if(b_action)
		{
		im_pause.style.display="inline";
		im_play.style.display="none";
		im_descr.innerHTML="";
		t_1=setInterval('vai(0)', 3000);
		}
	else
		{
		im_pause.style.display="none";
		im_play.style.display="inline";
		im_descr.innerHTML="Clicca su una foto per ingrandirla";
		clearInterval(t_1);
		}
	}

//aggiunta il 11/06/2009 per visualizzare il menu a fondo pagina (quello con i separatori |) in modo comune a tutte le pagine
function ShowBottomMenu() {
//document.write('<p id='+'"'+'imFooterSiteMap'+'"'+'><a href='+'"'+'index.html'+'"'+' title'+'='"'+'"'+'>Home Page</a> | <a href='+'"'+'la_societa.html'+'"'+' title='+'"'+'"'+'>La Società</a></p>');
document.write('<p id=\"imFooterSiteMap\"><a href=\"index.html\" title=\"\">Home Page</a> | <a href=\"la_societa.html\" title=\"\">La Società</a> | <a href=\"i_servizi.html\" title=\"\">I Servizi</a> | <a href=\"i_clienti.html\" title=\"\">I Clienti</a> | <a href=\"i_lavori.html\" title=\"\">I Lavori</a> | <a href=\"contattaci.html\" title=\"\">Contattaci</a> | <a href=\"lavora_con_noi.html\" title=\"\">Lavora con noi</a> | <a href=\"certificazioni.html\" title=\"\">Certificazioni</a> | <a href="\press.html\" title=\"\">Press</a> | <a href=\"imsitemap.html\" title=\"Mappa generale del sito\">Mappa del sito</a></p>');
}

// aggiunta il 11/06/2009 per visualizzare il menu a principale in modo comune a tutte le pagine
// da modificare quando viene aggiunta una nuova pagina senza modificare la pagina stessa
// ogni pagina richiama il proprio menu con la funzione passandogli il numero opportuno
function ShowMainMenu(MenuVoice) {
var MainMenuLinks = new Array(10);
MainMenuLinks[0]=""
MainMenuLinks[1]="index.html"
MainMenuLinks[2]="la_societa.html"
MainMenuLinks[3]="i_servizi.html"
MainMenuLinks[4]="i_clienti.html"
MainMenuLinks[5]="i_lavori.html"
MainMenuLinks[6]="contattaci.html"
MainMenuLinks[7]="lavora_con_noi.html"
MainMenuLinks[8]="certificazioni.html"
MainMenuLinks[9]="press.html"
MainMenuLinks[10]="http://www.indaginistrutturali.eu/login.aspx" //la prossima voce di menu utilizzerà immnu_011(a-b-c).gif

document.write('<div id=\"imMnMn\">')
document.write('<ul>')
for(var i = 1; i < MainMenuLinks.length; i++) {
	if(i==MenuVoice)
		document.write('<li><img src=\"./res/immnu_0'+MenuVoice.toString()+'c.gif\" style=\"cursor:default; vertical-align:middle \" title=\"\" alt=\"\" /></li>');
	else
		document.write('<li><a class=\"imMnItm_'+i.toString()+'\" href=\"'+MainMenuLinks[i]+'\" title=\"\"></a></li>');
	}
document.write('</ul>')
document.write('</div>')
}

function select_words(url) //seleziona le frasi ricercate;introdotta il 14/07/2009 in seguito all'introduzione della ricerca personalizzata con Google search
{

var volte = 0;
var conta = 0;
var dove_sta = 0; // se la ricerca ha esito positivo mi fermo al primo <li> e valorizzo questa var
var trovato = false;
if (url=='') return false;

var word = url.substr(8) //reperisco la frase da ricercare dopo ?select=
word=unescape(word)
var min_word = word
min_word.toLowerCase()
if (document.all) {
var r_txt = new Array(6)
for (i=1; i<7; i++)
	{
	r_txt[i]=document.getElementById('li_item'+i)
	if (r_txt[i])
		{
		var test_str = r_txt[i].innerText.toLowerCase()
		var r = test_str.indexOf(min_word);
		if (r > -1)
			{
			var dove_sta = i;
			break;
			}
		}
	}
var html=document.body.createTextRange()
var txt=document.body.createTextRange()
do {
   trovato=txt.findText(word)
   if (trovato)
		{ 
		txt.findText(word); 
		txt.pasteHTML("<span style='background-color:white'><strong>"+ txt.text +"</strong></span>")
		conta = 1; 
		volte++;
		txt.moveStart("word", 1);
		txt.moveEnd("word");
		txt.scrollIntoView
	        }
   } 
while (trovato)
if (volte == '0') 
		  {
		  conta = conta - 1;
		  } 
else		  
		  {
		  volte = 0;
		  }
toggle('item' + dove_sta) //se sono nelle pagine clienti e lavori apro la cartella dove ho trovato quanto ricercato per evidenziarlo
  }
else {
//var s = document.body.innerHTML

//var r = new RegExp("[x]", "g");
//  document.write(a);
//r.compile(word);
//var a = r.exec(s);
//alert(a.length);

highlightWord(document.getElementsByTagName("body")[0], word)



} 
}
//sostituisce la select_words che funziona solo con IE
function highlightWord(node,word) {
	// Iterate into this nodes childNodes

	if (node.hasChildNodes) {
		var hi_cn;
		var all_ids;
		for (hi_cn=0;hi_cn<node.childNodes.length;hi_cn++) {
			highlightWord(node.childNodes[hi_cn],word);
		}
	}
	
	// And do this node itself
	if (node.nodeType == 3) { // text node
		tempNodeVal = node.nodeValue.toLowerCase();

		tempWordVal = word.toLowerCase();
		if (tempNodeVal.indexOf(tempWordVal) != -1) {
			pn = node.parentNode;
			//da rivedere; l'if risolve solo il problema dell'assegnamento della classe 'open' ad altri oggetti
			//ma non risolve l'assegnamento dei corretti img e title
      var this_node = node.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode
      if(this_node.id.substr(0,7)=='li_item')
      {
      this_node.className='open'
      var imgElement = document.getElementById("img_item" + this_node.id.substr(7,1));
			imgElement.src = "res/imopen.gif";
			var liElement = document.getElementById("item" + this_node.id.substr(7,1));
			liElement.title = "Fai clic per chiudere questo oggetto"
      }
			node.parentNode.scrollIntoView()
			//close_open_all(false)//apro tutte le tabelle
			if (pn.className != "searchword") {
				// word has not already been highlighted!
				nv = node.nodeValue;
				ni = tempNodeVal.indexOf(tempWordVal);
				// Create a load of replacement nodes
				before = document.createTextNode(nv.substr(0,ni));
				docWordVal = nv.substr(ni,word.length);
				after = document.createTextNode(nv.substr(ni+word.length));
				hiwordtext = document.createTextNode(docWordVal);
				hiword = document.createElement("span");
				hiword.className = "searchword";
				hiword.appendChild(hiwordtext);
				pn.insertBefore(before,node);
				pn.insertBefore(hiword,node);
				pn.insertBefore(after,node);
				pn.removeChild(node);
			}
		}
	}
}
