﻿function getPhotos(uid, plid) {
    $.ajax({
        url: 'gPhotoList.asmx/getpl?uid=' + uid + '&plid=' + plid,
        type: 'GET',
        dataType: 'xml',
        timeout: 20000,
        error: function() {
            alert('Error loading XML document');
        },
        success: function(xml) {
            // do something with xml
            $("#photodesc")[0].innerHTML = xml.getElementsByTagName("photolist")[0].attributes[0].nodeValue;
            var pl = $("#Photos");
            pl[0].innerHTML = "";
            var pll = xml.getElementsByTagName("photo");
            for (var i = 0; i < pll.length; i++) {
                var im = document.createElement("img");
                var aa = document.createElement("a");
                im.src = pll[i].attributes[0].nodeValue;
                aa.href = pll[i].attributes[0].nodeValue;
                aa.appendChild(im);
                pl[0].appendChild(aa);
            }
            pl.find("a").lightBox();
        }
    });
}

$(document).ready(
    function() {
        if ($("#plist span").length > 0) {
            $("#plist span:first").trigger('click');
        }
        $("#hjjsdv a").lightBox();
        $(".newphoto a").lightBox();
        //alert($('#plist').find("div"))
        $('#plist').setScroll(
        {img: 'images/scroll_bk.gif', width: 14 }, //background-image and width
        {img: 'images/scroll_arrow_up.gif', height: 15 }, //up
        {img: 'images/scroll_arrow_down.gif', height: 15 }, //down
        {img: 'images/scroll_bar.gif', height: 35}//bar
        );
        $("#flash").html("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0'"+
        " width='500' height='375'><param name='allowScriptAccess' value='sameDomain'><param name='movie' value='images/za/zahd.swf'><param name='quality' value='high'>" +
        "<param name='menu' value='false'><param name=wmode value='transparent'>" +
        "<embed src='images/za/zahd.swf' wmode='transparent' menu='false' quality='high' width='500' height='375' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' /></object>");
    }
);
