function ridimensiona(){
win_width = 810
win_height = 730
x_coord = ((screen.width - win_width) / 2)
y_coord = ((screen.height - win_height) / 2)
window.moveTo(x_coord,y_coord)
window.resizeTo(win_width,win_height)
}

function popupFAQ(myform, windowname) {
		if (! window.focus)return true;
		window.open('', windowname, 'width=555,height=400,left=50,top=50,scrollbars=yes');
		myform.target=windowname;
		return true;
}

function Schiaccia(NomeProdURL, name, NomeProdURL2, name1) {
			document.images[name].src = NomeProdURL
			document.images[name1].src = NomeProdURL2
}

function Schiaccia1(NomeProdURL,name) {
		document.images[name].src = NomeProdURL
}

function openWindow(fin,nom,vari) {
  var popupWin = window.open(fin,nom,vari);popupWin.focus();
}


function aprilista(fin,nom,vari) { 
  var popupWin = window.open(fin,nom,vari);popupWin.focus();
}


function openWindows(fin,met,vari) {
  popupWin = window.open(fin,met,vari)
}


function Form_Validator(theForm)
{
  if (Form.selection.selectedIndex <=0)
  {
    alert("Please select an item.");
    theForm.selection.focus();
    return (false);
  }
  return (true);
}

function jump(sel) {
  if (sel.options[sel.selectedIndex].value) {
  top.location.href ="download_datasheet.asp?para1="+sel.options[sel.selectedIndex].value
		}
}

function jump1(sel) {
  if (sel.options[sel.selectedIndex].value) {
  top.location.href ="download_manuals.asp?para1="+sel.options[sel.selectedIndex].value
		}
}


function jump2(sel) {
  if (sel.options[sel.selectedIndex].value) {
  top.location.href ="download_"+sel.options[sel.selectedIndex].value+".asp"
		}
}


function jump3(sel) {
  if (sel.options[sel.selectedIndex].value) {
  top.location.href ="support_applications.asp?a="+sel.options[sel.selectedIndex].value
		}
}

function Form1_Validators(theForm) {
  if (Form1.selection.selectedIndex <=0)
  {
    alert("Please select a motors family.");
    theForm.selection.focus();
    return (false);
  }
  return (true);
}

function Form2_Validators(theForm){
  if (Form2.selection.selectedIndex <=0)
  {
    alert("Please select an item.");
    theForm.selection.focus();
    return (false);
  }
  return (true);
}

function Form1_Validator(theForm)
{
  if (theForm.firstName.value == "")
   {
    alert("Please enter a value for the \"First name\" field!");
    theForm.firstName.focus();
    return(false);
  }

  if (theForm.lastName.value == "")
  {
    alert("Please enter a value for the \"Last name\" field!");
    theForm.lastName.focus();
    return(false);
  }

  if (theForm.companyName.value == "")
  {
    alert("Please enter a value for the \"Company name\" field!");
    theForm.companyName.focus();
    return (false);
  }

  if (theForm.address.value == "")
  {
    alert("Please enter a value for the \"Address\" field!");
    theForm.address.focus();
    return (false);
  }

  if (theForm.city.value == "")
  {
    alert("Please enter a value for the \"City\" field!");
    theForm.city.focus();
    return (false);
  }

  if (theForm.stateProvince.value == "")
  {
    alert("Please enter a value for the \"State / Province\" field!");
    theForm.State_Province.focus();
    return (false);
  }

  if (theForm.zipPostalcode.value == "")
  {
    alert("Please enter a value for the \"Zip Postal Code\" field!");
    theForm.Zip_Postal_code.focus();
    return (false);
  }
  var checkOK = "0123456789-,.";
  var checkStr = theForm.zipPostalcode.value;
  var allValid = true;
  var decPoints = 0;
  var allNum = "";
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    if (ch == ",")
    {
      allNum += ".";
      decPoints++;
    }
    else if (ch != ".")
      allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only digit characters in the \"Zip Postal Code\" field!");
    theForm.zipPostalcode.focus();
    return (false);
  }
  if (decPoints > 1)
  {
    alert("Please enter a valid number in the \"Zip Postal Code\" field!");
    theForm.zipPostalcode.focus();
    return (false);
  }

  if (theForm.country.value == "")
  {
    alert("Please enter a value for the \"Country\" field!");
    theForm.country.focus();
    return (false);
  }

  if (theForm.phone.value == "")
  {
    alert("Please enter a value for the \"Phone\" field!");
    theForm.phone.focus();
    return (false);
  }
  var checkOK = "0123456789-,.";
  var checkStr = theForm.phone.value;
  var allValid = true;
  var decPoints = 0;
  var allNum = "";
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    if (ch == ",")
    {
      allNum += ".";
      decPoints++;
    }
    else if (ch != ".")
      allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only digit characters in the \"Phone\" field!");
    theForm.phone.focus();
    return (false);
  }
  if (decPoints > 1)
  {
    alert("Please enter a valid number in the \"Phone\" field!");
    theForm.phone.focus();
    return (false);
  }
  if (theForm.fax.value == "")
  {
    alert("Please enter a value for the \"Fax\" field!");
    theForm.fax.focus();
    return (false);
  }
  var checkOK = "0123456789-,.";
  var checkStr = theForm.fax.value;
  var allValid = true;
  var decPoints = 0;
  var allNum = "";
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    if (ch == ",")
    {
      allNum += ".";
      decPoints++;
    }
    else if (ch != ".")
      allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only digit characters in the \"Fax\" field!");
    theForm.fax.focus();
    return (false);
  }
  if (decPoints > 1)
  {
    alert("Please enter a valid number in the \"Fax\" field!");
    theForm.fax.focus();
    return (false);
  }
  if (theForm.EmailAddress.value == "")
  {
    alert("Please enter a value for the \"E-mail Address\" field!");
    theForm.EmailAddress.focus();
    return (false);
  }

  return (true);
}

function MM_findObj(n, d) { //v4.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);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_validateForm() { //v4.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') {
        if (isNaN(val)) 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 (val<min || max<val) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+args[i+1]+' \n'; }
  } if (errors) alert('Missing following informations:\n'+errors);
  document.MM_returnValue = (errors == '');
}

function MA_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MA_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') {
        if (isNaN(val)) 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 (val<min || max<val) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+args[i+1]+' \n'; }
  } if (errors) alert('Le seguenti informazioni sono mancanti:\n'+errors);
  document.MA_returnValue = (errors == '');
}


var ma=new Array();
var mx=new Array();
var my=new Array();
var mc=new Array();
var mal=0;
var main=0;
var menuw=200;
var psrc=0;
var pname="";
var al="";
var NS6=(!document.all&&document.getElementById);
var NS4=(!document.getElementById);
var IE5=(!NS4&&!NS6&&navigator.userAgent.indexOf('MSIE 5.0')!=-1);
if(navigator.userAgent.indexOf('Opera')!=-1)NS4=1;

function startMainMenu(file,h,w,dir,space,align){if(w>0)menuw=w;main=dir;if(main==1||main==2)document.write("<table border=\"0\" cellspacing=\""+space+"\" cellpadding=\"0\">");if(file!=""){al="";if(align==1)al=" align=\"right\"";if(align==2)al=" align=\"center\"";if(main==1||main==2)document.write("<tr><td"+al+">");document.write("<img src=\""+loc+file+"\" border=\"0\"");if(h>0)document.write(" height=\""+h+"\"");if(w>0)document.write(" width=\""+w+"\"");document.write(" />");if(main==1||main==2)document.write("</td>");if(main==1)document.write("</tr>");if(main==3)document.write("<br></br>");}}

function endMainMenu(file,h,w){if(file!=""){if(main==1)document.write("<tr>");if(main==1||main==2)document.write("<td"+al+">");document.write("<img src=\""+loc+file+"\" border=\"0\"");if(h>0)document.write(" height=\""+h+"\"");if(w>0)document.write(" width=\""+w+"\"");document.write(" />");if(main==1||main==2)document.write("</td></tr>");}if(main==1||main==2)document.write("</table>");main=0;}

function mainMenuItem(name,ext,h,w,url,tar,alt,dir,state,s){if(NS4&&main==0)return;var isgraphic=ext.charAt(0)==".";if(main==1)document.write("<tr>");if(main==1||main==2)document.write("<td"+al+">");document.write("<a ");if(url!=""||!isgraphic)document.write("href=\""+url+"\" ");if(tar!="")document.write("target=\""+tar+"\" ");document.write("onmouseout=\"");if(dir>0)document.write("tidyMenu(event);");document.write("\" onmouseover=\"");if(dir>0)document.write("openMenu(event, '"+name+"',"+dir+","+bc+","+fc+");");if(state>1&&isgraphic){document[name+"_over"]=new Image();document[name+"_over"].src=loc+name+"_over"+ext;document.write("setGraphic(event, '"+loc+name+"_over"+ext+"');");}document.write("return false;\"");if(!isgraphic)document.write(" class=\""+s+"\" style=\"width:"+(w>0?w:menuw)+"px\"");document.write(">");if(isgraphic){document.write("<img src=\""+loc+name+ext+"\" border=\"0\"");if(h>0)document.write(" height=\""+h+"\"");if(w>0)document.write(" width=\""+w+"\"");if(alt!="")document.write(" alt=\""+alt+"\"");document.write(" />");}else{document.write("&nbsp;"+ext+"&nbsp;");}document.write("</a>");if(main==1||main==2)document.write("</td>");if(main==1)document.write("</tr>");if(main==3)document.write("<br></br>");}

function startSubmenu(name,style,sw){if(NS4)return;if(sw>0)menuw=sw;document.write("<div id=\""+name+"\" class=\""+style+"\"  style=\"width:"+(menuw+(NS6?bd*2:0))+"px\">");}

function endSubmenu(name){if(NS4)return;document.write("</div>");if(!NS6)document.getElementById(name).onmouseout=tidyMenu;}

function submenuItem(text,url,tar,s){if(NS4)return;if(text.charAt(0)=='<')document.write(text);else{document.write("<a ");if(url!="")document.write("href=\""+url+"\" ");if(tar!="")document.write("target=\""+tar+"\" ");document.write("class=\""+s+"\" style=\"width:"+menuw+"px\">&nbsp;"+text+"&nbsp;</a>");}}

function setGraphic(event,name){if(NS4)return;psrc=(NS6)?event.target:event.srcElement;pname=psrc.src;if(NS6)event.target.src=name;else event.srcElement.src=name;}

function openMenu(event,id,pos,bc,fc){if(NS4)return;var el,x,y;if(mal>0){el=document.getElementById(ma[mal-1]);if(mx[mal-1]!=el.offsetLeft||my[mal-1]!=el.offsetTop){el.style.left=mx[mal-1];el.style.top=my[mal-1];}tidyMenu(event);}if(NS6){if(mal==0){x=event.target.x-bd;y=event.target.y;dx=event.target.offsetWidth;dy=event.target.offsetHeight;if(typeof(event.target.x)=="undefined"){x=event.target.offsetLeft;y=event.target.offsetTop;}}else{var p=event.target;if(p.nodeName!="A"&&p.parentNode.nodeName=="A")p=p.parentNode;dx=p.offsetWidth;dy=p.offsetHeight;el=document.getElementById(ma[mal-1]);x=el.offsetLeft-bd;y=el.offsetTop+p.offsetTop;}}else{x=event.clientX-event.offsetX+document.body.scrollLeft-document.body.clientLeft;y=event.clientY-event.offsetY+document.body.scrollTop-document.body.clientTop-bd;dx=event.srcElement.offsetWidth;dy=event.srcElement.offsetHeight;if(mal>0)x-=2*bd;}el=document.getElementById(id);if(el&&el.style.visibility!="visible"){if(pos==1){x+=dx;el.style.left=x-el.offsetWidth;el.style.top=y;nspeed=el.offsetWidth/frames;}else if(pos==2){y+=dy;el.style.left=x;el.style.top=y-el.offsetHeight;nspeed=el.offsetHeight/frames;}else if(pos==3){x-=el.offsetWidth;el.style.left=x+el.offsetWidth;el.style.top=y;nspeed=el.offsetWidth/frames;}mx[mal]=x;my[mal]=y;if(NS6||IE5||frames==0){el.style.left=x;el.style.top=y;}if(!IE5)clipMenu(mal,el);el.style.visibility="visible";ma[mal]=id;if(NS6){var p=event.target;if(p.nodeName!="A"&&p.parentNode.nodeName=="A")p=p.parentNode;mc[mal]=p.style;el.onmouseout=tidyMenu;}else{mc[mal]=event.srcElement.style;if(mal>0){mc[mal].backgroundColor=bc;mc[mal].color=fc;}}mal++;}}

function overMenu(x,y){for(i=0;i<mal;i++){var el=document.getElementById(ma[i]);if(el.offsetLeft+el.offsetWidth>x&&el.offsetLeft<=x&&el.offsetTop+el.offsetHeight>y&&el.offsetTop<=y){return ma[i];}}return "";}

function tidyMenu(e){if(NS4)return;if(NS6){t=overMenu(e.pageX,e.pageY);if(t!=""&&(e.target.firstChild==e.relatedTarget||e.target==e.relatedTarget.firstChild))return;}else t=overMenu(event.clientX+document.body.scrollLeft-document.body.clientLeft,event.clientY+document.body.scrollTop-document.body.clientTop);om=0;for(i=0;i<mal;i++){var mail=ma[i].length;if(mail>t.length||t.substring(0,mail)!=ma[i]){var el=document.getElementById(ma[i]);el.style.visibility="hidden";mc[i].backgroundColor="";mc[i].color="";}else{ma[om]=ma[i];mx[om]=mx[i];my[om]=my[i];om++;}}mal=om;if(mal==0&&psrc)psrc.src=pname;}

function animate(){for(i=0;i<mal;i++){var el=document.getElementById(ma[i]);if(el.style.visibility=="visible"){if(el.offsetLeft<mx[i])el.style.left=Math.min(el.offsetLeft+nspeed,mx[i])+"px";if(el.offsetLeft>mx[i])el.style.left=Math.max(el.offsetLeft-nspeed,mx[i])+"px";if(el.offsetTop<my[i])el.style.top=Math.min(el.offsetTop+nspeed,my[i])+"px";clipMenu(i,el);}}if(mal!=0||frames!=0)setTimeout("animate()",50);}

function clipMenu(i,el){if(el.offsetLeft>mx[i])el.style.clip="rect("+(my[i]-el.offsetTop)+"px "+(el.offsetWidth+(mx[i]-el.offsetLeft))+"px "+el.offsetHeight+"px "+0+"px)";else el.style.clip="rect("+(my[i]-el.offsetTop)+"px "+el.offsetWidth+"px "+el.offsetHeight+"px "+(mx[i]-el.offsetLeft)+"px)";}


var delay=100;
var space=100;
var msg="State of the art servo systems for leading solutions in motion control.";

function scroll_start() {
timed = 0;
scrollGo = false;
i=0;
for (i=0;i<space;i++)
msg=" "+msg;
scrollGo=true;
timerid=window.setTimeout("scrollmsg(0)",delay);
}

function scrollmsg(pos) {
out = "";
scrollGo=false;
if (pos < msg.length)
self.status = msg.substring(pos, msg.length);
else
pos=-1;
++pos;
scrollGo=true;
timerid=window.setTimeout("scrollmsg("+pos+")",delay);
}

