﻿/// <reference path="scripts/jquery-1.3.2-vsdoc2.js" />

// e-bülten aboneliği için textbox varsayılan metnini ayarlama
$(document).ready(function() {
$('input.textbox-newsletter').addClass("textbox-newsletter-unfocused");
var origValue = [];
    $('input.textbox-newsletter').each(function(currentIndex) {
        origValue.push($(this).val());
        $(this).focus(function() {
            $(this).removeClass("textbox-newsletter-unfocused");
            var defaultText = $(this).val();
            if ($(this).val() == origValue[currentIndex]) {
                $(this).val('');
            }

            $(this).blur(function() {
                var userInput = $(this).val();
                if (userInput == '') {
                    $(this).val(defaultText);
                    $(this).addClass("textbox-newsletter-unfocused");
                }
            });
        });
    });
});
// e-bülten aboneliği için textbox varsayılan metnini ayarlama sonu

// smooth scrolling
$(document).ready(function() {
    $('a[href*=#]').click(function() {
        if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '')
    && location.hostname == this.hostname) {
            var $target = $(this.hash);
            $target = $target.length && $target
      || $('[name=' + this.hash.slice(1) + ']');
            if ($target.length) {
                var targetOffset = $target.offset().top;
                $('html,body')
        .animate({ scrollTop: targetOffset }, 1000);
                return false;
            }
        }
    });
});
// smooth scrolling sonu

// eşit yükseklikte div
$(document).ready(function() {
    var maxHeight = 0;
    var left_side_height = $('.panel-content-left').height();
    var right_side_height = $('.panel-content-right').height();

    if (left_side_height > right_side_height)
        maxHeight = left_side_height;
    else
        maxHeight = right_side_height;

    $('.panel-content-left').height(maxHeight);
    $('.panel-content-right').height(maxHeight);
});
// eşit yükseklikte div

// nesne ortalama
jQuery.fn.center = function() {
    //this.css("position", "absolute");
    this.css("top", ($(window).height() - this.height()) / 2 + $(window).scrollTop() + "px");
    this.css("left", ($(window).width() - this.width()) / 2 + $(window).scrollLeft() + "px");
    return this;
}
// nesne ortalama

// yeni pencerede aç
$(document).ready(function() {
    $('a[rel="external"]').click(function() {
        window.open($(this).attr('href'));
        return false;
    });
    // tooltip
	if (($.browser.msie && $.browser.version.substr(0,1)>7) || !$.browser.msie) {
		$("a, input, textarea").tipTip();
    	$(".textbox-newsletter").tipTip();
    	$(".newsletter-button").tipTip();
	}
    
});
// ---------------
$(document).ready(function() {
    $("a[rel^='prettyPhoto']").prettyPhoto({ theme: 'facebook' });
});