var MapState = 0;
var CurrentPopUp = null;
var DescriptionText = new Array ("");
var CurrentImage = 0;
function MasterInit ()
{
Warning: file(DinamicData/Photo/PhotoMeta.txt) [function.file]: failed to open stream: No such file or directory in /web/htdocs/www.bbrosadeiventi.com/home/Contatti/index.js.php on line 17
DescriptionText[DescriptionText.length] = "";DescriptionText[DescriptionText.length] = "";DescriptionText[DescriptionText.length] = "";DescriptionText[DescriptionText.length] = "";DescriptionText[DescriptionText.length] = "";DescriptionText[DescriptionText.length] = "";DescriptionText[DescriptionText.length] = "";DescriptionText[DescriptionText.length] = ""; Nifty("td.ButtonMedium a","transparent");
ToggleMap ();
}
function MasterDispose ()
{
;
}
function OpenPopUp (ImgRef)
{
var ImageName = "DinamicData/Photo/Big/"+ImgRef+".jpg";
CurrentImage = ImgRef;
PopuPContent = "
";
PopuPContent +="
";
PopuPContent +="

";
PopuPContent +="
";
PopuPContent +="
";
PopuPContent +="
";
PopuPContent +="";
PopuPContent +="| ";
PopuPContent +="";
PopuPContent +=" | ";
PopuPContent +="";
PopuPContent +="";
PopuPContent +=" | ";
PopuPContent +="
";
PopuPContent +="
";
PopuPContent +="
";
PopuPContent +="
";
if (CurrentPopUp == null)
{
CurrentPopUp = new Window (
{
className:"mac_os_x",
width:650,
height:530,
zIndex:-100,
resizable:false,
closable:true,
minimizable:false,
maximizable:false,
title:"B&B Rosadeiventi ("+DescriptionText[ImgRef]+")",
draggable:true,
wiredDrag:false,
showEffect:Effect.BlindDown,
hideEffect:Effect.SwitchOff,
onClose:ClosePopUp
}
);
CurrentPopUp.showCenter ();
CurrentPopUp.setConstraint (true,{bottom:10});
CurrentPopUp.toFront ();
}
CurrentPopUp.setTitle ("B&B Rosadeiventi ("+DescriptionText[ImgRef]+")");
CurrentPopUp.getContent ().innerHTML = PopuPContent;
Nifty("table.ButtonMedium a","transparent");
if (ImgRef == 1)
{
MyElemID ("PrevBtn").style.visibility = "hidden";
}
if (ImgRef == 8)
{
MyElemID ("NextBtn").style.visibility = "hidden";
}
}
function ShowPhoto (Direction)
{
CurrentImage = CurrentImage+Direction;
var ImageName = "DinamicData/Photo/Big/"+CurrentImage+".jpg";
MyElemID ("PhotoField").src = ImageName;
CurrentPopUp.setTitle ("B&B Rosadeiventi ("+DescriptionText[CurrentImage]+")");
MyElemID ("PrevBtn").style.visibility = "visible";
MyElemID ("NextBtn").style.visibility = "visible";
if (CurrentImage == 1)
{
MyElemID ("PrevBtn").style.visibility = "hidden";
}
if (CurrentImage == 8)
{
MyElemID ("NextBtn").style.visibility = "hidden";
}
}
function ClosePopUp ()
{
CurrentPopUp = null;
}
function SendMail ()
{
var ErrorMessage = "";
if (document.Contatto.Cognome.value == "")
{
ErrorMessage += "Devi indicare il cognome.\n";
}
if (document.Contatto.Telefono.value == "" && document.Contatto.Cellulare.value == "" && document.Contatto.eMail.value == "")
{
ErrorMessage += "Devi indicare un recapito telefonico o un email.\n";
}
if (document.Contatto.Oggetto.value == "")
{
ErrorMessage += "Devi indicare l'oggetto del messaggio.\n";
}
if (document.Contatto.Messaggio.value == "")
{
ErrorMessage += "Devi indicare il corpo del messaggio.\n";
}
if (ErrorMessage != "")
{
alert (ErrorMessage);
}
else
{
alert ("Il messaggio e\' stato inviato.");
document.Contatto.submit ();
}
}
function ToggleMap ()
{
if (MapState == 0)
{
if (GBrowserIsCompatible())
{
MyElemID ("map").style.display = "block";
var map = new GMap2 (document.getElementById ("map"));
map.setCenter (new GLatLng (38.204878,13.322425),17);
map.addControl (new GSmallMapControl ());
map.addControl (new GMapTypeControl ());
map.openInfoWindow (map.getCenter(),document.createTextNode ("B & B Rosadeiventi."));
}
MapState = 1;
}
}