var fred;

function setFlash(mysrc)
{
	clearTimeout(fred);
	var s1 = new SWFObject("flash/"+mysrc+".swf","flashbox","100%","100%","8");
      s1.addParam("quality","high");
	s1.addParam("bgcolor","#FFFFFF");
	s1.addParam("wmode","transparent");
	s1.write("slideshow");
	fred = setTimeout("returnVid()",8000);
}


function returnVid()
{
	var s1 = new SWFObject(mainvid,"flashbox","100%","100%","8");
      s1.addParam("quality","high");
	s1.addParam("bgcolor","#FFFFFF");
	s1.addParam("wmode","transparent");
	s1.write("slideshow");
}

function stopSlides()
{
    	clearTimeout(fred);
    	var show = parent.document.getElementById('slideshow');
     	var slide = parent.document.getElementById('hidden');
     	show.innerHTML = slide.innerHTML;

}
/*function setSlideshow(showname)
{
      s1.addVariable("file",showname+".xml");
	s1.write("slideshow");
}*/




function getFlashMovieObject(movieName)
{
  if (window.document[movieName])
  {
      return window.document[movieName];
  }
  if (navigator.appName.indexOf("Microsoft Internet")==-1)
  {
    if (document.embeds && document.embeds[movieName])
      return document.embeds[movieName];
  }
  else if (navigator.appName.indexOf("Microsoft Internet")!=-1)
  {
    return document.getElementById(movieName);
  }
}

/*function getFlashMovieObject(movieName)
{

  if (window.document[movieName])
  {
      alert("1 "+window.document[movieName]);
	return window.document[movieName];
  }
  else if (document.embeds && document.embeds[movieName])
  {
      alert("2 "+document.embeds[movieName]);
      return document.embeds[movieName];
  }
  else if (document.getElementById(movieName))
  {
      alert("3 " + document.getElementById(movieName));
  	return document.getElementById(movieName);
  }

}*/

var speed=0; //, currentpos=curpos1=0,alt=1,curpos2=-1
//var check=50;
var check=(document.all)? 30 : 50;
var timing = window.setInterval("initialize()",check);
function scrollPane()
{
      var scrollpane = document.getElementById("thumbs");
      var w = 782;
//	alert(w);
	var w2 = scrollpane.offsetWidth-150;
	var maxXPos = w-w2;
	var pos = parseInt(scrollpane.style.left);
	pos+=speed;
	if (pos<=0&&pos>=maxXPos)  scrollpane.style.left = pos+"px";     //
}
function initialize() {
	if (speed!=0) scrollPane();
}

window.onresize=fixPosition;
var posX;

function fixPosition()
{
	var mycontrols = document.getElementById('controlbar');
      var textObj = document.getElementById('bigtitle');
	var content = document.getElementById('container');
	var offsetY = container.offsetHeight;
	if (window.innerWidth) var w = window.innerWidth;
	else if (document.body.clientWidth) var w = document.body.clientWidth;
	var cwidth=mycontrols.style.width;
	cwidth = cwidth.replace("px","");
 	posX = (w-cwidth)/2;
      mycontrols.style.left=(posX-12)+"px";
	mycontrols.style.top = offsetY;
}

//Script by Trånn: http://come.to/tronds
//Submitted to JavaScript Kit (http://javascriptkit.com)
//Visit http://javascriptkit.com for this script
var good;
function checkEmailAddress(field)
{
	var goodEmail = field.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\.info)|(\.sex)|(\.biz)|(\.aero)|(\.coop)|(\.museum)|(\.name)|(\.pro)|(\..{2,2}))$)\b/gi);
	if (goodEmail) {
	good = true;
	}
	else {
	alert('Please enter a valid address.');
	field.focus();
	field.select();
	good = false;
	   }
}
u = window.location;
function mailThisUrl(pkg) {
      var initialsubj="Here's a Getway pkg you might be interested in";
	var initialmsg="Hello,\n You may want to check out this great Culinary Getaway pkg: "+pkg+" "+window.location
	good = false
	checkEmailAddress(document.eMailer.email);
	if (good) {

//window.location = "mailto:"+document.eMailer.email.value+"?subject="+initialsubj+"&body="+document.title+" "+u;
	window.location = "mailto:"+document.eMailer.email.value+"?subject="+initialsubj+"&body="+initialmsg
   }
}



