﻿/*
	Author: Müslüm TORUN - www.muslumtorun.com
*/
$(document).ready(function(){
	//jftr ayarlari
	jFTR.run();
	//aktif link
	activeLink();
	//complement
	$.Complement();
	//jprompt
	initJPrompt();
	//dropdownlist elamanları için
	$("#dropdownlist li").bind("click", function(){
		var $this = $(this);
		var $divs = $("#dropdownlist .notetable");
		dropdown.closeAll($divs);
		dropdown.open($this.find(".notetable"));
		$("body,html").animate({scrollTop:$(document).height()}, "slow")
	});
});

var dropdown = {
		speed: "fast",
		open: function(ths) {
			ths.slideDown(dropdown.speed);
		},
		close: function(ths) {
			ths.slideUp(dropdown.speed)
		},
		closeAll: function(obj) {
			$(obj).slideUp(dropdown.speed);
		}
	};

var jFTR = {
	run: function() {
		$(".jftr").jFTR({
			src: "/_swf/arial.swf",
			css: [ '* { color: #c1080b; font-size: 30pt; text-align: left }',
				   'a { color: #0099CC; text-decoration: none; }',
				   'a:hover { text-decoration: underline; }'
				 ]
		});
		
		$("#dropdownlist h1").jFTR({
			src: "/_swf/calibri.swf",
			css: [ '* { color: #C1080B; font-size: 25px; text-align: left }',
				   'a { color: #0099CC; text-decoration: none; }',
				   'a:hover { text-decoration: underline; }'
				 ]
		});
	},
	refresh: function() {
		jFTR.run();
	}
};

function activeLink() {
	var _loc = location.href;
	$("#right-menu a").each(function(){
		if (_loc.indexOf($(this).attr("href")) != -1)
			$(this).addClass("selected");
		else
			$(this).removeClass();
	});
}
