﻿;(function($){$.fn.superfish=function(op){var sf=$.fn.superfish,c=sf.c,over=function(){var $$=$(this),menu=getMenu($$);clearTimeout(menu.sfTimer);$$.showSuperfishUl().siblings().hideSuperfishUl()},out=function(){var $$=$(this),menu=getMenu($$),o=sf.op;clearTimeout(menu.sfTimer);menu.sfTimer=setTimeout(function(){o.retainPath=($.inArray($$[0],o.$path)>-1);$$.hideSuperfishUl();if(o.$path.length&&$$.parents(['li.',o.hoverClass].join('')).length<1){over.call(o.$path)}},o.delay)},getMenu=function($menu){var menu=$menu.parents(['ul.',c.menuClass,':first'].join(''))[0];sf.op=sf.o[menu.serial];return menu},addArrow=function($a){$a.addClass(c.anchorClass).append($arrow.clone())};return this.each(function(){var s=this.serial=sf.o.length;var o=$.extend({},sf.defaults,op);o.$path=$('li.'+o.pathClass,this).slice(0,o.pathLevels).each(function(){$(this).addClass([o.hoverClass,c.bcClass].join(' ')).filter('li:has(ul)').removeClass(o.pathClass)});sf.o[s]=sf.op=o;$('li:has(ul)',this)[($.fn.hoverIntent&&!o.disableHI)?'hoverIntent':'hover'](over,out).each(function(){}).not('.'+c.bcClass).hideSuperfishUl();var $a=$('a',this);$a.each(function(i){var $li=$a.eq(i).parents('li');$a.eq(i).focus(function(){over.call($li)}).blur(function(){out.call($li)})});o.onInit.call(this)}).each(function(){var menuClasses=[c.menuClass];if(sf.op.dropShadows&&!($.browser.msie&&$.browser.version<7))menuClasses.push(c.shadowClass);$(this).addClass(menuClasses.join(' '))})};var sf=$.fn.superfish;sf.o=[];sf.op={};sf.IE7fix=function(){var o=sf.op;if($.browser.msie&&$.browser.version>6&&o.dropShadows&&o.animation.opacity!=undefined)this.toggleClass(sf.c.shadowClass+'-off')};sf.c={bcClass:'sf-breadcrumb',menuClass:'sf-js-enabled',anchorClass:'sf-with-ul',arrowClass:'sf-sub-indicator',shadowClass:'sf-shadow'};sf.defaults={hoverClass:'sfHover',pathClass:'overideThisToUse',pathLevels:1,delay:800,animation:{opacity:'show'},speed:'normal',autoArrows:false,dropShadows:false,disableHI:false,onInit:function(){},onBeforeShow:function(){},onShow:function(){},onHide:function(){}};$.fn.extend({hideSuperfishUl:function(){var o=sf.op,not=(o.retainPath===true)?o.$path:'';o.retainPath=false;var $ul=$(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass).find('>ul').hide().css('visibility','hidden');o.onHide.call($ul);return this},showSuperfishUl:function(){var o=sf.op,sh=sf.c.shadowClass+'-off',$ul=this.addClass(o.hoverClass).find('>ul:hidden').css('visibility','visible');sf.IE7fix.call($ul);o.onBeforeShow.call($ul);$ul.animate(o.animation,o.speed,function(){sf.IE7fix.call($ul);o.onShow.call($ul)});return this}})})(jQuery);

$(document).ready(function () {
    $('#slider1content li a img').css('height', '347px');
    $("#menu > li").hover(
        function () { $(this).addClass("hoverli"); },
        function () { $(this).removeClass("hoverli"); }
    );
    $('input[name=sample]:checked').val()
    jQuery('#menu').superfish();
    $(".planlama_button").click(function () {
        if ($(".planlama_button a").hasClass('acik')) {
            $("#planlama").animate({ marginTop: '-244' }, 1000, function () { $('.planlama_button a').removeClass('acik'); });
        } else {
            $("#planlama").animate({ marginTop: '0' }, 1000, function () { $('.planlama_button a').addClass('acik'); });
        }
    });
    jQuery('.spBx:nth-child(2n)').css('margin-right', '0');
    jQuery('#menu li span').live('click', function () {
        window.location = $(this).next().attr('href');
    });
    $(".ozelproje-detay").click(function () {
        var id = $(this).attr("rel");
        $.ajax({
            type: 'POST',
            url: '/OzelProjeDetay/' + id,
            dataType: "html",
            data: '',
            success: function (data) {
                var singleP = $('#singleProject');
                singleP.animate({ opacity: 0 }, 300, function () { singleP.html(data); });
                setTimeout(function () { singleP.animate({ opacity: 1 }, 700) }, 700);
                $('html, body, document').animate({ scrollTop: 0 }, 'slow');
                return false;
            }
        });
    });

    $("#sehirRd").change(function () {
        var cityR = $("#sehirRd").val();
        if (cityR == '00') {
            $('#sehirRC').attr("disabled", "disabled");
            return false;
        }
        $.ajax({
            type: 'GET',
            url: '/canliyayinlar/' + cityR + "/radyo",
            dataType: "json",
            data: '',
            success: function (data) {
                var tempR = "";
                $.each(data, function (i, mecra) {
                    tempR += '<option value="' + mecra.Link + '/">' + mecra.MecraAdi + '</option>';
                });
                $('#sehirRC').removeAttr('disabled');
                $("#sehirRC").html(tempR);
            }
        });
    });

    $("#sehirTv").change(function () {
        var cityT = $("#sehirTv").val();
        if (cityT == '00') {
            $('#sehirTC').attr("disabled", "disabled");
            return false;
        }
        $.ajax({
            type: 'GET',
            url: '/canliyayinlar/' + cityT + "/televizyon",
            dataType: "json",
            data: '',
            success: function (data) {
                var tempT = "";
                $.each(data, function (i, mecra) {
                    tempT += '<option value="' + mecra.Id + '">' + mecra.MecraAdi + '</option>';
                });
                //alert(tempT)
                $('#sehirTC').removeAttr('disabled');
                $("#sehirTC").html(tempT);
            }
        });
    });
    $('.loc .radioBt, .loc .tvBt').live('click', function () {
        var selectB = $(this).prev('select');
        if (selectB.attr('disabled')) {
            if ($(this).hasClass('radioBt')) {
                alert('Lütfen öncelikle yerel yayınları dinlemek istediğiniz şehri şeçiniz.');
            } else {
                alert('Lütfen öncelikle yerel yayınları izlemek istediğiniz şehri şeçiniz.');
            }
            return false;
        }
        var selectV = selectB.val();
		alert(selectV);
		return false;
        //window.open('/popup.html?url=' + selectV, 'localTime', 'width=350,height=360,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=no');
        window.open('/modules/shoutcast/popup.asp?rID=' + selectV, 'localTime', 'width=490,height=120,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=no');
    });
    $('#planlama label').live('click', function () {
        if ($('input[name=pradio]:checked').val() == '1') {
            $('#login2').fadeOut('200', function () {
                $('#login').fadeIn('fast');
            });
        } else if ($('input[name=pradio]:checked').val() == '2') {
            $('#login').fadeOut('200', function () {
                $('#login2').fadeIn('fast');
            });
        }
    });
});

function form_validate() {
	var res3, res4;
	if ($('#yayan option:selected').val() != '00') {
	    $('#yayan').css('border-color', '#d6d8d8');
		res3 = true;
	} else {
        $('#yayan').css('border-color', '#f58f8f');
		res3 = false;
	}
	if($('#pass2').val()) {
		$('#pass2').removeClass('false');
		res4 = true;
	} else {
		$('#pass2').addClass('false');
		res4 = false;
	}
	if(res3 && res4) {return true} else {return false}
 }
 function form_validate2() {
     var res, res2;
     
     if ($('#name').val()) {
         $('#name').removeClass('false');
         res = true;
     } else {
         $('#name').addClass('false');
         res = false;
     }
     if ($('#pass').val()) {
         $('#pass').removeClass('false');
         res2 = true;
     } else {
         $('#pass').addClass('false');
         res2 = false;
     }
     if (res && res2) { return true } else { return false }
 }
// Cufon Start
Cufon.replace('#planlama p');
Cufon.replace('#nv li.menu01 > a', { hover: { color: '#fff'} });
Cufon.replace('#nv2 ul li a');
Cufon.replace('.search h1');
Cufon.replace('.loc p.srch');
Cufon.replace('h3.title');
Cufon.replace('.bc a');
Cufon.replace('.bc em');
Cufon.replace('.planlama_button a');
Cufon.replace('.svBx p');
Cufon.replace('.hrApp .yhdr i', { hover: false });
Cufon.replace('.yhdr a', {hover: true });
Cufon.replace('form .sendForm', { hover: {color: '#fff'}});
Cufon.replace('.hrApp h2');
Cufon.replace('a.appL', { hover: {color: '#fff'}});
Cufon.replace('.spBx h1');
Cufon.replace('a.listBt', { hover: true });
Cufon.replace('.pasiv');
Cufon.replace('.nopage h2');
Cufon.replace('.nopage p');
Cufon.replace('.nopage a', {hover: true});


Cufon.replace('.chnList li h1');
Cufon.replace('.spBx h2');
// Cufon End



