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);
}(function($) {
	$.fn.self = function() {
		return $(this).clone().appendTo($("<div />")).parent().html();
	}
})(jQuery);
function title_hazirla() {
	$("input[title!=], textarea[title!=]").each(function(a, b) {
		if($(this).val() == "") {
			$(this).val($(this).attr("title"));
			$(this).addClass("titled");
		}
		$(this).focus(function() {
			if($(this).val() == $(this).attr("title")) {
				$(this).val("");
				$(this).removeClass("titled");
			}
		});
		$(this).blur(function() {
			if($(this).val() == "") {
				$(this).val($(this).attr("title"));
				$(this).addClass("titled");
			}
		});
	});
	$(window).unload(function() {
		title_kaldir()
	});
}

function title_kaldir() {
	$("input.titled[title!=],textarea.titled[title!=]").each(function(a, b) {
		if($(this).val() == $(this).attr("title")) {
			$(this).val("");
		}
		$(this).removeClass("titled");
	});
}

$(document).ready(function() {
	var SW = screen.width;
	if(SW < 1200 && SW > 1000) {
		$("html").addClass("SR_1024x768");
	}
	// debugprop();
});
function MathBase(girdi) {
	var yeni = String((girdi)).split(".");
	return parseInt(yeni[0]);
}

function formatCurrency(num) {
	num = num.toString().replace(/\$|\,/g, '');
	if(isNaN(num))
		num = "0";
	sign = (num == ( num = Math.abs(num)));
	num = Math.floor(num * 100 + 0.50000000001);
	cents = num % 100;
	num = Math.floor(num / 100).toString();
	if(cents < 10)
		cents = "0" + cents;
	for(var i = 0; i < Math.floor((num.length - (1 + i)) / 3); i++)
	num = num.substring(0, num.length - (4 * i + 3)) + '.' + num.substring(num.length - (4 * i + 3));
	return (((sign) ? '' : '-') + num + ',' + cents);
}

function formsubmit(islem, alanlar, method) {
	$form = $("<form method='" + method + "' />").attr("action", islem);
	$bos = $("<input type='hidden' />");
	$.each(alanlar, function(key, value) {
		$bos.clone().attr("name", key).val(value).appendTo($form);
	});
	$form.appendTo($("body")).submit();
}
