var prefix = GetAppPath();
var AppPath = GetAppPath();

$(document).ready(function() {
    $('li.sendFriend').hover(function() { $(this).children('a#friSend,#cphClub_hlSendToFriend').show(); }, function() { $(this).children('a#friSend,#cphClub_hlSendToFriend').hide(); });
    $('#searchText').focus(function() { $(this).attr('value', ''); });
    $('#searchText').blur(function() {
        if ($(this).attr('value') == "") {
            var a = $(this).attr('Name');
            $(this).attr('value', a);
        }
    });
    $(window).scroll(function() { if ($('div#fancybox-wrap').css('display') == "block") $.fancybox.center(true); });
    $('ul.accordion li a.acord').click(function() { $(this).parent().next('.accordionsub').slideToggle().parent().siblings().children('div.accordionsub').slideUp(); });
    $('div#dpicker').datepicker({ changeMonth: true });
    $('div.favorites').hover(function() { $(this).children().show(); }, function() { $(this).children().hide(); })
    $('ul#contracted-agencies li').hover(function() { $(this).addClass('on'); }, function() { $(this).removeClass('on'); })
    $('a#voice').click(function() {
        $(this).toggleClass('voiceon');
        if ($('a#voice').attr('class') == 'voiceon') { $.cookie("vp", "sesKapali"); }
        else { $.cookie("vp", "sesAcik"); }
    });
    /*Video Player Cookie*/
    /*setTimeout(function(){
    var getSes=$.cookie("vp");	
    if(getSes=='sesKapali')$('a#voice').trigger('click');
    },1000)*/

    //$('li.sendFriend').hover(function () { $(this).children().show(); }, function () { $(this).children().hide(); })
    /*Arama input*/
    $('#searchText').focus(function() {
        $(this).keydown(function(event) {
            if (event.keyCode == '13') { $('input#searchButton').click(); return false; }
        });
    });

    $('input#searchButton').click(function(event) {
        event.preventDefault();
        var query = $('#hmnSearch div input').val();
        query = query.replace(/^\s+|\s+$/g, '');
        if (query != "Arama" && query != "" && query != " " && query.length > 2) {
            document.location.href = AppPath + 'search.aspx?q=' + query;
        }
    });

    /*Arama input*/
    var docloc = document.location.href;
    $('a.fancybx').fancybox({
        'overlayShow': true,
        'overlayOpacity': 0.8,
        'overlayColor': '#000'
    });
    $('a.sendToFriend').fancybox({
        'width': 580,
        'height': 465
    });
    $('a.userGalleryImage,a.Gallerywinner').fancybox({
        'width': 650,
        'height': 650,
        'type': 'iframe'
    });
    $('a.ApproveRules').fancybox({
        'width': 580,
        'height': 465
    });
    $('a.terms-of-use').fancybox({
        'width': 600,
        'height': 510,
        'type': 'iframe',
        'padding': 0,
        'margin': 0
    });

    $('a.sendedToFriend,a.Suggestion,a.memberlogin').fancybox({
        'width': 580,
        'height': 175
    });

    if (docloc.indexOf('#SendedSucsess') > -1) {
        setTimeout("$('a.sendedToFriend').trigger('click');", 100);
    }
    if (docloc.indexOf('#MemberSucsess') > -1) {
        setTimeout("$('a.memberlogin').trigger('click');", 100);
    }
    if (docloc.indexOf('#SendedSucsess') > -1) {
        setTimeout("$('a.sendedToFriend').trigger('click');", 100);
    }
    if (docloc.indexOf('#SuggestionThanks') > -1) {
        setTimeout("$('a.Suggestion').trigger('click');", 100);
    }


    //$('li.sendFriend').click(function() {  $('a.sendToFriend').click(); });
    /* Ana Sayfa Videolar Klüp Seçimi */
	$('#haberlerHeader div.etkinlikSelect2 select').change(function() {
		var value =$(this).val();
		getClubNews(value);
	});
    $("#videolarHeader div.etkinlikSelect select").change(function() {
        var id, title, sayac, cleanurl, videohref, clubid;
        clubid = $(this).val();
        if (clubid == 0) { document.location.href = AppPath + "video.aspx"; }
        else {
            sayac = 0;
            $('div.videocontent ul').css('left', '0');
            $.ajax({
                type: 'GET',
                url: AppPath + 'Sockets/Videos.ashx?MainPageVideoSelection=true',
                dataType: 'json',
                data: "groupId=" + $(this).val(),
                success: function(data) {
                    $('div.videocontent ul').empty();
                    $.each(data, function(key, val) {
                        if (sayac < 12) {
                            id = val.Id;
                            title = val.Title;
                            cleanurl = val.CleanUrl;
                            videohref = AppPath + clubid + '/' + cleanurl + '.aspx?id=' + id;
                            $('div.videocontent ul')
							.append($('<li class="video"/>')
								.append($($('<a class="vplaybg"/>').html('VideoPlay').attr('href', videohref)))
								.append($('<div class="vCapsule"/>')
									.append($('<a/>').attr('href', videohref)
										.append($('<img height="144" width="180"/>').attr({ alt: title, border: '0', src: AppPath + 'GalleryImage.aspx?id=' + id }))
									)
								)
								.append($('<p class="vtitle"/>').html(title))
						)
                        }
                        sayac++;
                    });
                    if (data.length < 12) {
                        videoSlide(data.length);
                        if (data.length < 1) {
                            $('div.videocontent ul')
							.append($('<li />').html('Bu Kategoride Video Bulunmamaktadir.'))
                        }
                    }
                    else { videoSlide(12); }
                }
            });
        }
    });
    videoSlide($('div.videocontent ul li').length);
    /* Videolar Klüp Seçimi */

    /* Ana Sayfa Etkinlik Tabi Seçimi */
    $("#etkArsiv").click(function() {
        $(this).children('a').addClass('selected').parent().siblings('li').children('a').removeClass('selected');
		$('div#haberlerHeader div.etkinlikSelect2').hide();
        var acid, actitle, acdesc;
        $.ajax({
            type: 'GET',
            url: AppPath + 'Sockets/FotoGaleri.ashx?MainPagePhotoGallery=true',
            dataType: 'json',
            success: function(data) {
                $('div.newcontent ul').empty();
                $.each(data, function(key, val) {
                    acid = val.Id;
                    acGroupId = val.GroupId;
                    actitle = val.TitleSummary;
                    acdesc = val.DescriptionSummary;
                    acurl = "GalleryImage.aspx?id=" + val.VisualId + "&mode=tn";
                    $('div.newcontent ul')
							.append($('<li class="haber"/>')
								.append($('<div class="HCImg"/>')
									.append($('<a/>').attr('href', AppPath + 'Gallery.aspx?groupid=' + acGroupId + '&id=' + acid)
                    					.append($('<img height="99" width="99"/>').attr({ alt: actitle, border: '0', src: prefix + acurl }))
									)
								)
								.append($('<div class="HCDesc"/>')
									.append($('<h1/>').append($('<a/>').attr('href', AppPath + 'Gallery.aspx?groupid=' + acGroupId + '&id=' + acid).html(actitle)))
                    //.append($('<p/>').html(acdesc))
								)
						)
                });

                newsSlide(data.length);
                if (data.length < 1) {
                    $('div.newcontent ul')
						.append($('<li />').html('Haber Bulunmamaktadir.'))
                }
                $('div.newcontent ul').css('left', '0px');
            }
        });
    });
    /* Ana Sayfa Etkinlik Tabi Seçimi */

    /* Ana Sayfa Haberler Tabi Seçimi */
    $("#etkHaberler").children('a').addClass('selected').parent().siblings('li').children('a').removeClass('selected');
    getClubNews(0);	
    //$("#etkHaberler").trigger('click');
    /* Ana Sayfa Haberler Tabi Seçimi */

    /* Kulüpler Sayfasi Yeni Videolar */
    $("#news").click(function() {
        var rndnum = Math.floor(Math.random() * 100);
        $(this).children().addClass('selected').parent().siblings().children().removeClass('selected');
        $.ajax({
            type: 'GET',
            url: AppPath + 'Sockets/Videos.ashx?NewestVideos=true&groupId=' + groupId + '&xmlid=' + rndnum,
            data: getUrlVars()["groupId"] == null ? "" : "groupId=" + getUrlVars()["groupId"],
            dataType: 'json',
            success: function(data) {
                videoData(data,groupId);
            }
        });
    });
    /* Kulüpler Sayfasi Yeni Videolar */

    /* Kulüpler Sayfasi Tüm Videolar */
    $("#allVideos").click(function() {
        var rndnum = Math.floor(Math.random() * 100);
        $(this).children().addClass('selected').parent().siblings().children().removeClass('selected');
        $.ajax({
            type: 'GET',
            url: AppPath + 'Sockets/Videos.ashx?MostVoted=true&groupId=' + groupId + '&xmlid=' + rndnum,
            data: getUrlVars()["groupId"] == null ? "" : "groupId=" + getUrlVars()["groupId"],
            dataType: 'json',
            success: function(data) {
                videoData(data,groupId);
            }
        });
    });
    /* Kulüpler Sayfasi Tüm Videolar */

    /* Kulüpler Sayfasi En Çok izlenen Videolar */
    $("#mostPopular").click(function() {
        var rndnum = Math.floor(Math.random() * 100);
        $(this).children().addClass('selected').parent().siblings().children().removeClass('selected');
        $.ajax({
            type: 'GET',
            url: AppPath + 'Sockets/Videos.ashx?MostViewedVideos=true&groupId=' + groupId + '&xmlid=' + rndnum,
            data: getUrlVars()["groupId"] == null ? "" : "groupId=" + getUrlVars()["groupId"],
            dataType: 'json',
            success: function(sonuc) {
                videoData(sonuc,groupId);
            }
        });
    });

    if (getQuerystring('?') == '') {
        $("#news").trigger('click');
    } else {
        getFLV('<%= FlvSrc %>', getQuerystring("id"));
        $('div.chooseScroll').jScrollPane({ showArrows: true });
    }

    /* Kulüpler Sayfasi En Çok izlenen Videolar */

    /*Foto Slide*/
    var phuzunluk = $('div#foto-list ul li').length;
    var phgenislik = 358;
    var phulLeft;
    var phfazla = phuzunluk - 1;
    var phslideul = $('div#foto-list ul');
    phslideul.width(phuzunluk * phgenislik);
    $('div.foto-nav span').html('1/' + phuzunluk);
    $('div.foto-nav a.prev').click(function() {
        if (phslideul.queue("fx").length < 1) {
            phulLeft = parseInt(phslideul.css('left'));
            if (phulLeft < 0) {
                var spantext = $('div.foto-nav span').text();
                spantextarr = spantext.split('/');
                $('div.foto-nav span').html(Number(spantextarr[0]) - 1 + '/' + phuzunluk);
                phslideul.animate({ left: phulLeft + phgenislik + 'px' }, 1000)
            };
        }
    });
    $('div.foto-nav a.next').click(function() {
        if (phslideul.queue("fx").length < 1) {
            phulLeft = parseInt(phslideul.css('left'));
            if (phulLeft > phfazla * phgenislik * -1) {
                var spantext = $('div.foto-nav span').text();
                spantextarr = spantext.split('/');
                $('div.foto-nav span').html(Number(spantextarr[0]) + 1 + '/' + phuzunluk);
                phslideul.animate({ left: phulLeft - phgenislik + 'px' }, 1000)
            };
        }
    });
    /*Foto Slide*/

    /*Sayfalama */
    if (getQuerystring('p') != '') {
        var p = getQuerystring('p');
        $('.pager li ').each(function() {
            if ($(this).find('a').text() == p) {
                $(this).find('a').addClass('on');
            }
        });
    }
    else {

        $('.pager li ').each(function() {
            if ($(this).find('a').text() == '1') {
                $(this).find('a').addClass('on');
            }
        });
    }
    $('div.pager ul li.prev').next().remove();
    //$('.prev').next().remove();
    /*Sayfalama*/

    /*Clup subpage activities*/
    var slideul, ulLeft, genislik, fazla2;
    genislik = 219 * 3;
    slideul = $('div.etkinlikcontent ul');
    fazla2 = Number(slideul.children('li').length) - 3;
    slideul.width(Number(slideul.children('li').length) * genislik);
    $('div#etkinlikScroll a#prev').click(function() {
        if (slideul.queue("fx").length < 1) {
            ulLeft = parseInt(slideul.css('left'));
            if (ulLeft < 0) {
                slideul.animate({ left: ulLeft + genislik + 'px' }, 1000)
            };
        }
    });
    $('div#etkinlikScroll a#next').click(function() {
        if (slideul.queue("fx").length < 1) {
            ulLeft = parseInt(slideul.css('left'));
            if (ulLeft > fazla2 * (genislik / 3) * -1) {
                slideul.animate({ left: ulLeft - genislik + 'px' }, 1000)
            };
        }
    });

    /*Videolar Sayfasi Kulup Secim*/
    $("#videoband div.etkinlikSelect select").change(function() {
        var clubid = $(this).val();
        document.location.href = AppPath + "video.aspx?groupId=" + clubid;
    });
});
function setSesCookie(Voicevalue){
	$.cookie("vp",Voicevalue);		
}
function getSesCookie(){
	if($.cookie("vp")!=0 && $.cookie("vp")!='' ){
		return $.cookie("vp");	
	}else{
		setSesCookie('sesAcik');
		return 'sesAcik';
	}
}
var first =true;
var clicked = false;
function videoData(data,gid) {
    if (data.length > 0) {
        var vid, vtitle, vurl, totalv;
        $('div.chooseScroll ul').empty();
        $.each(data, function (key, val) {
            vid = val.Id;
            vtitle = val.Title;
            vurl = val.Source;
            totalv = val.TotalViews;
			vtitle = vtitle.replace(' ?','?');
            $('div.chooseScroll ul')
			.append($('<li class="videHover"/>')
				.append($('<div class="videoThumbContainer clearFix"/>')
					.append($('<div class="vidThumb"/>')
						.append($('<img/>').attr({ src: AppPath + 'GalleryImage.aspx?id=' + vid, width: '79', height: '59', alt: vtitle }))
						.append($('<span class="vidMask"/>')
							.append($('<a href="javascript:;" rel="' + vurl + '" rev="' + vid + '" />').click(function () {
                            
							getFLV( $(this).attr('rel'),$(this).attr('rev') );
						}))
						)
					)
					.append($('<div class="vidDetails"/>')
						.append($('<h1>').append($('<a href="javascript:;" rel="' + vurl + '"  rev="' + vid + '" />').click(function () {
						    getFLV($(this).attr('rel'), $(this).attr('rev'));						
						}).html(vtitle)))
						.append($('<p class="vidComments"/>').append($('<a href="javascript:;" rel="' + vurl + '" rev="' + vid + '"  />').click(function () {
						    getFLV($(this).attr('rel'), $(this).attr('rev'));					
						}).html(totalv)))
					)
				)
			);

        });
        if (clicked == false) {
			if(gid=='12' && first){
				getFLV('hafta_138_tiyatro_mahsericumbuskimdir.flv', '3838');
				$('div.chooseScroll').jScrollPane({ showArrows: true });					
			}
			else{
				$('li.videHover:first').find('span').children('a').trigger('click');
				$('div.chooseScroll').jScrollPane({ showArrows: true });
				clicked = true;
			}
        } else {
            $('div.chooseScroll').jScrollPane({ showArrows: true });
        }
    }
    else {
        $('div.chooseScroll ul').empty().append($('<li class="videHover"/>').html('Video Bulunmamaktadır.'))
    }
	first=false;
}
//helper get url params..
function getUrlVars() {
    var vars = [], hash;
    var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
    for (var i = 0; i < hashes.length; i++) {
        hash = hashes[i].split('=');
        vars.push(hash[0]);
        vars[hash[0]] = hash[1];
    }
    return vars;}
function getQuerystring(key, default_) {
    if (default_ == null) default_ = "";
    key = key.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
    var regex = new RegExp("[\\?&]" + key + "=([^&#]*)");
    var qs = regex.exec(window.location.href);
    if (qs == null)
        return default_;
    else
        return qs[1];}
//Play Selected Video

function getFLV(src,id) {
    var params = {
    menu: "false",
    scale: "noScale",
    allowFullscreen: "true",
    allowScriptAccess: "always",
    controls: 'true',
    src: 'http://212.58.7.44/' + src,
    autoPlay: 'true',
    bgcolor: "#FFFFFF",
    wmode: "transparent"
};
	var rndnum = Math.floor(Math.random() * 100);
    swfobject.embedSWF(AppPath + "_swf/videoPlayer.swf", "vp1", "400", "300", "9.0.0", "../_swf/expressInstall.swf", params, { menu: "false", bgcolor: "#ffffff", allowFullScreen: "true", wmode: "transparent" });
    if (id != undefined)  $.post(GetAppPath() + "Sockets/VideoWatch.ashx?videoId="+id+"&xmlid="+rndnum, { }, function (response, status) { }, 'json');
}; 

function showVideo(src, img, url) {
    var flash;
    if (window['vp']) { flash = window['vp']; }
    else { flash = document['vp']; }
    flash.loadVideo('http://212.58.7.44/' + src, img, url, true);}
function videoSlide(vduzunluk) {
    /*Videolar Slide*/
    var vdgenislik = 218;
    var vdulLeft;
    var vdfazla = vduzunluk - 4;
    var vdslideul = $('div#videolarContent div.videocontent ul');
    vdslideul.width(vduzunluk * vdgenislik);
    $('div#videolarContent a#vdPrev').click(function () {
        if (vdslideul.queue("fx").length < 1) {
            vdulLeft = parseInt(vdslideul.css('left'));
            if (vdulLeft < 0) {
                vdslideul.animate({ left: vdulLeft + vdgenislik + 'px' }, 1000)
            };
        }
    });
    $('div#videolarContent a#vdNext').click(function () {
        if (vdslideul.queue("fx").length < 1) {
            vdulLeft = parseInt(vdslideul.css('left'));
            if (vdulLeft > vdfazla * vdgenislik * -1) {
                vdslideul.animate({ left: vdulLeft - vdgenislik + 'px' }, 1000)
            };
        }
    });
    /*Videolar Slide*/
	
	
	var ahdgenislik = 298;
    var ahdulLeft;  
    var ahdslideul = $('div.newcontent ul');
	 $('div#haberlerContent a#hdPrev').live('click',function () {
        if (ahdslideul.queue("fx").length < 1) {
            ahdulLeft = parseInt(ahdslideul.css('left'));
            if (ahdulLeft < 0) {
                ahdslideul.animate({ left: ahdulLeft + ahdgenislik + 'px' }, 1000)
            };
        }
    });
    $('div#haberlerContent a#hdNext').live('click',function () {
		  var ahdfazla =  $('div.newcontent ul').attr('rel');															 
        if (ahdslideul.queue("fx").length < 1) {
            ahdulLeft = parseInt(ahdslideul.css('left'));			
            if (ahdulLeft > ahdfazla * ahdgenislik * -1) {
                ahdslideul.animate({ left: ahdulLeft - ahdgenislik + 'px' }, 1000)
            };
        }
    }); }
function newsSlide(hduzunluk) {
    /*Haberler Slide*/
    var hdgenislik = 298;
    var hdulLeft;
    var hdfazla = hduzunluk - 3;
    var hdslideul = $('div.newcontent ul');
    hdslideul.width(hduzunluk * hdgenislik);
    hdslideul.attr('rel',hdfazla);
    /*Haberler Slide*/ }
function GetAppPath() {
    var sLinkHref = document.getElementById("getPath").getAttribute("src");
    var sPathToRoot = sLinkHref.substring(0, sLinkHref.indexOf("script"));
    return sPathToRoot; }
function CleanUrlName(title) {
    var result = title;
    for (var i = 0; i < result.length; i++)
        result = result.replace(".", "");
    result = result.replace(/<.*?>/g, "");
    result = result.replace(/^\s+|\s+$/g, "");
    return result; }
function hscroll(sclength) {
    $('.scroll-content').width(sclength * 219);
    //scrollpane parts
    var scrollPane = $(".scroll-pane"),
	scrollContent = $(".scroll-content");
    //build slider
    if (sclength > 3) {
        var scrollbar = $(".scroll-bar").slider({
            slide: function (event, ui) {
                if (scrollContent.width() > scrollPane.width()) {
                    scrollContent.css("margin-left", Math.round(
						ui.value / 100 * (scrollPane.width() - scrollContent.width())
					) + "px");
                } else {
                    scrollContent.css("margin-left", 0);
                }
            }
        });
        //append icon to handle
        var handleHelper = scrollbar.find(".ui-slider-handle")
		.mousedown(function () {
		    scrollbar.width(handleHelper.width());
		})
		.mouseup(function () {
		    scrollbar.width("100%");
		})
		.append("<span class='ui-icon ui-icon-grip-dotted-vertical'></span>")
		.wrap("<div class='ui-handle-helper-parent'></div>").parent();
    }
    //change overflow to hidden now that slider handles the scrolling
    scrollPane.css("overflow", "hidden");
    //init scrollbar size
    if (sclength > 3) setTimeout(sizeScrollbar, 10);
    function sizeScrollbar() {
        var remainder = scrollContent.width() - scrollPane.width();
        var proportion = remainder / scrollContent.width();
        var handleSize = scrollPane.width() - (proportion * scrollPane.width());
        scrollbar.find(".ui-slider-handle").css({
            width: handleSize,
            "margin-left": -handleSize / 2
        });
        handleHelper.width("").width(scrollbar.width() - handleSize);
    }
    //reset slider value based on scroll content position
    function resetValue() {
        var remainder = scrollPane.width() - scrollContent.width();
        var leftVal = scrollContent.css("margin-left") === "auto" ? 0 :
			parseInt(scrollContent.css("margin-left"));
        var percentage = Math.round(leftVal / remainder * 100);
        scrollbar.slider("value", percentage);
    }
    //if the slider is 100% and window gets larger, reveal content
    function reflowContent() {
        var showing = scrollContent.width() + parseInt(scrollContent.css("margin-left"), 10);
        var gap = scrollPane.width() - showing;
        if (gap > 0) {
            scrollContent.css("margin-left", parseInt(scrollContent.css("margin-left"), 10) + gap);
        }
    }
    //change handle position on window resize
    $(window).resize(function () {
        resetValue();
        sizeScrollbar();
        reflowContent();
    });}
function setFileNameFromPath(path) { document.getElementById('tbhidden').value = value = path.substr(path.lastIndexOf('\\') + 1); }
function sosyallesmeLinkleri(nereye, sayfaLinki) {
    /*if (sayfaLinki == "")
        sayfaLinki = location.href;*/
    var sosyalAcilanLink;
    switch (nereye) {
        case '1': { sosyalAcilanLink = "http://www.facebook.com/share.php?u=" + encodeURIComponent( sayfaLinki); break }
        case '2': { sosyalAcilanLink = "http://twitter.com/intent/tweet?text=" + sayfaLinki; break }
    }
    window.open(sosyalAcilanLink, 'sosyal', 'height=580,width=780,resizable=yes,scrollbars=yes,toolbar=yes,status=yes');
    $.post("Socket.ashx", { what: 'social', type: nereye }, function (response, status) { }, 'json');} 
var me;
function callAS() {
	if (navigator.appName.indexOf("Microsoft") > -1) { me = document["promoarea"]; }
	else { me = document["promoarea"]; }
	var getSes = $.cookie("vp");
	if ($('a#voice').attr('class') == 'voiceon') { me.soundOn(); } else { me.soundOf(); }
	//setTimeout(function(){if (getSes == 'sesKapali') { me.soundOn();  } else {  me.soundOf();  }},500);
}
function getClubNews(gid) {
	var newsid, newstitle, newsdesc;
        $.ajax({
            type: 'GET',
            url: AppPath + 'Sockets/News.ashx?MainPageNews=true&groupId='+gid,
            dataType: 'json',
            success: function(data) {
                $('div.newcontent ul').empty();
                $.each(data, function(key, val) {
                    newsid = val.Id;
                    newstitle = val.Title;
                    newsdesc = val.BodySummary;
                    newsgroupid = val["Group.Id"];
                    newssectionid = val.SectionId;
                    var acleanlink = val.CleanUrl;
                    var urlName = CleanUrlName(newstitle);

                    $('div.newcontent ul')
							.append($('<li class="haber"/>')
								.append($('<div class="HCImg"/>')
									.append($('<a/>').attr('href', AppPath + 'haber/' + newsid + '/' + newsgroupid + '/' + newssectionid + "/" + acleanlink + ".aspx")
                   					 .append($('<img  height="99" width="99" border: "0"/>').attr({ alt: newstitle, src: AppPath + 'Image.aspx?id=' + newsid + '&type=haber' }))
                    //.append($('<img/>').attr({ height: '99', width: '99', alt: newstitle, border: '0', src: 'images/ornek-haber.gif' }))
									)
								)
								.append($('<div class="HCDesc"/>')
									.append($('<h1/>').append($('<a/>').attr('href', AppPath + 'haber/' + newsid + '/' + newsgroupid + '/' + newssectionid + "/" + acleanlink + ".aspx").html(newstitle)))
									.append($('<p/>').html(newsdesc.substring(0, 55) + '...'))
								)
						)
                });

                newsSlide(data.length);
                if (data.length < 1) {
                    $('div.newcontent ul')
						.append($('<li />').html('Haber Bulunmamaktadir.'))
                }
                $('div.newcontent ul').css('left', '0px');
            }
        });
}

