
function Modulo() {
var title = document.modulo.text_title.value;
var description_title = document.modulo.text_description.value;
var keyword = document.modulo.text_keyword.value;
var email = document.modulo.email.value;
var titlelong = document.modulo.text_title.value.length;
var descriptionlong = document.modulo.text_description.value.length;
var keywordlong = document.modulo.text_keyword.value.length;
var email_reg_exp = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;
if ((title == "") || (title == "undefined") || (titlelong <=5) ) {
alert("Il campo Title è obbligatorio e deve contenere almeno 6 Caratteri.");
document.modulo.text_title.focus();
return false;}
else if ((description_title == "") || (description_title == "undefined") || (descriptionlong <=5)) {
alert("Il campo Descrizione è obbligatorio e deve contenere almeno 6 Caratteri.");
document.modulo.text_description.focus();
return false;}
else if ((keyword == "") || (keyword == "undefined") || (keywordlong <=5)) {
alert("Il campo Keyword è obbligatorio e deve contenere almeno 6 Caratteri.");
document.modulo.text_keyword.focus();
return false;}
else if (!(email=="" || email == "undefined")){
if (!email_reg_exp.test(email)){
alert("Inserire un indirizzo E-Mail corretto.");
document.modulo.email.focus();
return false;}}		
{document.modulo.action = "Meta_Tag_Generator/Generatore_di_Meta_Tag.asp";
 document.modulo.submit();}}
function contat() {
var countert = document.modulo.contatore1.value = document.modulo.text_title.value.length;
if (countert >=130){
alert("E' stato superato il numero di Caratteri consigliato per il campo Title.");
document.modulo.text_title.focus();
return false;}
if (countert >5){
index=1;
pindex=0;
endwhile=0
bodyt=document.modulo.text_title.value;
bodyl=bodyt.toLowerCase()
finalfs=bodyl.indexOf(".",bodyl.length-1);
if(finalfs>=0)
bodyl=bodyl.substring(0,bodyl.length-1);
while(index>=0){
index = bodyl.indexOf("<",0);
if (index >= 0){
pindex = bodyl.indexOf(">",index);
bodyank=bodyl.substring(index,pindex+1);
bodyl=bodyl.replace(bodyank," ");
bodyl=bodyl.replace(". "," ");
bodyl=bodyl.replace("@ "," ");
bodyl=bodyl.replace("<"," ");
bodyl=bodyl.replace(">"," ");}}
rm_ext_char="";
real_chr="";
for(i=0; i<bodyl.length; i++){
one_chr=bodyl.charCodeAt(i);
if ((one_chr>=65 && one_chr<=90) || (one_chr>=97 && one_chr<=122) || (one_chr>=48 && one_chr<=57)){
real_chr=bodyl.charAt(i);
}else{real_chr=" ";}
rm_ext_char=rm_ext_char+real_chr}
bodyl=rm_ext_char.split(" ");
rm_s_d="";
full_text="";
count=0
for(i=0; i<bodyl.length; i++){rm_s_d=bodyl[i];
if (rm_s_d.length>2){
count=count+1;
full_text=full_text+" "+rm_s_d;}}
if (document.keyword.key.value!=""){
kf=document.keyword.key.value;
rm_ext_char="";
real_chr="";
for(i=0; i<kf.length; i++){one_chr=kf.charCodeAt(i);
if ((one_chr>=65 && one_chr<=90) || (one_chr>=97 && one_chr<=122) || (one_chr>=48 && one_chr<=57)){
real_chr=kf.charAt(i);
}else{real_chr=" ";}
rm_ext_char=rm_ext_char+real_chr}
kf=rm_ext_char;
kslen=kf.split(" ");
if(kslen.length>1){kf=kf.toLowerCase()
countkf=0.1;
kftotal=0;
while(countkf>=0){if (countkf>=0.1 && countkf<0.2){
countkf = full_text.indexOf(kf,0);}else{
end=countkf+kf.length;
countkf = full_text.indexOf(kf,end);}
if (countkf >= 0){kftotal=kftotal+1;}}
if (kslen.length>count)
document.modulo.frequency_title.value=0;
else
document.modulo.frequency_title.value=math_round(kftotal/(count+1-kslen.length)*100,1);
}else{if (document.keyword.key.value!=""){
k1=document.keyword.key.value;
kl=k1.toLowerCase()
ks=k1+"s";
countk1=0;
for(i=0; i<bodyl.length; i++){rm_s_d=bodyl[i];
if (rm_s_d.length>1){if (rm_s_d==kl || rm_s_d==ks){countk1=countk1+1;}}}
document.modulo.frequency_title.value=math_round(countk1/count*100,1);}}}
return (false);}else{
document.modulo.frequency_title.value=0;}
return (false);}
function contad() {
var counterd = document.modulo.contatore2.value = document.modulo.text_description.value.length;
if (counterd >=250){
alert("E' stato superato il numero di Caratteri consigliato per il campo Description.");
document.modulo.text_description.focus();
return false;}
if (counterd >5){
index=1;
pindex=0;
endwhile=0
bodyu=document.modulo.text_description.value;
bodym=bodyu.toLowerCase()
finalfs=bodym.indexOf(".",bodym.length-1);
if(finalfs>=0)
bodym=bodym.substring(0,bodym.length-1);
while(index>=0){index = bodym.indexOf("<",0);
if (index >= 0){pindex = bodym.indexOf(">",index);
bodyank=bodym.substring(index,pindex+1);
bodym=bodym.replace(bodyank," ");
bodym=bodym.replace(". "," ");
bodym=bodym.replace("@ "," ");
bodyl=bodym.replace("<"," ");
bodym=bodym.replace(">"," ");}}
rm_ext_char="";
real_chr="";
for(i=0; i<bodym.length; i++){one_chr=bodym.charCodeAt(i);
if ((one_chr>=65 && one_chr<=90) || (one_chr>=97 && one_chr<=122) || (one_chr>=48 && one_chr<=57)){
real_chr=bodym.charAt(i);}else{
real_chr=" ";}
rm_ext_char=rm_ext_char+real_chr}
bodym=rm_ext_char.split(" ");
rm_s_d="";
full_text="";
count=0
for(i=0; i<bodym.length; i++){rm_s_d=bodym[i];
if (rm_s_d.length>2){count=count+1;
full_text=full_text+" "+rm_s_d;}}
if (document.keyword.key.value!=""){
kf=document.keyword.key.value;
rm_ext_char="";
real_chr="";
for(i=0; i<kf.length; i++){one_chr=kf.charCodeAt(i);
if ((one_chr>=65 && one_chr<=90) || (one_chr>=97 && one_chr<=122) || (one_chr>=48 && one_chr<=57)){
real_chr=kf.charAt(i);}else{
real_chr=" ";}
rm_ext_char=rm_ext_char+real_chr}
kf=rm_ext_char;
kslen=kf.split(" ");
if(kslen.length>1){kf=kf.toLowerCase()
countkf=0.1;
kftotal=0;
while(countkf>=0){if (countkf>=0.1 && countkf<0.2){
countkf = full_text.indexOf(kf,0);}else{
end=countkf+kf.length;
countkf = full_text.indexOf(kf,end);}
if (countkf >= 0){kftotal=kftotal+1;}}
if (kslen.length>count)
document.modulo.frequency_description.value=0;
else
document.modulo.frequency_description.value=math_round(kftotal/(count+1-kslen.length)*100,1);
}else{if (document.keyword.key.value!=""){
k2=document.keyword.key.value;
kl=k2.toLowerCase()
ks=k2+"s";
countk2=0;
for(i=0; i<bodym.length; i++){rm_s_d=bodym[i];
if (rm_s_d.length>1){if (rm_s_d==kl || rm_s_d==ks){countk2=countk2+1;}}}
document.modulo.frequency_description.value=math_round(countk2/count*100,1);}}}
return (false);}
else{document.modulo.frequency_description.value=0;}  
return (false);}
function expandit(curobj){
folder=ns6?curobj.nextSibling.nextSibling.style:document.all[curobj.sourceIndex+1].style
if (folder.display=="none")
folder.display=""
else
folder.display="none"
}function contak() {
var counterk = document.modulo.contatore3.value = document.modulo.text_keyword.value.length;
if (counterk >=200){
alert("E' stato superato il numero di Caratteri consigliato per il campo Description.");
document.modulo.text_keyword.focus();
return false;}       
if (counterk >5){
index=1;
pindex=0;
endwhile=0
bodyx=document.modulo.text_keyword.value;
bodyz=bodyx.toLowerCase()
finalfs=bodyz.indexOf(".",bodyz.length-1);
if(finalfs>=0)
bodyz=bodyz.substring(0,bodyz.length-1);
while(index>=0){index = bodyz.indexOf("<",0);
if (index >= 0){pindex = bodyz.indexOf(">",index);
bodyank=bodyz.substring(index,pindex+1);
bodyz=bodyz.replace(bodyank," ");
bodyz=bodyz.replace(". "," ");
bodyz=bodyz.replace("@ "," ");
bodyz=bodyz.replace("<"," ");
bodyz=bodyz.replace(">"," ");}}
rm_ext_char="";
real_chr="";
for(i=0; i<bodyz.length; i++){one_chr=bodyz.charCodeAt(i);
if ((one_chr>=65 && one_chr<=90) || (one_chr>=97 && one_chr<=122) || (one_chr>=48 && one_chr<=57)){
real_chr=bodyz.charAt(i);}else{
real_chr=" ";}
rm_ext_char=rm_ext_char+real_chr}
bodyz=rm_ext_char.split(" ");
rm_s_d="";
full_text="";
count=0
for(i=0; i<bodyz.length; i++){
rm_s_d=bodyz[i];
if (rm_s_d.length>2){count=count+1;
full_text=full_text+" "+rm_s_d;}}
if (document.keyword.key.value!=""){kf=document.keyword.key.value;
rm_ext_char="";
real_chr="";
for(i=0; i<kf.length; i++){one_chr=kf.charCodeAt(i);
if ((one_chr>=65 && one_chr<=90) || (one_chr>=97 && one_chr<=122) || (one_chr>=48 && one_chr<=57)){
real_chr=kf.charAt(i);}else{
real_chr=" ";}
rm_ext_char=rm_ext_char+real_chr}
kf=rm_ext_char;
kslen=kf.split(" ");
if(kslen.length>1){kf=kf.toLowerCase()
countkf=0.1;
kftotal=0;
while(countkf>=0){if (countkf>=0.1 && countkf<0.2){
countkf = full_text.indexOf(kf,0);}
else{end=countkf+kf.length;
countkf = full_text.indexOf(kf,end);}
if (countkf >= 0){kftotal=kftotal+1;}}
if (kslen.length>count)
document.modulo.frequency_keyword.value=0;
else
document.modulo.frequency_keyword.value=math_round(kftotal/(count+1-kslen.length)*100,1);
}else{if (document.keyword.key.value!=""){
k3=document.keyword.key.value;
kl=k3.toLowerCase()
ks=k3+"s";
countk3=0;
for(i=0; i<bodyz.length; i++){rm_s_d=bodyz[i];
if (rm_s_d.length>1){if (rm_s_d==kl || rm_s_d==ks){countk3=countk3+1;}}}
document.modulo.frequency_keyword.value=math_round(countk3/count*100,1);}}}
return (false);}else{
document.modulo.frequency_keyword.value=0;}  
return (false);}
function open_pop(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
{toolbar_str = toolbar ? 'yes' : 'no';
menubar_str = menubar ? 'yes' : 'no';
statusbar_str = statusbar ? 'yes' : 'no';
scrollbar_str = scrollbar ? 'yes' : 'no';
resizable_str = resizable ? 'yes' : 'no';
window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);}
function copia(area) {
var appoggio=eval("document."+area)
appoggio.focus()
appoggio.select()
intervallo=appoggio.createTextRange()
intervallo.execCommand("Copy")}
