﻿// JScript File

function chang_cat_photo(){
    var c = document.getElementById("lst_cat").value;
    var s = document.getElementById("lst_saison").value;
    document.location.href="/photos/detail.aspx?cat="+c+"&p=0&saison=" + s;
}

function chang_saison_photo(){
    var s = document.getElementById("lst_saison").value;
    document.location.href="/photos/detail.aspx?saison="+s+"&p=0";
}

var AxSuppr_photo = {
	delay: 200,
	prepare: function() { 
		InputVar = new Array(id_photo);
	},
	call: proxies.AjaxFunc.DeletePhoto,
	finish: function (p) 
	{ 
		document.getElementById("ligne_"+id_photo).style.display = "none";
	},
	onException: ajax.alertException
}


function Suppr(i){
if(confirm("Etes vous sur de vouloir supprimer cette photo ?"))
    {
    id_photo = i;
    SoapMethod = "POST";
	ajax.Start(AxSuppr_photo);
	}
}


function getCat(val) {

    var AxGetCat = {
        delay: 200,
        prepare: function () {
            InputVar = new Array(val);
        },
        call: proxies.AjaxFunc.GetCatPhotos,
        finish: function (p) {

            document.getElementById("choix_cat_listederoul").options.length = 0;

            var tab = p.split('|');
            
            var i;

            for (i = 0; i < tab.length-1; i++) {

                var opt = document.createElement("option");
                opt.text = tab[i].split(',')[1];
                opt.value = tab[i].split(',')[0];

                document.getElementById("choix_cat_listederoul").options.add(opt);
            }


        },
        onException: ajax.alertException
    }


    SoapMethod = "POST";
    ajax.Start(AxGetCat);
}



