//Allows 2 seperate links (image and text) to start Lightbox gallery without a duplicate 1st image.
function lightBoxLink(){
	document.getElementById('link2').onclick()
}
/*function linker(num){
	var link1 = document.getElementById('link1');
	var link2 = document.getElementById('link2');
	link1.rel="";
	link2.rel="";
	if(num==1){
		link1.rel="lightbox[crerar]";
	}
	else{link2.rel="lightbox[crerar]";
	}
}*/

// bookmark this page
function addBookmark()
{
	var bookmarkurl = window.location;
	var bookmarktitle = document.title;
	if (document.all)
		window.external.AddFavorite(bookmarkurl,bookmarktitle)
}


// print page
function printPage()
{
	window.print();
}


// button links
function goToBookingEngine()
{ 
	//window.location = ''; 
}


// gallery
function OpenWindow(image){
	
	var width = 520;
	var height = 350;
	
	var leftPos = (screen.availWidth - width) / 2;
	var topPos = (screen.availHeight - height) / 2;
	
	window.open("/Gallery_Popup.html?image="+image,"libraryWindow","toolbar=no,location=no,scrollbars=yes,resizable=yes,width="+width+",height="+height+",left="+leftPos+",top="+topPos);
}

function addOnloadEvent(fnc){
  if ( typeof window.addEventListener != "undefined" )
    window.addEventListener( "load", fnc, false );
  else if ( typeof window.attachEvent != "undefined" ) {
    window.attachEvent( "onload", fnc );
  }
  else {
    if ( window.onload != null ) {
      var oldOnload = window.onload;
      window.onload = function ( e ) {
        oldOnload( e );
        window[fnc]();
      };
    }
    else
      window.onload = fnc;
  }
}


function showSubMenu(num){
	var uls = document.getElementById('menu').getElementsByTagName('ul');
	if( num <= uls.length){
			for (var i=0; i<uls.length; i++) {
				if(i == num){
					uls[i].className = "show";
				}else{
					uls[i].className = "hide";
				}
			}							
	}
	if(num == 999){
			for (var i=0; i<uls.length; i++) {
					uls[i].className = "show";
			}		
	}
	if(num > uls.length && num != 999){
			for (var i=0; i<uls.length; i++) {
					uls[i].className = "hide";
			}			
	}							
}	