//first load jquery
function setButtons()
{
	$(".btnDelete").button
	(
		{
		icons: 
			{
				primary: "ui-icon-trash",
			},
		text: false
		}
	);
	$(".btnAdd").button
	(
		{
		icons: 
			{
				primary: "ui-icon-plusthick",
			},
		text: false
		}
	);		
	$(".btnRemove").button
	(
		{
		icons: 
			{
				primary: "ui-icon-minusthick",
			},
		text: false
		}
	);	
	$(".btnUpdate").button
	(
		{
		icons: 
			{
				primary: "ui-icon-gear",
			},
		text: false
		}
	);
	$(".btnOk").button
	(
		{
		icons: 
			{
				primary: "ui-icon-check",
			},
		text: false
		}
	);
	$(".btnNext").button
	(
		{
		icons: 
			{
				primary: "ui-icon-triangle-1-e",
			},
		text: false
		}
	);
	$(".btnPre").button
	(
		{
		icons: 
			{
				primary: "ui-icon-triangle-1-w",
			},
		text: false
		}
	);
	
	$(".btnSearch").button
	(
		{
		icons: 
			{
				primary: "ui-icon-search",
			},
		text: false
		}
	);
	$(".btnRefresh").button
	(
		{
		icons: 
			{
				primary: "ui-icon-refresh",
			},
		text: false
		}
	);
	$(".btnPlus").button
	(
		{
		icons: 
			{
				primary: "ui-icon-plusthick",
			},
		text: false
		}
	);
	
	$(".btnImage").button
	(
		{
		icons: 
			{
				primary: "ui-icon-image",
			},
		text: false
		}
	);	
	$(".btnBulb").button
	(
		{
		icons: 
			{
				primary: "ui-icon ui-icon-lightbulb",
			},
		text: false
		}
	);
	$(".btn").button();
}

function setAjaxInfo(divId)
{
	$("#"+divId).ajaxStart(function()
	{ 
		$("#"+divId).show();
		$("#"+divId).html("Yükleniyor");
	});
	
	$("#"+divId).ajaxStop(function()
	{ 
		$("#"+divId).html("");
		$("#"+divId).hide();
	});
	/*$("#"+divId).ajaxSend(function()
	{ 
		$("#"+divId).append(" gönderildi");
	});
	$("#"+divId).ajaxComplete(function()
	{ 
		$("#"+divId).append(" tamamlandı ");
	});
	$("#"+divId).ajaxSuccess(function()
	{ 
		$("#"+divId).append(" başarılı ");
	});*/

	$("#"+divId).ajaxError(function()
	{ 
		$("#"+divId).show();
		$("#"+divId).append("İstek Sonucu Hata Oluştu");
	});


}

function limitTextArea()
	{
		
		$('textarea[maxlength]').keyup(function()
		{
			
			var max = parseInt($(this).attr("maxlength"));
			
			if($(this).val().length > max)
			{
				$(this).val($(this).val().substr(0, $(this).attr('maxlength')));
			}

			$(this).parent().find('.charsRemaining').html('You have ' + (max - $(this).val().length) + ' characters remaining');
		});
		
		$(':text[maxlength]').keyup(function()
		{
			
			var max = parseInt($(this).attr("maxlength"));
			
			if($(this).val().length > max)
			{
				$(this).val($(this).val().substr(0, $(this).attr('maxlength')));
			}

			$(this).parent().find('.charsRemaining').html('You have ' + (max - $(this).val().length) + ' characters remaining');
		});
	}
function makeButton(id,image,size)
	{
			$("#"+id).css("background","url('"+image+"') no-repeat 0 0")
			$("#"+id).bind("mousedown", function()
			{
				$(this).css("background-position","0 -"+(size*2));
			});

			$("#"+id).bind("mouseup", function()
			{
				$(this).css("background-position","0 -"+size);
			});

			$("#"+id).bind("mouseover", function()
			{
				$(this).css("background-position","0 -"+size);
			});
			$("#"+id).bind("mouseout", function()
			{
				$(this).css("background-position","0 0px");
			});
	
	}


//global settings
var bgColor1="#ffeeee";
var bgColor2="#ffffff";





