var xmlHttp
function switchMenuOn(object, object2) {
	var el = document.getElementById(object);
		el.style.display = '';
}

function switchMenuOff(object, object2) {
	var el = document.getElementById(object);
	var el2 = document.getElementById(object2);
		el.style.display = 'none';
		el2.style.display = 'none';
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  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 MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function showPro(box, id) {
			xmlHttp=GetXmlHttpObject()
			if (xmlHttp==null)
			 {
			 alert ("Browser does not support HTTP Request")
			 return
			 }
			var el = document.getElementById(box);
			el.style.display = '';
			var url="getInfo.php"
			url=url+"?q="+id
			url=url+"&sid="+Math.random()
			xmlHttp.onreadystatechange=stateChanged 
			xmlHttp.open("GET",url,true)
			xmlHttp.send(null)
			}
			function stateChanged() 
			{ 
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
			 { 
			 setTimeout("",1250);
			 document.getElementById('Layer1').innerHTML=xmlHttp.responseText 
			 } 
			}
			function GetXmlHttpObject()
			{
			var xmlHttp=null;
			try
			 {
			 // Firefox, Opera 8.0+, Safari
			 xmlHttp=new XMLHttpRequest();
			 }
			catch (e)
			 {
			 //Internet Explorer
			 try
			  {
			  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
			  }
			 catch (e)
			  {
			  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			  }
			 }
			return xmlHttp;
			}	

function randOrd(){
return (Math.round(Math.random())-0.5); }
var pictures = new Array ("images/header/1.jpg", "images/header/10.jpg", "images/header/11.jpg", "images/header/12.jpg", "images/header/13.jpg", "images/header/15.jpg", "images/header/16.jpg", "images/header/17.jpg", "images/header/18.jpg", "images/header/19.jpg", "images/header/20.jpg", "images/header/21.jpg", "images/header/22.jpg", "images/header/3.jpg", "images/header/4.jpg", "images/header/5.jpg", "images/header/6.jpg", "images/header/7.jpg", "images/header/8.jpg", "images/header/9.jpg", "images/header/dann070607007.jpg", "images/header/dann070607040.jpg", "images/header/dann070607069.jpg", "images/header/dann070607080.jpg", "images/header/dann0710230011.jpg", "images/header/dann0710230019.jpg", "images/header/dann0710230022.jpg", "images/header/dann0710230023.jpg", "images/header/dann0803110046.jpg", "images/header/dann0803150054.jpg", "images/header/dann0803150060.jpg", "images/header/dann0803270088.jpg");
pictures.sort(randOrd);
var picture_num = 1;
var time = 4000;
var current_picture = new Image();
function start_show() 
{
setInterval("slideshow()", time);
current_picture.src = pictures[0];
document["rotating_picture"].src = current_picture.src;
}
function slideshow() 
{
	picture_num++;
		if (picture_num == pictures.length) 
		{
		picture_num = 0;
		}
		current_picture.src = pictures[picture_num];
		document["rotating_picture"].src = current_picture.src;
}
function writeVideo()
{
document.getElementById('container').innerHTML= "<embed type=\"application/x-shockwave-flash\" src=\"player.swf\" style=\"\" id=\"ply\" name=\"ply\" bgcolor=\"#FFFFFF\" quality=\"high\" allowfullscreen=\"true\" allowscriptaccess=\"always\" flashvars=\"file=promo.flv&amp;image=images/Dannunziologo.jpg\" height=\"320\" width=\"400\">";
}
function eraseVideo()
{
document.getElementById('container').innerHTML='';
}
/*
Simple Image Trail script- By JavaScriptKit.com
Visit http://www.javascriptkit.com for this script and more
This notice must stay intact
*/

var offsetfrommouse=[15,15]; //image x,y offsets from cursor position in pixels. Enter 0,0 for no offset
var displayduration=0; //duration in seconds image should remain visible. 0 for always.
var currentimageheight = 270;	// maximum image size.

if (document.getElementById || document.all){
document.write('<div id="trailimageid">');
document.write('</div>');
}

function gettrailobj(){
if (document.getElementById)
return document.getElementById("trailimageid").style
else if (document.all)
return document.all.trailimagid.style
}

function gettrailobjnostyle(){
if (document.getElementById)
return document.getElementById("trailimageid")
else if (document.all)
return document.all.trailimagid
}


function truebody(){
return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function showtrail(imagename,title,description,showthumb,height){

if (height > 0){
currentimageheight = height;
}

document.onmousemove=followmouse;

newHTML = '<div style="padding: 5px; background-color: #FFFFFF; border: 1px solid #888888;">';
newHTML = newHTML + '<h2>' + title + '</h2>';
newHTML = newHTML + description + '<br/>';

if (showthumb > 0){
newHTML = newHTML + '<div align="center" style="padding: 8px 2px 2px 2px;">';
newHTML = newHTML + '<img src="' + imagename + '" border="0"></div>';
}

gettrailobjnostyle().innerHTML = newHTML;
gettrailobj().visibility="visible";

}

function hidetrail(){
gettrailobj().visibility="hidden"
document.onmousemove=""
gettrailobj().left="-500px"

}

function followmouse(e){

var xcoord=offsetfrommouse[0]
var ycoord=offsetfrommouse[1]

var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
var docheight=document.all? Math.min(truebody().scrollHeight, truebody().clientHeight) : Math.min(window.innerHeight)

//if (document.all){
//	gettrailobjnostyle().innerHTML = 'A = ' + truebody().scrollHeight + '<br>B = ' + truebody().clientHeight;
//} else {
//	gettrailobjnostyle().innerHTML = 'C = ' + document.body.offsetHeight + '<br>D = ' + window.innerHeight;
//}

if (typeof e != "undefined"){
if (docwidth - e.pageX < 380){
xcoord = e.pageX - xcoord - 400; // Move to the left side of the cursor
} else {
xcoord += e.pageX;
}
if (docheight - e.pageY < (currentimageheight + 110)){
ycoord += e.pageY - Math.max(0,(110 + currentimageheight + e.pageY - docheight - truebody().scrollTop));
} else {
ycoord += e.pageY;
}

} else if (typeof window.event != "undefined"){
if (docwidth - event.clientX < 380){
xcoord = event.clientX + truebody().scrollLeft - xcoord - 400; // Move to the left side of the cursor
} else {
xcoord += truebody().scrollLeft+event.clientX
}
if (docheight - event.clientY < (currentimageheight + 110)){
ycoord += event.clientY + truebody().scrollTop - Math.max(0,(110 + currentimageheight + event.clientY - docheight));
} else {
ycoord += truebody().scrollTop + event.clientY;
}
}

var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
var docheight=document.all? Math.max(truebody().scrollHeight, truebody().clientHeight) : Math.max(document.body.offsetHeight, window.innerHeight)
if(ycoord < 0) { ycoord = ycoord*-1; }
gettrailobj().left=xcoord+"px"
gettrailobj().top=ycoord+"px"

}
