﻿function SetParameterCookie(sName, sValue, expDate) { var sExpires; if (expDate == "session") { sExpires = ""; } else { sExpires = ";expires=" + (expDate ? expDate : new Date(2021, 10, 4).toGMTString()); } document.cookie = sName + "=" + escape(sValue) + sExpires + ";path=/" + ((location.host.toLowerCase().indexOf("ntvmsnbc.com") >= 0) ? ";domain=ntvmsnbc.com" : ""); }

$(function () {
  if ($(".dropdownStart a")) {
    $(".dropdownStart a").click(function () {
      var selectBox = $(this).parent().parent().find("ul.selectbox");
      if ($(selectBox).hasClass("dn")) {
        $(selectBox).removeClass("dn").hover(function () { }, function () {
          $(this).addClass("dn");
        });
      } else {
        $(selectBox).addClass("dn");
      };
      return false;
    });
  };

  $("#ntvspor-wc2010 a, a.dunya-kupasi-merkezi").click(function () {
    $("#wc2010InteractiveIFrame").attr("src", "http://media1.ntvspor.net/pub/afp/isports/sample/tr.WC2010-index.html");
    new Boxy($("#wc2010Interactive"), { modal: true, title: "Dünya Kupası 2010", closeText: "Kapat", afterShow: function () { this.resize(800, 600); } });
    return false;
  });

  $("#searchString").labelify({ labelledClass: "labelHighlight" });


  $("a#rememberUserPass").click(function () {
    $("#signinForm").addClass("dn");
    $("#rememberWhat").attr("value", "p");
    $("#rememberForm").removeClass("dn");
    $("#secondarySigninFunctions").addClass("dn");
    return false;
  });
  $("button#cancelRemember").click(function () {
    $("#signinForm").removeClass("dn");
    $("#rememberForm").addClass("dn");
    $("#secondarySigninFunctions").removeClass("dn");
    return false;
  });
  $("#sUuserTerms,#userTermsandConditions").click(function () {
    if ($("#userTermsandConditions").hasClass("dn")) {
      $('#userTermsandConditions div:first').load('/KullanimSozlesmesi.html', function () {
        $("#userTermsandConditions").removeClass("dn");
      });
    } else {
      $("#userTermsandConditions").addClass("dn");
    }
    return false;
  });
  $("p.tac:first").click(function () {
    $("#userTerms").attr('checked', 'checked');
  })

  $('#navContent ul li').hover(function () {
      $(this).addClass('hover');
    }, function () {
      $(this).removeClass('hover');
  });

  $("a.nw").click(function () {
    window.open(this.href);
    return false;
  })

});

function showLogin() {
  new Boxy($("#signin"), { modal: true, title: "Giriş Yap", closeText: "Kapat", afterShow: function () { this.resize(400, 190); } });
  return false;
}

function getContentsByFilterDateTime(categoryID, type, dateTimeFilter, controlID) {
  $.getJSON("/Content/GetContentByDateTimeFilter/" + categoryID + "/" + type + "/" + dateTimeFilter, null, function (data) {
  	$(controlID).html(data);
  });
}
