var numH=1;var numG=1;function accoda(box){if(document.createElement&&document.getElementById&&document.getElementsByTagName){if(box=="H"){var oDivBox=document.createElement("div");oDivBox.setAttribute("id","boxH_"+numH);var oLabelHotel=document.createElement("label");oLabelHotel.appendChild(document.createTextNode("Hotel "));var oSelectHotel=document.createElement("select");oSelectHotel.setAttribute("name","boxH_hotel_"+numH);oSelectHotel.setAttribute("id","boxH_hotel_"+numH);var oOpt0=document.createElement("option");var t0=document.createTextNode("--");oOpt0.setAttribute("value","");oOpt0.setAttribute("selected","selected");oOpt0.appendChild(t0);oSelectHotel.appendChild(oOpt0);var oOpt1=document.createElement("option");var t1=document.createTextNode("Hotel 1");oOpt1.setAttribute("value","Hotel 1");oOpt1.appendChild(t1);oSelectHotel.appendChild(oOpt1);var oOpt2=document.createElement("option");var t2=document.createTextNode("Hotel 2");oOpt2.setAttribute("value","Hotel 2");oOpt2.appendChild(t2);oSelectHotel.appendChild(oOpt2);var oOpt3=document.createElement("option");var t3=document.createTextNode("Hotel 3");oOpt3.setAttribute("value","Hotel 3");oOpt3.appendChild(t3);oSelectHotel.appendChild(oOpt3);var oLabelPersone=document.createElement("label");oLabelPersone.appendChild(document.createTextNode(" Persone "));var oinputPersone=document.createElement("input");oinputPersone.setAttribute("type","text");oinputPersone.setAttribute("name","boxH_persone_"+numH);oinputPersone.setAttribute("id","boxH_persone_"+numH);oinputPersone.setAttribute("class","input_text");var oLabelDal=document.createElement("label");oLabelDal.appendChild(document.createTextNode(" dal "));var oinputDal=document.createElement("input");oinputDal.setAttribute("type","text");oinputDal.setAttribute("name","boxH_dal_"+numH);oinputDal.setAttribute("id","boxH_dal_"+numH);oinputDal.setAttribute("size","10");oinputDal.setAttribute("maxlength","10");oinputDal.setAttribute("class","input_data margim-data");var oACalDal=document.createElement("a");oACalDal.setAttribute("href","javascript:calDal_"+numH+".popup();");var oImgCalDal=document.createElement("img");oImgCalDal.setAttribute("src","imagepmw/cal.gif");oImgCalDal.setAttribute("width","16");oImgCalDal.setAttribute("height","16");oImgCalDal.setAttribute("hspace","2");oImgCalDal.setAttribute("border","0");oImgCalDal.setAttribute("alt","Click per selezionare la data");oImgCalDal.setAttribute("align","absmiddle");oACalDal.appendChild(oImgCalDal);var oScriptDal=document.createElement("script");oScriptDal.setAttribute("language","JavaScript");var tScriptDal=document.createTextNode("var calDal_"+numH+" = new calendar1(document.forms['prenota'].elements['boxH_dal_"+numH+"']); calDal_"+numH+".year_scroll = false; calDal_"+numH+".time_comp = false; ");oScriptDal.appendChild(tScriptDal);var oLabelAl=document.createElement("label");oLabelAl.appendChild(document.createTextNode(" al "));var oinputAl=document.createElement("input");oinputAl.setAttribute("type","text");oinputAl.setAttribute("name","boxH_al_"+numH);oinputAl.setAttribute("id","boxH_al_"+numH);oinputAl.setAttribute("size","10");oinputAl.setAttribute("maxlength","10");oinputAl.setAttribute("class","input_data");var oACalAl=document.createElement("a");oACalAl.setAttribute("href","javascript:calAl_"+numH+".popup();");var oImgCalAl=document.createElement("img");oImgCalAl.setAttribute("src","imagepmw/cal.gif");oImgCalAl.setAttribute("width","16");oImgCalAl.setAttribute("height","16");oImgCalAl.setAttribute("hspace","2");oImgCalAl.setAttribute("border","0");oImgCalAl.setAttribute("alt","Click per selezionare la data");oImgCalAl.setAttribute("align","absmiddle");oACalAl.appendChild(oImgCalAl);var oScriptAl=document.createElement("script");oScriptAl.setAttribute("language","JavaScript");var tScriptAl=document.createTextNode("var calAl_"+numH+" = new calendar1(document.forms['prenota'].elements['boxH_al_"+numH+"']); calAl_"+numH+".year_scroll = false; calAl_"+numH+".time_comp = false; ");oScriptAl.appendChild(tScriptAl);var oButt=document.createElement("input");oButt.setAttribute("type","button");oButt.setAttribute("value","rimuovi");if(oButt.attachEvent){oButt.attachEvent("onclick",function(e){rimuovi(e,"contH")})}else{if(oButt.addEventListener){oButt.addEventListener("click",function(e){rimuovi(e,"contH")},false)}}oDivBox.appendChild(document.createElement("br"));oDivBox.appendChild(oLabelHotel);oDivBox.appendChild(oSelectHotel);oDivBox.appendChild(document.createElement("br"));oDivBox.appendChild(oLabelPersone);oDivBox.appendChild(oinputPersone);oDivBox.appendChild(oLabelDal);oDivBox.appendChild(oinputDal);oDivBox.appendChild(document.createTextNode(" "));oDivBox.appendChild(oACalDal);oDivBox.appendChild(oScriptDal);oDivBox.appendChild(oLabelAl);oDivBox.appendChild(oinputAl);oDivBox.appendChild(document.createTextNode(" "));oDivBox.appendChild(oACalAl);oDivBox.appendChild(oScriptAl);oDivBox.appendChild(document.createTextNode(" "));oDivBox.appendChild(oButt);document.getElementById("contH").appendChild(oDivBox);numH++}if(box=="G"){var oDivBox=document.createElement("div");oDivBox.setAttribute("id","boxG_"+numG);var oSelectGolf=document.createElement("select");oSelectGolf.setAttribute("name","boxG_golf_"+numG);oSelectGolf.setAttribute("id","boxG_golf_"+numG);var oOpt0=document.createElement("option");var t0=document.createTextNode("--");oOpt0.setAttribute("value","");oOpt0.setAttribute("selected","selected");oOpt0.appendChild(t0);oSelectGolf.appendChild(oOpt0);var oOpt1=document.createElement("option");var t1=document.createTextNode("Golf 1");oOpt1.setAttribute("value","Golf 1");oOpt1.appendChild(t1);oSelectGolf.appendChild(oOpt1);var oOpt2=document.createElement("option");var t2=document.createTextNode("Golf 2");oOpt2.setAttribute("value","Golf 2");oOpt2.appendChild(t2);oSelectGolf.appendChild(oOpt2);var oOpt3=document.createElement("option");var t3=document.createTextNode("Golf 3");oOpt3.setAttribute("value","Golf 3");oOpt3.appendChild(t3);oSelectGolf.appendChild(oOpt3);var oButt=document.createElement("input");oButt.setAttribute("type","button");oButt.setAttribute("value","rimuovi");if(oButt.attachEvent){oButt.attachEvent("onclick",function(e){rimuovi(e,"contG")})}else{if(oButt.addEventListener){oButt.addEventListener("click",function(e){rimuovi(e,"contG")},false)}}oDivBox.appendChild(document.createElement("br"));oDivBox.appendChild(document.createTextNode("Golf "));oDivBox.appendChild(oSelectGolf);oDivBox.appendChild(document.createTextNode(" "));oDivBox.appendChild(oButt);document.getElementById("contG").appendChild(oDivBox);numG++}}}function rimuovi(e,NomeDiv){if(document.removeChild&&document.getElementById&&document.getElementsByTagName){if(!e){e=window.event}var srg=(e.target)?e.target:e.srcElement;while(srg.tagName!="DIV"){srg=(srg.parentNode)?srg.parentNode:srg.parentElement}document.getElementById(NomeDiv).removeChild(srg)}};
