﻿//Ortak

window.onload = function() {
    MenuAdmin_Load();
    Subscription_Load();
}

    //MenuAdmin

var IDPodcast;
var URL_Plain = "http://podcast.mbirgin.com/Plain.aspx";
// var URL_Plain = "/Podcast/Plain.aspx";

    function MenuAdmin_Load() {
        var hdnIDPodcast = document.getElementById("hdnIDPodcast");
        if (!hdnIDPodcast) {
            return false;
        }
        
        IDPodcast = hdnIDPodcast.value;
        if (IDPodcast > 0) {
            document.getElementById("divCommandEdit").style.display = '';
        }

    }

    function Edit_Podcast() {
        Popup(URL_Plain + "?c=Edit/Post&ID=" + IDPodcast, 333, 444);
    }

    function Edit_List() {
        Popup(URL_Plain + "?c=List/AddtoList&ID=" + IDPodcast, 333, 444);
    }



//Subscription
    var RSS;

    function Subscription_Load() {
        var hdnRSSURL = document.getElementById("hdnRSSURL");
        if (hdnRSSURL) {
            RSS = hdnRSSURL.value;
            if (RSS.length > 0) {
                document.getElementById("txtRSS").value = RSS;
                document.getElementById("divSubscription").style.display = '';
            }
        }
    }

    function Subscribe(pReader) {
        var FeedURL = "";
        var EncodedRSS = encodeURI(RSS);

        switch (pReader) {
            case "google":
                FeedURL = "http://fusion.google.com/add?feedurl=" + RSS;
                break;
            case "yahoo":
                FeedURL = "http://add.my.yahoo.com/rss?url=" + RSS;
                break;
            case "live":
                FeedURL = "http://www.live.com/?addFeed=" + RSS;
                break;
            default: //xml 
                FeedURL = RSS;
        }

        // alert(pReader + " / " + RSS);
        window.open(FeedURL);
    }
