/* ========================================================================
    common.js written by Simon Holmes, Design Motive
    Copyright 2004 Design Motive Ltd
	http://www.designmotive.co.uk/
   ======================================================================== */ 


// DEFINE GLOBAL VARIABLES AND SET UP SOME STANDARD DOM VAR'S
var showh, showv, structure, viseq, closingb, active, displayB, displayI, displayN, diseq;
docimg = "document.images.";
showh = "'hidden'";
showv = "'visible'";
displayB = "'block'";
displayI = "'inline'";
displayN = "'none'";

structure = "document.getElementById('";
viseq = "').style.visibility = ";
diseq = "').style.display = ";
closingb = "')";


function testElement(id)
{
 test = eval(structure +id + closingb);
 if (!test) {return false;}
 return true;
}

function showHideLayer(lyrid,state)
{
 if (!testElement(lyrid)) {return false;}
 var strVis = ((state == 1) ? displayB : displayN);
 eval(structure + lyrid + diseq + strVis)
}

function fn_NotYet()
{alert("Sorry, this page hasn't been constructed as part of this demonstration");}

function fn_elementDisplay(strID,state)
{
 if (!testElement(strID)) {return false;}
 var strDisp = ((state == 1) ? displayB : displayN);
 eval(structure + strID + diseq + strDisp)
}

 function preloadThumb(tmpID)
 {
  eval('thumbImg_' + tmpID + '_off = new Image(52,49); thumbImg_' + tmpID + '_off.src="/_images/Yachts/' + dbYachtName + '/' + dbYachtName + '_thumb_' + tmpID + '_off.jpg";')
  eval('thumbImg_' + tmpID + '_on = new Image(52,49); thumbImg_' + tmpID + '_on.src="/_images/Yachts/' + dbYachtName + '/' + dbYachtName + '_thumb_' + tmpID + '_on.jpg";')
 }


