function strDay (intA)
{
   var strDayR;
   switch (intA)
   {
      case 0: strDayR = "Sunday"; break;
      case 1: strDayR = "Monday"; break;
      case 2: strDayR = "Tuesday"; break;
      case 3: strDayR = "Wednesday"; break;
      case 4: strDayR = "Thursday"; break;
      case 5: strDayR = "Friday"; break;
      case 6: strDayR = "Saturday"; break;
   }
   return strDayR;
}

function strMonth (intA)
{
   var strMonthR;
   switch (intA)
   {
      case  0: strMonthR = "January"; break;
      case  1: strMonthR = "February"; break;
      case  2: strMonthR = "March"; break;
      case  3: strMonthR = "April"; break;
      case  4: strMonthR = "May"; break;
      case  5: strMonthR = "June"; break;
      case  6: strMonthR = "July"; break;
      case  7: strMonthR = "August"; break;
      case  8: strMonthR = "September"; break;
      case  9: strMonthR = "October"; break;
      case 10: strMonthR = "November"; break;
      case 11: strMonthR = "December"; break;
   }
   return strMonthR;
}

function LoadBody ()
{
   var locbody = location.search;
   var newbody = "";
   var today = new Date();

   spandate.innerHTML = strDay(today.getDay()) + ', ' + strMonth(today.getMonth()) + ' ' + today.getDate() + ', ' + today.getFullYear();

   locbody = locbody + '.';
   locbody = locbody.substring(1,locbody.indexOf('.'));

   if (locbody == '.') locbody = 'index';

   var validfiles = ['index','sitemap','feedback','contactus','welcome','liveitup','business','planatrip','essentials','about','brochure',
                     'chistory','cpeople','cgeography','cwaystoliveitup','cattractions','cfoodent','cshopping','cfestivals','csports','caccomodation','ctourmiragia','ctourregion',
                     'termsofuse','privacypolicy','corporate','adinfo','mediakit','error404'];

   var isfilevalid = false;

   for (d in validfiles)
      if (locbody == validfiles[d]) isfilevalid = true;

   if (isfilevalid == false) locbody = 'error404';

   newbody = locbody + '.';
   newbody = newbody.substring(0,newbody.indexOf('.'));

   document.write("<script language='JavaScript' src='js/body_" + newbody + ".js'></script>");

   switch (newbody)
   {
      case 'welcome':
         break;
      case 'liveitup':
         break;
      case 'planatrip':
         break;

      case 'chistory':
         newbody = 'welcome';
         break;
      case 'cpeople':
         newbody = 'welcome';
         break;
      case 'cgeography':
         newbody = 'welcome';
         break;

      case 'cwaystoliveitup':
         newbody = 'liveitup';
         break;
      case 'cattractions':
         newbody = 'liveitup';
         break;
      case 'cfoodent':
         newbody = 'liveitup';
         break;
      case 'cshopping':
         newbody = 'liveitup';
         break;
      case 'cfestivals':
         newbody = 'liveitup';
         break;
      case 'csports':
         newbody = 'liveitup';
         break;

      case 'caccomodation':
         newbody = 'planatrip';
         break;
      case 'ctourmiragia':
         newbody = 'planatrip';
         break;
      case 'ctourregion':
         newbody = 'planatrip';
         break;

      default:
         newbody = 'index';
   }

   document.write("<script language='JavaScript' src='js/side_" + newbody + ".js'></script>");
}



function verifyBrochure()
{
   if ((frmbrochure.broname1.value=="") || (frmbrochure.broname2.value=="") || (frmbrochure.broadd1.value=="") || (frmbrochure.brocomm.value==""))
   {
      alert("Please fill in all mandatory fields.");
      return false;
   }
   else
      return true;
}

function verifyAdinfo()
{
   if ((frmads.broemail.value=="") || (frmads.broname1.value=="") || (frmads.broname2.value=="") || (frmads.broadd1.value=="") || (frmads.brocomm.value==""))
   {
      alert("Please fill in all mandatory fields.");
      return false;
   }
   else
      return true;
}

function verifyNews()
{
   if ((frmnews.broname.value=="") || (frmnews.broemail.value==""))
   {
      alert("Please fill in all mandatory fields.");
      return false;
   }
   else
      return true;
}

function goInterest()
{
   location.replace('index.htm?cattractions#'+frminterest.selinterest.value);
   return false;
}