﻿// ------------------------------------
// ShipWatcher Javascript file
// (c) 2009 Neil Ennis
// ------------------------------------

// ------------------------------------
// pop up a window containing info
// about a ship
// ------------------------------------
function showInfo(shipID, locationID, imageID){
var MyWin;
var MyUrl;
MyUrl = 'ShipInfo.aspx?i='+shipID+'&l='+locationID+'&g='+imageID;
MyWin = window.open(MyUrl, 'ShipInfo', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,status=yes,height=400,Width=400');
MyWin.focus();
}
// ------------------------------------
// pop up a window showing the location
// of a ship on google maps
// ------------------------------------
function displayMap(shipID, locationID, imageID){
var MyWin;
var MyUrl;
MyUrl = 'DisplayMap.aspx?i='+shipID+'&l='+locationID+'&g='+imageID;
MyWin = window.open(MyUrl, 'DisplayMap', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,status=yes,height=550,Width=550');
MyWin.focus();
}
// ------------------------------------
// take a photo of a ship
// ------------------------------------
function takePhoto(shipID){
var MyWin;
var MyUrl;
MyUrl = 'TakePhoto.aspx?i='+shipID;
MyWin = window.open(MyUrl, 'TakePhoto', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,status=yes,height=850,Width=850');
MyWin.focus();
}
// ------------------------------------
// pick a few interesting ships
// ------------------------------------
function quickPick(){
var MyWin;
var MyUrl;
MyUrl = 'QuickPick.aspx';
MyWin = window.open(MyUrl, 'QuickPick', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,status=yes,height=200,Width=400');
MyWin.focus();
}
// ------------------------------------
// play a slideshow of recent images
// ------------------------------------
function playImage(imgID, shipID){
var thisImage;
thisImage=document.getElementById('Play'+imgID);
thisImage.style.display='none';
thisImage.style.width='1px';
thisImage=document.getElementById('Stop'+imgID);
thisImage.style.display='';
thisImage.style.width='12px';
AddNewShow(imgID, shipID);
//AddNewShow('http://shipwatcher.com/photos/ImageLocations/ShowImage.aspx?a='+shipID, imgID, shipID);
}
// ------------------------------------
// revert back to the current image
// ------------------------------------
function stopImage(imgID, shipID){
var thisImage;
thisImage=document.getElementById('Stop'+imgID);
thisImage.style.display='none';
thisImage.style.width='1px';
thisImage=document.getElementById('Play'+imgID);
thisImage.style.display='';
thisImage.style.width='12px';
RemoveShow(imgID, shipID);
}

