﻿/*---------------------------------------------------------*/
/* Creators: 
Peter Liedstrand peter.liedstrand@entraction.com
Johan Lindholm johan.lindholm@entraction.com*/ 
/*adds an onload event to rendering */
/*Megamenu, Carusel feature, animation on footer to top*/
/*---------------------------------------------------------*/
$(document).ready(function() {
    function addMega() {
        $(this).addClass("hovering");
    }
    function removeMega() {
        $(this).removeClass("hovering");
    }
    var megaConfig = {
        interval: 1,
        sensitivity: 4,
        over: addMega,
        timeout: 200,
        out: removeMega
    };
    $("li.mega").hoverIntent(megaConfig)
    if (document.getElementById("carouselWrapper")) {
        $(".carouselWrapper .jCarouselLite").jCarouselLite({
            btnNext: ".carouselWrapper .next",
            btnPrev: ".carouselWrapper .prev",
            speed: 500,
            visible: 1,
            mouseWheel: false,
            btnGo:
                [".carouselWrapper .1", ".carouselWrapper .2",
                ".carouselWrapper .3", ".carouselWrapper .4",
                ".carouselWrapper .5", ".carouselWrapper .6",
                ".carouselWrapper .7"]
        });
    }
    
    $("ul.menu_body li:even").addClass("alt");
    $('img.menu_head').click(function() {
        $('ul.menu_body').slideToggle('medium');
    });
    $('ul.menu_body li a').mouseover(function() {
        $(this).animate({ fontSize: "14px", paddingLeft: "20px" }, 50);
    });
    $('ul.menu_body li a').mouseout(function() {
        $(this).animate({ fontSize: "12px", paddingLeft: "10px" }, 50);
    });

    $('#divFooterUpToTopArea').click(function() {
        $('html, body').animate({ scrollTop: 0 }, 'slow');
    });
    $("#imgPrev")
        .mouseover(function() {
            var src = "";
            var substringPath = getSubStringImages($(this).attr("src"));
            if (substringPath != undefined || substringPath != null) {src = substringPath + "carousel-button-prev-active.gif";}
            $(this).attr("src", src);
        })
        .mouseout(function() {
            var src = "";
            var substringPath = getSubStringImages($(this).attr("src"));
            if (substringPath != undefined || substringPath != null) {src = substringPath + "carousel-button-prev.gif";}
            $(this).attr("src", src);
        });
    $("#imgNext")
        .mouseover(function() {
            var src = "";
            var substringPath = getSubStringImages($(this).attr("src"));
            if (substringPath != undefined || substringPath != null) {src = substringPath + "carousel-button-next.gif";}
            $(this).attr("src", src);
        })
        .mouseout(function() {
            var src = "";
            var substringPath = getSubStringImages($(this).attr("src"));
            if (substringPath != undefined || substringPath != null) {src = substringPath + "carousel-button-next-default.gif";}
            $(this).attr("src", src);
        });
    $(".img")
        .mouseover(function() {
            var src = "";
            var substringPath = getSubStringImages($(this).attr("src"));
            if (substringPath != undefined || substringPath != null) {src = substringPath + "carousel-button-selected.gif";}
            $(this).attr("src", src);
        })
        .mouseout(function() {
            var src = "";
            var substringPath = getSubStringImages($(this).attr("src"));
            if (substringPath != undefined || substringPath != null) {src = substringPath + "carousel-button.gif";}
            $(this).attr("src", src);
        });       
});
    function getSubStringImages(src) {
        if ((src != undefined || src != null) && (src.lastIndexOf("/") > -1)) {
            var count = src.lastIndexOf("/"); var substringPath = src.substring(0, count + 1)
            return substringPath;
        }
        else { return substringPath; }
    }
function redirectURLtoLocation(elmUrl) {
    window.location = elmUrl;
}
/*---------------------------------------------------------*/
/*adds an onload event to rendering*/
/*---------------------------------------------------------*/
function addLoadEvent(func) {
    var oldonload = window.onload;
    if (typeof window.onload != 'function') {
        window.onload = func;
    } else {
        window.onload = function() {
            if (oldonload) {
                oldonload();
            }
            func();
        }
    }
}
/*---------------------------------------------------------*/
/*Fix png picture for IE6*/
/*---------------------------------------------------------*/
function FixPng() {
    var arVersion = navigator.appVersion.split("MSIE")
    var version = parseFloat(arVersion[1])
    if ((version >= 5.5) && (version < 7) && (document.body.filters)) {
        for (var i = 0; i < document.images.length; i++) {
            var img = document.images[i]
            var imgName = img.src.toUpperCase()
            if (imgName.substring(imgName.length - 3, imgName.length) == "PNG") {
                var imgID = (img.id) ? "id='" + img.id + "' " : ""
                var imgClass = (img.className) ? "class='" + img.className + "' " : ""
                var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
                var imgStyle = "display:inline-block;" + img.style.cssText
                if (img.align == "left") imgStyle = "float:left;" + imgStyle
                if (img.align == "right") imgStyle = "float:right;" + imgStyle
                if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
                var strNewHTML = "<span " + imgID + imgClass + imgTitle
+ " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
+ "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
                img.outerHTML = strNewHTML
                i = i - 1
            }
        }
    }
}
addLoadEvent(FixPng);
/*---------------------------------------------------------*/
/* These fuctions set the colors over a tr in a table onMouseOver, onMouseOut,Onclicked.*/
/*---------------------------------------------------------*/
var lastClicked = null; 	// Last table row that was clicked
// Sets bgcolor on tablerow (usage: on onmouseover="trOnMouseOver(this, 'myOverColor')")	
function TrOnMouseOver(elem, cssClass) {
    if (elem != null) {
        if (lastClicked != null) {
            if (elem != lastClicked)
                elem.className = cssClass;
        }
        else
            elem.className = cssClass;
    }
}
// Removes bgcolor on tablerow (usage: on onmouseout="trOnMouseOut(this, 'myOutColor')")
function TrOnMouseOut(elem, cssClass) {
    if (elem != null && elem != lastClicked)
        elem.className = cssClass;
}
/*---------------------------------------------------------*/
/* These fuctions is for googlemaps.*/
/*---------------------------------------------------------*/
$(document).ready(function() { //Start script when ready
if (document.getElementById("map_canvas_Cruise")) {
    //Default map center location
    var defaultLat = 50.5;
    var defaultLon = -1.4;
    var markers = new Array();

    markers[0] = new Array(new GMarker(new GLatLng(34.05349, -118.245319)), "Los Angeles, California", "<strong>Los Angeles, California</strong><br/>The cruise start end end point");
    markers[1] = new Array(new GMarker(new GLatLng(22.880919, -109.9142)), "Cabo San Lucas, Mexico", "<strong>Cabo San Lucas, Mexico</strong><br/>The first stop for the cruise");
    markers[2] = new Array(new GMarker(new GLatLng(23.200015, -106.421769)), "Mazatlan, Mexico", "<strong>Mazatlan, Mexico</strong><br/>The second stop for the cruise");
    markers[3] = new Array(new GMarker(new GLatLng(20.61055, -105.233739)), "Puerto Vallarta, Mexico", "<strong>Puerto Vallarta, Mexico</strong><br/>The third stop for the cruise");

    var map = new google.maps.Map2($("#map_canvas_Cruise").get(0)); //Initialise google maps
    //map.addControl(new GLargeMapControl());
    map.addControl(new GSmallMapControl()); 
    map.addControl(new GMapTypeControl());
    map.setCenter(new GLatLng(defaultLat, defaultLon), 4); //Set location to the default and zoom level to 8
    map.disableDoubleClickZoom(); //Disable zooming

    $.each(markers, function(i, marker) {
        var delayTime = ((i * 3000) / (0.5 * markers.length)); //Delay time decreases as number of markers increases

        setTimeout(function() {
            map.addOverlay(marker[0]);
            $("<li />")
							.html(markers[i][1])//Use list item label from array
							.click(function() {
							    displayPoint(marker[0], i);
							    setActive(this); //Show active state
							})
							.appendTo("#map_list_Cruise");

            GEvent.addListener(marker[0], "click", function() {
                displayPoint(marker[0], i);
                setActive(i); //Show active location
            });

            displayPoint(marker[0], i);
            setActive(i); //Show active location
            if (i == (markers.length - 1)) {//If last item in array
                setTimeout(function() {//Remove active class and fade marker after delay
                    $("#map_message_Cruise").fadeOut();
                    //setActive();
                }, 3500);
            }
        }, delayTime);
    });

    $("#map_list_Cruise").css("opacity", "0.2").animate({ opacity: 1 }, 1100); //Fade in menu
    $("#map_message_Cruise").appendTo(map.getPane(G_MAP_FLOAT_SHADOW_PANE));

    function displayPoint(marker, index) {
        if ($('#map_message_Cruise').is(':hidden')) {//Allow toggling of markers
            $('#map_message_Cruise').fadeIn();
        }
        else {//Remove all .active classes and hide markers
            $('#map_message_Cruise').hide();
            $(".active").removeClass();
        }
        var moveEnd = GEvent.addListener(map, "moveend", function() {
            var markerOffset = map.fromLatLngToDivPixel(marker.getLatLng());
            $("#map_message_Cruise")
							.html(markers[index][2])//Use information from array
							.fadeIn()
							.css({ top: markerOffset.y, left: markerOffset.x });
            GEvent.removeListener(moveEnd);
        });
        map.panTo(marker.getLatLng());
    }

    function setActive(el) {
        $(".active").removeClass(); //Remove all .active classes
        $("#map_list_Cruise").find('li').eq(el).addClass('active'); //Find list element equal to index number and set active
        $(el).addClass('active'); //Set active if list element clicked directly
    }
} //End if map_canvas exists
});     //End onReady 


$(document).ready(function () { //Start script when ready
    if (document.getElementById("map_canvas_Dublin")) {
        //Default map center location
        var defaultLat = 50.5;
        var defaultLon = -1.4;
        var markers = new Array();

        markers[0] = new Array(new GMarker(new GLatLng(53.364667, -6.206557)), "Clontarf Castle Dublin", "<strong>Clontarf Castle Dublin</strong><br/>Castle AveDublin 3, Co. Dublin<br /><a href='http://www.clontarfcastle.ie' target='_blank'>www.clontarfcastle.ie</a>");       
        var map = new google.maps.Map2($("#map_canvas_Dublin").get(0)); //Initialise google maps
        map.addControl(new GLargeMapControl());
        map.addControl(new GMapTypeControl());
        map.setCenter(new GLatLng(defaultLat, defaultLon), 14); //Set location to the default and zoom level to 8
        map.disableDoubleClickZoom(); //Disable zooming

        $.each(markers, function (i, marker) {
            var delayTime = ((i * 3000) / (0.5 * markers.length)); //Delay time decreases as number of markers increases

            setTimeout(function () {
                map.addOverlay(marker[0]);
                $("<li />")
							.html(markers[i][1])//Use list item label from array
							.click(function () {
							    displayPoint(marker[0], i);
							    setActive(this); //Show active state
							})
							.appendTo("#map_list_Dublin");

                GEvent.addListener(marker[0], "click", function () {
                    displayPoint(marker[0], i);
                    setActive(i); //Show active location
                });

                displayPoint(marker[0], i);
                setActive(i); //Show active location
                if (i == (markers.length - 1)) {//If last item in array
                    setTimeout(function () {//Remove active class and fade marker after delay
                        $("#map_message_Dublin").fadeOut();
                        //setActive();
                    }, 3500);
                }
            }, delayTime);
        });

        $("#map_list_Dublin").css("opacity", "0.2").animate({ opacity: 1 }, 1100); //Fade in menu
        $("#map_message_Dublin").appendTo(map.getPane(G_MAP_FLOAT_SHADOW_PANE));

        function displayPoint(marker, index) {
            if ($('#map_message_Dublin').is(':hidden')) {//Allow toggling of markers
                $('#map_message_Dublin').fadeIn();
            }
            else {//Remove all .active classes and hide markers
                $('#map_message_Dublin').hide();
                $(".active").removeClass();
            }
            var moveEnd = GEvent.addListener(map, "moveend", function () {
                var markerOffset = map.fromLatLngToDivPixel(marker.getLatLng());
                $("#map_message_Dublin")
							.html(markers[index][2])//Use information from array
							.fadeIn()
							.css({ top: markerOffset.y, left: markerOffset.x });
                GEvent.removeListener(moveEnd);
            });
            map.panTo(marker.getLatLng());
        }

        function setActive(el) {
            $(".active").removeClass(); //Remove all .active classes
            $("#map_list_Dublin").find('li').eq(el).addClass('active'); //Find list element equal to index number and set active
            $(el).addClass('active'); //Set active if list element clicked directly
        }
    } //End if map_canvas exists
});     //End onReady 


//<!- PRAGUE MAP -->

$(document).ready(function () { //Start script when ready
    if (document.getElementById("map_canvas_Prague")) {
        //Default map center location
        var defaultLat = 50.5;
        var defaultLon = -1.4;
        var markers = new Array();
        
        // from google maps - casino location: 50.068985, 14.403269
        // hotel location: 50.07121,14.402335
        markers[0] = new Array(new GMarker(new GLatLng(50.07121, 14.402335)), "Andel's Hotel, Prague", "<strong>Andel's Hotel, Prague</strong><br/>Stroupežnického 21,150 00 Prague, Czech Republic<br /><a href='http://www.andelshotel.com/en/home/' target='_blank'>http://www.andelshotel.com/en/home/</a>");
        markers[1] = new Array(new GMarker(new GLatLng(50.068985, 14.403269)), "Card Casino Prague", "<strong>Card Casino Prague</strong><br/>Ostrovského 3, 150 00 Praha 5, Czech Republic<br /><a href='http://www.cardcasinoprague.cz/' target='_blank'>http://www.cardcasinoprague.cz/</a>");
        var map = new google.maps.Map2($("#map_canvas_Prague").get(0)); //Initialise google maps
        map.addControl(new GLargeMapControl());
        map.addControl(new GMapTypeControl());
        map.setCenter(new GLatLng(defaultLat, defaultLon), 14); //Set location to the default and zoom level to 8
        map.disableDoubleClickZoom(); //Disable zooming

        $.each(markers, function (i, marker) {
            var delayTime = ((i * 3000) / (0.5 * markers.length)); //Delay time decreases as number of markers increases

            setTimeout(function () {
                map.addOverlay(marker[0]);
                $("<li />")
							.html(markers[i][1])//Use list item label from array
							.click(function () {
							    displayPoint(marker[0], i);
							    setActive(this); //Show active state
							})
							.appendTo("#map_list_Prague");

                GEvent.addListener(marker[0], "click", function () {
                    displayPoint(marker[0], i);
                    setActive(i); //Show active location
                });

                displayPoint(marker[0], i);
                setActive(i); //Show active location
                if (i == (markers.length - 1)) {//If last item in array
                    setTimeout(function () {//Remove active class and fade marker after delay
                        $("#map_message_prague").fadeOut();
                        //setActive();
                    }, 3500);
                }
            }, delayTime);
        });

        $("#map_list_Prague").css("opacity", "0.2").animate({ opacity: 1 }, 1100); //Fade in menu
        $("#map_message_Prague").appendTo(map.getPane(G_MAP_FLOAT_SHADOW_PANE));

        function displayPoint(marker, index) {
            if ($('#map_message_Prague').is(':hidden')) {//Allow toggling of markers
                $('#map_message_Prague').fadeIn();
            }
            else {//Remove all .active classes and hide markers
                $('#map_message_Prague').hide();
                $(".active").removeClass();
            }
            var moveEnd = GEvent.addListener(map, "moveend", function () {
                var markerOffset = map.fromLatLngToDivPixel(marker.getLatLng());
                $("#map_message_Prague")
							.html(markers[index][2])//Use information from array
							.fadeIn()
							.css({ top: markerOffset.y, left: markerOffset.x });
                GEvent.removeListener(moveEnd);
            });
            map.panTo(marker.getLatLng());
        }

        function setActive(el) {
            $(".active").removeClass(); //Remove all .active classes
            $("#map_list_Prague").find('li').eq(el).addClass('active'); //Find list element equal to index number and set active
            $(el).addClass('active'); //Set active if list element clicked directly
        }
    } //End if map_canvas exists
});     //End onReady  

//<!-- PRAGUE -->


$(document).ready(function() { //Start script when ready
if (document.getElementById("map_canvas_Barcelona")) {
    //Default map center location
    var defaultLat = 50.5;
    var defaultLon = -1.4;
    var markers = new Array();

    markers[0] = new Array(new GMarker(new GLatLng(41.387135, 2.196627)), "Gran Casino  Barcelona", "<strong>Gran Casino Barcelona</strong><br/>C/ Marina, 19-21<br />(Port Olímpic)08005 Barcelona<br /><a href='http://www.casino-barcelona.com' target='_blank'>www.casino-barcelona.com</a>");
    markers[1] = new Array(new GMarker(new GLatLng(41.39285644060681, 2.1920299530029297)), "Hotel H10 Marina Barcelona ", "<strong>H10 Marina Barcelona</strong><br/>Av. Bogatell, 64-68<br />E-08005 Barcelona<br /><a href='http://www.hotelh10marinabarcelona.com/en/index.html' target='_blank'>website</a>");
    var map = new google.maps.Map2($("#map_canvas_Barcelona").get(0)); //Initialise google maps
    map.addControl(new GLargeMapControl());
    map.addControl(new GMapTypeControl());
    map.setCenter(new GLatLng(defaultLat, defaultLon), 14); //Set location to the default and zoom level to 8
    map.disableDoubleClickZoom(); //Disable zooming

    $.each(markers, function(i, marker) {
        var delayTime = ((i * 3000) / (0.5 * markers.length)); //Delay time decreases as number of markers increases

        setTimeout(function() {
            map.addOverlay(marker[0]);
            $("<li />")
							.html(markers[i][1])//Use list item label from array
							.click(function() {
							    displayPoint(marker[0], i);
							    setActive(this); //Show active state
							})
							.appendTo("#map_list_Barcelona");

            GEvent.addListener(marker[0], "click", function() {
                displayPoint(marker[0], i);
                setActive(i); //Show active location
            });

            displayPoint(marker[0], i);
            setActive(i); //Show active location
            if (i == (markers.length - 1)) {//If last item in array
                setTimeout(function() {//Remove active class and fade marker after delay
                $("#map_message_Barcelona").fadeOut();
                    //setActive();
                }, 3500);
            }
        }, delayTime);
    });

    $("#map_list_Barcelona").css("opacity", "0.2").animate({ opacity: 1 }, 1100); //Fade in menu
    $("#map_message_Barcelona").appendTo(map.getPane(G_MAP_FLOAT_SHADOW_PANE));

    function displayPoint(marker, index) {
        if ($('#map_message_Barcelona').is(':hidden')) {//Allow toggling of markers
            $('#map_message_Barcelona').fadeIn();
        }
        else {//Remove all .active classes and hide markers
            $('#map_message_Barcelona').hide();
            $(".active").removeClass();
        }
        var moveEnd = GEvent.addListener(map, "moveend", function() {
            var markerOffset = map.fromLatLngToDivPixel(marker.getLatLng());
            $("#map_message_Barcelona")
							.html(markers[index][2])//Use information from array
							.fadeIn()
							.css({ top: markerOffset.y, left: markerOffset.x });
            GEvent.removeListener(moveEnd);
        });
        map.panTo(marker.getLatLng());
    }

    function setActive(el) {
        $(".active").removeClass(); //Remove all .active classes
        $("#map_list_Barcelona").find('li').eq(el).addClass('active'); //Find list element equal to index number and set active
        $(el).addClass('active'); //Set active if list element clicked directly
    }
} //End if map_canvas exists
});     //End onReady  
$(document).ready(function() { //Start script when ready
if (document.getElementById("map_canvas_Italy")) {
    //Default map center location
    var defaultLat = 50.5;
    var defaultLon = -1.4;
    var markers = new Array();

    markers[0] = new Array(new GMarker(new GLatLng(45.969994, 8.970554)), "Casino di Campione", "<strong>Casino di Campione</strong><br/><a href='http://www.casinocampione.it/' target='_blank'>www.casinocampione.it</a>");
    markers[1] = new Array(new GMarker(new GLatLng(46.002975, 8.951305)), "Town Lugano", "<strong>Town Lugano</strong><br/>Lugano has numerous hotels which are close to Casino di Campione<br />Buses and ferrys goes from Lugano to Casino di Campione.<br />");
    /*markers[2] = new Array(new GMarker(new GLatLng(42.689293562069906, 27.706575393676758)), "Sunny Beach Casino", "<strong>Address Line</strong><br/>Some information<br />Can go here<br />01234 567 890<br /><a href='http://www.google.com'>google.com</a>");
    */
    var map = new google.maps.Map2($("#map_canvas_Italy").get(0)); //Initialise google maps
    map.addControl(new GLargeMapControl());
    map.addControl(new GMapTypeControl());
    map.setCenter(new GLatLng(defaultLat, defaultLon), 14); //Set location to the default and zoom level to 8
    map.disableDoubleClickZoom(); //Disable zooming

    $.each(markers, function(i, marker) {
        var delayTime = ((i * 3000) / (0.5 * markers.length)); //Delay time decreases as number of markers increases

        setTimeout(function() {
            map.addOverlay(marker[0]);
            $("<li />")
							.html(markers[i][1])//Use list item label from array
							.click(function() {
							    displayPoint(marker[0], i);
							    setActive(this); //Show active state
							})
							.appendTo("#map_list_Italy");

            GEvent.addListener(marker[0], "click", function() {
                displayPoint(marker[0], i);
                setActive(i); //Show active location
            });

            displayPoint(marker[0], i);
            setActive(i); //Show active location
            if (i == (markers.length - 1)) {//If last item in array
                setTimeout(function() {//Remove active class and fade marker after delay
                $("#map_message_Italy").fadeOut();
                    //setActive();
                }, 3500);
            }
        }, delayTime);
    });

    $("#map_list_Italy").css("opacity", "0.2").animate({ opacity: 1 }, 1100); //Fade in menu
    $("#map_message_Italy").appendTo(map.getPane(G_MAP_FLOAT_SHADOW_PANE));

    function displayPoint(marker, index) {
        if ($('#map_message_Italy').is(':hidden')) {//Allow toggling of markers
            $('#map_message_Italy').fadeIn();
        }
        else {//Remove all .active classes and hide markers
            $('#map_message_Italy').hide();
            $(".active").removeClass();
        }
        var moveEnd = GEvent.addListener(map, "moveend", function() {
            var markerOffset = map.fromLatLngToDivPixel(marker.getLatLng());
            $("#map_message_Italy")
							.html(markers[index][2])//Use information from array
							.fadeIn()
							.css({ top: markerOffset.y, left: markerOffset.x });
            GEvent.removeListener(moveEnd);
        });
        map.panTo(marker.getLatLng());
    }

    function setActive(el) {
        $(".active").removeClass(); //Remove all .active classes
        $("#map_list_Italy").find('li').eq(el).addClass('active'); //Find list element equal to index number and set active
        $(el).addClass('active'); //Set active if list element clicked directly
    }
} //End if map_canvas exists
});     //End onReady  
$(document).ready(function() { //Start script when ready
if (document.getElementById("map_canvas_Lissabon")) {
    //Default map center location
    var defaultLat = 50.5;
    var defaultLon = -1.4;
    var markers = new Array();

    markers[0] = new Array(new GMarker(new GLatLng(38.70743834083687, -9.39828872680664)), "Casino Estoril", "<strong>Casino Estoril</strong><br/>Praça José Teodoro dos Santos 2765-237 Estoril<br />Cascais, Portugal <br /><a href='http://www.casino-estoril.pt/MainTemplate.aspx' target='_blank'>www.casino-estoril.pt</a>");
    markers[1] = new Array(new GMarker(new GLatLng(38.69669, -9.42038)), "Hotel Vila Galé Cascais", "<strong>Hotel Vila Galé Cascais</strong><br/>Rua Frei Nicolau de Oliveira, no.80 <br />Parque da Gandarinha, 2750-641 Cascais, Portugal. <br /><a href='http://www.vilagale.pt/index.php?lang=2' target='_blank'>www.vilagale.pt</a>");
    markers[2] = new Array(new GMarker(new GLatLng(38.703499, -9.39741)), "Vila Galé Estoril Hotel", "<strong>Vila Galé Estoril Hotel</strong><br/>Av.Marginal - Apartado 49<br />2766-901 Estoril, Portugal.<br /><a href='http://www.vilagale.pt/index.php?lang=2' target='_blank'>www.vilagale.pt</a>");
    
    var map = new google.maps.Map2($("#map_canvas_Lissabon").get(0)); //Initialise google maps
    map.addControl(new GLargeMapControl());
    map.addControl(new GMapTypeControl());
    map.setCenter(new GLatLng(defaultLat, defaultLon), 14); //Set location to the default and zoom level to 8
    map.disableDoubleClickZoom(); //Disable zooming

    $.each(markers, function(i, marker) {
        var delayTime = ((i * 3000) / (0.5 * markers.length)); //Delay time decreases as number of markers increases

        setTimeout(function() {
            map.addOverlay(marker[0]);
            $("<li />")
							.html(markers[i][1])//Use list item label from array
							.click(function() {
							    displayPoint(marker[0], i);
							    setActive(this); //Show active state
							})
							.appendTo("#map_list_Lissabon");

            GEvent.addListener(marker[0], "click", function() {
                displayPoint(marker[0], i);
                setActive(i); //Show active location
            });

            displayPoint(marker[0], i);
            setActive(i); //Show active location
            if (i == (markers.length - 1)) {//If last item in array
                setTimeout(function() {//Remove active class and fade marker after delay
                $("#map_message_Lissabon").fadeOut();
                    //setActive();
                }, 3500);
            }
        }, delayTime);
    });

    $("#map_list_Lissabon").css("opacity", "0.2").animate({ opacity: 1 }, 1100); //Fade in menu
    $("#map_message_Lissabon").appendTo(map.getPane(G_MAP_FLOAT_SHADOW_PANE));

    function displayPoint(marker, index) {
        if ($('#map_message_Lissabon').is(':hidden')) {//Allow toggling of markers
            $('#map_message_Lissabon').fadeIn();
        }
        else {//Remove all .active classes and hide markers
            $('#map_message_Lissabon').hide();
            $(".active").removeClass();
        }
        var moveEnd = GEvent.addListener(map, "moveend", function() {
            var markerOffset = map.fromLatLngToDivPixel(marker.getLatLng());
            $("#map_message_Lissabon")
							.html(markers[index][2])//Use information from array
							.fadeIn()
							.css({ top: markerOffset.y, left: markerOffset.x });
            GEvent.removeListener(moveEnd);
        });
        map.panTo(marker.getLatLng());
    }

    function setActive(el) {
        $(".active").removeClass(); //Remove all .active classes
        $("#map_list_Lissabon").find('li').eq(el).addClass('active'); //Find list element equal to index number and set active
        $(el).addClass('active'); //Set active if list element clicked directly
    }
} //End if map_canvas exists
});     //End onReady  
$(document).ready(function() { //Start script when ready
if (document.getElementById("map_canvas_Malta")) {
    //Default map center location
    var defaultLat = 50.5;
    var defaultLon = -1.4;
    var markers = new Array();

    markers[0] = new Array(new GMarker(new GLatLng(35.88643548033453, 14.521350860595703)), "Casino di Venezia", "<strong>Casino di Venezia</strong><br/><a href='http://www.casinodivenezia.com.mt' target='_blank'>www.casinodivenezia.com.mt</a>");
    markers[1] = new Array(new GMarker(new GLatLng(35.897368, 14.504619)), "Grand Hotel Excelsior", "<strong>Grand Hotel Excelsior</strong><br/><a href='http://www.grandhotelexcelsior.com.mt/index.asp?m=1' target='_blank'>www.grandhotelexcelsior.com.mt/index.asp?m=1</a>");

    var map = new google.maps.Map2($("#map_canvas_Malta").get(0)); //Initialise google maps
    map.addControl(new GLargeMapControl());
    map.addControl(new GMapTypeControl());
    map.setCenter(new GLatLng(defaultLat, defaultLon), 14); //Set location to the default and zoom level to 8
    map.disableDoubleClickZoom(); //Disable zooming

    $.each(markers, function(i, marker) {
        var delayTime = ((i * 3000) / (0.5 * markers.length)); //Delay time decreases as number of markers increases

        setTimeout(function() {
            map.addOverlay(marker[0]);
            $("<li />")
							.html(markers[i][1])//Use list item label from array
							.click(function() {
							    displayPoint(marker[0], i);
							    setActive(this); //Show active state
							})
							.appendTo("#map_list_Malta");

            GEvent.addListener(marker[0], "click", function() {
                displayPoint(marker[0], i);
                setActive(i); //Show active location
            });

            displayPoint(marker[0], i);
            setActive(i); //Show active location
            if (i == (markers.length - 1)) {//If last item in array
                setTimeout(function() {//Remove active class and fade marker after delay
                $("#map_message_Malta").fadeOut();
                    //setActive();
                }, 3500);
            }
        }, delayTime);
    });

    $("#map_list_Malta").css("opacity", "0.2").animate({ opacity: 1 }, 1100); //Fade in menu
    $("#map_message_Malta").appendTo(map.getPane(G_MAP_FLOAT_SHADOW_PANE));

    function displayPoint(marker, index) {
        if ($('#map_message_Malta').is(':hidden')) {//Allow toggling of markers
            $('#map_message_Malta').fadeIn();
        }
        else {//Remove all .active classes and hide markers
            $('#map_message_Malta').hide();
            $(".active").removeClass();
        }
        var moveEnd = GEvent.addListener(map, "moveend", function() {
            var markerOffset = map.fromLatLngToDivPixel(marker.getLatLng());
            $("#map_message_Malta")
							.html(markers[index][2])//Use information from array
							.fadeIn()
							.css({ top: markerOffset.y, left: markerOffset.x });
            GEvent.removeListener(moveEnd);
        });
        map.panTo(marker.getLatLng());
    }

    function setActive(el) {
        $(".active").removeClass(); //Remove all .active classes
        $("#map_list_Malta").find('li').eq(el).addClass('active'); //Find list element equal to index number and set active
        $(el).addClass('active'); //Set active if list element clicked directly
    }
} //End if map_canvas exists
});     //End onReady  
$(document).ready(function() { //Start script when ready
if (document.getElementById("map_canvas_Bulgaria")) {
    //Default map center location
    var defaultLat = 50.5;
    var defaultLon = -1.4;
    var markers = new Array();

    markers[0] = new Array(new GMarker(new GLatLng(42.693135569603726, 27.708356380462646)), "Crystal Crown Casino", "<strong>Crystal Crown Casino</strong><br/>Sunny Beach, Bulgaria<br/><a href='http://www.crystal-crown.com/' rel='external' target='_blank'>Crystal Crown Casino</a>");
    markers[1] = new Array(new GMarker(new GLatLng(42.6913, 27.7109)), "Hotel Chaika Beach", "<strong>Hotel Chaika Beach</strong><br/>8240 Sunny Beach, Bulgaria<br/>");
        
        var map = new google.maps.Map2($("#map_canvas_Bulgaria").get(0)); //Initialise google maps
        map.addControl(new GLargeMapControl());
        map.addControl(new GMapTypeControl());
        map.setCenter(new GLatLng(defaultLat, defaultLon), 14); //Set location to the default and zoom level to 8
        map.disableDoubleClickZoom(); //Disable zooming

        $.each(markers, function(i, marker) {
            var delayTime = ((i * 3000) / (0.5 * markers.length)); //Delay time decreases as number of markers increases

            setTimeout(function() {
                map.addOverlay(marker[0]);
                $("<li />")
							.html(markers[i][1])//Use list item label from array
							.click(function() {
							    displayPoint(marker[0], i);
							    setActive(this); //Show active state
							})
							.appendTo("#map_list_Bulgaria");

                GEvent.addListener(marker[0], "click", function() {
                    displayPoint(marker[0], i);
                    setActive(i); //Show active location
                });

                displayPoint(marker[0], i);
                setActive(i); //Show active location
                if (i == (markers.length - 1)) {//If last item in array
                    setTimeout(function() {//Remove active class and fade marker after delay
                    $("#map_message_Bulgaria").fadeOut();
                        //setActive();
                    }, 3500);
                }
            }, delayTime);
        });

        $("#map_list_Bulgaria").css("opacity", "0.2").animate({ opacity: 1 }, 1100); //Fade in menu
        $("#map_message_Bulgaria").appendTo(map.getPane(G_MAP_FLOAT_SHADOW_PANE));

        function displayPoint(marker, index) {
            if ($('#map_message_Bulgaria').is(':hidden')) {//Allow toggling of markers
                $('#map_message_Bulgaria').fadeIn();
            }
            else {//Remove all .active classes and hide markers
                $('#map_message_Bulgaria').hide();
                $(".active").removeClass();
            }
            var moveEnd = GEvent.addListener(map, "moveend", function() {
                var markerOffset = map.fromLatLngToDivPixel(marker.getLatLng());
                $("#map_message_Bulgaria")
							.html(markers[index][2])//Use information from array
							.fadeIn()
							.css({ top: markerOffset.y, left: markerOffset.x });
                GEvent.removeListener(moveEnd);
            });
            map.panTo(marker.getLatLng());
        }

        function setActive(el) {
            $(".active").removeClass(); //Remove all .active classes
            $("#map_list_Bulgaria").find('li').eq(el).addClass('active'); //Find list element equal to index number and set active
            $(el).addClass('active'); //Set active if list element clicked directly
        }
    } //End if map_canvas exists
});     //End onReady
$(document).ready(function() { //Start script when ready
if (document.getElementById("map_canvas_GranCanaria")) {
        //Default map center location
        var defaultLat = 50.5;
        var defaultLon = -1.4;
        var markers = new Array();       
        markers[0] = new Array(new GMarker(new GLatLng(28.1214, -15.4276)), "Hotel Santa Catalina", "<strong>Hotel Santa Catalina</strong><br/>León y Castillo, 227<br/>35005 Las Palmas de Gran Canaria, Spain<br /><a href='http://www.hotelsantacatalina.com' rel='external' target='_blank'>www.hotelsantacatalina.com</a>");
        markers[1] = new Array(new GMarker(new GLatLng(28.127746, -15.429838)), "Casino Las Palmas", "<strong>Casino Las Palmas</strong><br/>C/ Simón Bolivar, 3 - Edificio Saba (Saba Building)<br/>Parque Santa Catalina (Santa Catalina Park)<br />35007 Las Palmas de Gran Canaria, Spain.<br /><a href='http://www.casinolaspalmas.com' rel='external' target='_blank'>www.casinolaspalmas.com</a>");
        
        var map = new google.maps.Map2($("#map_canvas_GranCanaria").get(0)); //Initialise google maps
        map.addControl(new GLargeMapControl());
        map.addControl(new GMapTypeControl());
        map.setCenter(new GLatLng(defaultLat, defaultLon), 15); //Set location to the default and zoom level to 8
        map.disableDoubleClickZoom(); //Disable zooming

        $.each(markers, function(i, marker) {
            var delayTime = ((i * 3000) / (0.5 * markers.length)); //Delay time decreases as number of markers increases

            setTimeout(function() {
                map.addOverlay(marker[0]);
                $("<li />")
							.html(markers[i][1])//Use list item label from array
							.click(function() {
							    displayPoint(marker[0], i);
							    setActive(this); //Show active state
							})
							.appendTo("#map_list_GranCanaria");

                GEvent.addListener(marker[0], "click", function() {
                    displayPoint(marker[0], i);
                    setActive(i); //Show active location
                });

                displayPoint(marker[0], i);
                setActive(i); //Show active location
                if (i == (markers.length - 1)) {//If last item in array
                    setTimeout(function() {//Remove active class and fade marker after delay
                    $("#map_message_GranCanaria").fadeOut();
                        //setActive();
                    }, 3500);
                }
            }, delayTime);
        });

        $("#map_list_GranCanaria").css("opacity", "0.2").animate({ opacity: 1 }, 1100); //Fade in menu
        $("#map_message_GranCanaria").appendTo(map.getPane(G_MAP_FLOAT_SHADOW_PANE));

        function displayPoint(marker, index) {
            if ($('#map_message_GranCanaria').is(':hidden')) {//Allow toggling of markers
                $('#map_message_GranCanaria').fadeIn();
            }
            else {//Remove all .active classes and hide markers
                $('#map_message_GranCanaria').hide();
                $(".active").removeClass();
            }
            var moveEnd = GEvent.addListener(map, "moveend", function() {
                var markerOffset = map.fromLatLngToDivPixel(marker.getLatLng());
                $("#map_message_GranCanaria")
							.html(markers[index][2])//Use information from array
							.fadeIn()
							.css({ top: markerOffset.y, left: markerOffset.x });
                GEvent.removeListener(moveEnd);
            });
            map.panTo(marker.getLatLng());
        }

        function setActive(el) {
            $(".active").removeClass(); //Remove all .active classes
            $("#map_list_GranCanaria").find('li').eq(el).addClass('active'); //Find list element equal to index number and set active
            $(el).addClass('active'); //Set active if list element clicked directly
        }
    } //End if map_canvas exists
});     //End onReady  

$(document).ready(function() { //Start script when ready
if (document.getElementById("map_canvas_Ljubljana")) {//Checks to see that the page element exists and to prevent conflict with other maps
        //Default map center location
        var defaultLat = 50.5;
        var defaultLon = -1.4;
        var markers = new Array();

        markers[0] = new Array(new GMarker(new GLatLng(46.08168, 14.513259)), "Grand Casino Ljubljana", "<strong>Grand Casino Ljubljana</strong><br/>Dunajska 154<br />1000 Ljubljana, Slovenia");
        markers[1] = new Array(new GMarker(new GLatLng(46.08166, 14.513258)), "Austria Trend Hotel Ljubljana", "<strong>Austria Trend Hotel Ljubljana</strong><br/>Dunajska 154<br />1000 Ljubljana, Slovenia<br /><a href='http://www.austria-trend.at/Hotel-Ljubljana' rel='external' target='_blank'>www.austria-trend.at</a>");
        /*
        markers[2] = new Array(new GMarker(new GLatLng(42.689293562069906, 27.706575393676758)), "Sunny Beach Casino", "<strong>Address Line</strong><br/>Some information<br />Can go here<br />01234 567 890<br /><a href='http://www.google.com'>google.com</a>");
        markers[3] = new Array(new GMarker(new GLatLng(51.41, -0.76)), "Location4", "<strong>Address Line</strong><br/>Some information<br />Can go here<br />01234 567 890");
        markers[4] = new Array(new GMarker(new GLatLng(50.93, -1.26)), "Location5", "<strong>Address Line</strong><br/>Some information<br />Can go here<br />01234 567 890<br /><a href='http://www.google.com'>google.com</a>");
        markers[5] = new Array(new GMarker(new GLatLng(50.75, -1.38999)), "Location6", "<strong>Address Line</strong><br/>Some information<br />Can go here<br />01234 567 890<br /><a href='http://www.google.com'>google.com</a>");
        */
        var map = new google.maps.Map2($("#map_canvas_Ljubljana").get(0)); //Initialise google maps
        map.addControl(new GLargeMapControl());
        map.addControl(new GMapTypeControl());
        map.setCenter(new GLatLng(defaultLat, defaultLon), 15); //Set location to the default and zoom level to 8
        map.disableDoubleClickZoom(); //Disable zooming

        //This section works fine but does not animate on load
        /*
        $(markers).each(function(i,marker){
        map.addOverlay(marker[0]);
        $("<li />")
        .html(markers[i][1])//Use list item label from array
        .click(function(){
        displayPoint(marker[0], i);
        setActive(this);//Show active state
        if ($('#map_message').is(':hidden')) {//Allow toggling of active state
        setActive();
        }
        })
        .appendTo("#map_list");
					
				    GEvent.addListener(marker[0], "click", function(){
        displayPoint(marker[0], i);
        setActive(i);//Show active location
        if ($('#map_message').is(':hidden')) {//Allow toggling of active state
        setActive();
        }
        });
        });
        */

        $.each(markers, function(i, marker) {
            var delayTime = ((i * 3000) / (0.5 * markers.length)); //Delay time decreases as number of markers increases

            setTimeout(function() {
                map.addOverlay(marker[0]);
                $("<li />")
							.html(markers[i][1])//Use list item label from array
							.click(function() {
							    displayPoint(marker[0], i);
							    setActive(this); //Show active state
							})
							.appendTo("#map_list_Ljubljana");

                GEvent.addListener(marker[0], "click", function() {
                    displayPoint(marker[0], i);
                    setActive(i); //Show active location
                });

                displayPoint(marker[0], i);
                setActive(i); //Show active location
                if (i == (markers.length - 1)) {//If last item in array
                    setTimeout(function() {//Remove active class and fade marker after delay
                    $("#map_message_Ljubljana").fadeOut();
                        //setActive();
                    }, 3500);
                }
            }, delayTime);
        });

        $("#map_list_Ljubljana").css("opacity", "0.2").animate({ opacity: 1 }, 1100); //Fade in menu
        $("#map_message_Ljubljana").appendTo(map.getPane(G_MAP_FLOAT_SHADOW_PANE));

        function displayPoint(marker, index) {
            if ($('#map_message_Ljubljana').is(':hidden')) {//Allow toggling of markers
                $('#map_message_Ljubljana').fadeIn();
            }
            else {//Remove all .active classes and hide markers
                $('#map_message_Ljubljana').hide();
                $(".active").removeClass();
            }
            var moveEnd = GEvent.addListener(map, "moveend", function() {
                var markerOffset = map.fromLatLngToDivPixel(marker.getLatLng());
                $("#map_message_Ljubljana")
							.html(markers[index][2])//Use information from array
							.fadeIn()
							.css({ top: markerOffset.y, left: markerOffset.x });
                GEvent.removeListener(moveEnd);
            });
            map.panTo(marker.getLatLng());
        }

        function setActive(el) {
            $(".active").removeClass(); //Remove all .active classes
            $("#map_list_Ljubljana").find('li').eq(el).addClass('active'); //Find list element equal to index number and set active
            $(el).addClass('active'); //Set active if list element clicked directly
        }
    } //End if map_canvas exists
});     //End onReady 
$(document).ready(function() { //Start script when ready
 if (document.getElementById("map_canvas_Warsaw")) {//Checks to see that the page element exists and to prevent conflict with other maps
        //Default map center location
        var defaultLat = 50.5;
        var defaultLon = -1.4;
        var markers = new Array();

        markers[0] = new Array(new GMarker(new GLatLng(52.236752, 21.003382)), "Olympic Casino Sunrise", "<strong>Olympic Casino Sunrise</strong><br/>Olympic Casino Sunrise Grzybowska 63 Str.<br />In Hilton Hotel, Warsaw<br /><a href='http://www.olympic-casino.com' target='_blank'>www.olympic-casino.com</a>");
        markers[1] = new Array(new GMarker(new GLatLng(52.236720, 21.003375)), "Hilton Warsaw Hotel", "<strong>Hilton Warsaw Hotel</strong><br/>Hilton Warsaw Hotel Grzybowska 63 Str.<br />, Warsaw<br /><a href='http://www1.hilton.com/en_US/hi/hotel/WAWHIHI-Hilton-Warsaw-Hotel-and-Convention-Centre/index.do' target='_blank'>Hilton Warsaw</a>");
        
        var map = new google.maps.Map2($("#map_canvas_Warsaw").get(0)); //Initialise google maps
        map.addControl(new GLargeMapControl());
        map.addControl(new GMapTypeControl());
        map.setCenter(new GLatLng(defaultLat, defaultLon), 15); //Set location to the default and zoom level to 8
        map.disableDoubleClickZoom(); //Disable zooming

        //This section works fine but does not animate on load
        /*
        $(markers).each(function(i,marker){
        map.addOverlay(marker[0]);
        $("<li />")
        .html(markers[i][1])//Use list item label from array
        .click(function(){
        displayPoint(marker[0], i);
        setActive(this);//Show active state
        if ($('#map_message').is(':hidden')) {//Allow toggling of active state
        setActive();
        }
        })
        .appendTo("#map_list");
					
				    GEvent.addListener(marker[0], "click", function(){
        displayPoint(marker[0], i);
        setActive(i);//Show active location
        if ($('#map_message').is(':hidden')) {//Allow toggling of active state
        setActive();
        }
        });
        });
        */

        $.each(markers, function(i, marker) {
            var delayTime = ((i * 3000) / (0.5 * markers.length)); //Delay time decreases as number of markers increases

            setTimeout(function() {
                map.addOverlay(marker[0]);
                $("<li />")
							.html(markers[i][1])//Use list item label from array
							.click(function() {
							    displayPoint(marker[0], i);
							    setActive(this); //Show active state
							})
							.appendTo("#map_list_Warsaw");

                GEvent.addListener(marker[0], "click", function() {
                    displayPoint(marker[0], i);
                    setActive(i); //Show active location
                });

                displayPoint(marker[0], i);
                setActive(i); //Show active location
                if (i == (markers.length - 1)) {//If last item in array
                    setTimeout(function() {//Remove active class and fade marker after delay
                    $("#map_message_Warsaw").fadeOut();
                        //setActive();
                    }, 3500);
                }
            }, delayTime);
        });

        $("#map_list_Warsaw").css("opacity", "0.2").animate({ opacity: 1 }, 1100); //Fade in menu
        $("#map_message_Warsaw").appendTo(map.getPane(G_MAP_FLOAT_SHADOW_PANE));

        function displayPoint(marker, index) {
            if ($('#map_message_Warsaw').is(':hidden')) {//Allow toggling of markers
                $('#map_message_Warsaw').fadeIn();
            }
            else {//Remove all .active classes and hide markers
                $('#map_message_Warsaw').hide();
                $(".active").removeClass();
            }
            var moveEnd = GEvent.addListener(map, "moveend", function() {
                var markerOffset = map.fromLatLngToDivPixel(marker.getLatLng());
                $("#map_message_Warsaw")
							.html(markers[index][2])//Use information from array
							.fadeIn()
							.css({ top: markerOffset.y, left: markerOffset.x });
                GEvent.removeListener(moveEnd);
            });
            map.panTo(marker.getLatLng());
        }

        function setActive(el) {
            $(".active").removeClass(); //Remove all .active classes
            $("#map_list_Warsaw").find('li').eq(el).addClass('active'); //Find list element equal to index number and set active
            $(el).addClass('active'); //Set active if list element clicked directly
        }
    } //End if map_canvas exists
});     //End onReady

$(document).ready(function () { //Start script when ready
    if (document.getElementById("map_canvas_Riga")) {
        //Default map center location
        var defaultLat = 50.5;
        var defaultLon = -1.4;
        var markers = new Array();

        markers[0] = new Array(new GMarker(new GLatLng(56.95955446765498, 24.13318634033203)), "Royal Casino Spa & Hotel Resort", "<strong>Royal Casino Spa & Hotel Resort</strong><br/>Riga, Latvia<br/><a href='http://www.royalcasino.lv/' target='_blank'>Royal Casino Spa & Hotel Resort</a>");
        markers[1] = new Array(new GMarker(new GLatLng(56.952054406382494, 24.120547771453857)), "Radisson Blu Hotels & Resort", "<strong>Radisson Blu Hotels & Resort</strong><br/>Riga, Latvia<br/><a href='http://www.radissonblu.com/elizabetehotel-riga' target='_blank'>Radisson Blu Hotels & Resort</a>");
     


        var map = new google.maps.Map2($("#map_canvas_Riga").get(0)); //Initialise google maps
        map.addControl(new GLargeMapControl());
        map.addControl(new GMapTypeControl());
        map.setCenter(new GLatLng(defaultLat, defaultLon), 14); //Set location to the default and zoom level to 8
        map.disableDoubleClickZoom(); //Disable zooming

        $.each(markers, function (i, marker) {
            var delayTime = ((i * 3000) / (0.5 * markers.length)); //Delay time decreases as number of markers increases

            setTimeout(function () {
                map.addOverlay(marker[0]);
                $("<li />")
							.html(markers[i][1])//Use list item label from array
							.click(function () {
							    displayPoint(marker[0], i);
							    setActive(this); //Show active state
							})
							.appendTo("#map_list_Riga");

                GEvent.addListener(marker[0], "click", function () {
                    displayPoint(marker[0], i);
                    setActive(i); //Show active location
                });

                displayPoint(marker[0], i);
                setActive(i); //Show active location
                if (i == (markers.length - 1)) {//If last item in array
                    setTimeout(function () {//Remove active class and fade marker after delay
                        $("#map_message_Riga").fadeOut();
                        //setActive();
                    }, 3500);
                }
            }, delayTime);
        });

        $("#map_list_Riga").css("opacity", "0.2").animate({ opacity: 1 }, 1100); //Fade in menu
        $("#map_message_Riga").appendTo(map.getPane(G_MAP_FLOAT_SHADOW_PANE));

        function displayPoint(marker, index) {
            if ($('#map_message_Riga').is(':hidden')) {//Allow toggling of markers
                $('#map_message_Riga').fadeIn();
            }
            else {//Remove all .active classes and hide markers
                $('#map_message_Riga').hide();
                $(".active").removeClass();
            }
            var moveEnd = GEvent.addListener(map, "moveend", function () {
                var markerOffset = map.fromLatLngToDivPixel(marker.getLatLng());
                $("#map_message_Riga")
							.html(markers[index][2])//Use information from array
							.fadeIn()
							.css({ top: markerOffset.y, left: markerOffset.x });
                GEvent.removeListener(moveEnd);
            });
            map.panTo(marker.getLatLng());
        }

        function setActive(el) {
            $(".active").removeClass(); //Remove all .active classes
            $("#map_list_Riga").find('li').eq(el).addClass('active'); //Find list element equal to index number and set active
            $(el).addClass('active'); //Set active if list element clicked directly
        }
    } //End if map_canvas exists
});     //End onReady




//Start of Premium partner slideshow.


function theRotator(type) {
    switch (type) {
        case 1:
            //Set the opacity of all images to 0
            $('div#rotator1 ul li').css({ opacity: 0.0 });

            //Get the first image and display it (gets set to full opacity)
            $('div#rotator1 ul li:first').css({ opacity: 1.0 });
            setInterval('rotate(1)', 2000);
            break;
        case 2:
            //Set the opacity of all images to 0
            $('div#rotator2 ul li').css({ opacity: 0.0 });

            //Get the first image and display it (gets set to full opacity)
            $('div#rotator2 ul li:first').css({ opacity: 1.0 });
            setInterval('rotate(2)', 2000);
            break;
        case 3:
            //Set the opacity of all images to 0
            $('div#rotator3 ul li').css({ opacity: 0.0 });

            //Get the first image and display it (gets set to full opacity)
            $('div#rotator3 ul li:first').css({ opacity: 1.0 });
            setInterval('rotate(3)', 2000);
            break;
        default:
            alert('error1');
            break;
    }
    
    /*
    //Set the opacity of all images to 0
    $('div#rotator2 ul li').css({ opacity: 0.0 });

    //Get the first image and display it (gets set to full opacity)
    $('div#rotator2 ul li:first').css({ opacity: 1.0 });

    //Set the opacity of all images to 0
    $('div#rotator3 ul li').css({ opacity: 0.0 });

    //Get the first image and display it (gets set to full opacity)
    $('div#rotator3 ul li:first').css({ opacity: 1.0 });
    */
    //Call the rotator function to run the slideshow, 6000 = change to next image after 6 seconds
    //setInterval('rotate()', 3000);

}

function rotate(type) {
    switch (type) {
        case 1:
            //Get the first image
            var current = ($('div#rotator1 ul li.show') ? $('div#rotator1 ul li.show') : $('div#rotator1 ul li:first'));
            //Get next image, when it reaches the end, rotate it back to the first image
            var next = ((current.next().length) ? ((current.next().hasClass('show')) ? $('div#rotator1 ul li:first') : current.next()) : $('div#rotator1 ul li:first'));
            next.css({ opacity: 0.0 }).addClass('show').animate({ opacity: 1.0 }, 500);
            current.animate({ opacity: 0.0 }, 500).removeClass('show');
            break;
        case 2:
            //Get the first image
            var current2 = ($('div#rotator2 ul li.show') ? $('div#rotator2 ul li.show') : $('div#rotator2 ul li:first'));
            //Get next image, when it reaches the end, rotate it back to the first image
            var next2 = ((current2.next().length) ? ((current2.next().hasClass('show')) ? $('div#rotator2 ul li:first') : current2.next()) : $('div#rotator2 ul li:first'));
            next2.css({ opacity: 0.0 }).addClass('show').animate({ opacity: 1.0 }, 500);
            current2.animate({ opacity: 0.0 }, 500).removeClass('show');
            break;
        case 3:
            //Get the first image
            var current3 = ($('div#rotator3 ul li.show') ? $('div#rotator3 ul li.show') : $('div#rotator3 ul li:first'));
            //Get next image, when it reaches the end, rotate it back to the first image
            var next3 = ((current3.next().length) ? ((current3.next().hasClass('show')) ? $('div#rotator3 ul li:first') : current3.next()) : $('div#rotator3 ul li:first'));
            next3.css({ opacity: 0.0 }).addClass('show').animate({ opacity: 1.0 }, 500);
            current3.animate({ opacity: 0.0 }, 500).removeClass('show');
            break;    
        default:
            alert('error2');
            break;
    }
    
    //Get the first image
    //var current2 = ($('div#rotator2 ul li.show') ? $('div#rotator2 ul li.show') : $('div#rotator2 ul li:first'));

    //Get next image, when it reaches the end, rotate it back to the first image
    //var next2 = ((current.next().length) ? ((current.next().hasClass('show')) ? $('div#rotator2 ul li:first') : current.next()) : $('div#rotator2 ul li:first'));

    //Get the first image
    //var current3 = ($('div#rotator3 ul li.show') ? $('div#rotator3 ul li.show') : $('div#rotator3 ul li:first'));

    //Get next image, when it reaches the end, rotate it back to the first image
    //var next3 = ((current.next().length) ? ((current.next().hasClass('show')) ? $('div#rotator3 ul li:first') : current.next()) : $('div#rotator3 ul li:first'));

    //Set the fade in effect for the next image, the show class has higher z-index
    /*
    next.css({ opacity: 0.0 })
	.addClass('show')
	.animate({ opacity: 1.0 }, 500);
	*/
    /*
    next1.css({ opacity: 0.0 })
    .addClass('show')
    .animate({ opacity: 1.0 }, 500);*/
    /*
    next2.css({ opacity: 0.0 })
    .addClass('show')
    .animate({ opacity: 1.0 }, 500);*/
    /*
    next3.css({ opacity: 0.0 })
    .addClass('show')
    .animate({ opacity: 1.0 }, 500);*/

    //Hide the current image
    /*
    current.animate({ opacity: 0.0 }, 500)
	.removeClass('show');
    current1.animate({ opacity: 0.0 }, 500)
    .removeClass('show');
    current2.animate({ opacity: 0.0 }, 500).removeClass('show');
    current3.animate({ opacity: 0.0 }, 500).removeClass('show');
    */

};

$(document).ready(function() {
    //Load the slideshow
    if (document.getElementById("rotator1") != undefined || document.getElementById("rotator1") != null) {
        theRotator(1);
    }
    if (document.getElementById("rotator2") != undefined || document.getElementById("rotator2") != null) {
        theRotator(2);
    }
    if (document.getElementById("rotator3") != undefined || document.getElementById("rotator3") != null) {
        theRotator(3);
    }
});

//End of Premium partner slideshow.

//Start: Activate tabs in News/Live Reporting/Twitter puff.
$(document).ready(function () {

	//When page loads...
	//Start: Activates News tab (comment away this code and remove comments from Activates live reporting tab to activate second tab)

	// 0 - news
	// 1 - live reporting
	// 2 - twitter
	var activeTab = 1;
	var idListItem;

	switch (activeTab) {
		case 0: 
			idListItem = "#liNewsTab"; break;
		case 1:
			idListItem = "#liLiveTab"; break;
		case 2:
			idListItem = "#liTwitterTab"; break;
	}; 
	//
	$(".tab_content").hide(); //Hide all content
	$(idListItem).addClass("active").show();
	$(".tab_content").eq(activeTab).show();

	//Start: Activates Live Reporting tab
	/*
	$(".tab_content").hide(); //Hide all content
	$("ul.tabs li:last").addClass("active").show(); //Activate second tab
	$(".tab_content:last").show(); //Show second tab content
	*/

	//Start: Activates the next tab to the right of the first tab (not specific to any content, just the second tab.
	/*
	$(".tab_content").hide();
	$("ul.tabs li:first").next().addClass("active").show();
	$(".tab_content:first").next().show();
	*/

	//Start: Testing some animations for hovering the tabs..
	/*var navDuration = 150;
	var navJumpHeight = "0.08em";
    
	$('ul.tabs li').hover(function(){
	$(this).animate({top : "-="+navJumpHeight},navDuration);
	}, function(){
	$(this).animate({ top : "0px" }, navDuration);
            
	});*/

	//On Click Event
	$("ul.tabs li").click(function () {

		$("ul.tabs li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab_content").hide(); //Hide all tab content

		var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active ID content
		return false;
	});

});
//End: Activate tabs in News/Live Reporting/Blog puff.

//Start: Hide and show effect for FAQ.
$(document).ready(function() {

    $(".accordion h3:first").addClass("active");
    $(".accordion p:not(:first)").hide();

    $(".accordion h3").click(function() {
        $(this).next("p").slideToggle("slow")
        $(this).next("table").slideTogge("slow")
		.siblings("p:visible").slideUp("slow");
        $(this).toggleClass("active");
        $(this).siblings("h3").removeClass("active");
    });

});
//End: Hide and show effect for FAQ.

//Start: Share info
$(function() {
    $('.bubbleInfo').each(function() {
        var distance = 10;
        var time = 250;
        var hideDelay = 500;

        var hideDelayTimer = null;

        var beingShown = false;
        var shown = false;
        var trigger = $('.trigger', this);
        var info = $('.popup', this).css('opacity', 0);


        $([trigger.get(0), info.get(0)]).mouseover(function() {
            if (hideDelayTimer) clearTimeout(hideDelayTimer);
            if (beingShown || shown) {
                // don't trigger the animation again
                return;
            } else {
                // reset position of info box
                beingShown = true;

                info.css({
                    top: -90,
                    left: -33,
                    display: 'block'
                }).animate({
                    top: '-=' + distance + 'px',
                    opacity: 1
                }, time, 'swing', function() {
                    beingShown = false;
                    shown = true;
                });
            }

            return false;
        }).mouseout(function() {
            if (hideDelayTimer) clearTimeout(hideDelayTimer);
            hideDelayTimer = setTimeout(function() {
                hideDelayTimer = null;
                info.animate({
                    top: '-=' + distance + 'px',
                    opacity: 0
                }, time, 'swing', function() {
                    shown = false;
                    info.css('display', 'none');
                });

            }, hideDelay);

            return false;
        });
    });
});

//End: Share info.

// Email.js version 5 To prevent spam mails.
var tld_ = new Array()
tld_[0] = "com";
tld_[1] = "org";
tld_[2] = "net";
tld_[3] = "ws";
tld_[4] = "info";
tld_[10] = "co.uk";
tld_[11] = "org.uk";
tld_[12] = "gov.uk";
tld_[13] = "ac.uk";
var topDom_ = 13;
var m_ = "mailto:";
var a_ = "@";
var d_ = ".";

function mail(name, dom, tl, params)
{
	var s = e(name,dom,tl);
	document.write('<a href="'+m_+s+params+'">'+s+'</a>');
}
function mail2(name, dom, tl, params, display)
{
	document.write('<a href="'+m_+e(name,dom,tl)+params+'">'+display+'</a>');
}
function e(name, dom, tl)
{
	var s = name+a_;
	if (tl!=-2)
	{
		s+= dom;
		if (tl>=0)
			s+= d_+tld_[tl];
	}
	else
		s+= swapper(dom);
	return s;
}
function swapper(d)
{
	var s = "";
	for (var i=0; i<d.length; i+=2)
		if (i+1==d.length)
			s+= d.charAt(i)
		else
			s+= d.charAt(i+1)+d.charAt(i);
	return s.replace(/\?/g,'.');
}



