/**
 * Note: The functions contained in this file are for demonstration purposes
 * only and are certainly not necessary in your own project.
 */
function initDemos(){

    // setup flash gallery demo
    Shadowbox.setup([
        document.getElementById('flash1'),
        document.getElementById('flash2'),
        document.getElementById('flash3')
    ], {
        gallery:        'Flash',
        continuous:     true,
        counterType:    'skip',
        animSequence:   'sync'
    });

    // setup image map demo
    Shadowbox.setup(document.getElementById('hongkongmap').getElementsByTagName('area'));

};

function demoMap(){

    Shadowbox.open({
        player:     'html',
        content:    '',
        height:     300,
        width:      500,
        options:    {
            onFinish: function(item){
                if(GBrowserIsCompatible()){
                    var map = new GMap2(document.getElementById('shadowbox_content'));
                    map.setCenter(new GLatLng(37.4419, -122.1419), 13);

                    // 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 GMapTypeControl());
                }
            }
        }
    });

};

function demoMessage(){

    Shadowbox.open({
        player:     'html',
        content:    '<div class="shadowbox_message">You\'re using <a href="http://www.mjijackson.com/shadowbox">Shadowbox</a>!</div>',
        height:     100,
        width:      200
    });

};

function demoGallery(URLFOTO){

    var img = {
        player:     'img',
        content:    URLFOTO
    };

    Shadowbox.open([img], {
        continuous: true
    });

};
function msg_windows(msg){
    var s = window.parent.Shadowbox;

    s.open({
        player:     'html',
        title:      'Information',
        content:    '<div style="padding-top:40px;text-align:center;color:#fff">'+ msg +'</div>',
        width:      300,
        height:     100
    });
};
function concours(url,titulo,ancho,alto){
    //var s = window.parent.Shadowbox;
	var param='&nom='+ $("#elm_15").val()+'&pre='+ $('#elm_17').val()+'&pais='+$('#elm_27').val()+'&dep='+$('#elm_25').val()+'&cod='+$('#elm_29').val();
	//alert(param);
    Shadowbox.open({
        player:     'iframe',
        title:      titulo,
        content:    url+param,
        width:      ancho,
        height:     alto
    });
};
function image_show(url,titulo,ancho,alto){

    Shadowbox.open({
        player:     'iframe',
        title:      titulo,
        content:    url,
        width:      ancho,
        height:     alto
    });
};
function concours_frame(url,titulo,ancho,alto){
    var s = window.parent.Shadowbox;
    s.open({
        player:     'iframe',
        title:      titulo,
        content:    url,
        width:      ancho,
        height:     alto
    });
};

