
 
                function gone()
                {
                 	location=document.quickmenu.menucontent.options[document.quickmenu.menucontent.selectedIndex].value;
                }
                
				function gone_attachment()
                {    // location=document.attachmentmenu.attachmentmenucontent.options[document.attachmentmenu.attachmentmenucontent.selectedIndex].value
                	window.open(document.attachmentmenu.attachmentmenucontent.options[document.attachmentmenu.attachmentmenucontent.selectedIndex].value,'mywindow','width=800,height=600,toolbar=yes, location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes, resizable=yes')
				}
				function isValidMainCreate3() {
					var Pax=document.MainCreate3.pax.value - 0;
					var CamereSingole= document.MainCreate3.camere_singole.value - 0;
					var CamereDoppie=document.MainCreate3.camere_doppie.value - 0;
					var CamereTriple=document.MainCreate3.camere_triple.value - 0;
					var PaxCheck = CamereSingole + (CamereDoppie * 2) + (CamereTriple * 3); 
					var Text = "";
					if (PaxCheck > Pax) {
						Text += "Il numero dei posti nelle camere scelte (" + PaxCheck + " in totale: ";
						if (CamereSingole > 0) Text += " " + CamereSingole + " camere singole";
						if (CamereDoppie > 0) Text += " " + CamereDoppie + " camere doppie";
						if (CamereTriple > 0) Text += " " + CamereTriple + " camere triple";
						Text += ") e' maggiore del numero\ndei partecipanti (" + Pax + ") indicati. Ti chiediamo di correggere la scelta. Grazie.";
						alert (Text);
						return false;
					}
					else if (PaxCheck < Pax) {
						Text += "Il numero dei posti nelle camere scelte (" + PaxCheck;
						if (CamereSingole > 0) Text += " " + CamereSingole + " camere singole";
						if (CamereDoppie > 0) Text += " " + CamereDoppie + " camere doppie";
						if (CamereTriple > 0) Text += " " + CamereTriple + " camere triple";
						Text += ") e' minore del numero\ndei partecipanti (" + Pax + ") indicati. Ti chiediamo di correggere la scelta. Grazie.";
						alert (Text);
						return false;
					}
					else return true;
				}
				
				function showMoscaVladivostok()
                {
                    location="travelmat_trips.php?" + document.tratte.MoscaVladivostok.options[document.tratte.MoscaVladivostok.selectedIndex].value;
                }
                function showMoscaPechino()
                {
                   location="travelmat_trips.php?" + document.tratte.MoscaPechino.options[document.tratte.MoscaPechino.selectedIndex].value;
                }
                function showMoscaIrkutsk()
                {
                  location="travelmat_trips.php?" + document.tratte.MoscaIrkutsk.options[document.tratte.MoscaIrkutsk.selectedIndex].value;
                }
               	function showMoscaUlanBator()
                {
                  location="travelmat_trips.php?" + document.tratte.MoscaUlanBator.options[document.tratte.MoscaUlanBator.selectedIndex].value;
                }
                function mySubmit(target){
                    document.email.action="Email.php?" + target;
                    document.email.submit();
                }
				
				var popupHandle;

function popup(picUrlString, windowWidth, windowHeight)
{

  // Always close the old one, so only one at a time is open
  if(popupHandle || popupHandle!=null)
  {
    if (!popupHandle.closed) popupHandle.close();
  }
  popupHandle=null;

  // create a feature string for the popup
  var x=(screen.width-windowWidth)/2
  var y=(screen.height-windowHeight)/2
  var featureString = "toolbar=no,scrollbars=no,resizable=no"
  featureString = ',left='+x + ',top='+y
  featureString += ',width='+windowWidth+',height='+windowHeight

  // html content of the popup
  var htmlString = "<html><head><title>Clicca per chiudere.</title></head>"
  htmlString += "<body marginwidth=0 marginheight=0 leftmargin=0 topmargin=0 bgcolor=white text=\"white\" onclick=\"self.close()\">"
  htmlString += "<A HREF=\"javascript:window.close();\" title=\"Chiudi\" >"
  htmlString += "<IMG SRC=\"" + picUrlString + "\" BORDER=\"0\" WIDTH=" + windowWidth + " HEIGHT=" + windowHeight + "></A>"
  htmlString += "</body></html>"

  popupHandle = window.open("" ,"popup",featureString)
  popupHandle = window.open("" ,"popup")
  popupHandle.document.clear();
  popupHandle.document.writeln(htmlString);
  popupHandle.focus();
  popupHandle.document.close(); // should trigger the picture loading.
  return popupHandle;

}

function winclose()
{
  if (window.popupHandle!=null && !window.popupHandle.closed)
  {
    window.popupHandle.close();
  }
}

function doNothing(){} // does nothing but required by JavaScript in this case
//-->


                function openAWindow( pageToLoad, winName, width, height, center) {
                xposition=0; yposition=0;
                if ((parseInt(navigator.appVersion) >= 4 ) && (center)){
                var xposition = (screen.width - width) / 2;
                var yposition = (screen.height - height) / 2;
                }
                args = "width=" + width + ","
                + "height=" + height + ","
                + "location=0,"
                + "menubar=0,"
                + "resizable=1,"
                + "scrollbars=1,"
                + "status=0,"
                + "titlebar=0,"
                + "toolbar=0,"
                + "hotkeys=0,"
                + "screenx=" + xposition + ","  //NN Only
                + "screeny=" + yposition + ","  //NN Only
                + "left=" + xposition + ","     //IE Only
                + "top=" + yposition;           //IE Only
                 window.open( pageToLoad,winName,args );
                }


