/**
 * Note: The functions contained in this file are for demonstration purposes
 * only and are not necessary in your own project.
 *
 *
 *
 * http://www.shadowbox-js.com/index.html
 */

function initDemos(){
    // setup flash gallery demo, use a css selector
    Shadowbox.setup('a.flash-gallery', {
        gallery:        'Flash',
        continuous:     true,
        counterType:    'skip',
        animSequence:   'sync'
    });

    // setup image map demo
   // Shadowbox.setup(document.getElementById('hongkongmap').getElementsByTagName('area'));
}


//<p><a class="option" onclick="GoogleMaps(41.500736,-5.000326,'&lt;b&gt;Polic&iacute;a Local &lt;/b&gt;&lt;br /&gt;Plaza Mayor 1, 47100, Tordesillas ');" href="#">Ver mapa</a> &gt;&gt;</p>
function GoogleMaps(latitud,longitud,texto){
    Shadowbox.open({
        player:     'html',
        content:    '',
        height:     300,
        width:      500,
        options:    {
            onFinish: function(item){
                if(GBrowserIsCompatible()){
                    var body = document.getElementById(Shadowbox.contentId());
                    var map = new GMap2(body);
                    map.setCenter(new GLatLng(latitud,longitud), 16);
					map.openInfoWindowHtml(new GLatLng(latitud,longitud),"<span class='texto_mapa'>"+texto+"</span>");

                    // add 10 markers to the map at random locations
                   // var bounds = map.getBounds();
//                    var southWest = bounds.getSouthWest();
//                    var northEast = bounds.getNorthEast();
//                    var lngSpan = northEast.lng() - southWest.lng();
//                    var latSpan = northEast.lat() - southWest.lat();
//                    for(var i = 0; i < 10; i++){
//                        var point = new GLatLng(southWest.lat() + latSpan * Math.random(),
//                            southWest.lng() + lngSpan * Math.random());
//                        map.addOverlay(new GMarker(point));
//                    }

                    // add some simple controls
//                    map.addControl(new GSmallMapControl());
                    map.addControl(new GSmallMapControl());
                    map.addControl(new GMapTypeControl());
                }
            }
        }
		
    });
}

function MensajeShadow(texto, color){
	
	var existeColor = (color) ? color : false;
	if(existeColor == false) color = "d3d4d2";
	
    Shadowbox.open({
        player:     'html',
        content:    '<div><p id="alerta">'+ texto +'<br /><br /><a href="#" onclick="Shadowbox.close();" title="cerrar ventana">aceptar</a></p></div>',
		width:      500,
        height:     150,
		options: { overlayColor: "#"+color}
    });
}

function demoGallery(){
    var options = {
        continuous: true
    };

    var img = {
        player:     'img',
        content:    'gallery/aston_martin/vanquish.jpg',
        options:    options
    };

    var video = {
        player:     'iframe',
        content:    'http://www.youtube.com/v/y8Kyi0WNg40&amp;autoplay=1',
        height:     340,
        width:      405,
        title:      'Dramatic Look',
        options:    options
    };

    Shadowbox.open([img, video]);
}

function Procesar_Shadow(tipo,contenido,ancho,alto)
{
	
	Shadowbox.open({
					   content: contenido
					   ,player: tipo
					   ,height:alto
					   ,width:ancho 
					   ,options: { overlayColor: "#333",overlayOpacity: '0.3', resizeDuration: '0', autoDimensions: false, slideshowDelay:'0', modal: true,animate:false}
					});
}

function Abrir_Shadow(tipo,contenido,ancho,alto)
{
	
	Shadowbox.open({
					   content: contenido
					   ,player: tipo
					   ,height:alto
					   ,width:ancho 
					});
}

function Cerrar_Shadow()
{
		Shadowbox.close();	
}

window.onload = initDemos;
