function fxFormDataToAjax(obj){
sData = ''
$('input,textarea,select',obj).each(
function(){
if($(this).attr('name').length>0){
sName = $(this).attr('name');
sData += '&'+sName+'='+encodeURIComponent($(this).val())
}
}
)
return sData
}
function fAlert(sContent,sTitle){
$("body").append('
');
$("#alertOverlay").css({height: $(document).height(),opacity: 0.85});
//$("#alertContainer").css({minWidth: $("#alertContainer").outerWidth(),maxWidth: $("#alertContainer").outerWidth()});
fAlertReposition()
$(window).bind('resize',fAlertReposition);
}
function fAlertReposition(){
var top = (($(window).height() / 2) - ($("#alertContainer").outerHeight() / 2)) -75;
var left = (($(window).width() / 2) - ($("#alertContainer").outerWidth() / 2));
if( top < 0 ) top = 0;
if( left < 0 ) left = 0;
$("#alertContainer").css({
top: top + 'px',
left: left + 'px'
});
$("#alertOverlay").height($(document).height());
}
function fAlertClose(){
$('div[id=alertContainer],div[id=alertOverlay]').remove()
}
function fWaitMini(){
if($('#waitMini').length>0){
$('#waitMini').remove()
}
else {
$('body').append('Lütfen bekleyiniz...
')
}
}
$(function (){
$.fn.toggleIMG = function () {
this.each( function() {
var $t = $(this);
var sImgSrc = $t.attr('src')
var sImgSrcOther = $t.attr('srcOther')
$t.attr('src',sImgSrcOther)
$t.attr('srcOther',sImgSrc)
});
return this;
}
$.fn.dbID = function () {
return this.attr('dbID');
}
// ajax initials
$.ajaxDefaultParams = {
async:false,
type:'GET',
urlUser:'/_php_includes/ajaxUser.php',
urlAdmin:'/_php_includes/ajaxAdmin.php',
dataType:'script',
beforeSend:function(op){},
complete:function(op){}
}
$.ajaxDefault = function(options){
if(options.func)
options.data += '&func='+options.func
if(options.hash)
options.data += '&hash='+options.hash
var current = $.extend({},$.ajaxSetup,$.ajaxDefaultParams,options);
//alert(current.data)
$.ajaxSetup({global:false});
$.ajax(current)
}
$.fn.xUser = function(options){
$.ajaxDefault($.extend({url:$.ajaxDefaultParams.urlUser},options));
}
$.fn.xAdmin = function(options){
$.ajaxDefault($.extend({url:$.ajaxDefaultParams.urlAdmin},options));
}
$('#alertContainer div[id=alertTitle] b').live('click',fAlertClose)
});