// Title: General Function for all pages
// Version: 1.0
// Date: 12-01-2007 (mm-dd-yyyy)
// Author: Paola De Angelis
// Notes: Permission given to use this script in any kind of applications if
//    header lines are left unchanged. Feel free to contact the author
//    for feature requests and/or donations

function bookmarksite(title, url){
if (document.all)
window.external.AddFavorite(url, title);
else if (window.sidebar)
window.sidebar.addPanel(title, url, "")
}

function e_friend(ita_eng) {
if (ita_eng=="it")  {
	var e_add= prompt('Inserisci l\'indirizzo email:','');
	var subj= "Vivi e Lavora in Australia!! Visita il sito: www.focus-australia.it";
}
if (ita_eng=="en")  {
	var e_add= prompt('Email address:','');
	var subj= "Work and Live in Australia!! Visit: www.focus-australia.it";
}
if ((e_add==" ") || (e_add==null))
	 subj="Hi!"
	else
window.location="mailto:"+e_add+"?subject="+subj;
}


function data_time(ita_eng)
{
   var now = new Date();
   var yr = now.getFullYear();
   var mName = now.getMonth() + 1;
   var dName = now.getDay() + 1;
   var dayNr = ((now.getDate()<10) ? "0" : "")+ now.getDate();
   var ampm = (now.getHours() >= 12) ? " P.M." : " A.M."
   var hours = now.getHours();
       hours = ((hours > 12) ? hours - 12 : hours);
   var minutes = ((now.getMinutes() < 10) ? ":0" : ":") + now.getMinutes();
   var seconds = ((now.getSeconds() < 10) ? ":0" : ":") + now.getSeconds();
   if(dName==1) Day = "Domenica";
   if(dName==2) Day = "Lunedì";
   if(dName==3) Day = "Martedì";
   if(dName==4) Day = "Mercoledì";
   if(dName==5) Day = "Giovedì";
   if(dName==6) Day = "Venerdì";
   if(dName==7) Day = "Sabato";
if (ita_eng=="it")  {
   if(mName==1) Month="Gennaio";
   if(mName==2) Month="Febbraio";
   if(mName==3) Month="Marzo";
   if(mName==4) Month="Aprile";
   if(mName==5) Month="Maggio";
   if(mName==6) Month="Giugno";
   if(mName==7) Month="Luglio";
   if(mName==8) Month="Agosto";
   if(mName==9) Month="Settembre";
   if(mName==10) Month="Ottobre";
   if(mName==11) Month="Novembre";
   if(mName==12) Month="Dicembre";
}
if (ita_eng=="en")  {
   if(mName==1) Month="January"
   if(mName==2) Month="February"
   if(mName==3) Month="March"
   if(mName==4) Month="April"
   if(mName==5) Month="May"
   if(mName==6) Month="June"
   if(mName==7) Month="July"
   if(mName==8) Month="August"
   if(mName==9) Month="September"
   if(mName==10) Month="October"
   if(mName==11) Month="November"
   if(mName==12) Month="December"
}
// String to display current date.
//   var DayDateTime=(" " + Day+ " "+dayNr+ " "+ Month+ " "+ yr+ "     "+ hours+ minutes+ " "+ ampm);
//   var DayDateTime=(" " + Day+ "<br>"+"  "+dayNr+ " "+ Month+ " "+ yr);
   var DayDateTime=(dayNr+ " "+ Month+ " "+ yr);
// Displays Day-Date-Time on the staus bar.
   document.write(DayDateTime);
}

function checkform(ita_eng) {
iscomplete=true
mancante =""
testo =""
window.status=""
if (ita_eng=="it")  {
	testo="Per favore compilare: \n"
	mancante=""
//	if (document.dati.Intenzioni_Richiesta.value=="0") {mancante="Tipo richiesta immigrazione"}
//	if (document.dati.IngleseComprensione.value=="null") {mancante="Livello Inglese Comprensione"}
//	if (document.dati.IngleseLetto.value=="null") {mancante="Livello Inglese Letto"}
//	if (document.dati.IngleseScritto.value=="null") {mancante="Livello Inglese Scritto"}
//	if (document.dati.IngleseParlato.value=="null") {mancante="Livello Inglese Parlato"}
//	if (document.dati.TitoliStudio.value=="") {mancante="Lista degli studi completati"} 
//	if (document.dati.ImpiegoAttuale.value=="") {mancante="Impiego attuale"}  
//	if (document.dati.DataNascita.value=="") {mancante="Data di Nascita"} 
	if (document.dati.Cognome.value=="") {mancante="\n- Cognome "}
	if (document.dati.Nome.value=="") {mancante=mancante + "\n- Nome "}
	if (document.dati.email.value=="") {mancante=mancante + "\n- Indirizzo e-mail"} 
	if (document.dati.SOL_ID.value=="-1") {mancante=mancante + "\n- Professione"}
	}
if (ita_eng=="en")  {
		testo="Please fill in the field "
		if (document.dati.IngleseComprensione.value=="null") {mancante="English Understanding"}
   	    if (document.dati.IngleseLetto.value=="null") {mancante="English Reading"}
		if (document.dati.IngleseScritto.value=="null") {mancante="English Writing"}
		if (document.dati.IngleseParlato.value=="null") {mancante="English Speaking"}
		if (document.dati.Studies.value=="") {mancante="Studies"}
		if (document.dati.Current_occupation.value=="") {mancante="Current Occupation"}
		if (document.dati.Date_of_Birth.value=="") {mancante="Date of Birth"}
		if (document.dati.email.value=="") {mancante="e-mail"}
    	if (document.dati.Name.value=="") {mancante="First Name"}
		if (document.dati.Surname.value=="") {mancante="Surname"}
	}
if (mancante!="") {iscomplete=false}
if (!iscomplete) {
		alert(testo + mancante)
		window.status=testo+mancante
		if (document.layers) {
			document.dati.submitbut.value="NO"
			iscomplete=false
			}
			else if (document.all) {iscomplete=false}
			else if (document.getElementById) {
				document.dati.submitbut.value="NO"
				iscomplete=false
			}
	}
}

function oksubmit(ita_eng) {
    checkform(ita_eng)
	return iscomplete
	}
	
function open_info(n,l,h){
nome=n+".html";
newWin= window.open(nome, '', 'scrollbars=yes,resizable=no,width='+l+',height='+h+',status=no,location=no,toolbar=no,top=1,left=1');
}
