// JavaScript Document
//detail() invoked by Flash Interactive map 
function details(id,category)
{
  var pd = "<cfoutput>#paidDisplay#</cfoutput>";
  if( typeof popUpWin != 'undefined')
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  if(category == 'all')
  {
 	 popUpWin = open('http://lakeplacid.com/dbsearch/attractPop.cfm?id='+id+'&paidDisplay='+pd, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width=600,height=550,left=10,top=10,screenX=10,screenY=10');
  }
  else if(category == 'dining')
  {
 	 popUpWin = open('http://lakeplacid.com/dbsearch/diningPop.cfm?id='+id+'&paidDisplay='+pd, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width=600,height=550,left=10,top=10,screenX=10,screenY=10');
  }
  else if(category == 'lodging')
  {
 	 popUpWin = open('http://lakeplacid.com/dbsearch/resFormPop.cfm?id='+id+'&paidDisplay='+pd, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width=600,height=550,left=10,top=10,screenX=10,screenY=10');
  }
}
var addToTPWindow = 0;
function addToTripPlanner(theID,theCAT)
{
	if(addToTPWindow)
	{
		if(!addToTPWindow.closed)
		{
			addToTPWindow.close();
		}
	}
	addToTPWindow= open("http://lakeplacid.com/tripplanner/addToTripPlanner.cfm?id="+theID+"&category="+theCAT,"addToTPWindow","width=200,height=125,top=150,left=150"); 
	addToTPWindow.focus();
}

var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=1,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}
//use the following var to remember an image's original src value
//the imageRoll function will constantly update this value, allowing the imageOut function to use its current value
var imageSourceValue = '';
function imageRoll(imageObject)
{
	//store the current src value
	imageSourceValue = imageObject.src;
	//grab the directory from the src attribute
	var folderIndex = imageObject.src.lastIndexOf("/");
	var theDirectory = imageObject.src.substring(0,folderIndex+1);//returns the DIR in the form http://domain.com/folder
	//test for image file type, jpg v. gif
	var theFileType = imageObject.src.substring(imageObject.src.length-3);//grab the last 3 characters, they represent the file type

	imageObject.src=theDirectory+imageObject.name+'-on.'+theFileType;
}
function imageOut(imageObject)
{
	//retrieve the original image src attribute
	imageObject.src = imageSourceValue;
}
var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }  
  popUpWin2 = open(URLStr, 'popUpWin2', 'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,copyhistory=1,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}
var mapPopUp = 0;
function popLodgingMap(URLStr, left, top, width, height)
{
  if(mapPopUp)
  {
    if(!mapPopUp.closed) mapPopUp.close();
  }  
  mapPopUp = open(URLStr, 'mapPopUp', 'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,copyhistory=1,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}


var googleMap=0;
function loadMap(s,id)
{
	var width = 1024;
	var height = 700;
	var top, left = 10;
  
  	var qString = "";
  	if(s == "tripplanner")
	{
		qString = "loadTP=1";
	}
	else qString = "searchCategory="+s;
	
	if(typeof id != "undefined")
	{
		qString = qString+"&id="+id;
	}
  
	  if(googleMap)
	  {
		if(!googleMap.closed) googleMap.close();
	  }
	  googleMap = open('http://lakeplacid.com/tripplanner/index.cfm?'+qString, 'googleMap', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=1,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}