function formValidation(form){
if(notEmpty(form.name) && notEmpty(form.email) && notEmpty(form.Tel) && notEmpty(form.Address)){
return true;
}
return false;
}
function notEmpty(elem){
var str = elem.value;
if(str.length == 0){
alert("You must fill in all required fields (*)");
return false;
} else {
return true;
}
}


function doPopups() {
  if (!document.getElementsByTagName) return false;
  var links = document.getElementsByTagName("a");
  for (var i=0; i < links.length; i++) {
    if (links[i].className.match("newpage")) {
      links[i].onclick = function() {
        window.open(this.href);
        return false;
      }
    }
  }
}
window.onload=function(){
doPopups();
prepareMenpop();
}

function prepareMenpop() {
  if (!document.getElementsByTagName) return false;
  if (!document.getElementById) return false;
  if (!document.getElementById("men")) return false;
  var gallery = document.getElementById("men");
  var links = gallery.getElementsByTagName("a");
  for ( var i=0; i < links.length; i++) {
    links[i].onclick = function() {
      return pop(this);
    }
  }
}

function pop(ref) {
leftPos = 350
topPos = 250
if (screen) {
leftPos = (screen.width-450) / 2
topPos = (screen.height-300) / 2
}
newwin = window.open(ref,"","left="+leftPos+",top="+topPos+",height=300,width=450,scrollbars=1,resizable=0")
return false;
}

function daysInMonth(iMonth, iYear){//returns number of days in month, feed with month(0 based) and year
return 32 - new Date(iYear, iMonth-1, 32).getDate();
}

var days = new Array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31);

function fill(fe){
var opt_key = fe.selectedIndex;
var uri_val = fe.options[opt_key].value; //value in select option
var curMonthOption = document.getElementById(uri_val); //other month column has id equal to first month column value
curMonthOption.selected = true; // select this month in depart date
suba = document.getElementById('arrive').options //find options column in arrive days box
suba.length = 0; //delete them all
subb = document.getElementById('depart').options
subb.length = 0;
k = 0;
l = 0;
mdays = daysInMonth(uri_val.substring(5), uri_val.substring(0, 4))-1; //get days in current month, subtract 1 for 0 base
//alert(mdays);
for (i = 0; i <= mdays; i++ ){
suba[k] = new Option(days[i], days[i]);//write new options
subb[k] = new Option(days[i], days[i]);
l = i-1;
subb[k].id = days[l];//assign an id to depart options
k++;
}
}

function pin(dd){ //advance day of depart column to follow day of arrive column
var opt_key = dd.selectedIndex;
var uri_val = dd.options[opt_key].value;
var curDayOption = document.getElementById(uri_val);
curDayOption.selected = true;		
}
function ch2(sel){//populate depart day column with relevant detail for the selected month
var opt_key = sel.selectedIndex;
var uri_val = sel.options[opt_key].value;
subb = document.getElementById('depart').options
subb.length = 0;
mdays = daysInMonth(uri_val.substring(5), uri_val.substring(0, 4))-1;
k = 0;
for (i = 0; i <= mdays; i++ ){
subb[k] = new Option(days[i], days[i]);
k++;
}
}


//News Scroller***********
p6='<h3>Events!!!<\/h3><p>Any important message goes here<\/p>';
p6+='<p><em>Note: <\/em>Hover on newsbox to stop scrolling!';
function createLayer(){
nmsg='<div id="layer'+this.name+'" style="position:relative;overflow:hidden;';
nmsg+='float:'+this.initFl+';background-color:#'+this.initBg;
nmsg+=';width:'+this.initW+'px;height:'+this.initH;
nmsg+='px;" onmouseover="'+this.name+'.scrollLoop(0)" onmouseout="';
nmsg+=this.name+'.scrollLoop('+this.speed+')">';
nmsg+='<div id="'+this.name+'" style="position:absolute;top:';
nmsg+=this.initH+'px;left:0px;border:0px solid black;width:';
nmsg+=this.widthB+'px;height:'+this.heightB+'px;background-color:#';
nmsg+=this.Bg+'">'+this.content+'<\/div><\/div>';document.write(nmsg);
if(this.scrollLayer){this.timer=setInterval(this.name+'.scrollLayer()','30');}
}
function getElement(){this.elem=document.getElementById(this.name);}
function scrollLoop(s){this.speed=s;}
function scrollLayer(){
if(parseInt(this.elem.style.top,10)>(this.elem.offsetHeight*(-1))){
  this.elem.style.top=parseInt(this.elem.style.top,10)-this.speed+'px';
  } else{this.elem.style.top=this.initH+'px';}}
function scrollerObj(name,initH,initW,heightB,widthB,content,initBg,Bg,speed,initFl){
this.name=name;this.initH=initH;this.initW=initW;this.heightB=heightB;
this.widthB=widthB;this.content=content;this.initBg=initBg;
this.Bg=Bg;this.initFl=initFl;this.speed=parseInt(speed,10);
this.timer=name+"Timer";
this.getElement=getElement;this.createLayer=createLayer;
this.scrollLayer=scrollLayer;this.scrollLoop=scrollLoop;
this.createLayer();this.getElement();this.scrollLayer();}
//News Scroller*************
