/**
 * @package: EGPS - Easy Sell for Google Photo
 */
$ = jQuery; 

$('document').ready(function () {

    $('.egps_album_item').on('click', function () {

        var btn_val = $(this).attr('album_id');
        
        window.location.href = "?aphot=" + btn_val;

        return true;

    });
    
    $('#photodata_back_btn').on('click', function(){
        var btn_val = $(this).val();
        
        window.location.href = "?aphot=" + btn_val;
        
        return true;
    });

    $('#photoalbum_back_btn').on('click', function(){
        var btn_val = $(this).val();

        window.location.href = btn_val;

        return true;
    });

    
    /*** FIREBASE public API data to broswer localstorage */

    var reload_page = false;
    if( localStorage.getItem("EgpsFirebaseDataAPIKEY") == null){
        reload_page = true;
    }
    localStorage.setItem("EgpsFirebaseDataAPIKEY", object_name.firebase_apikey);
    localStorage.setItem("EgpsFirebaseDataAUTHDOMAIN", object_name.firebase_authdomain);
    localStorage.setItem("EgpsFirebaseDataPROJECTID", object_name.firebase_projectid);
    localStorage.setItem("EgpsFirebaseDataSTORAGEBUCKET", object_name.firebase_storagebucket);
    localStorage.setItem("EgpsFirebaseDataMESSAGING", object_name.firebase_messagingsender);
    localStorage.setItem("EgpsFirebaseDataAPPID", object_name.firebase_appid);

    localStorage.setItem("egps_site_url", object_name.egps_site_url);


    if(reload_page){
        location.reload();
    }
    
});



