/* javascript functions
 * Copyright (c) PawPrint Travel
 *
 * A simple template engine that grew some legs and left home.
 *
 * Should be replaced with something server-side, and object-oriented, but I've resisted
 * so far.
 */

var top_names= ["medical home",
		"first aid courses",
		"diary",
		"the team",
		"contact us"];

var top_links= ["index",
		"courses",
		"diary",
		"team",
		"contact"];

var series_names= ["the Dolomites",
		"the Pyrenees",
		"the Discover series",
		"hike &amp; climb",
		"ski",
		"holidays by date"];

var series_links = ["dolomites",
		"pyrenees",
		"discover",
		"hikeclimb",
		"snowsports",
		"diary"];


var series_treks = new Object;
series_treks.dolomites = ["dolomites_av1",
			"dolomites_av2",
			"discover_dolomites",
			"dolomites_via_ferrata",
			"ski_dolomites"];
series_treks.pyrenees = ["pyrenees_mountaineer",
			"pyrenees_coast_to_coast"];
series_treks.discover = ["anniviers",
			"discover_madeira",
			"discover_mallorca",
			"discover_dolomites",
			"lake_garda"];
series_treks.hikeclimb = ["valencia"];
series_treks.snowsports = ["ski_dolomites"];


series_treks.diary = ["diary_05",
			"diary_06"];

trek2series = new Object;
trek2series.dolomites_av1 = "dolomites";
trek2series.dolomites_av2 = "dolomites";
trek2series.discover_dolomites = "dolomites";
trek2series.dolomites_via_ferrata = "dolomites";
trek2series.ski_dolomites = "dolomites";
trek2series.pyrenees_mountaineer = "pyrenees";
trek2series.pyrenees_coast_to_coast = "pyrenees";
trek2series.anniviers = "discover";
trek2series.discover_madeira = "discover";
trek2series.discover_mallorca = "discover";
trek2series.discover_dolomites = "dolomites";
trek2series.lake_garda = "discover";
trek2series.valencia = "hikeclimb";
trek2series.ski_dolomites = "dolomites";
trek2series.diary_05= "diary";
trek2series.diary_06= "diary";


var series_treks_titles = new Object;
series_treks_titles.dolomites = ["alta via 1",
				"alta via 2",
				"Discover",
				"via ferrata",
				"ski the dolomites"];
series_treks_titles.pyrenees = ["mountaineer",
				"coast to coast"];
series_treks_titles.discover = ["Swiss Alps",
				"Madeira",
				"Mallorca",
				"Dolomites",
				"Lake Garda"];
series_treks_titles.hikeclimb = ["Valencia"];
series_treks_titles.snowsports = ["ski the dolomites"];
series_treks_titles.diary = 
	["2005",
	"2006"];

var titles_long= new Object;
titles_long.discover_dolomites= "Discover the Dolomites";
titles_long.pyrenees= "Trek the Pyrenees";
titles_long.anniviers=  "Discover the Swiss Alps";
titles_long.lake_garda= "Discover Lake Garda";
titles_long.velebit= "Discover the Velebit";
titles_long.diary= "holidays by date";
titles_long.dolomites_av1 = "Dolomites alta via 1";
titles_long.dolomites_av2 = "Dolomites alta via 2";
titles_long.pyrenees_mountaineer = "Pyrenees mountaineer";
titles_long.ski_dolomites = "Ski the Dolomites";
titles_long.dolomites_via_ferrata = "Dolomites Via Ferrata";
titles_long.pyrenees_coast_to_coast = "Pyrenees Coast to Coast";
titles_long.discover_mallorca = "Discover Mallorca";
titles_long.valencia = "Valencia Hike &amp; Climb";
titles_long.discover_madeira = "Discover Madeira";

var chapter_names= 
	["overview",
	"sample itinerary",
	"accommodation",
	"travel arrangements",
	"your group",
	"your leader",
	"insurance",
	"dates and prices",
	"book"];

var chapter_links= 
	["overview",
	"itinerary",
	"accommodation",
	"travel",
	"group",
	"leader",
	"insurance",
	"prices",
	"book"];

var dates05= new Object;
var dates06= new Object;

dates05.lake_garda= 
	["17/09 - 24/09 !",
	"24/09 - 01/10",
	"15/10 - 22/10",
	"22/10 - 29/10"];

dates06.lake_garda= 
	["08/04 - 25/04",
	"30/09 - 07/10 !",
	"07/10 - 14/10 "];

dates05.valencia =
	["05/11 - 12/11 !",
	"10/12 - 17/12 !"];


dates06.anniviers= 
	["24/06 - 01/07",
	"15/07 - 22/07",
	"19/08 - 26/08 !"];

dates06.dolomites_av1= 
	["29/07 - 12/08",
	"12/08 - 26/08 !"];

dates06.pyrenees_mountaineer= 
	["23/07 - 29/07",
	"06/08 - 12/08 !"];

dates06.discover_dolomites= 
	["24/06 - 01/07 !",
	"22/07 - 29/07",
	"26/08 - 02/09"];


dates06.ski_dolomites= 
	["07/01 - 14/01 !",
	"07/01 - 14/01"];

dates05.discover_madeira = 
	["19/11 - 26/11",
	"26/11 - 03/12 !"]; 


dates06.discover_madeira= 
	["28/01 - 04/02",
	"25/02 - 04/03",
	"04/03 - 11/03 !",
	"13/05 - 20/05 !",
	"20/05 - 27/05",
	"21/10 - 28/10 !",
	"28/10 - 04/11",
	"09/12 - 16/12 !",
	"16/12 - 23/12"];

dates06.valencia= 
	["11/02 - 18/02",
	"18/03 - 25/03 !",
	"22/04 - 29/04 !",
	"29/04 - 06/05",
	"11/11 - 18/11",
	"18/11 - 25/11 !"];



dates06.discover_mallorca= 
	["22/04 - 29/04",
	"03/06 - 10/06 !",
	"10/06 - 17/06",
	"09/09 - 16/09 !",
	"16/09 - 23/09"];

dates06.dolomites_av2= 
	["01/07 - 08/07 first week only",
	"08/07 - 16/07 second week only",
	"15/07 - 22/07 first week only !",
	"22/07 - 30/07 second week only !",
	"29/07 - 12/08 full two week experience !",
	"12/08 - 26/08 full two week experience"];

dates06.dolomites_via_ferrata= 
	["01/07 - 08/07",
	"08/07 - 15/07 !",
	"26/08 - 02/09"];

dates06.pyrenees_coast_to_coast= new Array(4);
dates06.pyrenees_coast_to_coast[0]= "15/07 - 29/07 stage one";
dates06.pyrenees_coast_to_coast[1]= "29/07 - 12/08 stage two";
dates06.pyrenees_coast_to_coast[2]= "12/08 - 26/08 stage three";
dates06.pyrenees_coast_to_coast[3]= "26/08 - 09/09 stage four";


function insert_women_only()
{
  document.write('<img src="images/women_only_17.png" alt="women only!">');
}

function date_list_core(dates, trek)
{
  document.writeln('<ul>');
  for (i= 0; i < dates.length; i++)
  {
    var text= dates[i];
    document.write('<li>');
    if (text.charAt(text.length - 1) == '!')
    {
      document.write(text.substring(0, text.length - 1));
      insert_women_only();
    }
    else
    {
      document.write(text);
    }
    document.writeln('</li>');
  }
  document.writeln('</ul>');
}

function date_list(trek)
{
  if (dates05[trek] != null)
  {
    document.writeln('<p>');
    document.writeln('<h1>dates for 2005</h1>');
    date_list_core(dates05[trek], trek);
  }
  if (dates06[trek] != null)
  {
    document.writeln('<p>');
    document.writeln('<h1>dates for 2006</h1>');
    date_list_core(dates06[trek], trek);
  }
}

function i_heard()
{
document.writeln('<tr><td align=right>I heard about PawPrint from</td><td><select name="I heard"><option value="please select">please select<option VALUE="Google">Google<option VALUE="Yahoo">Yahoo<option value="Trail magazine">Trail magazine<option value="TGO magazine">TGO magazine<option value="Outdoors Magic">OutdoorsMagic<option value="national newspaper">national newspaper<option value="newspaper article">newspaper article<option value="Scottish Mountaineer">Scottish Mountaineer<option value="GP">GP<option value="Vet Times">Vet Times<option value="my walking club">my walking club<option value="other">other</select></td></tr>');  
}

function text_input(text, name)
{
  document.write('<tr><td align=right>');
  document.write(text);
  document.write('</td> <td><input name="');
  document.write(name);
  document.write('"></td>');
}

function insert_year(year)
{
  if (year == '5')
  {
    document.write(' (2005) ');
  }
  else
  {
    document.write(' (2006) ');
  }
}
function book_list(trek)
{
  document.writeln('<form action="http://www.pawprinttravel.com/cgi-bin/mailto" method=post>');
  document.writeln('<input type=hidden name="To" value="bookings@pawprinttravel.com">');
  document.write('<input type=hidden name="Subject" value="booking: ');
  document.write(trek);
  document.write('">');

  document.writeln('<input type=hidden name="Acknowledge" value="/thankyou.html">');
  document.writeln('<table cellspacing=3 style="font-size:12">');
  text_input('your first name', 'First name');
  text_input('your family name', 'Family name');
  text_input('a daytime contact phone number', 'Day phone');
  text_input('an evening contact phone number', 'Eve phone');
  text_input('your email address', 'From');
  document.writeln('<tr><td align=right>I would prefer to be contacted by</td><td><select name="Contact preference"><option value="please select">please select<option VALUE="daytime phone">daytime phone<option VALUE="evening phone">evening phone<option value="email">email</select></td></tr>');

  var dates= new Array;
  var j= 0;
  if (dates05[trek] != null)
  {
    for (i= 0; i < dates05[trek].length; i++)
    {
      dates[j]= dates05[trek][i] + '5';
      j= j + 1;
    }
  }
  if (dates06[trek] != null)
  {
    for (i= 0; i < dates06[trek].length; i++)
    {
      dates[j]= dates06[trek][i] + '6';
      j= j + 1;
    }
  }

  for (i= 0; i < dates.length; i++)
  {
    document.writeln('<tr><td align=right>');
    if (i == 0)
    {
      document.write('I want to book onto ');
      document.write(titles_long[trek]);
    }

    document.write('<td>');
    var text= dates[i];
    document.write('<input name="dates" type=checkbox value="');
    document.write(text);
    document.write('">');
    var year= text.charAt(text.length - 1);
    text= text.substring(0, text.length - 1);


    if (text.charAt(text.length - 1) == '!')
    {
      document.write(text.substring(0, text.length - 1));
      insert_year(year);
      insert_women_only();
    }
    else
    {
      document.write(text);
      insert_year(year);
    }

    document.writeln('</td></tr>');
  }
  i_heard();

  document.writeln('<tr><td></td><td align=left><input type=submit value="submit"></td></tr>');
  document.writeln('</table>');

  document.writeln('</form>');
}

function gift_vouchers()
{
  document.writeln('<form action="http://www.pawprinttravel.com/cgi-bin/mailto" method=post>');
  document.writeln('<input type=hidden name="To" value="gifts@pawprinttravel.com">');
  document.write('<input type=hidden name="Subject" value="gift voucher');
  document.write('">');
  document.writeln('<input type=hidden name="Acknowledge" value="/thankyou_gift.html">');
  document.writeln('<table cellspacing=3>');
  document.writeln('<tr><td align=right style="color:black;">who is the gift voucher for?</td><td></td>');
  document.writeln('<tr><td align=right>name</td> <td><input name="recipient name"></td>');
  document.writeln('<tr><td>&nbsp;</td><td></td>');
  document.writeln('<tr><td align=right style="color:black;">who is the gift voucher from?</td><td></td>');
  document.writeln('<tr><td align=right>name</td><td><input name="purchaser name"></td>');
  document.writeln('<tr><td align=right>account holder name(s) as written on the cheque you are sending</td><td><input name="cheque name"></td>');  
  document.writeln('<tr><td align=right>contact phone number</td> <td><input name="phone"></td>');
  document.writeln('<tr><td align=right>email address</td><td><input name="From"></td>');
  document.writeln('<tr><td>&nbsp;</td><td></td>');  
  document.writeln('<tr><td align=right style="color:black;">who should we send the gift voucher to?</td><td></td>');
  document.writeln('<tr><td align=right>name</td><td><input name="post contact name"></td>');
  document.writeln('<tr><td align=right>postal address</td><td><input name="Post Address 1"></td>');
  document.writeln('<tr><td align=right></td><td><input name="Post Address 2"></td>');
  document.writeln('<tr><td align=right></td><td><input name="Post Address 3"></td>');
  document.writeln('<tr><td align=right>post code</td><td><input name="Post Post Code"></td>');
  document.writeln('<tr><td>&nbsp;</td><td></td>');  
  document.writeln('<tr><td align=right style="color:black;">amount (minimum &pound;10)</td><td><input name="Amount"></td>');  
  document.writeln('<tr><td align=right>message to be printed on the gift voucher</td><td><input name="Message 1"></td>');
  document.writeln('<tr><td align=right></td><td><input name="Message 2"></td>');
  document.writeln('<tr><td align=right></td><td><input name="Message 3"></td>');
  document.writeln('<tr><td align=right></td><td><input name="Message 4"></td>');    
  i_heard();
  document.writeln('<tr><td></td><td align=left><input type=submit value="submit"></td></tr>');
  document.writeln('</table>');
  document.writeln('</form>'); 
}

function core_menu(current, names, links)
{
  document.writeln('<ul>');
  for (var position= 0; position < names.length; position++)
  {
    document.write('<li ');
    if (links[position] == current)
    {
      document.write(' class="current"');
    }
    document.write('>');

    document.write('<a href="');
    document.write(links[position]);
    document.write('.html">');
    document.write(names[position]);
    document.write('</a></li>')
  }
  document.writeln('</ul>');
}

/* Write out the html for a menu containing names with 
 * corresponding links.  Add style for the current selection
 */
function write_menu_list(current, names, links, className)
{
  document.write('<div class="');
  document.write(className);
  document.write('">');
  core_menu(current, names, links);  
  document.writeln('</div>');
}

function write_menu_list_graphic(current, names, links, className)
{
  document.write('<div class="');
  document.write(className);
  document.write('">');
  document.writeln('<table cellspacing=3 cellpadding=3 style="margin-top:3px;"><tr>');
  document.writeln('<td><img src="images/medlogo_35.png"></td><td>');
  core_menu(current, names, links);
  document.writeln('</td></tr></table></div>');
}

function horizontal_menu(current, names, links)
{
  document.writeln('<div class=h-menu>');  
  write_menu_list(current, names, links);
  document.writeln('<div style="clear:both;"></div>');
  document.writeln('</div>');
}

function vertical_menu(current, names, links)
{
  document.writeln('<div class="v-menu">');
  write_menu_list(current, names, links);
  document.writeln('</div>');
}

function top_menu(current)
{
  write_menu_list_graphic(current, top_names, top_links, "menu-top");  
}

function lookup_series(trek)
{
  return trek2series[trek];
}

function series_menu(current)
{
  var links= new Array(series_names.length);

  for (var i= 0; i < series_names.length; i++)
  {
    links[i]= series_links[i] + '-overview';
  }
  write_menu_list(current + '-overview', series_names, links, "menu-trek")

}

function overview_menu(series_name, trek)
{
  var series= series_treks[series_name];
  var length= series.length;
  var links= new Array(length);

  for (var i= 0; i < length; i++)
  {
    links[i]= series[i] + '-' + 'overview';
  }

  if (trek == "")
  {
    write_menu_list("", series_treks_titles[series_name], links, "menu-trek");
  }
  else
  {
    write_menu_list(trek + '-overview', series_treks_titles[series_name], links, "menu-trek");
  }
}

function chapter_menu(trek, chapter)
{
  var links= new Array(chapter_links.length);
  for (var i= 0; i < links.length; i++)
  {
    links[i]= trek + '-' + chapter_links[i];
  }
  write_menu_list(trek + '-' + chapter, chapter_names, links, "menu-chapter");
}

function title(trek, chapter)
{
  document.write('<h1>');
  document.write(titles_long[trek]);
  document.write(' - ');
  for (var i= 0; i < chapter_names.length; i++)
  {
    if (chapter_links[i] == chapter)
    {
      document.write(chapter_names[i]);
      break;
    }
  }
  document.writeln('</h1>');
}

function front_header()
{
  write_menu_list("index", top_names, top_links, "front-menu");
}

function trek_header(trek, page)
{
  top_menu("2005dest");
  series_menu(lookup_series(trek));
  overview_menu(lookup_series(trek), trek);
  chapter_menu(trek, page);
  document.writeln('<p></p>');
  document.writeln('<div class="content">');
  title(trek, page);
}

function series_header(series)
{
  top_menu("2005dest");
  series_menu(series);
  overview_menu(series,"");
  document.writeln('<p></p>');
  document.writeln('<div class="content">');
}

function date_header(trek)
{
  top_menu("2005dest");
  series_menu("diary");
  overview_menu("diary", trek);
  document.writeln('<p></p>');
  document.writeln('<div class="content">');
}


function flag(country, hotels, huts, self_catering, challenge, women)
{
  document.write('<div class=flag-box>');
  document.write('<img src="images/info_50.png" alt="Essential Information" style="padding-left:0px;">');

  countries= country.split(',');
  for (i= 0; i < countries.length; i++)
  {
    document.write('<img src="images/');
    document.write(countries[i]);
    document.write('_50.png" alt="');
    document.write(countries[i]);
    document.write('">');
  }
  document.write('<a href="faqs.html#accom-symbols">');
  if (hotels != 0)
  {
    document.write('<img src="images/hotel_50.png" alt="hotels">x');
    document.write(hotels);
  }
  if (huts != 0)
  {
    document.write('<img src="images/hut_50.png" alt="mountains huts">x');
    document.write(huts);
  }
  if (self_catering != 0)
  {
    document.write('<img src="images/sc_50.png" alt="self-catering apartments">x');
    document.write(self_catering);
  }
  document.write('</a><a href="faqs.html#challenge"><img src="images/');
  document.write(challenge);
  document.write('paw_50.png" alt="challenge level ');
  document.write(challenge);
  document.write('"></a>');
  if (women == true)
  {
    document.write('<img src="images/women.png" alt="women only dates available">');
  }
  document.write('</div>');

  document.writeln('<p style="clear:left;margin:0px;">');
}


function tag_line()
{
/*  document.writeln('<div style="clear:both">');
  document.writeln('<img src="images/bottom_graphic.png" alt="making tracks in wild places">');
  document.writeln('</div>');
*/
}

function trek_footer()
{
  tag_line(); 
  document.writeln('</div>'); /* class="content" */
}

function series_footer()
{
  trek_footer();
}

function date_footer()
{
  trek_footer();
}

function group_page(image, trek)
{
  if (image != "")
  {
    document.write('<img src="photos/');
    document.write(image);
    document.write('" class="floatRight">');
  }
  document.write('PawPrint believes small is beautiful - we never have more than 6 clients on any one trip. We have several good reasons for this:');
  document.write('<ul>');
  document.write('<li>a small group means that everyone can get to know each other easily');
  document.write('<li>your leader will often have comments to make about the environment you are passing through, for example mountain names, the geology or the flowers - a small group means you won\'t miss out on hearing what she or he has to say!');
  document.write('<li>the areas that we visit are very environmentally sensitive, and by minimising our impact we help to preserve them');
  document.write('<li>the areas that we visit are used by other mountaineers as well, and a small group does not diminish their enjoyment');
  document.write('<li>most importantly, your safety is our top priority and a small group allows us to maintain the highest safety standards that you would expect from our qualified <a href="');
  document.write(trek);
  document.write('-leader.html">International Mountain Leaders</a>');
  document.write('</ul>');
  document.write('<br><br><font style="font-size:2pt;">.</font>');
}

function leader_page(image)
{
  if (image != "")
  {
    document.write('<img src="photos/');
    document.write(image);
    document.write('" class="floatLeft">');
  }
  document.write('On your holiday you will be accompanied by a British, fully qualified International Mountain Leader (IML). IMLs have been assessed in the skills required for leading walking parties both within the European Union and across the rest of the world. Apart from the technical skills expected of an experienced mountaineer, their areas of expertise include the mountain environment, local history, geology, flora and fauna and mountain weather. The IML award is identical to the French');
  document.write('<img src="images/baiml100.jpg" class="floatRight middleImage">');
  document.write('<img src="images/uimla100.jpg" class="floatRight middleImage">');
  document.write(' "Accompagnateur en Montagne Europ&eacute;en" and equivalent awards in other EU countries, and in the UK it is administered by Mountain Leader Training UK. All our IMLs are members of the <a href="http://www.baiml.org">British Association of International Mountain Leaders</a>. Women-only holidays will always be lead by a female IML!');
  document.write('<p>Your IML will hold a mountain first aid certificate and many trips will be lead by an IML who is also a fully qualified Emergency Medical Technician Wilderness Specialist. Your IML is always able to contact our medical advisor, <a href="team.html#gill">Dr Gill Tuck</a>, 24 hours a day during the holiday.<p>Because we only use qualified IMLs you can be assured that your leader will be practising the best standards of safety and is guaranteed to have a specialist\'s knowledge of the mountain environment.<br><br><br><br><br><br><br><br><br><br><br><br><font style="font-size:2pt;">.</font>');
}

function insurance_page(image)
{
  if (image != "")
  {
    document.write('<img src="photos/');
    document.write(image);
    document.write('" class="floatLeft">');
  }
  document.write('All clients are required to have travel and mountain rescue insurance that covers trekking in Europe. <a href="http://www.snowcard.co.uk">Snowcard</a> and The <a href="http://www.thebmc.co.uk/insurance/index.htm">British Mountaineering Council</a> (BMC) offer suitable insurance, and policies can be bought on-line.');
  document.write('<p>For BMC insurance you will have to be an individual member or affiliated member of the BMC, the <a href="http://www.mountaineering.ie">Mountaineering Council of Ireland</a> (MCI) or the <a href="http://www.mountaineering-scotland.org.uk">Mountaineering Council of Scotland</a> (MCofS) to be eligible to buy a policy from them. Affiliate membership is usually held by being a member of a mountaineering club which has paid for club membership of the BMC, MCI or MCofS.<p>There are other suitable insurance policies are available from various insurance brokers, but you must check that mountain rescue insurance is included, and that trekking in Europe is covered. Clients will be respectfully required to show proof of travel and mountain rescue insurance cover before the start of the holiday.');
  document.write('<br><br><br><br><br><br><br><br><br><br><br><font style="font-size:2pt;">.</font>');
}

function holding_comment(image)
{
  if (image != "")
  {
    document.write('<img src="photos/');
    document.write(image);
    document.write('" class="floatLeft">');
    document.write('<div style="clear:both"></div>');
  }
  document.write('<p>Details will be available shortly.  Please <a href="contact.html">contact us</a> for more information');
}

function random_pyrenees_image()
{
  var images= ["pyrenees/F1030031-10x10pc.jpg",
"pyrenees/F1030032-10x10pc.jpg",
"pyrenees/F1030035-10x10pc.jpg",
"pyrenees/F1040004-10x10pc.jpg",
"pyrenees/F1040005-10x10pc.jpg",
"pyrenees/F1040006-10x10pc.jpg",
"pyrenees/F1040012-10x10pc.jpg",
"pyrenees/F1040018-10x10pc.jpg",
"pyrenees/F1040022-10x10pc.jpg",
"pyrenees/F1040024-10x10pc.jpg",
"pyrenees/F1050010-10x10pc.jpg",
"pyrenees/F1050030-10x10pc.jpg",
"pyrenees/F10500301-10x10pc.jpg",
"pyrenees/IMG_1297-10x10pc.jpg",
"pyrenees/IMG_1309-10x10pc.jpg",
"pyrenees/IMG_1312-10x10pc.jpg",
"pyrenees/IMG_1321-10x10pc.jpg",
"pyrenees/IMG_1325-10x10pc.jpg",
"pyrenees/IMG_1333-10x10pc.jpg",
"pyrenees/IMG_1336-10x10pc.jpg",
"pyrenees/IMG_1342-10x10pc.jpg",
"pyrenees/IMG_1351-10x10pc.jpg",
"pyrenees/IMG_1356-10x10pc.jpg",
"pyrenees/IMG_1358-10x10pc.jpg",
"pyrenees/IMG_1361-10x10pc.jpg",
"pyrenees/IMG_1378-10x10pc.jpg",
"pyrenees/IMG_1390-10x10pc.jpg",
"pyrenees/IMG_1424-10x10pc.jpg",
"pyrenees/IMG_1437-10x10pc.jpg",
"pyrenees/orchid2-10x10pc.jpg",
"pyrenees/orchid3-10x10pc.jpg"];

  return images[Math.floor(Math.random()*images.length)];
}

function random_dolomites_image()
{ /*deprecated*/
  var images= ["dolomites_3_380.jpg",
               "dolomites_5_380.jpg",
               "dolomites_6_380.jpg",
               "north_towards_austria_cropped-50p.jpg",
               "south_from_lagazuoi-30p.jpg",
               "alpine_meadow-20p.jpg",
               "anna-20p.jpg",
               "dolomites_sunset-30p.jpg",
               "tofana_di_mezzo-20p.jpg",
               "dolomites_moonscape-20p.jpg",
               "paternkofel.jpg",
               "tre_cime_2.jpg",
               "above_arabba.jpg",
               "war_remains.jpg",
               "tre_cime.jpg"];
  return images[Math.floor(Math.random()*images.length)];
}
function random_madeira_image()
{
  var images= ["madeira/flower-10x10pc.jpg",
"madeira/flower2-12x12pc.jpg",
"madeira/goat-12x12pc.jpg",
"madeira/levada10-12x12pc.jpg",
"madeira/levada11-12x12pc.jpg",
"madeira/levada2-12x12pc.jpg",
"madeira/levada3-12x12pc.jpg",
"madeira/levada4-12x12pc.jpg",
"madeira/levada5-12x12pc.jpg",
"madeira/levada6-12x12pc.jpg",
"madeira/levada7-12x12pc.jpg",
"madeira/levada8-12x12pc.jpg",
"madeira/levada9-12x12pc.jpg",
"madeira/mountains10-12x12pc.jpg",
"madeira/mountains-12x12pc.jpg",
"madeira/mountains11-12x12pc.jpg",
"madeira/mountains14-12x12pc.jpg",
"madeira/mountains15-12x12pc.jpg",
"madeira/mountains16-12x12pc.jpg",
"madeira/mountains2-12x12pc.jpg",
"madeira/mountains3-12x12pc.jpg",
"madeira/mountains4-12x12pc.jpg",
"madeira/mountains5-12x12pc.jpg",
"madeira/mountains6-12x12pc.jpg",
"madeira/mountains7-12x12pc.jpg",
"madeira/mountains8-12x12pc.jpg",
"madeira/mountains9-12x12pc.jpg",
"madeira/path-12x12pc.jpg",
"madeira/road-12x12pc.jpg",
"madeira/road2-12x12pc.jpg",
"madeira/sea-12x12pc.jpg",
"madeira/sea2-12x12pc.jpg",
"madeira/sea5-12x12pc.jpg",
"madeira/sea6-12x12pc.jpg",
"madeira/sea7-12x12pc.jpg",
"madeira/town-12x12pc.jpg",
"madeira/town2-12x12pc.jpg",
"madeira/trees-12x12pc.jpg",
"madeira/trees2-12x12pc.jpg",
"madeira/trees3-12x12pc.jpg"];
  return images[Math.floor(Math.random()*images.length)];
}

function random_mallorca_image()
{
  var images= ["mallorca/bay-12x12pc.jpg",
"mallorca/bay2-12x12pc.jpg",
"mallorca/beach-12x12pc.jpg",
"mallorca/beach3-12x12pc.jpg",
"mallorca/beach4-12x12pc.jpg",
"mallorca/boats-12x12pc.jpg",
"mallorca/coast2-12x12pc.jpg",
"mallorca/coast3-12x12pc.jpg",
"mallorca/coast5-12x12pc.jpg",
"mallorca/coast6-12x12pc.jpg",
"mallorca/coast7-12x12pc.jpg",
"mallorca/cove-12x12pc.jpg",
"mallorca/cove3-12x12pc.jpg",
"mallorca/fruit-12x12pc.jpg",
"mallorca/palm-12x12pc.jpg",
"mallorca/sierra-12x12pc.jpg",
"mallorca/sierra2-12x12pc.jpg",
"mallorca/sunset-12x12pc.jpg",
"mallorca/town-12x12pc.jpg",
"mallorca/tree-12x12pc.jpg"];
  return images[Math.floor(Math.random()*images.length)];
}

function random_dolomites_ski_image()
{
  var images= ["dolomites-ski/IMG_0838-10x10pc.jpg",
"dolomites-ski/IMG_0840-10x10pc.jpg",
"dolomites-ski/IMG_0850-10x10pc.jpg",
"dolomites-ski/IMG_0852-10x10pc.jpg",
"dolomites-ski/IMG_0872-10x10pc.jpg",
"dolomites-ski/IMG_0886-10x10pc.jpg",
"dolomites-ski/IMG_0906-10x10pc.jpg",
"dolomites-ski/IMG_0948-10x10pc.jpg",
"dolomites-ski/IMG_0958-10x10pc.jpg",
"dolomites-ski/p1010052-10x10pc.jpg",
"dolomites-ski/view_2-10x10pc.jpg",
"dolomites-ski/view_from_belvedere_1-10x10pc.jpg",
"dolomites-ski/view_from_campitello_top_station-10x10pc.jpg"];
  return images[Math.floor(Math.random()*images.length)];
}

function random_valencia_image()
{
  var images= ["valencia/cimg2623-10x10pc.jpg",
"valencia/cimg2627-10x10pc.jpg",
"valencia/cimg2632-10x10pc.jpg",
"valencia/cimg2636-10x10pc.jpg",
"valencia/cimg2683-10x10pc.jpg",
"valencia/cimg2685-10x10pc.jpg",
"valencia/cimg2694-10x10pc.jpg",
"valencia/Image11-10x10pc.jpg",
"valencia/Image12-10x10pc.jpg",
"valencia/Image17-10x10pc.jpg",
"valencia/Image53-10x10pc.jpg",
"valencia/Image8-10x10pc.jpg",
"valencia/Image9-10x10pc.jpg",
"valencia/IMG_1052-10x10pc.jpg",
"valencia/IMG_1105-10x10pc.jpg",
"valencia/IMG_1133-10x10pc.jpg",
"valencia/IMG_1143-10x10pc.jpg",
"valencia/IMG_1187-10x10pc.jpg",
"valencia/imgp0507-10x10pc.jpg",
"valencia/imgp0509-10x10pc.jpg",
"valencia/imgp0535-10x10pc.jpg",
"valencia/imgp0542-10x10pc.jpg",
"valencia/imgp0549-10x10pc.jpg",
"valencia/imgp0562-10x10pc.jpg",
"valencia/imgp0565-10x10pc.jpg",
"valencia/imgp0570-10x10pc.jpg"];
  return images[Math.floor(Math.random()*images.length)];
}

function random_dolomites_walking_image()
{
var images= ["dolomites_walking/img_1893-12x12pc.jpg",
"dolomites_walking/img_1946-12x12pc.jpg",
"dolomites_walking/img_2012-12x12pc.jpg",
"dolomites_walking/img_2027-12x12pc.jpg",
"dolomites_walking/img_2067-12x12pc.jpg",
"dolomites_walking/img_2108-12x12pc.jpg",
"dolomites_walking/img_2109-12x12pc.jpg",
"dolomites_walking/img_2124-12x12pc.jpg",
"dolomites_walking/img_2137-12x12pc.jpg",
"dolomites_walking/img_2161-12x12pc.jpg",
"dolomites_walking/img_2163-12x12pc.jpg",
"dolomites_walking/img_2169-12x12pc.jpg",
"dolomites_walking/img_2177-12x12pc.jpg",
"dolomites_walking/img_2188-12x12pc.jpg",
"dolomites_walking/img_2191-12x12pc.jpg",
"dolomites_walking/img_2209-12x12pc.jpg",
"dolomites_walking/img_2212-12x12pc.jpg",
"dolomites_walking/img_2221-12x12pc.jpg",
"dolomites_walking/img_2267-12x12pc.jpg",
"dolomites_walking/img_2284-12x12pc.jpg",
"dolomites_walking/img_2292-12x12pc.jpg",
"dolomites_walking/img_2300-12x12pc.jpg",
"dolomites_walking/img_2303-12x12pc.jpg",
"dolomites_walking/img_2311-12x12pc.jpg",
"dolomites_walking/img_2324-12x12pc.jpg",
"dolomites_walking/img_2328-12x12pc.jpg",
"dolomites_walking/img_2366-12x12pc.jpg",
"dolomites_walking/img_2378-12x12pc.jpg",
"dolomites_walking/img_2383-12x12pc.jpg",
"dolomites_walking/img_2400-12x12pc.jpg",
"dolomites_walking/img_2411-12x12pc.jpg",
"dolomites_walking/img_2420-12x12pc.jpg",
"dolomites_walking/img_2421-12x12pc.jpg",
"dolomites_walking/img_2429-12x12pc.jpg",
"dolomites_walking/img_2441-12x12pc.jpg",
"dolomites_walking/img_2450-12x12pc.jpg",
"dolomites_walking/img_2451-12x12pc.jpg",
"dolomites_walking/img_2463-12x12pc.jpg",
"dolomites_walking/img_2476-12x12pc.jpg",
"dolomites_walking/img_2492-12x12pc.jpg"];
  return images[Math.floor(Math.random()*images.length)];
}

function random_dolomites_vf_image()
{
  var images= ["dolomites_vf/F1010024-10x10pc.jpg",
"dolomites_vf/F1010027-10x10pc.jpg",
"dolomites_vf/img_1454-10x10pc.jpg",
"dolomites_vf/img_1488-10x10pc.jpg",
"dolomites_vf/img_1511-10x10pc.jpg",
"dolomites_vf/img_1523-10x10pc.jpg",
"dolomites_vf/img_1574-10x10pc.jpg",
"dolomites_vf/img_1597-10x10pc.jpg",
"dolomites_vf/img_1634-10x10pc.jpg",
"dolomites_vf/img_1681-10x10pc.jpg",
"dolomites_vf/img_1684-10x10pc.jpg",
"dolomites_vf/img_1692-10x10pc.jpg",
"dolomites_vf/img_1695-10x10pc.jpg",
"dolomites_vf/img_1702-10x10pc.jpg",
"dolomites_vf/img_1703-10x10pc.jpg",
"dolomites_vf/img_1708-10x10pc.jpg",
"dolomites_vf/img_1717-10x10pc.jpg",
"dolomites_vf/img_1751-10x10pc.jpg",
"dolomites_vf/imgp0696-10x10pc.jpg",
"dolomites_vf/imgp0717-10x10pc.jpg",
"dolomites_vf/imgp0719-10x10pc.jpg",
"dolomites_vf/imgp0735-10x10pc.jpg",
"dolomites_vf/imgp0752-10x10pc.jpg"];
  return images[Math.floor(Math.random()*images.length)];
}

function random_pyrenees_image_full(image)
{
  document.write('<img src="photos/');
  document.write(random_pyrenees_image());
  document.write('" class="floatLeft">');
  document.write('<div style="clear:both"></div>');
}

function image_full(image)
{
  document.write('<img src="photos/');
  document.write(image);
  document.write('" class="floatRight">');
}

