/*
	### Javascript Functions for AlanRogers.com
	### (c) Copyright 2008 Alan Rogers Guides Ltd
*/

<!-- //  Hide script from older browsers
function travelserviceprice(price, accomtype)
{
	//Convert euros to pounds
	price = price / 1.0;
	
	//Take off 6%
	//price = price * 0.94;
	
	if( accomtype == "L" )
	{
		price = (( price * 1 ) + 45 );
	}
	if( accomtype == "E" )
	{
		price = ( ( price * 1 ) + 45 );
	}
	price = price + 0.5;
	price = Math.round(price);
	return price;
}

function submitform(formname,page)
{
	document.forms[formname].action = page;
	document.forms[formname].submit();
}

function addToFavorites(urlAddress, pageName)
{
	if (window.external)
	{
		window.external.AddFavorite(urlAddress,pageName) 
	}
	else
	{
		alert("Sorry! Your browser doesn't support this function."); 
	}
}
// -->

function showDestinations()
{
		Effect.BlindDown('subnav', { duration: 0.5 });
		document.getElementById("navDest").innerHTML = '<a href="#" onclick="hideDestinations();">Bestemmingen</a>';
}

function hideDestinations()
{
		Effect.BlindUp('subnav', { duration: 0.5 });
		document.getElementById("navDest").innerHTML = '<a href="#" onclick="showDestinations();">Bestemmingen</a>';
}


searchState = 0;

function expandSearch()
{
		if (searchState == 0)
		{
			searchState = 1;
			Effect.BlindDown('searchexpand', { duration: 0.5 });
			document.getElementById("search-box").style.background = "url(http://www.alanrogers.nl/lib/img/layout/keyword-search-heading.gif) no-repeat top left #F1F7FA";
		}
}

function hideSearch()
{
		Effect.BlindUp('searchexpand', { duration: 0.5 });
}

/* Home button (logo) */
function goHome()
{
	document.logo.src ="http://www.alanrogers.nl/lib/img/layout/ar-logo-home.gif";
}
function noHome()
{
	document.logo.src ="http://www.alanrogers.nl/lib/img/layout/ar-logo.gif";
}

/* Social Bookmark Script
# Version 1.9
# Copyright (C) 2006-2008 by Alexander Hadj Hassine - All rights reserved
# Website http://www.social-bookmark-script.com/
#
# By using our script you must leave our copyright notices and the links
# in the script untouched. The links doesn't be removed, converted, hidden
# or made invisible. If you set a backlink to http://www.social bookmark script.com/
# (at least 1 time "search machines friendly" from the starting side of your web page)
# you can be adapt the script to you for your purpose changes.
	*/
			
<!--
function Social_Load()
{ 
	var d=document; 
	if(d.images){ if(!d.Social) d.Social=new Array();
	var i,j=d.Social.length,a=Social_Load.arguments; for(i=0; i<a.length; i++)
	if (a[i].indexOf("#")!=0){ d.Social[j]=new Image; d.Social[j++].src=a[i];}}
	}
	Social_Load('http://www.social-bookmark-script.de/img/bookmarks/digg_trans_ani.gif','http://www.social-bookmark-script.de/img/bookmarks/del_trans_ani.gif','http://www.social-bookmark-script.de/img/bookmarks/reddit_trans_ani.gif','http://www.social-bookmark-script.de/img/bookmarks/stumbleupon_trans_ani.gif','http://www.social-bookmark-script.de/img/bookmarks/netscape_trans_ani.gif','http://www.social-bookmark-script.de/img/bookmarks/furl_trans_ani.gif','http://www.social-bookmark-script.de/img/bookmarks/yahoo_trans_ani.gif','http://www.social-bookmark-script.de/img/bookmarks/spurl_trans_ani.gif','http://www.social-bookmark-script.de/img/bookmarks/google_trans_ani.gif','http://www.social-bookmark-script.de/img/bookmarks/technorati_trans_ani.gif','http://www.social-bookmark-script.de/img/bookmarks/newsvine_trans_ani.gif','http://www.social-bookmark-script.de/img/bookmarks/netvouz_trans_ani.gif','http://www.social-bookmark-script.de/load.gif')
	function schnipp() { 
	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 schnupp(n, d) { 
	  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=schnupp(n,d.layers[i].document);
	  if(!x && d.getElementById) x=d.getElementById(n); return x;
	  }
	function schnapp() { 
	  var i,j=0,x,a=schnapp.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	  if ((x=schnupp(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
	  }
//-->




/*  GO TO TOP!  */
var t;
function top()
{
  if (document.body.scrollTop!=0 || document.documentElement.scrollTop!=0)
  {
    window.scrollBy(0,-25);
    t=setTimeout('top()',1);
  }
  else clearTimeout(t);
}


/*  GO TO TOP, QUICKLY!!  */
var t;
function topquick()
{
  if (document.body.scrollTop!=0 || document.documentElement.scrollTop!=0)
  {
    window.scrollBy(0,-300);
    t=setTimeout('top()',1);
  }
  else clearTimeout(t);
}