function openSmallWindow(theURL) { //v2.0
  var pop = window.open(theURL,'Tecross','toolbar=no,width=300,height=350,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no,location=no,left=10,top=25');
  if (window.focus) { pop.focus();
        return false; }
}
function openMediumWindow(theURL) { //v2.0
  var pop = window.open(theURL,'Tecross','toolbar=no,width=500,height=500,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no,location=no,left=10,top=25');
  if (window.focus) { pop.focus();
        return false;  }
}
function openLargeWindow(theURL) { //v2.0
  var pop = window.open(theURL,'Tecross','toolbar=no,width=650,height=650,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no,location=no,left=10,top=25');
  if (window.focus) { pop.focus();
        return false;  }
}

function nav()
   {
   var w = document.survey_type.mylist.selectedIndex;
   var url_add = document.survey_type.mylist.options[w].value;
   if (url_add)
     {
     window.location.href = url_add;
    }
   }
   
function textCounter(field, maxlimit) {
if (field.value.length > maxlimit) {
  field.value = field.value.substring(0, maxlimit);
  alert("Reached the allowed size limit ")
  }
}

function  display_chart(thisChart) {
		<!-- Hide code from older browsers
		document.write("<table width=\"100%\">")
		for (j=0;j<thisChart.years.length;j++) {
			if (currChart.direction=="horizontal") {
			  document.write("<tr><td colspan='2'><b>"+thisChart.years[j]+"<\/b><\/td><\/tr>")
				for (i=0;i<thisChart.fieldnames.length;i++) {
					document.write("<tr><td width=\"25%\" align=\"right\">"+thisChart.fieldnames[i]+"<\/td><td width=\"75%\">")
					document.write("<img src='"+imgSrc+"' height='15' width='"+(thisChart.fields[i]*3)+"' alt='horizontal bar' \/>")
					document.write("  "+thisChart.fields[i]+"%<\/td><\/tr>")
				}
			}
			else {
				document.write("<tr><td colspan='"+thisChart.years.length+"'><p><br \/><\/p><b>")
				document.write(thisChart.years[j]+"<\/b><\/td><\/tr><tr valign='bottom' align='center'>")
				for (i=0;i<thisChart.fieldnames.length;i++) {
					document.write("<td><img src='"+imgSrc+"' hspace='10' width='15' height='"+(thisChart.fields[i][j]*3)+"' alt='vertical bar' \/><\/td>")
				}
				document.write("<\/tr><tr align='center'>")
				for (i=0;i<thisChart.fieldnames.length;i++) {
					document.write("<td>" + thisChart.fields[i][j] + "<br \/>" + thisChart.fieldnames[i] + "<\/td>")
				}
				document.write("<\/tr>")
			}
		}
		document.write("<\/table>")
		document.write("<hr>")
		// Stop hiding code -->
   }


    function setoptions(){
          alert("inside Startup" )
          //alert("next starting:" + document.myForm.criteria_action_type_10.value)
    	  var radio = $('employee_rating_summaries[1][:question_id]').value;
    	  alert("inside Startup" + radio)
    	  radio=5
    	  if (document.myForm.criteria_action_type_10.checked) {
    	  radio = 10}
    	  if (document.myForm.criteria_action_type_20.checked) {
    	  radio = 20}
    	  if (document.myForm.criteria_action_type_30.checked) {
    	  radio = 30}
    	  hidingoptions(radio)
    	  return
    }

    function hidingoptions(t){
    	if (t == 10) { 
    	   document.getElementById("div_faccess_code").style.display = 'block';    	       	   
    	   document.getElementById("div_taddr").style.display = 'none';
    	   document.getElementById("div_taccess_code").style.display = 'none';
    	   }
    	if (t == 20) { 
    	   document.getElementById("div_faccess_code").style.display = 'none';    	       	   
    	   document.getElementById("div_taddr").style.display = 'block';
    	   document.getElementById("div_taccess_code").style.display = 'none';
    	   }
    	if (t == 30 ) { 
    	   document.getElementById("div_faccess_code").style.display = 'block';    	       	   
    	   document.getElementById("div_taddr").style.display = 'block';
    	   document.getElementById("div_taccess_code").style.display = 'block';
    	   }
    }
    
   function set_access_type_options(){
          //alert("next starting:" + document.myForm.criteria_action_type_10.value)
    	  //var radio = $("criteria.action_type");
    	  radio=5
    	  if (document.myForm.address_access_type_1.checked) {
    	      radio = 1}
    	  if (document.myForm.address_access_type_2.checked) {
    	      radio = 2}
    	  hiding_access_type_options(radio)
    	  return
    }
   
   function hiding_access_type_options(t){
    	if (t == 1) { 
    	   document.getElementById("div_address_access_code").style.display = 'block';    	       	   
    	  } else {
       	    document.getElementById("div_address_access_code").style.display = 'none';    	       	   
    	  }
    }
