var eja_language="it";



function eja_load(url) {
 document.location.href=url;
}

function eja_pop_full(url) {
 window.open(url,"","width=900,height=700,menubar=yes,status=yes,scrollbars=yes,location=yes,toolbar=yes");
}

function eja_pop(url) {
 window.open(url,"","width=600,height=600,scrollbars=yes");
}

function eja_display(source,target) {
 if (document.getElementById(target).style.display == "none") { 
  source.style.fontSize="18px";
  source.style.fontWeight="bold";
  source.style.background="orange";
  showdiv(target); 
 } else { 
  hidediv(target);
  source.style.fontSize="12px"; 
  source.style.fontWeight="normal";
  source.style.background="white";
 }
}

function eja_print(obj) {
 document.getElementById('maintab').style.visibility='hidden';
 var a_tag=document.getElementsByTagName("img");
 for (i=0; i<a_tag.length; i++) { 
  if (a_tag.item(i).src.indexOf("media")>0) { a_tag.item(i).style.width="100px"; } 
 } 

 var a_tag=document.getElementsByTagName("div");
 for (i=0; i<a_tag.length; i++) {          
   if (a_tag.item(i).className=="pictures_mini") { a_tag.item(i).style.width="350px"; }
 }
 window.print();
}

function eja_text_limit(obj,limite) {
 document.getElementById("c_"+obj.name).value=(limite-obj.value.length);
 if (obj.value.length>limite) { alert("max: "+limite); }
}


function eja_form_check(array) {
 z=0;
 for (i=0; i<array.length;i++) {
  name=array[i];
  if (document.forms[0].elements[name].type=="checkbox") {
   if (document.forms[0].elements[name].checked==false) { z++; }
  }
  if (document.forms[0].elements[name].type=="text" || document.forms[0].elements[name].type=="textarea") {
   if (document.forms[0].elements[name].value=="") { z++; }
  }
} 

 if (z > 0) { 
  if (eja_language=="it") { alert("Alcuni campi non sono stati compilati."); } else { alert("Please fill all the fields."); }
  return false;
 } else {
  return true;
 }
}


// eja maps

var eja_map_longitude= new Array();
var eja_map_latitude=new Array();
var eja_map_title=new Array();
var eja_map_count=0;

function eja_map_load() {
 eja_map = new GMap2(document.getElementById("map"));
 eja_map.addControl(new GSmallMapControl());
 eja_map.addControl(new GMapTypeControl());
 eja_map.setCenter(new GLatLng(eja_map_latitude[0],eja_map_longitude[0]), 10);
 eja_map.setMapType(G_HYBRID_MAP); 
 for (i=0;i<eja_map_count;i++) {
  var point = new GLatLng(eja_map_latitude[i],eja_map_longitude[i]);
  var title = eja_map_title[i];
  var marker=new GMarker(point,{title: title});
  eja_map.addOverlay(marker);
 }
}

function eja_map(latitude,longitude,title,action) {
 eja_map_longitude[eja_map_count]=longitude;
 eja_map_latitude[eja_map_count]=latitude;
 eja_map_title[eja_map_count]=title;
 eja_map_count++;
}


