function cambiasrc(c) { with (document) { if ( c == "agenda") { getElementById('src1off').style.display = "none"; getElementById('src2off').style.display = "none"; getElementById('src1on').style.display = "block"; getElementById('src2on').style.display = "block"; } else { getElementById('src1on').style.display = "none"; getElementById('src2on').style.display = "none"; getElementById('src1off').style.display = "block"; getElementById('src2off').style.display = "block"; } } with (document.forms["advsrc"]) { luogo.value=""; for (i=0;i= 32) { alert ('Refine your search - Wrong Day.'); document.forms["advsrc"].gfr.value = ""; } } else if (m1 == 4 || m1 == 6 || m1 == 9 || m1 == 11) { if (g1 <= 0 || g1 >= 31) { alert ('Refine your search - Wrong Day.'); document.forms["advsrc"].gfr.value = ""; } } else if (m1 == 2 && a1%4 == 0) { if (g1 <= 0 || g1 >= 30) { alert ('Refine your search - Wrong Day.'); document.forms["advsrc"].gfr.value = ""; } } else if (m1 == 2 && a1%4 != 0) { if (g1 <= 0 || g1 >= 29) { alert ('Refine your search - Wrong Day.'); document.forms["advsrc"].gfr.value = ""; } } if (m1 == "") { alert ("Please specify the starting day of your search."); } else { if (m1 <= 0 || m1 >= 13) { alert ('Refine your search - Wrong Month.'); document.forms["advsrc"].mfr.value = ""; } } if (a1 == "") { alert ("Please specify the starting month of your search."); } else { if (a1 <= 2005 || a1 >= 2008) { alert ('Sorry, at the moment you can only search through 2006 and 2007.'); document.forms["advsrc"].afr.value = ""; } } } if (g2 != "" || m2 != "" || a2 != "") { if (g2 == "") { alert ('Please specify the last day of your search.'); } else if (m2 == 1 || m2 == 3 || m2 == 5 || m2 == 7 || m2 == 8 || m2 == 10 || m2 == 12) { if (g2 <= 0 || g2 >= 32) { alert ('Refine your search - Wrong Day.'); document.forms["advsrc"].gto.value = ""; } } else if (m2 == 4 || m2 == 6 || m2 == 9 || m2 == 11) { if (g2 <= 0 || g2 >= 31) { alert ('Refine your search - Wrong Day.'); document.forms["advsrc"].gto.value = ""; } } else if (m2 == 2 && a2%4 == 0) { if (g2 <= 0 || g2 >= 30) { alert ('Refine your search - Wrong Day.'); document.forms["advsrc"].gto.value = ""; } } else if (m2 == 2 && a2%4 != 0) { if (g2 <= 0 || g2 >= 29) { alert ('Refine your search - Wrong Day.'); document.forms["advsrc"].gto.value = ""; } } if (m2 == "") { alert ("Please specify the last month of your search."); } else { if (m2 <= 0 || m2 >= 13) { alert ('Refine your search - Wrong Month.'); document.forms["advsrc"].mto.value = ""; } } if (a2 == "") { alert ("Please specify the last year of your search."); } else { if (a2 <= 2005 || a2 >= 2008) { alert ('Sorry, at the moment you can only search through 2006 and 2007.'); document.forms["advsrc"].afr.value = ""; } } } racfr = ""+g1+"/"+m1+"/"+a1; racto = ""+g2+"/"+m2+"/"+a2; with (document.forms["advsrc"]) { from.value = ""+racfr; to.value = ""+racto; if ( sezione.value=="" && kw.value=="" && from.value=="//" && to.value=="//" ) alert("Select and/or complete the search fields."); else { submit(); } } } function racdata() { with (document.forms["advsrc"]) { if (gfr.value != "" && parseInt(gfr.value,10) != gfr.value) { alert ("Warning! Incorrect Item."); gfr.value = ""; } if (mfr.value != "" && parseInt(mfr.value,10) != mfr.value) { alert ("Warning! Incorrect Item."); mfr.value = ""; } if (afr.value != "" && parseInt(afr.value,10) != afr.value) { alert ("Warning! Incorrect Item."); afr.value = ""; } if (gto.value != "" && parseInt(gto.value,10) != gto.value) { alert ("Warning! Incorrect Item."); gto.value = ""; } if (mto.value != "" && parseInt(mto.value,10) != mto.value) { alert ("Warning! Incorrect Item."); mto.value = ""; } if (ato.value != "" && parseInt(ato.value,10) != ato.value) { alert ("Warning! Incorrect Item."); ato.value = ""; } } }