﻿var timerId = 0;

$(document).ready(function () {
  if ($("div.home-contents")) {
    $("div.home-contents ul li").mouseover(function () {
      $("div.home-contents ul li").each(function () {
        $(this).removeClass("selected");
      });
      $(this).addClass("selected");
    });
    $("div.home-contents ul li:first").addClass("selected");
  }
});

//$(document).ready(function() {
//    if ($("div.home-contents")) {
//        $("div.home-contents ul li").mouseover(function() {
//            $("div.home-contents ul li").each(function() {
//                $(this).removeClass("selected");
//            });
//            $(this).addClass("selected");
//            $("div.home-description").hide();
//        });
//        $("div.home-contents").mouseout(function() {
//            $("div.home-contents ul li").each(function() {
//                $(this).removeClass("selected");
//            });
//            $("div.home-description").show();
//        });
//    }
//});


function browseImages(target) {
  textbox = target;
  window.open('/admin/browsers/image.aspx', "imagebrowser", "menubar=no,width=800,height=500,toolbar=no,scrollbars=yes");
}

function browseFiles(target) {
  textbox = target;
  window.open('/admin/browsers/files.aspx', "imagebrowser", "menubar=no,width=800,height=500,toolbar=no,scrollbars=yes");
}


function SetUrl(url) {
  $('#' + textbox).val(url.substring(url.lastIndexOf('/') + 1));
}

function InsertDate(target) {
  var now = new Date();
  var date = ((now.getDate() < 10) ? "0" : "") + now.getDate();
  var month = ((now.getMonth() + 1 < 10) ? "0" : "") + (now.getMonth() + 1);
  var year = (now.getYear() < 1000) ? now.getYear() + 1900 : now.getYear();
  $(target).value = date + '/' + month + '/' + year;
}
