/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */

/**
 * @author       Luca Questa <info@webmastering.it>
 * @author       Webmastering.it di Questa Luca
 * @author       http://www.webmastering.it
 * @author       Domicilio fiscale: Via Col. E. Franceschi, 59/6 - Sede: Via S. Rufino, 32/7
 * @author       16043 Chiavari (GE) - Italy
 * @author       P.I.: IT-01154580995 - C.F.: QSTLCU74E03C621A
 * @author       Mobile: 039-328-2154633 - Phone/Fax: 039-199-741156
 *
 * @customer     Circolo Golf e Tennis Rapallo
 *
 * @description  JS Master library
 *
 * @usage		 (if applicable): embed
 *
 * @copyright	 2008-1-1 9:39 - Webmastering.it di Questa Luca
 * 
 * @revision	 2008-1-13 1:15 - Webmastering.it di Questa Luca
 *
 * The above copyright notice and the following disclaimer must remain untouched at all times.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

var currentTime			= new Date();
var thisYear			= currentTime.getFullYear();
var firstCopyrightYear	= "2002";
var thisDomain			= "golfetennisrapallo.it";
var companyClaim		= "Circolo Golf e Tennis Rapallo";

// This will update status bar copyright accordingly to current year and the first copyright year
// no matter which year we're in. Client-side updater.
	if (thisYear > firstCopyrightYear) {
		defaultStatus="© "+firstCopyrightYear+"-"+thisYear+" "+companyClaim;
	} else {
		defaultStatus="© "+thisYear+" "+companyClaim;
	}


// Allow both Microsoft IE and FireFox users to bookmark this website
function bookmarkMe()
{
    if (document.all) {
        window.external.AddFavorite("http://www."+thisDomain+"/it/",companyClaim);
	} else if (window.sidebar) {
    	window.sidebar.addPanel(companyClaim,"http://www."+thisDomain+"/it/","");
	} else if (window.opera && window.print) {
		alert("Per iserire "+thisDomain+" nei tuoi Preferiti, utilizza la combinazione CTRL+D.");
	} else {
		alert("Per iserire "+thisDomain+" nei tuoi Preferiti, utilizza la combinazione fornita dal tuo browser.");
	}
}

// Prints-out the current page
function printCurrentPage()
{ 
	if (window.print) {
		window.print();
	} else {
		alert("Il tuo browser non supporta la funzionalitŕ di stampa!\nPer stampare scegli la voce Stampa dal menů File."); 
	}
}

// Brake external frames 	
if (top.frames.length != 0) {
	top.location = self.document.location;
}

// Add a prototype to Lightbox
// Used in conjunction to the following callback to Flash for Lighboxing images contained in the slideshow
function LightboxDelegate(url,caption)
{
	var objLink = document.createElement('a');
	
	objLink.setAttribute('href',url);
	objLink.setAttribute('rel','lightbox');
	objLink.setAttribute('title',caption);
	Lightbox.prototype.start(objLink);
}

// Callback to Flash thumbnails contained into the header slideshow
function whichPressed(nbr)
{
	var imageToShow = '../pics/0'+nbr.toString()+'.jpg';
	var additionalInfo = '';
	if (nbr == 6) {
		additionalInfo	= ' - La Club House';
	} else if (nbr == 7) {
		additionalInfo	= ' - La Reception';
	} else if (nbr == 8) {
		additionalInfo	= ' - Il Ristorante';
	} else if (nbr == 5) {
		additionalInfo	= ' - I campi da Tennis';
	} else if (nbr == 1) {
		additionalInfo	= ' - La Chiesa di Santo Stefano';
	} else {
		additionalInfo	= ' - Veduta panoramica';
	}
	LightboxDelegate(imageToShow,'<span style="color: #000040;">'+companyClaim+additionalInfo+'</span>')
}