<!--

function MM_openBrWindow(theURL,winName,features) { //v2.0

  window.open(theURL,winName,features);

}

//-->





function bookmark(url, description)

{

netscape="First push OK and then hit CTRL+D to add a bookmark to this site."

if (navigator.appName=='Microsoft Internet Explorer')

{

window.external.AddFavorite(url, description);

}

else if (navigator.appName=='Netscape')

{

alert(netscape);

}

}





<!---

function decision(message, url){

if(confirm(message)) location.href = url;

}

// --->



<!--

function chgBg(obj,color){

if (document.all || document.getElementById)

  obj.style.backgroundColor=color;

else if (document.layers)

  obj.bgColor=color;

}

//-->





<!--

function MM_findObj(n, d) { //v3.0

  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); return x;

}



function MM_validateForm() { //v3.0

  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;

  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);

    if (val) { nm=val.name; if ((val=val.value)!="") {

      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');

        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';

      } else if (test!='R') { num = parseFloat(val);

        if (val!=''+num) errors+='- '+nm+' must contain a number.\n';

        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');

          min=test.substring(8,p); max=test.substring(p+1);

          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';

    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }

  } if (errors) alert('The following error(s) occurred:\n'+errors);

  document.MM_returnValue = (errors == '');

}

//-->





<!--

function MM_findObj(n, d) { //v3.0

  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); return x;

}



function MM_setTextOfTextfield(objName,x,newText) { //v3.0

  var obj = MM_findObj(objName); if (obj) obj.value = newText;

}

//-->





function MM_jumpMenu(targ,selObj,restore){ //v3.0

  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");

  if (restore) selObj.selectedIndex=0;

}





function addItems()

{

   document.fm1.lstbox.length++

   size = document.fm1.lstbox.length

   document.fm1.lstbox.options[size-1].text = document.fm1.inFile.value

   document.fm1.lstbox.options[size-1].value = document.fm1.inFile.value

   return true;

}





<!-- Begin

function Zoomthis(img){

  foto1= new Image();

  foto1.src=(img);

  Controlla(img);

}

function Controlla(img){

  if((foto1.width!=0)&&(foto1.height!=0)){

    viewFoto(img);

  }

  else{

    funzione="Controlla('"+img+"')";

    intervallo=setTimeout(funzione,20);

  }

}

function viewFoto(img){

  largh=foto1.width+20;

  altez=foto1.height+20;

  stringa="width="+largh+",height="+altez;

  finestra=window.open(img,"",stringa);

}

//  End -->







function MM_jumpMenu(targ,selObj,restore){ //v3.0

  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");

  if (restore) selObj.selectedIndex=0;

}





var stockcounter = 0; 

function stockmorefields() { 

if (stockcounter < 100) { 

stockcounter++; 

var newfields = document.getElementById('readstock').cloneNode(true); 

newfields.id = ''; 

newfields.style.display = 'block'; 

var newField = newfields.childNodes; 

for (var i=0;i<newField.length;i++) { 

var theName = newField[i].name 

if (theName) 

newField[i].name = theName + stockcounter; 

} 

var insertHere = document.getElementById('writestock'); 

insertHere.parentNode.insertBefore(newfields,insertHere); 

} else { 

alert ("Maximum field limited to 100"); 

} 

} 





function stockremovefields(instance) { 

instance.parentNode.parentNode.removeChild(instance.parentNode); 

} 





<!--

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 MM_openBrWindow(theURL,winName,features) { //v2.0

  window.open(theURL,winName,features);

}

//-->



<!--

function PopupWindow(TheURL, wid, hei) {

	var midw5=(screen.width-wid)/2; 

	var midh5=(screen.height-hei)/2;

	var windowprops =

		"resizable=no,scrollbars=yes,toolbar=no,location=no,menubar=yes"

		+ ",width=" + wid + ",innerWidth=" + wid

		+ ",height=" + hei + ",innerHeight=" + hei

		+ ",top=" + midh5 + ",left=" + midw5

		+ ",screenY=" + midh5 + ",screenX=" + midw5;

	window.open(TheURL,'MyWindow',windowprops);

}



//-->







if (document.getElementById){ 

document.write('<style type="text/css">\n')

document.write('.submenu{display: none;}\n')

document.write('</style>\n')

}



function SwitchMenu(obj){

	if(document.getElementById){

	var el = document.getElementById(obj);

	var ar = document.getElementById("masterdiv").getElementsByTagName("span"); 



		if(el.style.display != "block"){ 

			for (var i=0; i<ar.length; i++){

				if (ar[i].className=="submenu") 

				ar[i].style.display = "none";

			}

			el.style.display = "block";

		}else{

			el.style.display = "none";

		}

	}

}







function show(c) { 

if (document.getElementById && document.getElementById(c)!= null) 

node = document.getElementById(c).style.display=''; 

else if (document.layers && document.layers[c]!= null) 

document.layers[c].display = ''; 

else if (document.all) 

document.all[c].style.display = ''; 

} 

function hide(c) { 

if (document.getElementById && document.getElementById(c)!= null) 

node = document.getElementById(c).style.display='none'; 

else if (document.layers && document.layers[c]!= null) 

document.layers[c].display = 'none'; 

else if (document.all) 

document.all[c].style.display = 'none'; 

} 





<!-- Begin

browserName = navigator.appName;

browserVer = parseInt(navigator.appVersion);



ns3up = (browserName == "Netscape" && browserVer >= 3);

ie4up = (browserName.indexOf("Microsoft") >= 0 && browserVer >= 4);



function doPic(imgName) {

if (ns3up || ie4up) {

imgOn = ("" + imgName);

document.mainpic.src = imgOn;

   }

}

//  End -->





function radio_button_checker()

{

var radio_choice = false;

for (counter = 0; counter < radio_form.vote.length; counter++)

{

if (radio_form.vote[counter].checked)

radio_choice = true; 

}



if (!radio_choice)

{

alert("Please make a selection")

return (false);

}

return (true);

}



function xmlhttpPost(strURL) {

    var xmlHttpReq = false;

    var self = this;

    // Mozilla/Safari

    if (window.XMLHttpRequest) {

        self.xmlHttpReq = new XMLHttpRequest();

    }

    // IE

    else if (window.ActiveXObject) {

        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");

    }

    self.xmlHttpReq.open('POST', strURL, true);

    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');

    self.xmlHttpReq.onreadystatechange = function() {

        if (self.xmlHttpReq.readyState == 4) {

        

	var response = self.xmlHttpReq.responseText;

        var update = new Array();



        if(response.indexOf('|' != -1)) {

            update = response.split('|');

            document.getElementById(update[0]).innerHTML = update[1];

        }



        }

    }

    self.xmlHttpReq.send(getquerystring());

}



function getquerystring() {

    

var theForm     = document.forms['f1'];

var reqStr = "";



for(i=0; i < theForm.elements.length; i++)

{

isFormObject = false;



switch (theForm.elements[i].tagName)

{

case "INPUT":



switch (theForm.elements[i].type)

{

case "text":

case "hidden":

reqStr += theForm.elements[i].name + "=" + encodeURIComponent(theForm.elements[i].value);

isFormObject = true;

break;



case "checkbox":

if (theForm.elements[i].checked)

{

reqStr += theForm.elements[i].name + "=" + theForm.elements[i].value;

}else{

reqStr += theForm.elements[i].name + "=";

}

isFormObject = true;

break;



case "radio":

if (theForm.elements[i].checked)

{

reqStr += theForm.elements[i].name + "=" + theForm.elements[i].value;

isFormObject = true;

}

}

break;



case "TEXTAREA":



reqStr += theForm.elements[i].name + "=" + encodeURIComponent(theForm.elements[i].value);

isFormObject = true;

break;



case "SELECT":

var sel = theForm.elements[i];

reqStr += sel.name + "=" + sel.options[sel.selectedIndex].value;

isFormObject = true;

break;

}



if ((isFormObject) && ((i+1)!= theForm.elements.length))

{

reqStr += "&";

}



}



return reqStr;



}
