function MM_preloadImages()
{
 var d=document;
 if(d.images)
 {
  if(!d.MM_p)
   d.MM_p=new Array();
  var i,j=d.MM_p.length,a=MM_preloadImages.arguments;
  for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0)
   {
    d.MM_p[j]=new Image;
    d.MM_p[j++].src=a[i];
   }
 }
}

function checkemail()
{
 if (document.mailing.email.value=='')
 {
  window.alert("Please enter your email address");
  document.mailing.email.focus();
  return(false);
 }		
}

function openWindow(url,width,height)
{
  var params="menubar=yes,toolbar=yes,location=no,directories=no,status=no,scrollbars=yes,resizable=no,dependent,left=50,top=50,width="+width+",height="+height;
  popupWin = window.open(url, 'remote',params);
}

function openWindow2(url,width,height)
{
  var params="menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,dependent,left=50,top=50,width="+width+",height="+height;
  popupWin = window.open(url, 'domains',params);
}

function MM_preloadImages()
{
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function gogetit(url)
{
 if (url != '')
 {                
  self.location = url
 }
}

function countBoxes()
{
 count = 0;

 if (document.reg1.category1.checked==true)
 {
  count = count + 1;
 }
 if (document.reg1.category2.checked==true)
 {
  count = count + 1;
 }
 if (document.reg1.category3.checked==true)
 {
  count = count + 1;
 }
 if (document.reg1.category4.checked==true)
 {
  count = count + 1;
 }
 if (document.reg1.category5.checked==true)
 {
  count = count + 1;
 }
 if (document.reg1.category6.checked==true)
 {
  count = count + 1;
 }
 if (document.reg1.category7.checked==true)
 {
  count = count + 1;
 }
 if (document.reg1.category8.checked==true)
 {
  count = count + 1;
 }
 if (document.reg1.category9.checked==true)
 {
  count = count + 1;
 }
 if (document.reg1.category10.checked==true)
 {
  count = count + 1;
 }
 if (document.reg1.category11.checked==true)
 {
  count = count + 1;
 }
 if (document.reg1.category12.checked==true)
 {
  count = count + 1;
 }
 if (document.reg1.category13.checked==true)
 {
  count = count + 1;
 }
 if (document.reg1.category15.checked==true)
 {
  count = count + 1;
 }
 if (document.reg1.category16.checked==true)
 {
  count = count + 1;
 }
 if (document.reg1.category17.checked==true)
 {
  count = count + 1;
 }
 if (document.reg1.category18.checked==true)
 {
  count = count + 1;
 }
 if (document.reg1.category19.checked==true)
 {
  count = count + 1;
 }
 if (document.reg1.category20.checked==true)
 {
  count = count + 1;
 }
 if (document.reg1.category21.checked==true)
 {
  count = count + 1;
 }
 if (document.reg1.category22.checked==true)
 {
  count = count + 1;
 }
 if (document.reg1.category23.checked==true)
 {
  count = count + 1;
 }
 if (document.reg1.category24.checked==true)
 {
  count = count + 1;
 }

 document.reg1.boxes.value = count;
}

function checkreg1()
{
 if ((document.reg1.listing[0].checked==false)&&(document.reg1.listing[1].checked==false))
 {
  window.alert('Please select the type of Listing that you would like!');
  return(false);
 }
 if (document.reg1.company_name.value=='')
 {
  window.alert('Please enter your Company Name!');
  document.reg1.company_name.focus();
  return(false);
 }
 if ((document.reg1.address1.value==''))
 {
  window.alert('Please enter your Company Address!');
  document.reg1.address1.focus();
  return(false);
 }
 if ((document.reg1.city.value==''))
 {
  window.alert('Please enter your City!');
  document.reg1.city.focus();
  return(false);
 }
 if (document.reg1.county[document.reg1.county.selectedIndex].value=='unselected')
 {
  window.alert('Please enter your county!');
  document.reg1.county.focus();
  return(false);
 }
 if ((document.reg1.postcode.value==''))
 {
  window.alert('Please enter your postcode!');
  document.reg1.postcode.focus();
  return(false);
 }
 if (document.reg1.telephone.value=='')
 {
  window.alert('Please enter your Company Telephone Number!');
  document.reg1.telephone.focus();
  return(false);
 }
 if (document.reg1.employees[document.reg1.employees.selectedIndex].value=='')
 {
  window.alert('Please enter the number of employees!');
  document.reg1.employees.focus();
  return(false);
 }
 if (document.reg1.vehicles.value=='')
 {
  window.alert('Please enter the number of vehicles!');
  document.reg1.vehicles.focus();
  return(false);
 }
 if (document.reg1.contact_name.value=='')
 {
  window.alert('Please enter the Name of the Marketing Contact!');
  document.reg1.contact_name.focus();
  return(false);
 }
 if (document.reg1.position.value=='')
 {
  window.alert('Please enter the Position of the person above!');
  document.reg1.position.focus();
  return(false);
 }
 if (document.reg1.contact_telephone.value=='')
 {
  window.alert('Please enter the Telephone Number of the person above!');
  document.reg1.contact_telephone.focus();
  return(false);
 }
 if (document.reg1.contact_email.value=='')
 {
  window.alert('Please enter the Email Address of the person above!');
  document.reg1.contact_email.focus();
  return(false);
 }
 if (document.reg1.boxes.value<3)
 {
  alert('Please select at least 3 activities!');
  return(false);
 }
 if ((document.reg1.password.value=='')||(reg1.password.value != reg1.password2.value))
 {
  window.alert('Please enter a password!');
  document.reg1.password.focus();
  return(false);
 }
 if (document.reg1.listing[0].checked==true)
 {
  if (document.reg1.card_number.value=='')
  {
   window.alert('Please enter your credit card number!');
   document.reg1.card_number.focus();
   return(false);
  }
  if (document.reg1.card_holder.value=='')
  {
   window.alert('Please enter the credit card holders name!');
   document.reg1.card_holder.focus();
   return(false);
  }
  if (document.reg1.card_type.value=='')
  {
   window.alert('Please enter your credit card type!');
   document.reg1.card_type.focus();
   return(false);
  }
  if ((document.reg1.expiry_month[document.reg1.expiry_month.selectedIndex].value=='')||(document.reg1.expiry_year[document.reg1.expiry_year.selectedIndex].value==''))
  {
   window.alert('Please enter your credit card expiry date!');
   document.reg1.expiry_month.focus();
   return(false);
  }
  if (document.reg1.email.value=='')
  {
   window.alert('Please enter your email address!');
   document.reg1.email.focus();
   return(false);
  }
  if (document.reg1.web.value=='')
  {
   window.alert('Please enter your company web address!');
   document.reg1.web.focus();
   return(false);
  }
  if (document.reg1.comments.value=='')
  {
   window.alert('Please enter your comments!');
   document.reg1.comments.focus();
   return(false);
  }
 }
 return(true);
}

function checkreg2()
{
 if (document.reg2.company_name.value=='')
 {
  window.alert('Please enter your Company Name!');
  document.reg1.company_name.focus();
  return(false);
 }
 if (document.reg2.address1.value=='')
 {
  window.alert('Please enter your Company Address!');
  document.reg1.company_address.focus();
  return(false);
 }
 if(document.reg2.city.value=='')
 {
  window.alert('Please enter your City!');
  document.reg1.city.focus();
  return(false);
 }
 if(document.reg2.county.value=='')
 {
  window.alert('Please enter your County!');
  document.reg1.county.focus();
  return(false);
 }
if(document.reg2.postcode.value=='')
 {
  window.alert('Please enter your Postcode!');
  document.reg1.postcode.focus();
  return(false);
 }

 if (document.reg2.telephone.value=='')
 {
  window.alert('Please enter your Company Telephone Number!');
  document.reg1.telephone.focus();
  return(false);
 }
 return(true);
}

function checkreg3()
{
 if ((document.reg1.listing[0].checked==false)&&(document.reg1.listing[1].checked==false))
 {
  window.alert('Please select the type of Listing that you would like!');
  return(false);
 }
 if (document.reg1.company_name.value=='')
 {
  window.alert('Please enter your Company Name!');
  document.reg1.company_name.focus();
  return(false);
 }
 if ((document.reg1.address1.value==''))
 {
  window.alert('Please enter your Company Address!');
  document.reg1.address1.focus();
  return(false);
 }
 if ((document.reg1.city.value==''))
 {
  window.alert('Please enter your City!');
  document.reg1.city.focus();
  return(false);
 }
 if (document.reg1.county[document.reg1.county.selectedIndex].value=='unselected')
 {
  window.alert('Please enter your county!');
  document.reg1.county.focus();
  return(false);
 }
 if ((document.reg1.postcode.value==''))
 {
  window.alert('Please enter your postcode!');
  document.reg1.postcode.focus();
  return(false);
 }
 if (document.reg1.telephone.value=='')
 {
  window.alert('Please enter your Company Telephone Number!');
  document.reg1.telephone.focus();
  return(false);
 }
 if (document.reg1.employees[document.reg1.employees.selectedIndex].value=='')
 {
  window.alert('Please enter the number of employees!');
  document.reg1.employees.focus();
  return(false);
 }
 if (document.reg1.contact_name.value=='')
 {
  window.alert('Please enter the Name of the Marketing Contact!');
  document.reg1.contact_name.focus();
  return(false);
 }
 if (document.reg1.position.value=='')
 {
  window.alert('Please enter the Position of the person above!');
  document.reg1.position.focus();
  return(false);
 }
 if (document.reg1.contact_telephone.value=='')
 {
  window.alert('Please enter the Telephone Number of the person above!');
  document.reg1.contact_telephone.focus();
  return(false);
 }
 if (document.reg1.contact_email.value=='')
 {
  window.alert('Please enter the Email Address of the person above!');
  document.reg1.contact_email.focus();
  return(false);
 }
 if ((document.reg1.password.value=='')||(reg1.password.value != reg1.password2.value))
 {
  window.alert('Please enter a password!');
  document.reg1.password.focus();
  return(false);
 }
 if (document.reg1.listing[0].checked==true)
 {
  if (document.reg1.card_number.value=='')
  {
   window.alert('Please enter your credit card number!');
   document.reg1.card_number.focus();
   return(false);
  }
  if (document.reg1.card_holder.value=='')
  {
   window.alert('Please enter the credit card holders name!');
   document.reg1.card_holder.focus();
   return(false);
  }
  if (document.reg1.card_type.value=='')
  {
   window.alert('Please enter your credit card type!');
   document.reg1.card_type.focus();
   return(false);
  }
  if ((document.reg1.expiry_month[document.reg1.expiry_month.selectedIndex].value=='')||(document.reg1.expiry_year[document.reg1.expiry_year.selectedIndex].value==''))
  {
   window.alert('Please enter your credit card expiry date!');
   document.reg1.expiry_month.focus();
   return(false);
  }
  if (document.reg1.email.value=='')
  {
   window.alert('Please enter your email address!');
   document.reg1.email.focus();
   return(false);
  }
  if (document.reg1.web.value=='')
  {
   window.alert('Please enter your company web address!');
   document.reg1.web.focus();
   return(false);
  }
  if (document.reg1.comments.value=='')
  {
   window.alert('Please enter your comments!');
   document.reg1.comments.focus();
   return(false);
  }
 }
 return(true);
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function blank(field,text)
{
 if (document.search[field].value==text)
 {
  document.search[field].value='';
 }
}
function unblank(field,text)
{
 if (document.search[field].value=='')
 {
  document.search[field].value=text;
 }
}
function changePurpose(purp)
{
 document.search.purpose.value=purp;
 document.search.submit();
}

function bannerRotate()
{
 var how_many_ads = 6;
 var now = new Date()
 var sec = now.getSeconds()
 var ad = sec % how_many_ads;
 ad +=1;
 if (ad==1)
 {
  url="http://www.coach-hire.uk.com/destinations2.htm";
  target="_top";
  banner="http://www.coach-hire.uk.com/images/destinat-banner.gif";
 }
 if (ad==2)
 {
  url="http://www.altontowers.com/";
  target="_blank";
  banner="http://www.coach-hire.uk.com/images/alton1.gif";
 }
 if (ad==3)
 {
  url="http://www.ba-londoneye.com/";
  target="_blank";
  banner="http://www.coach-hire.uk.com/images/bale_banner_35k.gif";
 }
 if (ad==4)
 {
  url="http://www.chessington.com/";
  target="_blank";
  banner="http://www.coach-hire.uk.com/images/chessington-banner7.gif";
 }
 if (ad==5)
 {
  url="http://www.madame-tussauds.com/site/london/";
  target="_blank";
  banner="http://www.coach-hire.uk.com/images/mt-banner3.gif";
 }
 if (ad==6)
 {
  url="http://www.thorpepark.com/";
  target="_blank";
  banner="http://www.coach-hire.uk.com/images/thorpe_banner4.gif";
 }
 document.write('<A HREF="' + url + '" TARGET="'+target+'">');
 document.write('<IMG SRC="' + banner + '" WIDTH="468" HEIGHT="60" BORDER="0"></A>')
}

function bannerRotate2()
{
 var how_many_ads = 8;
 var now = new Date()
 var sec = now.getSeconds()
 var ad = sec % how_many_ads;
 ad +=1;
 if (ad==1)
 {
  url="http://www.coach-hire.uk.com/destinations2.htm";
  target="_top";
  banner="http://www.coach-hire.uk.com/images/destinat-banner.gif";
 }
 if (ad==2)
 {
  url="http://www.coach-hire.uk.com/webapp/coach-hire/servlet/CoachSearch?purpose=dest_search&destination=36";
  target="_top";
  banner="http://www.coach-hire.uk.com/images/alton1.gif";
 }
 if (ad==3)
 {
  url="http://www.coach-hire.uk.com/webapp/coach-hire/servlet/CoachSearch?purpose=dest_search&destination=45";
  target="_top";
  banner="http://www.coach-hire.uk.com/images/bale_banner_35k.gif";
 }
 if (ad==4)
 {
  url="http://www.coach-hire.uk.com/webapp/coach-hire/servlet/CoachSearch?purpose=dest_search&destination=46";
  target="_top";
  banner="http://www.coach-hire.uk.com/images/chessington-banner7.gif";
 }
 if (ad==5)
 {
  url="http://www.coach-hire.uk.com/webapp/coach-hire/servlet/CoachSearch?purpose=dest_search&destination=47";
  target="_top";
  banner="http://www.coach-hire.uk.com/images/mt-banner3.gif";
 }
 if (ad==6)
 {
  url="http://www.coach-hire.uk.com/webapp/coach-hire/servlet/CoachSearch?purpose=dest_search&destination=48";
  target="_top";
  banner="http://www.coach-hire.uk.com/images/thorpe_banner4.gif";
 }
 if (ad==7)
 {
  url="http://www.coach-hire.uk.com/webapp/coach-hire/servlet/CoachSearch?purpose=dest_search&destination=178";
  target="_top";
  banner="http://www.coach-hire.uk.com/images/eden-banner.gif";
 }
 if (ad==8)
 {
  url="http://www.coach-hire.uk.com/privatehire.htm";
  target="_top";
  banner="http://www.coach-hire.uk.com/images/coach-hire-banner-private.gif";
 }
 document.write('<A HREF="' + url + '" TARGET="'+target+'">');
 document.write('<IMG SRC="' + banner + '" WIDTH="468" HEIGHT="60" BORDER="0"></A>')
}

function copyright()
{
 date = new Date();
 year = date.getFullYear();
 document.write('<A CLASS="menu" HREF="http://www.netvillage.co.uk" TARGET="_blank">&copy; '+year+' netvillage ltd</A>');
}

