function submete(form) {
  var first=form.firstname.value;
  var last=form.lastname.value;
  var address=form.address.value;
  var address2=form.address2.value;
  var country=form.country.options[form.country.selectedIndex].value;
  if (first=="") {
    alert('Please inform your first name (required field)')
    return false;
  }
  if (last=="") {
    alert('Please inform your last name (required field)')
    return false;
  }
  if (address=="") {
    alert('Please inform your email address. (required field)');
    form.address2.focus();
    return false;
  }

  if (address!=address2) {
    alert('Email address and confirmation do not match. Please reinform.');
    return false;
  }

  if (country=="") {
    alert('Please inform your country of origin. (required field)')
    return false;
  }
  if (address.lastIndexOf('.')==-1 || address.indexOf('@')==-1) {
    alert('Email address is not in a valid format. Please reenter your email address.');
    return false;
  }
  return true;
}

function download(form,filename) {

	form.file.value=filename;	
	form.submit();

}

function openNewJet(opener) {

win=window.open('newjetchart.html','','width=650,height=500,scrollbars=yes');
      win.creator=opener;
}

function showAppletsWin() {

  window.open('applets/index.html','','toolbar=no,scrollbars=yes,width=650,height=460');
}

function showServletsWin() {

  window.open('servlets/index.html','','toolbar=no,scrollbars=yes,width=730,height=460');

}

function showPricesWin() {
  win=window.open('prices.html','','toolbar=no,scrollbars=yes,width=650,height=400');
}

function sendToFeedbackPage(win) {
     openerWindow=win.creator;
     opener.location="../feedback.jsp";
     opener.focus();
}

function checkHitsValue(form) {
	
	value1=form.hits1.value;
	value2=form.hits2.value;
	value3=form.hits3.value;
	value4=form.hits4.value;
	value5=form.hits5.value;
	value6=form.hits6.value;
	
	if (isNaN(value1))
	  alert("Value informed for the first domain is invalid.");
	else if (isNaN(value2))
	  alert("Value informed for the second domain is invalid.");
	else if (isNaN(value3))
	  alert("Value informed for the third domain is invalid.");
        else if (isNaN(value4))
	  alert("Value informed for the fourth domain is invalid.");
        else if (isNaN(value5))
	  alert("Value informed for the fifth domain is invalid.");
        else if (isNaN(value6))
	  alert("Value informed for the sixth domain is invalid.");
	else if (value1=="")
	  alert("Please inform a value for the first domain.");
        else if (value2=="")
	  alert("Please inform a value for the second domain.");
        else if (value3=="")
	  alert("Please inform a value for the third domain.");
        else if (value4=="")
	  alert("Please inform a value for the fourth domain.");
        else if (value5=="")
	  alert("Please inform a value for the fifth domain.");
        else if (value6=="")
	  alert("Please inform a value for the sixth domain.");
	else if (value1<1000 || value1>10000)
	  alert("Value for the first domain must be a number ranging from 1000 to 10000.");
        else if (value2<1000 || value2>10000)
	  alert("Value for the second domain must be a number ranging from 1000 to 10000.");
        else if (value3<1000 || value3>10000)
	  alert("Value for the third domain must be a number ranging from 1000 to 10000.");
        else if (value4<1000 || value4>10000)
	  alert("Value for the fourth domain must be a number ranging from 1000 to 10000.");
        else if (value5<1000 || value5>10000)
	  alert("Value for the fifth domain must be a number ranging from 1000 to 10000.");
        else if (value6<1000 || value6>10000)
	  alert("Value for the sixth domain must be a number ranging from 1000 to 10000.");
	else {
	  parent.frames[1].location="wait.html";
          parent.frames[2].location="domain.jsp";
	  form.submit();
	}

}

function mailto(address) {

	win=window.open("mailto.jsp","","width=400,height=300");
	win.address=address;

}

function sendmail(form) {

        if (confirm("Confirma envio do email ?")) { 
	  form.address.value=self.address;
	  form.submit();

        }


}

function showgraph(type) {

     var win;	

     if (type=='timeseries') {
	win=window.open('','win','toolbar=no,scrollbars=yes,width=650,height=450');

     }
     else {
	win=window.open('','win','toolbar=no,scrollbars=yes,width=500,height=400');
     }

     win=window.open('','win','toolbar=no,scrollbars=yes,width=w,height=h');
     win.focus();

     win.document.write("<html><body bgcolor=white><form><center><input type='button' value='Close window' onClick='window.close()'></center></form>");

     if (type=='orientation') {
      win.document.write('<center><table border=0 bgcolor=white><tr><td>'+
		  '<image src=images/example1.gif></td></tr></table>'+
	    '<br><table border=0 bgcolor=white><tr><td><image src=images/example2.gif></td></tr>'+
	    '</table></center></body></html>'); 
     }
     else if (type=='gradient') {
      win.document.write(
	          '<center><table border=0 bgcolor=black><tr><td>'+
		  '<image src=images/example3.gif></td></tr></table>'+
	          '</center></body></html>'); 
     }

     else if (type=='antialiasing') {
      win.document.write(
	          '<center><table border=0><tr><td>'+
		  '<image src=images/example24.png></td></tr></table>'+
	          '</center></body></html>'); 
     }

    else if (type=='backgroundimage') {
      win.document.write(
	          '<center><table border=0 bgcolor=black><tr><td>'+
		  '<image src=images/example4.gif></td></tr></table>'+
	          '</center></body></html>'); 
     }
     else if (type=='tooltips') {
      win.document.write(
	          '<center><table border=0 bgcolor=black><tr><td>'+
		  '<image src=images/example5.gif></td></tr></table>'+
	          '</center></body></html>'); 
     }
     else if (type=='multipletooltips') {
       win.document.write(
	          '<center><table border=0 bgcolor=white><tr><td>'+
		  '<image src=images/example6.gif></td></tr></table>'+
	          '</center></body></html>'); 
     }
      else if (type=='multiplelegendbox') {
       win.document.write(
	          '<center><table border=0 bgcolor=white><tr><td>'+
		  '<image src=images/example20.gif></td></tr></table>'+
	          '</center></body></html>'); 
     }
     else if (type=='stackedsleg') {
       win.document.write(
	          '<center><table border=0><tr><td>'+
		  '<image src=images/example22.gif></td></tr></table>'+
	          '</center></body></html>'); 
     }
     else if (type=='datechart') {
       win.document.write(
	          '<center><table border=0 bgcolor=black><tr><td>'+
		  '<image src=images/example7.gif></td></tr></table>'+
	          '</center></body></html>'); 
     }
     else if (type=='verticallabels') {
       win.document.write(
	          '<center><table border=0 bgcolor=black><tr><td>'+
		  '<image src=images/example8.gif></td></tr></table>'+
	          '</center></body></html>'); 
     }
     else if (type=='automanscale') {
       win.document.write(
	          '<center><table border=0 bgcolor=white><tr><td>'+
		  '<image src=images/example9.gif></td></tr></table>'+
	          '</center></body></html>'); 
     }
     else if (type=='highlight') {
       win.document.write(
	          '<center><table border=0 bgcolor=black><tr><td>'+
		  '<image src=images/example10.gif></td></tr></table>'+
	          '</center></body></html>'); 
     }
     else if (type=='annotations') {
       win.document.write(
	          '<center><table border=0 bgcolor=black><tr><td>'+
		  '<image src=images/example11.gif></td></tr></table>'+
	          '</center></body></html>'); 
     }
     else if (type=='doubleaxis') {
       win.document.write(
	          '<center><table border=0 bgcolor=white><tr><td>'+
		  '<image src=images/example12.gif></td></tr></table>'+
	          '</center></body></html>'); 
     }
     else if (type=='scalepos') {
       win.document.write(
	          '<center><table border=0 bgcolor=white><tr><td>'+
		  '<image src=images/example13.gif></td></tr></table>'+
	          '</center></body></html>'); 
     }
     else if (type=='multiplescales') {
       win.document.write(
	          '<center><table border=0 bgcolor=white><tr><td>'+
		  '<image src=images/example14.gif></td></tr></table>'+
	          '</center></body></html>'); 
     }
     else if (type=='multilabels') {
       win.document.write(
	          '<center><table border=0 bgcolor=white><tr><td>'+
		  '<image src=images/example15.gif></td></tr></table>'+
	          '</center></body></html>'); 
     }
     else if (type=='multirows') {
       win.document.write(
	          '<center><table border=0 bgcolor=white><tr><td>'+
		  '<image src=images/example16.gif></td></tr></table>'+
	          '</center></body></html>'); 
     }
     else if (type=='scrollinglabel') {
       win.document.write(
	          '<center><table border=0 bgcolor=#c8d0d0><tr><td>'+
		  '<image src=images/example17.gif></td></tr></table>'+
	          '</center></body></html>'); 
     }
     else if (type=='scrollingbar') {
       win.document.write(
	          '<center><table border=0 bgcolor=black><tr><td>'+
		  '<image src=images/example18.gif></td></tr></table>'+
	          '</center></body></html>'); 
     }

     else if (type=='seriesmap') {
     win.document.write('<html>'+
            '<head><STYLE TYPE="text/css">'+
            ' p {text-align:justify;font-family:Arial,Verdana,Helvetica;font-size:9pt;color:#000080}'+
            '</STYLE></head>'+
            '<body bgcolor=white><center><br><br>'+
	    '<table border=0><tr><td>'+
	    '<map name="map">'+
	    '<area shape=poly coords="141,120,223,186,231,179,238,171,244,162,249,153,252,143,254,133,255,123,255,113,254,103,251,94,247,84,141,120" href="http://www.javasoft.com">'+
            '<area shape=poly coords="141,120,247,84,245,80,242,75,239,71,236,67,232,63,229,59,225,55,221,51,216,48,211,45,207,42,205,41,141,120" href="http://www.jinsight.com">'+
            '<area shape=poly coords="142,105,206,26,196,21,185,16,174,13,162,11,150,10,138,10,126,10,115,12,103,15,92,19,142,105" href="http://www.javalobby.com">'+
            '<area shape=poly coords="141,120,91,34,87,36,84,37,80,39,77,41,74,43,71,45,67,47,64,49,61,51,59,54,56,56,53,59,51,61,141,120" href="http://www.javacat.com">'+
            '<area shape=poly coords="141,120,51,61,37,80,29,100,27,122,30,143,39,163,53,181,72,196,94,207,119,214,145,215,153,215,141,120" href="http://www.javashareware.com">'+
            '<area shape=poly coords="141,120,153,215,161,214,169,213,176,211,184,209,191,206,198,203,205,199,211,195,218,191,223,186,141,120" href="http://www.jars.com">'+
             '</map>'+
	     '<image src=images/example19.gif usemap=#map border=0></td></tr></table>'+
	     '<p>Move mouse cursor over any slice and click. Slices are mapped '+ 
             'to six different urls.</center>'+
	     '</body></html>');     
      }    


      else if (type=='scalelabels') {
       win.document.write(
	          '<center><table border=0><tr><td>'+
		  '<image src=images/example21.gif></td></tr></table>'+
	          '</center></body></html>'); 
      }

      else if (type=='monthlabels') {
       win.document.write(
	          '<center><table border=0><tr><td>'+
		  '<image src=images/example23.gif></td></tr></table>'+
	          '</center></body></html>'); 
     }    

     else if (type=='labelsstep') {
       win.document.write(
	          '<center><table border=0><tr><td>'+
		  '<image src=images/example24.png></td></tr></table>'+
	          '</center></body></html>'); 
     }    

     else if (type=='hiddenpoints') {
       win.document.write(
	          '<center><table border=0><tr><td>'+
		  '<image src=images/example25.gif></td></tr></table>'+
	          '</center></body></html>'); 
     }    

     else if (type=='timeseries') {
       win.document.write( 
	          '<center><table border=0><tr><td>'+
		  '<image src=images/example26.gif></td></tr></table>'+
	          '</center></body></html>'); 
     }    

     else if (type=='zoom') {
       win.document.write( 
	          '<center><table border=0><tr><td>'+
		  '<image src=images/example27.gif></td></tr></table>'+
	          '</center></body></html>'); 
     }    

     else if (type=='logscale') {
       win.document.write( 
	          '<center><table border=0><tr><td>'+
		  '<image src=images/example28.gif></td></tr></table>'+
	          '</center></body></html>'); 
     }    

     else if (type=='dashed') {
       win.document.write( 
	          '<center><table border=0><tr><td>'+
		  '<image src=images/example31.gif></td></tr></table>'+
	          '</center></body></html>'); 
     }    

     else if (type=='targetline') {
       win.document.write( 
	          '<center><table border=0><tr><td>'+
		  '<image src=images/example29.gif></td></tr></table>'+
	          '</center></body></html>'); 
     }    

     else if (type=='regline') {
       win.document.write( 
	          '<center><table border=0><tr><td>'+
		  '<image src=images/example30.gif></td></tr></table>'+
	          '</center></body></html>'); 
     }    

     else if (type=='targetzone') {
       win.document.write( 
	          '<center><table border=0 bgcolor=black><tr><td>'+
		  '<image src=images/example32.gif></td></tr></table>'+
	          '</center></body></html>'); 
     }    

     else if (type=='labelszone') {
       win.document.write( 
	          '<center><table border=0><tr><td>'+
		  '<image src=images/example33.gif></td></tr></table>'+
	          '</center></body></html>'); 
     }    

     win.document.close();

}
