﻿if (!window.yazgelistir)
	yazgelistir = {};

yazgelistir.Page = function() 
{
}

yazgelistir.Page.prototype =
{
	handleLoad: function(control, userContext, rootElement) 
	{
        FillCats();
	}
}

var Categories = [{"Name":"ASP.NET","RSS":"http://www.yazgelistir.com/rss.ashx?Id=1000000000"},
                {"Name":"ADO.NET","RSS":"http://www.yazgelistir.com/rss.ashx?Id=1000000001"},
                {"Name":"Visual Basic .NET","RSS":"http://www.yazgelistir.com/rss.ashx?Id=1000000002"},
                {"Name":"Visual C# .NET","RSS":"http://www.yazgelistir.com/rss.ashx?Id=1000000003"},
                {"Name":"Visual Studio ve Araçlar","RSS":"http://www.yazgelistir.com/rss.ashx?Id=1000000004"},
                {"Name":"Windows Server System","RSS":"http://www.yazgelistir.com/rss.ashx?Id=1000000005"},
                {"Name":"Office System","RSS":"http://www.yazgelistir.com/rss.ashx?Id=1000000006"},
                {"Name":".NET Framework","RSS":"http://www.yazgelistir.com/rss.ashx?Id=1000000007"},
                {"Name":"SQL Server","RSS":"http://www.yazgelistir.com/rss.ashx?Id=1000000008"},
                {"Name":"Yazılım Güvenliği","RSS":"http://www.yazgelistir.com/rss.ashx?Id=1000000010"},
                {"Name":"Yazılım Mühendisliği","RSS":"http://www.yazgelistir.com/rss.ashx?Id=1000000011"},
                {"Name":"Mobil Teknolojileri","RSS":"http://www.yazgelistir.com/rss.ashx?Id=1000000012"},
                {"Name":"Dynamics","RSS":"http://www.yazgelistir.com/rss.ashx?Id=1000000013"},
                {"Name":"Smart Client","RSS":"http://www.yazgelistir.com/rss.ashx?Id=1000000014"},
                {"Name":"Expression Studio","RSS":"http://www.yazgelistir.com/rss.ashx?Id=1000000016"},
                {"Name":"Silverlight","RSS":"http://www.yazgelistir.com/rss.ashx?Id=1000000017"},
                {"Name":"Kod Parçaları","RSS":"http://www.yazgelistir.com/rss.ashx?Id=1000000018"},
                {"Name":"Açık Kaynak Kodlu Uygulamalar","RSS":"http://www.yazgelistir.com/rss.ashx?Id=1000000019"},
                {"Name":"İş Zekası","RSS":"http://www.yazgelistir.com/rss.ashx?Id=1000000020"}];


var Selected = -1;
                                
function FillCats()
{
    var x;
    var SL = document.getElementById("YazgelistirSilverlight");
    for(x=0;x<Categories.length;x++)
    {
        var ButtonXAML = "";
        ButtonXAML += '<Canvas Width="199.975" Height="28.151" Canvas.Top=" ' + (28*x) + '" x:Name="Button' + x + '" xmlns="http://schemas.microsoft.com/client/2007" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">';
        ButtonXAML += '<Rectangle x:Name="ButtonBack' + x + '" Width="199.975" Height="27.9965" Stretch="Fill" Canvas.Top="0.154">';
        ButtonXAML += '<Rectangle.Fill>';
        ButtonXAML += '<LinearGradientBrush StartPoint="0.449962,0.738098" EndPoint="0.449962,-0.817456">';
        ButtonXAML += '<GradientStop Color="#273A3A3A" Offset="0"/>';
        ButtonXAML += '<GradientStop Color="#271D1D1D" Offset="0.101695"/>';
        ButtonXAML += '<GradientStop Color="#27000000" Offset="0.194915"/>';
        ButtonXAML += '<GradientStop Color="#27797979" Offset="0.228814"/>';
        ButtonXAML += '<GradientStop Color="#27BCBCBC" Offset="0.453159"/>';
        ButtonXAML += '<GradientStop Color="#27FFFFFF" Offset="1"/>';
        ButtonXAML += '</LinearGradientBrush>';
        ButtonXAML += '</Rectangle.Fill>';
        ButtonXAML += '</Rectangle>';
        ButtonXAML += '<Rectangle x:Name="ButtonGlow' + x + '" Width="6.83247" Height="28.1076" Stretch="Fill" RenderTransformOrigin="0.5,0.5" Opacity="0">';
        ButtonXAML += '<Rectangle.RenderTransform>';
        ButtonXAML += '<TransformGroup>';
        ButtonXAML += '<ScaleTransform ScaleX="1" ScaleY="1"/>';
        ButtonXAML += '<SkewTransform AngleX="0" AngleY="0"/>';
        ButtonXAML += '<RotateTransform Angle="0"/>';
        ButtonXAML += '<TranslateTransform X="0" Y="0"/>';
        ButtonXAML += '</TransformGroup>';
        ButtonXAML += '</Rectangle.RenderTransform>';
        ButtonXAML += '<Rectangle.Fill>';
        ButtonXAML += '<LinearGradientBrush StartPoint="0.544712,0.996048" EndPoint="0.544712,0.0197627">';
        ButtonXAML += '<GradientStop Color="#52FFFFFF" Offset="0"/>';
        ButtonXAML += '<GradientStop Color="#52FFDA7F" Offset="0.101695"/>';
        ButtonXAML += '<GradientStop Color="#52FF9C00" Offset="0.194915"/>';
        ButtonXAML += '<GradientStop Color="#FFFF9C00" Offset="0.440678"/>';
        ButtonXAML += '<GradientStop Color="#FFFF9C00" Offset="0.691409"/>';
        ButtonXAML += '<GradientStop Color="#FFFFFFFF" Offset="1"/>';
        ButtonXAML += '</LinearGradientBrush>';
        ButtonXAML += '</Rectangle.Fill>';
        ButtonXAML += '</Rectangle>';
        ButtonXAML += '<Rectangle x:Name="ButtonFront' + x + '" Width="199.975" Height="27.9965" Stretch="Fill" Canvas.Top="0.154" Opacity="0">';
        ButtonXAML += '<Rectangle.Fill>';
        ButtonXAML += '<LinearGradientBrush StartPoint="0.449962,0.738098" EndPoint="0.449962,-0.817456">';
        ButtonXAML += '<GradientStop Color="#AF3A3A3A" Offset="0"/>';
        ButtonXAML += '<GradientStop Color="#AF1D1D1D" Offset="0.101695"/>';
        ButtonXAML += '<GradientStop Color="#AF000000" Offset="0.194915"/>';
        ButtonXAML += '<GradientStop Color="#AF797979" Offset="0.224576"/>';
        ButtonXAML += '<GradientStop Color="#AFBCBCBC" Offset="0.450154"/>';
        ButtonXAML += '<GradientStop Color="#AFFFFFFF" Offset="1"/>';
        ButtonXAML += '</LinearGradientBrush>';
        ButtonXAML += '</Rectangle.Fill>';
        ButtonXAML += '</Rectangle>';
        ButtonXAML += '<TextBlock Foreground="#FF000000" x:Name="ButtonText' + x + '" Canvas.Left="11" Canvas.Top="5" FontSize="11" Text="' + Categories[x].Name + '" TextWrapping="Wrap"/>';
        ButtonXAML += '<Rectangle Tag="' + x + '" MouseLeftButtonDown="CatClick" Cursor="Hand" MouseEnter="MouseCatHover" MouseLeave="MouseCatGone" x:Name="ButtonHover' + x + '" Width="199.975" Height="27.9965" Stretch="Fill" Fill="#00000000"/>';
        ButtonXAML += '</Canvas>';
        var Button = SL.content.createFromXaml(ButtonXAML);
        SL.content.findName("Page").children.add(Button);
        
        var GeldiAnimXAML = '<Storyboard x:Name="ButtonHover' + x + 'OnCatHover" xmlns="http://schemas.microsoft.com/client/2007" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">';
        GeldiAnimXAML += '<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ButtonGlow' + x + '" Storyboard.TargetProperty="(UIElement.Opacity)">';
        GeldiAnimXAML += '<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>';
        GeldiAnimXAML += '<SplineDoubleKeyFrame KeyTime="00:00:01" Value="1"/>';
        GeldiAnimXAML += '</DoubleAnimationUsingKeyFrames>';
        GeldiAnimXAML += '<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ButtonFront' + x + '" Storyboard.TargetProperty="(UIElement.Opacity)">';
        GeldiAnimXAML += '<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>';
        GeldiAnimXAML += '<SplineDoubleKeyFrame KeyTime="00:00:01" Value="1"/>';
        GeldiAnimXAML += '</DoubleAnimationUsingKeyFrames>';
        GeldiAnimXAML += '<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ButtonText' + x + '" Storyboard.TargetProperty="(Foreground).(SolidColorBrush.Color)">';
        GeldiAnimXAML += '<SplineColorKeyFrame KeyTime="00:00:00" Value="#FF000000"/>';
        GeldiAnimXAML += '<SplineColorKeyFrame KeyTime="00:00:01" Value="#FFE3DEDE"/>';
        GeldiAnimXAML += '</ColorAnimationUsingKeyFrames>';
        GeldiAnimXAML += '</Storyboard>';
        var GeldiAnim = SL.content.createFromXaml(GeldiAnimXAML);
        SL.content.findName("Page").resources.add(GeldiAnim);
        
        var GittiAnimXAML = '<Storyboard x:Name="ButtonHover' + x + 'OnCatGone" xmlns="http://schemas.microsoft.com/client/2007" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">';
        GittiAnimXAML+='<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ButtonGlow' + x + '" Storyboard.TargetProperty="(UIElement.Opacity)">';
        GittiAnimXAML+='<SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>';
        GittiAnimXAML+='<SplineDoubleKeyFrame KeyTime="00:00:01" Value="0"/>';
        GittiAnimXAML+='</DoubleAnimationUsingKeyFrames>';
        GittiAnimXAML+='<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ButtonFront' + x + '" Storyboard.TargetProperty="(UIElement.Opacity)">';
        GittiAnimXAML+='<SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>';
        GittiAnimXAML+='<SplineDoubleKeyFrame KeyTime="00:00:01" Value="0"/>';
        GittiAnimXAML+='</DoubleAnimationUsingKeyFrames>';
        GittiAnimXAML+='<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ButtonText' + x + '" Storyboard.TargetProperty="(Foreground).(SolidColorBrush.Color)">';
        GittiAnimXAML+='<SplineColorKeyFrame KeyTime="00:00:00" Value="#FFE3DEDE"/>';
        GittiAnimXAML+='<SplineColorKeyFrame KeyTime="00:00:01" Value="#FF000000"/>';
        GittiAnimXAML+='</ColorAnimationUsingKeyFrames>';
        GittiAnimXAML+='</Storyboard>';
        var GittiAnim = SL.content.createFromXaml(GittiAnimXAML);
        SL.content.findName("Page").resources.add(GittiAnim);
        
        var SecildiAnimXAML = '<Storyboard x:Name="Secildi' + x + '" xmlns="http://schemas.microsoft.com/client/2007" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">';
        SecildiAnimXAML +='<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ButtonGlow' + x + '" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">';
        SecildiAnimXAML +='<SplineDoubleKeyFrame KeyTime="00:00:01" Value="29.253"/>';
        SecildiAnimXAML +='</DoubleAnimationUsingKeyFrames>';
        SecildiAnimXAML +='<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ButtonGlow' + x + '" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">';
        SecildiAnimXAML +='<SplineDoubleKeyFrame KeyTime="00:00:01" Value="96.519"/>';
        SecildiAnimXAML +='</DoubleAnimationUsingKeyFrames>';
        SecildiAnimXAML +='<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ButtonGlow' + x + '" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">';
        SecildiAnimXAML +='<SplineDoubleKeyFrame KeyTime="00:00:01" Value="1"/>';
        SecildiAnimXAML +='</DoubleAnimationUsingKeyFrames>';
        SecildiAnimXAML +='</Storyboard>';
        var SecildiAnim = SL.content.createFromXaml(SecildiAnimXAML);
        SL.content.findName("Page").resources.add(SecildiAnim);

        var SecilmediAnimXAML ='<Storyboard x:Name="Secilmedi' + x + '" xmlns="http://schemas.microsoft.com/client/2007" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">';
        SecilmediAnimXAML +='<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ButtonGlow' + x + '" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">';
        SecilmediAnimXAML +='<SplineDoubleKeyFrame KeyTime="00:00:01" Value="1"/>';
        SecilmediAnimXAML +='</DoubleAnimationUsingKeyFrames>';
        SecilmediAnimXAML +='<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ButtonGlow' + x + '" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">';
        SecilmediAnimXAML +='<SplineDoubleKeyFrame KeyTime="00:00:01" Value="0"/>';
        SecilmediAnimXAML +='</DoubleAnimationUsingKeyFrames>';
        SecilmediAnimXAML +='<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ButtonGlow' + x + '" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">';
        SecilmediAnimXAML +='<SplineDoubleKeyFrame KeyTime="00:00:01" Value="1"/>';
        SecilmediAnimXAML +='</DoubleAnimationUsingKeyFrames>';
        SecilmediAnimXAML +='</Storyboard>';
        var SecilmediAnim = SL.content.createFromXaml(SecilmediAnimXAML);
        SL.content.findName("Page").resources.add(SecilmediAnim);
    }
    for(x=0;x<5;x++)
    {
        var PostGelAnimXAML ='<Storyboard x:Name="PostIn'+x+'" xmlns="http://schemas.microsoft.com/client/2007" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">';
        PostGelAnimXAML +='<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="PostRec'+x+'" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">';
        PostGelAnimXAML +='<SplineDoubleKeyFrame KeySpline="0.115,0.761,0.262,0.954" KeyTime="00:00:01" Value="1"/>';
        PostGelAnimXAML +='</DoubleAnimationUsingKeyFrames>';
        PostGelAnimXAML +='<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="PostRec'+x+'" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">';
        PostGelAnimXAML +='<SplineDoubleKeyFrame KeySpline="0.115,0.761,0.262,0.954" KeyTime="00:00:01" Value="1"/>';
        PostGelAnimXAML +='</DoubleAnimationUsingKeyFrames>';
        PostGelAnimXAML +='<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="PostRec'+x+'" Storyboard.TargetProperty="(UIElement.Opacity)">';
        PostGelAnimXAML +='<SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>';
        PostGelAnimXAML +='</DoubleAnimationUsingKeyFrames>';
        PostGelAnimXAML +='<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="PostAuthor'+x+'" Storyboard.TargetProperty="(UIElement.Opacity)">';
        PostGelAnimXAML +='<SplineDoubleKeyFrame KeyTime="00:00:00.8000000" Value="0"/>';
        PostGelAnimXAML +='<SplineDoubleKeyFrame KeyTime="00:00:01.2000000" Value="1"/>';
        PostGelAnimXAML +='</DoubleAnimationUsingKeyFrames>';
        PostGelAnimXAML +='<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="PostTitle'+x+'" Storyboard.TargetProperty="(UIElement.Opacity)">';
        PostGelAnimXAML +='<SplineDoubleKeyFrame KeyTime="00:00:00.6000000" Value="0"/>';
        PostGelAnimXAML +='<SplineDoubleKeyFrame KeyTime="00:00:01" Value="1"/>';
        PostGelAnimXAML +='</DoubleAnimationUsingKeyFrames>';
        PostGelAnimXAML +='<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="PostText'+x+'" Storyboard.TargetProperty="(UIElement.Opacity)">';
        PostGelAnimXAML +='<SplineDoubleKeyFrame KeyTime="00:00:01" Value="0"/>';
        PostGelAnimXAML +='<SplineDoubleKeyFrame KeyTime="00:00:01.4000000" Value="1"/>';
        PostGelAnimXAML +='</DoubleAnimationUsingKeyFrames>';
        PostGelAnimXAML +='</Storyboard>';
        var PostGelAnim = SL.content.createFromXaml(PostGelAnimXAML);
        SL.content.findName("Page").resources.add(PostGelAnim);
        
        var PostGittiAnimXAML ='<Storyboard x:Name="PostOut' + x + '" xmlns="http://schemas.microsoft.com/client/2007" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">';
        PostGittiAnimXAML +='<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="PostRec'+x+'" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">';
        PostGittiAnimXAML +='<SplineDoubleKeyFrame KeySpline="0.738,0.046,0.885,0.239" KeyTime="00:00:01.4000000" Value="0"/>';
        PostGittiAnimXAML +='</DoubleAnimationUsingKeyFrames>';
        PostGittiAnimXAML +='<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="PostRec'+x+'" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">';
        PostGittiAnimXAML +='<SplineDoubleKeyFrame KeySpline="0.738,0.046,0.885,0.239" KeyTime="00:00:01.4000000" Value="0"/>';
        PostGittiAnimXAML +='</DoubleAnimationUsingKeyFrames>';
        PostGittiAnimXAML +='<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="PostAuthor'+x+'" Storyboard.TargetProperty="(UIElement.Opacity)">';
        PostGittiAnimXAML +='<SplineDoubleKeyFrame KeyTime="00:00:00.6000000" Value="0"/>';
        PostGittiAnimXAML +='</DoubleAnimationUsingKeyFrames>';
        PostGittiAnimXAML +='<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="PostTitle'+x+'" Storyboard.TargetProperty="(UIElement.Opacity)">';
        PostGittiAnimXAML +='<SplineDoubleKeyFrame KeyTime="00:00:00.8000000" Value="0"/>';
        PostGittiAnimXAML +='</DoubleAnimationUsingKeyFrames>';
        PostGittiAnimXAML +='<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="PostText'+x+'" Storyboard.TargetProperty="(UIElement.Opacity)">';
        PostGittiAnimXAML +='<SplineDoubleKeyFrame KeyTime="00:00:00.4000000" Value="0"/>';
        PostGittiAnimXAML +='</DoubleAnimationUsingKeyFrames>';
        PostGittiAnimXAML +='</Storyboard>';
        var PostGittiAnim = SL.content.createFromXaml(PostGittiAnimXAML);
        SL.content.findName("Page").resources.add(PostGittiAnim);
        
        var PostHoverAnimXAML ='<Storyboard x:Name="PostHover' + x + 'In" xmlns="http://schemas.microsoft.com/client/2007" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">';
        PostHoverAnimXAML +='<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="PostRec'+x+'" Storyboard.TargetProperty="(UIElement.Opacity)">';
        PostHoverAnimXAML +='<SplineDoubleKeyFrame KeyTime="00:00:00.4000000" Value="0"/>';
        PostHoverAnimXAML +='</DoubleAnimationUsingKeyFrames>';
        PostHoverAnimXAML +='</Storyboard>';
        var PostHoverAnim = SL.content.createFromXaml(PostHoverAnimXAML);
        SL.content.findName("Page").resources.add(PostHoverAnim);
        
        var PostLeaveAnimXAML ='<Storyboard x:Name="PostHover' + x + 'Out" xmlns="http://schemas.microsoft.com/client/2007" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">';
        PostLeaveAnimXAML +='<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="PostRec'+x+'" Storyboard.TargetProperty="(UIElement.Opacity)">';
        PostLeaveAnimXAML +='<SplineDoubleKeyFrame KeyTime="00:00:00.4000000" Value="1"/>';
        PostLeaveAnimXAML +='</DoubleAnimationUsingKeyFrames>';
        PostLeaveAnimXAML +='</Storyboard>';
        var PostLeaveAnim = SL.content.createFromXaml(PostLeaveAnimXAML);
        SL.content.findName("Page").resources.add(PostLeaveAnim);

    }
    // İlk açılışta yüklenen RSS adresi.
    RSS("http://www.yazgelistir.com/rss.ashx?Id=0");
    //RSS("rss.xml");
}

function MouseCatHover(sender)
{
    if(sender.Tag != Selected)
    {
        sender.findName(sender.Name + "OnCatHover").Begin();
    }
}
function MouseCatGone(sender)
{
    if(sender.Tag != Selected)
    {
        sender.findName(sender.Name + "OnCatGone").Begin();
    }
}

function CatClick(sender)
{
    if(sender.Tag != Selected)
    {
        if(Selected != -1)
        {
            sender.findName("Secilmedi" +Selected ).Begin();
            sender.findName("ButtonHover" +Selected + "OnCatGone").Begin();
        }
        var SL = document.getElementById("YazgelistirSilverlight");
        if(SL.content.findName("Post0"))
        {
            for(x=0;x<5;x++)
            {
            SL.content.findName("PostOut" + x).Begin();
            } 
        }
        Selected = sender.Tag;
        sender.findName("Secildi" + Selected).Begin();
        setTimeout('RSS("' + Categories[sender.Tag].RSS +'");',1400);
    }
    else
    {
        Selected = -1;
        sender.findName("Secilmedi" + sender.Tag).Begin();
    }
}

function RSS(Adres)
{
    if (window.ActiveXObject)
        xhr = new ActiveXObject("Microsoft.XMLHTTP");
    else if (window.XMLHttpRequest)
        xhr = new XMLHttpRequest();
    else
        alert("Tarayıcınızın JavaScript desteği yok. Maalesef site içerisinde bazı özellikler çalışmayacaktır.");

    var SL = document.getElementById("YazgelistirSilverlight");
    SL.content.findName("Loading").Opacity=100;
    SL.content.findName("LoadAnim").Begin();
    
    xhr.open("GET",Adres,true);

    xhr.setRequestHeader("Cache-Control", "no-cache");
    xhr.setRequestHeader("Pragma", "no-cache");

    xhr.onreadystatechange = function() {
        if (xhr.readyState == 4)
        {
            if (xhr.status == 200)
            {
                if (xhr.responseText != null)
                    GetirRSS(xhr.responseXML);
                else
                {
                    //alert("Dikkat1!");
                    return false;
                }
            }
            else{
             //alert("Dikkat2!");
            }
        }
    }

    xhr.send(null);
}

function GetirRSS(rssxml)
{
    var x;
    var ToplamYukseklik = 0;
    var SL = document.getElementById("YazgelistirSilverlight");
    SL.content.findName("PostPage").children.clear();
    if(!SL.content.findName("Post1"))
    {
        for (var x=0; x<5; x++)
        {
            var PostXAML ='<Canvas Width="428.025" Height="99" Canvas.Left="203.975" Canvas.Top="' + ToplamYukseklik + '" x:Name="Post' + x + '" xmlns="http://schemas.microsoft.com/client/2007" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">';
            PostXAML +='<Rectangle Opacity="0" Fill="#FFF5F5F5" x:Name="PostRec' + x + '" Width="395.025" Height="0" RadiusX="9.525" RadiusY="9.525" RenderTransformOrigin="0.5,0.5">';
            PostXAML +='<Rectangle.RenderTransform>';
            PostXAML +='<TransformGroup>';
            PostXAML +='<ScaleTransform ScaleX="0" ScaleY="0"/>';
            PostXAML +='<SkewTransform AngleX="0" AngleY="0"/>';
            PostXAML +='<RotateTransform Angle="0"/>';
            PostXAML +='<TranslateTransform X="0" Y="0"/>';
            PostXAML +='</TransformGroup>';
            PostXAML +='</Rectangle.RenderTransform>';
            PostXAML +='</Rectangle>';
            PostXAML +='<TextBlock Opacity="0" x:Name="PostAuthor' + x + '" Canvas.Left="365.667" Canvas.Top="6.248" FontSize="11" Foreground="#FF8F8F8F" TextWrapping="Wrap"><Run FontSize="11" Text="TextBlock"/></TextBlock>';
            PostXAML +='<TextBlock Opacity="0" TextWrapping="Wrap" x:Name="PostTitle' + x + '" Canvas.Left="10.31" Width="280.63" Canvas.Top="6.248" FontSize="11" FontWeight="Normal" Foreground="#FF000000"><Run FontSize="11" Text="TextBlock"/></TextBlock>';
            PostXAML +='<TextBlock Opacity="0" TextWrapping="Wrap" x:Name="PostText' + x + '" Width="375.63" Canvas.Left="10.31" Canvas.Top="23.151" FontSize="11" Foreground="#FF2E4B5E"><Run FontSize="11" Text="TextBlock"/></TextBlock>';
            PostXAML +='<Rectangle Cursor="Hand" MouseLeftButtonDown="PostClick" MouseEnter="MousePostHover" MouseLeave="MousePostGone" Fill="#00F5F5F5" RenderTransformOrigin="0.5,0.5" x:Name="PostHover' + x + '" Width="428.025" Height="99" RadiusX="9.525" RadiusY="9.525"/>';
            PostXAML +='</Canvas>';
            var Post = SL.content.createFromXaml(PostXAML);
            Post.findName("PostAuthor" + x).Text = rssxml.getElementsByTagName("item")[x].getElementsByTagName("author")[0].childNodes[0].nodeValue.substring(0,rssxml.getElementsByTagName("item")[x].getElementsByTagName("author")[0].childNodes[0].nodeValue.indexOf("<"));
            Post.findName("PostAuthor" + x)["Canvas.Left"] = Post.findName("PostRec" + x).Width - Post.findName("PostAuthor" + x).actualWidth - 7;
            Post.findName("PostTitle" + x).Text = rssxml.getElementsByTagName("item")[x].getElementsByTagName("title")[0].childNodes[0].nodeValue;
            Post.findName("PostTitle" + x).Width = Post.findName("PostRec" + x).Width -  Post.findName("PostAuthor" + x).actualWidth -20;
            Post.findName("PostText" + x)["Canvas.Top"]= Post.findName("PostTitle" + x).actualHeight + 7;
            Post.findName("PostText" + x).Text = rssxml.getElementsByTagName("item")[x].getElementsByTagName("description")[0].childNodes[0].nodeValue;
            Post.findName("PostRec" + x).Height = Post.findName("PostText" + x).actualHeight + Post.findName("PostTitle" + x).actualHeight + 13;
            Post.findName("PostHover" + x).Height = Post.findName("PostRec" + x).Height;
            Post.findName("PostHover" + x).Tag = rssxml.getElementsByTagName("item")[x].getElementsByTagName("link")[0].childNodes[0].nodeValue;
            ToplamYukseklik += Post.findName("PostRec" + x).Height + 5;
            SL.content.findName("PostPage").children.add(Post);
        }
    }
    else
    {
        for (var x=0; x<5; x++)
        {
            var Post = SL.content.findName("Post" + x);
            Post.findName("PostAuthor" + x).Text = rssxml.getElementsByTagName("item")[x].getElementsByTagName("author")[0].childNodes[0].nodeValue.substring(0,rssxml.getElementsByTagName("item")[x].getElementsByTagName("author")[0].childNodes[0].nodeValue.indexOf("<"));
            Post.findName("PostAuthor" + x)["Canvas.Left"] = 420 - Post.findName("PostAuthor" + x).actualWidth;
            Post.findName("PostTitle" + x).Text = rssxml.getElementsByTagName("item")[x].getElementsByTagName("title")[0].childNodes[0].nodeValue;
            Post.findName("PostTitle" + x).Width = 420 -  Post.findName("PostAuthor" + x).actualWidth -20;
            Post.findName("PostText" + x)["Canvas.Top"]= Post.findName("PostTitle" + x).actualHeight + 7;
            Post.findName("PostText" + x).Text = rssxml.getElementsByTagName("item")[x].getElementsByTagName("description")[0].childNodes[0].nodeValue;
            Post.findName("PostRec" + x).Height = Post.findName("PostText" + x).actualHeight + Post.findName("PostTitle" + x).actualHeight + 13;
            Post.findName("PostHover" + x).Height = Post.findName("PostRec" + x).Height;
            Post.findName("PostHover" + x).Tag = rssxml.getElementsByTagName("item")[x].getElementsByTagName("link")[0].childNodes[0].nodeValue;
            ToplamYukseklik += Post.findName("PostRec" + x).Height + 5;
        }
    };
    if((Categories.length * 30)>ToplamYukseklik)
    {
        ToplamYukseklik = Categories.length * 30;
    }
    SL.style.height = ToplamYukseklik + "px";
    SL.content.findName("Page").Height = ToplamYukseklik;
    SL.content.findName("Loading").Opacity=0;
    for(x=0;x<5;x++)
    {
        setTimeout('document.getElementById("YazgelistirSilverlight").content.findName("PostIn' + x + '").Begin();',x*1000);
    } 
}

function MousePostHover(sender)
{
    sender.findName(sender.Name + "In").Begin();
}
function MousePostGone(sender)
{
    sender.findName(sender.Name + "Out").Begin();
}
function PostClick(sender)
{
    document.location = sender.Tag;
}
