/**/
function IsNumeric(input) {
	return (input - 0) == input && input.length > 0;
}
function IsEmail(input) {
	var pattern = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);
	return pattern.test(input);
}
$.fn.exists = function() {
	return $(this).length > 0;
}

$(document).ready(function() {
		title_hazirla();
		$("#search_text").keydown(function(e) {
			$this = $(this);
			if(e.keyCode == 13) {
				val = $.trim($this.val());
				if(val != "") {
					location.href = "_/" + val;
				}				
			}
		});
});
SyntaxHighlighter.config.toolbar = false;
SyntaxHighlighter.config.clipboardSwf = 'js/highlight/clipboard.swf';
SyntaxHighlighter.all();

$(document).ready(function() {
	$("a[href^=http]:not([rel~=external])").attr("rel","external");
	$("a[rel~=external]").attr("target", "_blank");

	/* social bookmarking */
	var socialBookmarkAnimateSpeed = 250;
	$("#top_social_bookmarks a").hover(function() {
		$(this).stop(false, true).animate( {
			"top" : -3
		}, socialBookmarkAnimateSpeed).find("span").stop(false, true).animate( {
			"top" : 33
		}, socialBookmarkAnimateSpeed)
	}, function() {
		$(this).stop(false, true).animate( {
			"top" : 0
		}, socialBookmarkAnimateSpeed).find("span").stop(false, true).animate( {
			"top" : 26
		}, socialBookmarkAnimateSpeed)
	});

	/*
	 * $devDiv = $("#deviantImages"); $devHiz = 750; $.post("getdeviant.php",
	 * function(veri){ $devDiv.fadeOut($devHiz, function(){
	 * $devDiv.html(veri).fadeIn($devHiz); }) });
	 */

	$expands = $(".expand-collapse");
	$expands.click(function() {
		$this = $(this), $exSpan = $expands.find("span");
		if ($exSpan.eq(0).hasClass("collapse")) {
			$exSpan.removeClass("collapse");
			$("body").removeClass("expanded");
			$expands.attr("title", "Geniş Görünüm");
		} else {
			$exSpan.addClass("collapse");
			$("body").addClass("expanded");
			$expands.attr("title", "Dar Görünüm");
		}
	});
	$("table.css_table__").each(function(index, oge) {
		oge = $(oge);
		oge.find("thead tr").each(function(i, o) {
			$(o).find("th:eq(0)").addClass("ilk");
		});
		oge.find("tbody tr").each(function(i, o) {
			$(o).find("td:eq(0)").addClass("ilk");
		});
	});
});
