﻿//
// Default.aspx  
//

AddUnloadEvent(Gallery_Unload);

function AddLoadEvent(func) 
{ 
    var oldonload = window.onload;
    
   
    if (typeof window.onload != 'function') 
    { 
        window.onload = func; 
    } 
    else 
    {
        window.onload = function() 
        { 
            oldonload();
            func();
        }
    }
}

function AddUnloadEvent(func) 
{ 
    var oldonunload = window.onunload;
    
   
    if (typeof window.onunload != 'function') 
    { 
        window.onunload = func; 
    } 
    else 
    {
        window.onunload = function() 
        { 
            oldonunload();
            func();
        }
    }
}

function Gallery_Load() {

    MapInfo2D_Load();
    Contact_Load();
}

function Gallery_Unload() {

    GUnload();
}

function Contact_LocalizeValidator(id, setInnerHtml) {

    var myHiddenField_ErrorMessage
        = document.getElementById("dnn_ctr434_Contact_HiddenField_" + id.toString() + "_ErrorMessage");

    var myHiddenField_Text
        = document.getElementById("dnn_ctr434_Contact_HiddenField_" + id + "_Text");

    var errorMessage = myHiddenField_ErrorMessage.getAttribute("value");
    var text = myHiddenField_Text.getAttribute("value");

    var myValidator
        = document.getElementById("dnn_ctr434_Contact_WizardNotifierSelectionOeuvres_" + id);
    
    if (myValidator != undefined) {
        myValidator.setAttribute("errormessage", errorMessage);
        myValidator.setAttribute("text", text);
        if (setInnerHtml == "yes") myValidator.innerHTML = text;
    }
}

function Contact_Load() {

    //Email obligatoire
    Contact_LocalizeValidator("ValidateurCourriel", "no");    

    //Format Email
    Contact_LocalizeValidator("ValidateurFormatCourriel", "no");    

    //Longueur Message:
    Contact_LocalizeValidator("ValidateurMessage", "yes");    

}

//function Contact_Load() {

//    //Email obligatoire
//    var myHiddenField_ValidateurCourriel_ErrorMessage
//        = document.getElementById("dnn_ctr434_Contact_HiddenField_ValidateurCourriel_ErrorMessage");

//    var validateurCourrielErrorMessage = myHiddenField_ValidateurCourriel_ErrorMessage.getAttribute("value");

//    var myValidateurCourriel
//        = document.getElementById('dnn_ctr434_Contact_WizardNotifierSelectionOeuvres_ValidateurCourriel');


//    var myHiddenField_ValidateurCourriel_Text
//        = document.getElementById("dnn_ctr434_Contact_HiddenField_ValidateurCourriel_Text");

//    var validateurCourrielText = myHiddenField_ValidateurCourriel_Text.getAttribute("value");

//    var myValidateurCourrielText
//        = document.getElementById('dnn_ctr434_Contact_WizardNotifierSelectionOeuvres_ValidateurCourriel');

//    if (myValidateurCourriel != undefined) {
//        myValidateurCourriel.setAttribute("errormessage", validateurCourrielErrorMessage);
//        myValidateurCourriel.setAttribute("text", validateurCourrielText);
//    }    
//    

//    //Format Email
//    var myHiddenField_ValidateurFormatCourriel_ErrorMessage
//        = document.getElementById("dnn_ctr434_Contact_HiddenField_ValidateurFormatCourriel_ErrorMessage");

//    var validateurFormatCourrielErrorMessage = myHiddenField_ValidateurFormatCourriel_ErrorMessage.getAttribute("value");

//    var myValidateurFormatCourrielErrorMessage
//        = document.getElementById('dnn_ctr434_Contact_WizardNotifierSelectionOeuvres_ValidateurFormatCourriel');

//    if (myValidateurFormatCourrielErrorMessage != undefined) {
//        myValidateurFormatCourrielErrorMessage.setAttribute("errormessage", validateurFormatCourrielErrorMessage);
//    }

//    var myHiddenField_ValidateurFormatCourriel_ErrorMessage
//        = document.getElementById("dnn_ctr434_Contact_HiddenField_ValidateurFormatCourriel_ErrorMessage");

//    var validateurFormatCourrielErrorMessage = myHiddenField_ValidateurFormatCourriel_ErrorMessage.getAttribute("value");

//    var myValidateurFormatCourriel
//        = document.getElementById('dnn_ctr434_Contact_WizardNotifierSelectionOeuvres_ValidateurFormatCourriel');

//    if (myValidateurFormatCourriel != undefined) {
//        myValidateurFormatCourriel.setAttribute("text", validateurFormatCourrielErrorMessage);
//    }
//    
//    
//    //Longueur Message:
//    var myHiddenField_ValidateurMessage_ErrorMessage
//        = document.getElementById("dnn_ctr434_Contact_HiddenField_ValidateurMessage_ErrorMessage");

//    var validateurMessageErrorMessage = myHiddenField_ValidateurMessage_ErrorMessage.getAttribute("value");

//    var myValidateurMessageErrorMessage
//        = document.getElementById('dnn_ctr434_Contact_WizardNotifierSelectionOeuvres_ValidateurMessage');

//    if (myValidateurMessageErrorMessage != undefined) {
//        myValidateurMessageErrorMessage.setAttribute("errormessage", validateurMessageErrorMessage);
//    }

//    var myHiddenField_ValidateurMessage_ErrorMessage
//        = document.getElementById("dnn_ctr434_Contact_HiddenField_ValidateurMessage_ErrorMessage");

//    var validateurMessageErrorMessage = myHiddenField_ValidateurMessage_ErrorMessage.getAttribute("value");

//    var myValidateurMessageText
//        = document.getElementById('dnn_ctr434_Contact_WizardNotifierSelectionOeuvres_ValidateurMessage');

//    if (myValidateurMessageText != undefined) {
//        myValidateurMessageText.setAttribute("text", validateurMessageErrorMessage);
//    }    
//}

function Contact_Unload() {

}


//
// MapInfo2D.ascx  
//

	
//<![CDATA[
function MapInfo2D_Load() {

  if (GBrowserIsCompatible()) {

    var map = new GMap2(document.getElementById("map"));
    

    map.addControl(new GSmallMapControl());
    map.addControl(new GMapTypeControl());
    map.setCenter(new GLatLng(47.865588, -4.222019), 17);
    
    // Create a base icon for all of our markers that specifies the
    // shadow, icon dimensions, etc.
    var baseIcon = new GIcon(G_DEFAULT_ICON);
    baseIcon.shadow = "http://www.google.com/mapfiles/shadow50.png";
    baseIcon.iconSize = new GSize(20, 34);
    baseIcon.shadowSize = new GSize(37, 34);
    baseIcon.iconAnchor = new GPoint(9, 34);
    baseIcon.infoWindowAnchor = new GPoint(9, 2);
    
    // Creates a marker whose info window displays the letter corresponding
    // to the given index.
    
    function createMarker(point, index) {  
    // Create a lettered icon for this point using our icon class  
    var letteredIcon = new GIcon(baseIcon);  
    letteredIcon.image = "http://www.google.com/mapfiles/marker.png";  
    
    // Set up our GMarkerOptions object  
    markerOptions = { icon:letteredIcon };  
    var marker = new GMarker(point, markerOptions);  
    GEvent.addListener(
        marker, 
        "click", 
        function() 
        {    
            marker.openInfoWindowHtml(
                "<b>Galerie B</b>"
                + "<br />6 rue Jean Le Berre"
                + "<br />29120 Pont L'Abbé"
                + "<br />Tél/Fax: 02 98 87 12 97"
                + "<br />Mail: <a href=\"mailto:galerieb29120@gmail.com\">galerieb29120@gmail.com</a>"
                + "<br />Site Web: <a href=\"http://galerie-b.biz\">http://galerie-b.biz</a>");
        });
        
        return marker;
    }
    
    var point = new GLatLng(47.865588, -4.222019);
                            
    map.addOverlay(createMarker(point, 0));

  }
}
//]]>  


//
// Contact.ascx
//




