// Duration of crossfade (seconds)
var crossFadeDuration = 2

// Specify the image files
var Pic = new Array() // don't touch this
// to add more images, just continue
// the pattern, adding to the array below

/*
Pic[0] = 'img/tools/_home.gif'
Pic[1] = 'img/tools/_contacts.gif'
Pic[2] = 'img/tools/_sitemap.gif'
Pic[3] = 'img/tools/_policy.gif'
Pic[4] = 'img/tools/tools.gif'
Pic[5] = 'img/tools/_it.gif'
Pic[6] = 'img/tools/_en.gif'
*/
var t
var j = 0
var p = Pic.length

var preLoad = new Array()
for (i = 0; i < p; i++){
   preLoad[i] = new Image()
   preLoad[i].src = Pic[i]
}

function runSlideShow(imgIndex){
   if (document.all){
      document.images.SlideShow.style.filter="blendTrans(duration=2)"
      document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
      document.images.SlideShow.filters.blendTrans.Apply()      
   }
   document.images.SlideShow.src = preLoad[imgIndex].src
   if (document.all){
      document.images.SlideShow.filters.blendTrans.Play()
   }
}

function voidFunction(){
	//ie bug
}

function goToForm(idLang, strMess){
    var curId ="";
    var myObj = document.getElementsByTagName("input")
    
    for(i=0;i<myObj.length-1;i++){
        if(myObj.item(i).getAttribute("type") == "radio"){
            if(myObj.item(i).checked){
                curId = myObj.item(i).getAttribute("id")
            }    
        }
    }
    if(curId!=""){
        document.location.href="_vti_g"+ idLang +"_wantMods.aspx?idM=" + curId
    }else{
        alert(strMess)
    }
}

function createFlash(src,blnHome){
    if (navigator.appVersion.indexOf("MSIE") != -1){
    var strContent = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,0,0" ';
    //se non sono definiti width e height ==> non li setto
    strContent += 'width="805" ';
    if (blnHome){
        strContent += 'height="250">';
    }else{
        strContent += 'height="259">';
    }
    strContent += '<param name="movie" value="'+src+'">';
    strContent += '<param name=quality value=high>';
    strContent += '<param name="wmode" value="transparent">';
    strContent += 'Flash plug-in not installed.';
    strContent += '</object>';
    document.write(strContent);
  }else{
	document.write('<object type="application/x-shockwave-flash" data="'+ src +'" width="805" ');
	if (blnHome){
        document.write('height="250" ');
    }else{
	    document.write('height="259" ');
	}
	document.write('wmode="transparent">Flash plug-in not installed.</object>');
  }
}

function showBanner(src,width,height){
    if (navigator.appVersion.indexOf("MSIE") != -1){
    var strContent = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,0,0" ';
    //se non sono definiti width e height ==> non li setto
    strContent += 'width="' + width + '" ';
    strContent += 'height="' + height + '">';
    strContent += '<param name="movie" value="'+src+'">';
    strContent += '<param name=quality value=high>';
    strContent += '<param name="wmode" value="transparent">';
    strContent += 'Flash plug-in not installed.';
    strContent += '</object>';
    document.write(strContent);
  }else{
	document.write('<object type="application/x-shockwave-flash" data="'+ src +'" width="805" height="259" wmode="transparent">Flash plug-in not installed.</object>');
  }
}



function createMedia(mediaType,src,width,height,bgcolor,wmode,swliveConn,embedMovie,fvvar,fvvalue){
    //si tratta di flash
    if (mediaType == 0){
		if (navigator.appVersion.indexOf("MSIE") != -1){
			var strContent = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ';
			//se non sono definiti width e height ==> non li setto
			if (width != "") strContent += 'width="' + width + '" ';
			if (height != "") strContent += 'height="' + height + '"';
			strContent += '>';
			strContent += '<param name="movie" value="'+src+'">';
			strContent += '<param name="quality" value="high">';
			strContent += '<param name="bgcolor" value="'+bgcolor+'" />';
			strContent += '<param name="wmode" value="'+wmode+'">';
			if (fvvalue != "" && fvvar != "") strContent += '<param name="FlashVars" value="'+fvvar+'='+fvvalue+'">';
			
			if (swliveConn != "") strContent += '<param name="SwLiveConnect" value="'+swliveConn+'">';
			if (embedMovie != "") strContent += '<param name="EmbedMovie" value="'+embedMovie+'">';
			//alert('<param name="FlashVars" value="'+fvvar+'='+fvvalue+'">');
			
			strContent += 'Flash plug-in not installed.';
			strContent += '</object>';
			document.write(strContent);
		}else{
			document.write('<object type="application/x-shockwave-flash" data="'+src+'" ');
			
			//se non sono definiti width e height ==> non li setto
			if (width != "") document.write('width="'+width+'" ');
			if (height != "") document.write('height="'+height+'" ');
			
			document.write('wmode="'+wmode+'" bgcolor="'+bgcolor+'" ');
			
			if (fvvalue != "" && fvvar != "") document.write('FlashVars="'+fvvar+'='+fvvalue+'"');
			
			if (swliveConn != "") document.write('SwLiveConnect="'+swliveConn+'" ');
			if (embedMovie != "") document.write('EmbedMovie="'+embedMovie+'"');
			
			document.write('>Flash plug-in not installed.</object>');
		}
	}
}

function credits(){
	window.open("credits.htm","credits","toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=320,height=140");
}

function getObject(v_strIdImage){
	var vObj;
	
	var strBrowserName = whatbrowser();
	
	switch(strBrowserName){
		case "NN6":
		case "NN4":{
			vObj = document.getElementById(v_strIdImage);
			break;
		}
		case "ie4":
		case "ie6":
		case "ieMac":{
			vObj = document.all(v_strIdImage);
			break;
		}
		default:{
			vObj = document.all(v_strIdImage);
		}
	}
	
	return(vObj);
}


//whatbrowser()
//
//determina con quale browser l'utente è collegato e restituisce la sigla corrispondente
//
//argomenti:
//	nessuno
//
//valore di ritorno:
//	stringa	=	sigla corrispondente al browser con cui l'utente è collegato
//				NN4	=	netscape4
//				NN6	=	netscape6
//				ie	=	internet explorer
function whatbrowser(){
	var thisbrowser = "";	//sigla del browser utilizzato dall'utente
	var strAppVersion = navigator.appVersion;

	var blnIsIe4 = (strAppVersion.indexOf("MSIE 4") == -1) ? 0 : 1;
	var blnIsIe5 = (strAppVersion.indexOf("MSIE 5") == -1) ? 0 : 1;
	var blnIsIe6 = (strAppVersion.indexOf("MSIE 6") == -1) ? 0 : 1;
	var blnIsMac = (strAppVersion.indexOf("Macintosh") == -1) ? 0 : 1;
	
	//interrogo l'oggetto document per capire quale broeser sta utilizzando l'utente
    if(document.layers){
        thisbrowser="NN4";
    }
    if(document.all){
         if(blnIsIe4 == 1 || blnIsIe5==1) thisbrowser="ie4";
         else if(blnIsIe6 == 1) thisbrowser="ie6";
         else if(blnIsMac == 1) thisbrowser="ieMac";
         else thisbrowser="ie";
         
         //alert(thisbrowser);
    }
    if(!document.all && document.getElementById){
         thisbrowser="NN6";
    }
    
    return(thisbrowser);
}

//npwidthmax()
//
//calcola width della pagina, toglie larghezza menu sinistra e larghezza menu 
//destra return (la differenza)
function npwidthmax(){
	size = parseInt(window.innerWidth) - 161;
	return size;
}


function MM_preloadImages() {
	var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
		if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function OpenZoomWindow(sImg,sTitle,sWidth,sHeight){
	var oWin = window.open('','','status=0,scrollbars=0,height='+(sHeight/1+17)+'px,width='+sWidth+'px');
	var sHtml = '<html>\n';
	sHtml += '<head><title>' + sTitle + '</title>\n';
	sHtml += '<style type=\"text/css\">\n';
	sHtml += '.fntDefault { text-decoration: none; font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif; font-size: 11px; color: #514C3C }\n';
	sHtml += '</style>\n</head>\n';
	sHtml += '<body bgcolor=\"#ffffff\" leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">\n';
	sHtml += '<table width=\"100%\" height=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n';
	sHtml += '<tr><td align=\"center\" valign=\"middle\"><img border=\"0\" src=\"'+sImg+'\"  alt=\"'+sImg+'\"></td></tr>\n';
	sHtml += '<tr height=\"2\"><td bgcolor=\"#EBEAE5\"><img src=\"img/shared/np.gif\" height=\"2\" alt=\"\"></td></tr>\n';
	sHtml += '<tr height=\"15\"><td bgcolor=\"#F8F7F1\" align=\"right\" valign=\"middle\" class=\"fntDefault\"><a class=\"fntDefault\" href=\"javascript:window.close()\">close</a>&nbsp;&nbsp;</td></tr>\n';
	sHtml += '</table>\n';
	sHtml += '</body>\n';
	sHtml += '</html>';
	oWin.document.write(sHtml);
}

function OpenZoom(sImg,sTitle){
	var oWin =  window.open(''+ sImg +'','','status=0,scrollbars=0,height=50px,width=50px');
}

function gotoRegistration(sIdLang,sIdRepo){
    window.opener.location.href="_vti_g" + sIdLang + "_usr_aspx_rpstry_" + sIdRepo + "_.sphtml?from=Duss";
    window.close();
}


