$(document).ready(function () {
    //Examples of how to assign the ColorBox event to elements
    $("a[rel='example1']").colorbox();
    $("a[rel='example2']").colorbox({ transition: "fade" });
    $("a[rel='example3']").colorbox({ transition: "none", width: "75%", height: "75%" });
    $("a[rel='example4']").colorbox({ slideshow: true });
    $(".example5").colorbox();
    $(".example6").colorbox({ iframe: true, innerWidth: 425, innerHeight: 344 });
    $(".example7").colorbox({ width: "80%", height: "80%", iframe: true });
    $(".example8").colorbox({ width: "50%", inline: true, href: "#inline_example1" });
    $(".example9").colorbox({
        onOpen: function () { alert('onOpen: colorbox is about to open'); },
        onLoad: function () { alert('onLoad: colorbox has started to load the targeted content'); },
        onComplete: function () { alert('onComplete: colorbox has displayed the loaded content'); },
        onCleanup: function () { alert('onCleanup: colorbox has begun the close process'); },
        onClosed: function () { alert('onClosed: colorbox has completely closed'); }
    });

    //Example of preserving a JavaScript event for inline calls.
    $("#click").click(function () {
        $('#click').css({ "background-color": "#f00", "color": "#fff", "cursor": "inherit" }).text("Open this window again and this message will still be here.");
        return false;
    });
});

$(function () {
    $('img.image1').data('ad-desc', 'Whoa! This description is set through elm.data("ad-desc") instead of using the longdesc attribute.<br>And it contains <strong>H</strong>ow <strong>T</strong>o <strong>M</strong>eet <strong>L</strong>adies... <em>What?</em> That aint what HTML stands for? Man...');
    $('img.image1').data('ad-title', 'Title through $.data');
    $('img.image4').data('ad-desc', 'This image is wider than the wrapper, so it has been scaled down');
    $('img.image5').data('ad-desc', 'This image is higher than the wrapper, so it has been scaled down');
    var galleries = $('.ad-gallery').adGallery();
    $('#switch-effect').change(
          function () {
              galleries[0].settings.effect = $(this).val();
              return false;
          }
        );
    $('#toggle-slideshow').click(
          function () {
              galleries[0].slideshow.toggle();
              return false;
          }
        );
    galleries[0].addAnimation('wild',
          function (img_container, direction, desc) {
              var current_left = parseInt(img_container.css('left'), 10);
              var current_top = parseInt(img_container.css('top'), 10);
              if (direction == 'left') {
                  var old_image_left = '-' + this.image_wrapper_width + 'px';
                  img_container.css('left', this.image_wrapper_width + 'px');
                  var old_image_top = '-' + this.image_wrapper_height + 'px';
                  img_container.css('top', this.image_wrapper_height + 'px');
              } else {
                  var old_image_left = this.image_wrapper_width + 'px';
                  img_container.css('left', '-' + this.image_wrapper_width + 'px');
                  var old_image_top = this.image_wrapper_height + 'px';
                  img_container.css('top', '-' + this.image_wrapper_height + 'px');
              };
              if (desc) {
                  desc.css('bottom', '-' + desc[0].offsetHeight + 'px');
                  desc.animate({ bottom: 0 }, this.settings.animation_speed * 2);
              };
              img_container.css('opacity', 0);
              return { old_image: { left: old_image_left, top: old_image_top, opacity: 0 },
                  new_image: { left: current_left, top: current_top, opacity: 1 },
                  easing: 'easeInBounce',
                  speed: 2500
              };
          }
        );
});
function debug(str) {
    if (window.console && window.console.log && jQuery.browser.mozilla) {
        console.log(str);
    } else {
        $('#debug').show().val($('#debug').val() + str + '\n');
    }
}

function nesneyarat() {
    var nesne;
    var tarayici = navigator.appName;
    if (tarayici == "Microsoft Internet Explorer") {
        nesne = new ActiveXObject("Microsoft.XMLHTTP");
    } else {
        nesne = new XMLHttpRequest();
    }
    return nesne;
}

var http = nesneyarat();

function sehirGonder() {

    var il = document.getElementById('Sehir').value;
    http.open('get', 'Inc/ilceGetir.asp?sehirID=' + il);
    http.onreadystatechange = function () {
        if (http.readyState == 4) {
            document.getElementById('ilceDiv').innerHTML = http.responseText;
        }
    };
    http.send(null);
}

function yaziLinkim(Yazim) {

    window.location.href = Yazim;

}
