var ua		= navigator.userAgent;
var opera	= /opera [56789]|opera\/[56789]/i.test(ua);
var ie		= !opera && /msie [56789]/i.test(ua);		// preventing opera to be identified as ie
var moz		= !opera && /mozilla\/[56789]/i.test(ua);	// preventing opera to be identified as mz

if (moz) {
	document.write('<script type="text/javascript" src="/netscape.js"><\/script>');
}

function MM_newW(myLocation) {
	 window.open(myLocation, "newWin","toolbar=no,scrollbars=yes," + "resizable=yes,height=400,width=400"); 
}

function MM_newSizedW(myLocation,mywidth,myheight) {
	 x = window.open("", "newWin","toolbar=no,scrollbars=no," + "resizable=yes,height=" + myheight + ",width=" + mywidth); 
	 x.document.write ("<html><head><title>Le Vignette di Vincino</title><head><body><center><img src=\"" + myLocation + "\"></center></body></html>");
	 x.document.close ;
}
          


Style = 5; //pick a style from below

/*------------------------------
Style 1: March 17, 2000
Style 2: Mar 17, 2000
Style 3: Saturday March 17, 2000
Style 4: Sat Mar 17, 2000
Style 5: Sat March 17, 2000
Style 6: 17 March 2000
Style 7: 17 Mar 2000
Style 8: 17 Mar 00
Style 9: 3/17/00
Style 10: 3-17-00
Style 11: Saturday March 17
--------------------------------*/

months = new Array();
months[1] = "gennaio";  months[7] = "luglio";
months[2] = "febbraio"; months[8] = "agosto";
months[3] = "marzo";    months[9] = "settembre";
months[4] = "aprile";    months[10] = "ottobre";
months[5] = "maggio";      months[11] = "novembre";
months[6] = "giugno";     months[12] = "dicembre";

months2 = new Array();
months2[1] = "Jan"; months2[7] = "Jul";
months2[2] = "Feb"; months2[8] = "Aug";
months2[3] = "Mar"; months2[9] = "Sep";
months2[4] = "Apr"; months2[10] = "Oct";
months2[5] = "May"; months2[11] = "Nov";
months2[6] = "Jun"; months2[12] = "Dec";

days = new Array();
days[1] = "domenica";    days[5] = "giovedì";
days[2] = "lunedì";    days[6] = "venerdì";
days[3] = "martedì";   days[7] = "sabato";
days[4] = "mercoledì";

days2 = new Array();
days2[1] = "Sun"; days2[5] = "Thu";
days2[2] = "Mon"; days2[6] = "Fri";
days2[3] = "Tue"; days2[7] = "Sat";
days2[4] = "Wed";

todaysdate = new Date();
date  = todaysdate.getDate();
day  = todaysdate.getDay() + 1;
month = todaysdate.getMonth() + 1;
yy = todaysdate.getYear();
year = (yy < 1000) ? yy + 1900 : yy;
year2 = 2000 - year; year2 = (year2 < 10) ? "0" + year2 : year2;

dateline = new Array();
dateline[1] = months[month] + " " + date + ", " + year;
dateline[2] = months2[month] + " " + date + ", " + year;
dateline[3] = days[day] + ", " + date + " " + months[month] + " " + year;
dateline[4] = days2[day] + " " + months2[month] + " " + date + ", " + year;
dateline[5] = days2[day] + " " + months[month] + " " + date + ", " + year;
dateline[6] = date + " " + months[month] + " " + year;
dateline[7] = date + " " + months2[month] + " " + year;
dateline[8] = date + " " + months2[month] + " " + year2;
dateline[9] = month + "/" + date + "/" + year2;
dateline[10] = month + "-" + date + "-" + year2;
dateline[11] = days[day] + " " + months[month] + " " + date;

function BuildAttachments() {

	thead = "<table width=100% border=0 cellspacing=0 cellpadding=0>";
	thead = thead + "<tr><td colspan=3><img src=\"/images/transpix.gif\" width=5></td></tr>";
	thead = thead + "<tr><td colspan=3 background=\"/images/horizontal_dot_line.gif\"><img src=\"/images/transpix.gif\"></td></tr>";
	thead = thead + "<tr><td colspan=3><img src=\"/images/transpix.gif\" width=5></td></tr>";
	tfoot = "</table>";
	dummy = "";
	for (i = 0; i < myAttachments.length; i++) {
		if (myAttachments[i][0] != "") {
			dummy = dummy + "<tr><td class=\"articlelinks\" width=20><img src=\"/images/disk.png\"></td>";
			dummy = dummy + "<td class=\"articlelinks\"  width=5><img src=\"/images/transpix.gif\" width=5></td>";
			dummy = dummy + "<td class=\"articlelinks\"><a class=\"articlelinks\" href=\"" + myAttachments[i][0] + "\">" + myAttachments[i][1] + "</a></td></tr>";
		
		} 
		
		
	}

	if (dummy != "") {
	
		dummy = thead + dummy + tfoot;
		return dummy;
	
	} else {
	
		return "";
		
	}
}

function BuildLinks() {

	thead = "<table width=100% border=0 cellspacing=0 cellpadding=0>";
	thead = thead + "<tr><td colspan=3><img src=\"/images/transpix.gif\" width=5></td></tr>";
	thead = thead + "<tr><td colspan=3 background=\"/images/horizontal_dot_line.gif\"><img src=\"/images/transpix.gif\"></td></tr>";
	thead = thead + "<tr><td colspan=3><img src=\"/images/transpix.gif\" width=5></td></tr>";
	tfoot = "</table>";
	dummy = "";
	for (i = 0; i < myLinks.length; i++) {
		if (myLinks[i][0] != "") {
			dummy = dummy + "<tr><td valign=top class=\"articlelinks\" width=20><img src=\"/images/link.gif\"></td>";
			dummy = dummy + "<td valign=top class=\"articlelinks\" width=5><img src=\"/images/transpix.gif\" width=5></td>";
			dummy = dummy + "<td valign=top class=\"articlelinks\"><a class=\"articlelinks\" href=\"" + myLinks[i][0] + "\" target=\"_blank\">" + myLinks[i][1] + "</a></td></tr>";
		
		} 
		
		
	}

	if (dummy != "") {
	
		dummy = thead + dummy + tfoot;
		return dummy;
	
	} else {
	
		return "";
		
	}
}

function BuildRelateds() {

	thead = "<table width=100% border=0 cellspacing=0 cellpadding=0>";
	thead = thead + "<tr><td colspan=3><img src=\"/images/transpix.gif\" width=5></td></tr>";
	thead = thead + "<tr><td colspan=3 background=\"/images/horizontal_dot_line.gif\"><img src=\"/images/transpix.gif\"></td></tr>";
	thead = thead + "<tr><td colspan=3><img src=\"/images/transpix.gif\" width=5></td></tr>";
	tfoot = "</table>";
	dummy = "";
	for (i = 0; i < myRelated.length; i++) {
		if (myRelated[i][0] != "") {
			dummy = dummy + "<tr><td valign=top class=\"articlelinks\" width=20><img src=\"/images/related.gif\"></td>";
			dummy = dummy + "<td valign=top class=\"articlelinks\" width=5><img src=\"/images/transpix.gif\" width=5></td>";
			dummy = dummy + "<td valign=top class=\"articlelinks\"><a class=\"articlelinks\" href=\"/story_" + myRelated[i][0] + ".html\">" + myRelated[i][1] + "</a></td></tr>";
		
		} 
		
		
	}

	if (dummy != "") {
	
		dummy = thead + dummy + tfoot;
		return dummy;
	
	} else {
	
		return "";
		
	}
}

function BuildSlider(myindex) {

        mymaxwidth = 0;
        mymaxheight = 0;
        if (myimages[myindex][0] != "/pubimages//") {
        	for (i = 0; i < myimages.length; i++) {
        		mywidth = myimages[i][1];
        		myheight = myimages[i][2];
        		if (parseInt(mywidth) > mymaxwidth) {
        			mymaxwidth = mywidth;
        		}
        		if (parseInt(myheight) > mymaxheight) {
        			mymaxheight = myheight;
        		}
        		
        		
        	}
        	
        	//width="' + mymaxwidth + '"
        		dummy = '<table class=fotogadgetcontainer border=0 width="' + mymaxwidth + '" align=left cellspacing=0 cellpadding=0>';
        		//width="' + mymaxwidth + '" height="' + mymaxheight + '"
        		dummy = dummy + '<tr><td colspan=10 valign=middle align=center>';
        		dummy = dummy + '<img src="' + myimages[myindex][0] + '" width="' + myimages[myindex][1] + '" height="' + myimages[myindex][2] + '">';
        		dummy = dummy + '</td></tr>';
        		dummy = dummy + '<tr><td colspan=10 valign=middle align=center>';
        		dummy = dummy + '<div class=didascalia>' + myimages[myindex][3] + '</div>';
        		dummy = dummy + '</tr></td>';
        		dummy = dummy + '<tr>';
        		for (i = 0; i < myimages.length; i++) {
        		
        			if (myimages[i][0] != "/pubimages//") {
        			
        				tmp = i + 1;
        				if (i != myindex) {
        					dummy = dummy + '<td width=14 class=lightoff valign=top  OnMouseOver="this.className=\'lighton\'" OnMouseOut="this.className=\'lightoff\'"><a class=lightnolight href="JavaScript:goSlider(\'' + i + '\')">' + tmp + '</a></td>';
        				} else {
        					dummy = dummy + '<td width=14 class=lighton valign=top OnMouseOver="this.className=\'lighton\'" OnMouseOut="this.className=\'lighton\'"><a class=lightnolight href="JavaScript:goSlider(\'' + i + '\')">' + tmp + '</a></td>';
        				}
        			
        			} else {
        				dummy = dummy + '<td class=lightoff width=14><img src="/images/transpix.gif"></td>';
        			}
        				
        				
        				
        			
        			
        		}
        			mysize = mymaxwidth - (14 * myimages.length);
        			mysize = parseInt(mysize);
        			dummy = dummy + '<td class=lightoff width="' + mysize + '"><img src="/images/transpix.gif"></td>';
        				
        			
        		dummy = dummy + '</tr></table>';
        		
        		return dummy;
        	} else {
        	return "";
        }


}

function goSlider(myindex) {


	if (moz) {
		document.getElementById('imagespace').innerHTML = BuildSlider(myindex);
	} else {
		imagespace.innerHTML = BuildSlider(myindex);
	}

}




