Bodrum=new Image(400,218)
Bodrum.src="Kale/bodrum.jpg"
turkey=new Image(400,218)
turkey.src="Kale/turkey2.jpg"
function newWindow() {Bodrumlarge = window.open("Kale/bodrum.jpg","Bodrumlarge","width=700,height=450 left=0, top=0")}
function newWindow2() {Bodrumlarge = window.open("../../Kale/bodrum.jpg","Bodrumlarge","width=700,height=450 left=0, top=0")}
function newWindow3() {Bodrumlarge = window.open("../../../Kale/bodrum.jpg","Bodrumlarge","width=700,height=450,left=0, top=0")}
function disPhotosE(urle) {DisplayPhotos = window.open(urle,"DisplayPhotos","width=700,height=370,left=0, top=0 scrollbars=yes, toolbar=no, location=yes, resizable=yes")
 DisplayPhotos.focus()}
function disEditE(urle) {DisplayEdit = window.open(urle,"DisplayEdit","width=1200,height=600,left=0, top=0 scrollbars=yes, toolbar=no, location=yes, resizable=yes")
 DisplayEdit.focus()}
function flight1() {Flightnew = window.open("http://www.britanniadirect.com","Flightnew","width=700,height=450,left=0, top=0, scrollbars=yes, toolbar=yes, location=yes, resizable=yes")}
function flight2() {Flightnew = window.open("http://www.airtours.com","Flightnew","width=700,height=450,left=0, top=0, scrollbars=yes, toolbar=yes, location=yes, resizable=yes")}
function flight3() {Flightnew = window.open("http://www.thomascook.co.uk","Flightnew","width=700,height=450,left=0, top=0, scrollbars=yes, toolbar=yes, location=yes, resizable=yes")}
function flight4() {Flightnew = window.open("http://www.firstchoice.co.uk","Flightnew","width=700,height=450,left=0, top=0, scrollbars=yes, toolbar=yes, location=yes, resizable=yes")}
function help1() {Helpnew = window.open("help.html","Helpnew","width=700,height=450,left=0, top=0, scrollbars=yes, toolbar=yes, location=yes, resizable=yes")}
function help1close() {Helpnew.close()}
function toggleMenu(currMenu) {
		if (document.getElementById) {
                    thisMenu = document.getElementById(currMenu).style
                    if (thisMenu.display == "block") {
                        thisMenu.display = "none"
                        }
                        else {
                           thisMenu.display = "block"
                        }
                        return false
                 }
                 else {
                        return true
                 }
}
function toggleMenu2(currMenu,town) {
                if (town.value == "Bodrum") {
		  if (document.getElementById) {
                    thisMenu = document.getElementById(currMenu).style
                    if (thisMenu.display == "block") {
                        thisMenu.display = "none"
                        }
                        else {
                           thisMenu.display = "block"
                        }
                        return false
                  }
                  else {
                        return true
 
                  }
                }
                if (document.getElementById) {
                    thisMenu = document.getElementById(currMenu).style
                    if (thisMenu.display == "block") {
                        thisMenu.display = "none"
                        }
                 }
}



function slideShow(speed) {


	//append a LI item to the UL list for displaying caption
	$('ul.slideshow').append('<LI id=slideshow-caption class=caption><DIV class=slideshow-caption-container><H3></H3><P></P></DIV></LI>');

	//Set the opacity of all images to 0
	$('ul.slideshow li').css({opacity: 0.0});
	
	//Get the first image and display it (set it to full opacity)
	$('ul.slideshow li:first').css({opacity: 1.0});
	
	//Get the caption of the first image from REL attribute and display it
	$('#slideshow-caption h3').html($('ul.slideshow a:first').find('img').attr('title'));
	$('#slideshow-caption p').html($('ul.slideshow a:first').find('img').attr('alt'));
		
	//Display the caption
	$('#slideshow-caption').css({opacity: 0.7, bottom:0});
	
	//Call the gallery function to run the slideshow	
	var timer = setInterval('gallery()',speed);
	
	//pause the slideshow on mouse over
	$('ul.slideshow').hover(
		function () {
			clearInterval(timer);	
		}, 	
		function () {
			timer = setInterval('gallery()',speed);			
		}
	);
	
}

function gallery() {


	//if no IMGs have the show class, grab the first image
	var current = ($('ul.slideshow li.show')?  $('ul.slideshow li.show') : $('#ul.slideshow li:first'));

	//Get next image, if it reached the end of the slideshow, rotate it back to the first image
	var next = ((current.next().length) ? ((current.next().attr('id') == 'slideshow-caption')? $('ul.slideshow li:first') :current.next()) : $('ul.slideshow li:first'));
		
	//Get next image caption
	var title = next.find('img').attr('title');	
	var desc = next.find('img').attr('alt');	
		
	//Set the fade in effect for the next image, show class has higher z-index
	next.css({opacity: 0.0}).addClass('show').animate({opacity: 1.0}, 1000);
	
	//Hide the caption first, and then set and display the caption
	$('#slideshow-caption').slideToggle(300, function () { 
		$('#slideshow-caption h3').html(title); 
		$('#slideshow-caption p').html(desc); 
		$('#slideshow-caption').slideToggle(500); 
	});	

	//Hide the current image
	current.animate({opacity: 0.0}, 1000).removeClass('show');

}






// Browser Slide-Show script. With image cross fade effect for those browsers
// that support it.
// Script copyright (C) 2004-2010 www.cryer.co.uk.
// Script is free to use provided this copyright header is included.
var FadeDurationMS=1000;
function SetOpacity(object,opacityPct)
{
  // IE.
  object.style.filter = 'alpha(opacity=' + opacityPct + ')';
  // Old mozilla and firefox
  object.style.MozOpacity = opacityPct/100;
  // Everything else.
  object.style.opacity = opacityPct/100;
}
function ChangeOpacity(id,msDuration,msStart,fromO,toO)
{
  var element=document.getElementById(id);
  var msNow = (new Date()).getTime();
  var opacity = fromO + (toO - fromO) * (msNow - msStart) / msDuration;
  if (opacity>=100)
  {
    SetOpacity(element,100);
    element.timer = undefined;
  }
  else if (opacity<=0)
  {
    SetOpacity(element,0);
    element.timer = undefined;
  }
  else 
  {
    SetOpacity(element,opacity);
    element.timer = window.setTimeout("ChangeOpacity('" + id + "'," + msDuration + "," + msStart + "," + fromO + "," + toO + ")",10);
  }
}
function FadeInImage(foregroundID,newImage,backgroundID)
{
  var foreground=document.getElementById(foregroundID);
  if (foreground.timer) window.clearTimeout(foreground.timer);
  if (backgroundID)
  {
    var background=document.getElementById(backgroundID);
    if (background)
    {
      if (background.src)
      {
        foreground.src = background.src; 
        SetOpacity(foreground,100);
      }
      background.src = newImage;
      background.style.backgroundImage = 'url(' + newImage + ')';
      background.style.backgroundRepeat = 'no-repeat';
      var startMS = (new Date()).getTime();
      foreground.timer = window.setTimeout("ChangeOpacity('" + foregroundID + "'," + FadeDurationMS + "," + startMS + ",100,0)",10);
    }
  } else {
    foreground.src = newImage;
  }
}
var slideCache = new Array();
function RunSlideShow(pictureID,backgroundID,imageFiles,displaySecs)
{
  var imageSeparator = imageFiles.indexOf(";");
  var nextImage = imageFiles.substring(0,imageSeparator);
  if (slideCache[nextImage] && slideCache[nextImage].loaded)
  {
    FadeInImage(pictureID,nextImage,backgroundID);
    var futureImages = imageFiles.substring(imageSeparator+1,imageFiles.length)
      + ';' + nextImage;
    setTimeout("RunSlideShow('"+pictureID+"','"+backgroundID+"','"+futureImages+"',"+displaySecs+")",
      displaySecs*1000);
    // Identify the next image to cache.
    imageSeparator = futureImages.indexOf(";");
    nextImage = futureImages.substring(0,imageSeparator);
  } else {
    setTimeout("RunSlideShow('"+pictureID+"','"+backgroundID+"','"+imageFiles+"',"+displaySecs+")",
      1000);
  }
  // Cache the next image to improve performance.
  if (slideCache[nextImage] == null)
  {
    slideCache[nextImage] = new Image;
    slideCache[nextImage].loaded = false;
    slideCache[nextImage].onload = function(){this.loaded=true};
    slideCache[nextImage].src = nextImage;
  }
}


