<?php
	header('Content-Type: text/javascript');
	include("map.php");
?>
jQuery(document).ready(function(){
/*
dragover resize upload btn
	jQuery(window).on('dragenter', function(){
		jQuery(this).preventDefault();
	});
	jQuery('#upload_image_btn').bind('dragover', function(){
		jQuery(this).addClass('drag-over');
	});
	jQuery('#upload_image_btn').bind('dragleave', function(){
		jQuery(this).removeClass('drag-over');
	});
	jQuery('#upload_image_btn').bind('drop', function(){
		jQuery(this).removeClass('drag-over');
	});
*/
//qr toogle
	jQuery('.fa-sliders-h').click(function(){
	  jQuery('#q').toggleClass('qbr');
	});
	var ts1 = jQuery(".v8-col200pxL-right").attr("ts1");
	var ts2 = jQuery(".v8-col200pxL-right").attr("ts2");
	var ts3 = jQuery(".v8-col200pxL-right").attr("ts3");
	if(typeof ts1 !== 'undefined'){
		jQuery(".v8-col200pxL-right").append('<div class="v3-alert-warning" style="padding:5px; clear:both;"><i class="fa fa-plus text-warning"></i> '+ts1+' <i class="fa fa-refresh text-warning"></i> '+ts2+' <?php if($_GET["islem"]=="duye"){?><i class="fa fa-user text-warning"></i> '+ts3+'<?php }?></div>');	
	}
	jQuery(".crm_info").each(function(i){
		var info = jQuery(this).attr("data-info");
		jQuery(this).append('<i class="fas fa-question-circle info_icon text-info" data-toggle="tooltip" title="'+info+'"></i>');	
	});
	<?php if($darkmode=="1"){?>
	darkmode();
	<?php }?>
	<?php if($e10==1 and $_SESSION["user"]=="admin"){?>
		jQuery(".demo").attr("disabled", true);
	<?php }?>
	<?php if($E==1){?>
		jQuery(".editor").attr("disabled", true);
	<?php }?>
	jQuery("#filtre").keyup( function(){
		var value = jQuery(this).val().toLowerCase();
		jQuery(".filterable tr").filter(function() {
			jQuery(this).toggle(jQuery(this).text().toLowerCase().indexOf(value) > -1)
		});
	});
});

function cevir(metin) {
    const replacements = {'A': 'a', 'B': 'b', 'C': 'c', 'Ç': 'c', 'ç': 'c', 'D': 'd', 'E': 'e', 'F': 'f', 'G': 'g', 'Ğ': 'g', 'ğ': 'g', 'H': 'h', 'I': 'i', 'ı': 'i', 'İ': 'i', 'J': 'j', 'K': 'k', 'L': 'l', 'M': 'm', 'N': 'n', 'O': 'o', 'Ö': 'o', 'ö': 'o', 'P': 'p', 'R': 'r', 'S': 's', 'Ş': 's', 'ş': 's', 'T': 't', 'U': 'u', 'Ü': 'u', 'ü': 'u', 'V': 'v', 'Y': 'y', 'Z': 'z', ' ': '-', '/': '-', "'": '', '"': '', '!': '', '.': '', ',': '', '+': '', '_': '-', '(': '', ')': '', '=': '', '?': '', '&': '', '%': '', '[': '', ']': '', '{': '', '}': ''};
  
    // Replace characters using the replacements map
    for (const [key, value] of Object.entries(replacements)) {
        metin = metin.replace(new RegExp(key, 'g'), value);
    }
  
    return metin;
}

function delay(callback, ms) {
  var timer = 0;
  return function() {
	var context = this, args = arguments;
	clearTimeout(timer);
	timer = setTimeout(function () {  callback.apply(context, args); }, ms || 0); };
}

function darkmode() {
   var body = document.body;
   body.classList.toggle("dark-mode");
   jQuery('html').toggleClass("header-dark");
   jQuery('html').toggleClass("sidebar-light");
}

function vpass(ID) {
	var i = document.getElementById(ID);
	if (i.type === "password") {
		i.type = "text";
	} else {
		i.type = "password";
	}
}

jQuery(function() {
  jQuery(".repdot").keyup(function() {
        jQuery(this).val(jQuery(this).val().replace(",", "."));
  });
});

function setval(input,value) {
    jQuery(input).val(value);
}

function sortTable(id,n){
	var table, rows, switching, i, x, y, shouldSwitch, dir, switchcount = 0;
	table = document.getElementById(id);
	switching = true;
	dir = "asc";
	while (switching) {
		switching = false;
		rows = table.rows;
		for (i = 1; i < (rows.length - 1); i++) {
			shouldSwitch = false;
			x = rows[i].getElementsByTagName("TD")[n];
			y = rows[i + 1].getElementsByTagName("TD")[n];
			if (dir == "asc") {
				if (x.innerHTML.toLowerCase() > y.innerHTML.toLowerCase()) {
					shouldSwitch = true;
					break;
				}
			} else if (dir == "desc") {
			if (x.innerHTML.toLowerCase() < y.innerHTML.toLowerCase()) {
				shouldSwitch = true;
				break;
			}
		}
	}
	if (shouldSwitch) {
		rows[i].parentNode.insertBefore(rows[i + 1], rows[i]);
		switching = true;
				switchcount ++;
			} else {
				if (switchcount == 0 && dir == "asc") {
					dir = "desc";
					switching = true;
				}
			}
		}
	}

<?php if($_GET["page"]<>"scripts"){?>
function domo(){
	var elements = [
		"esc","tab","space","return","backspace","scroll","capslock","numlock","insert","home","del","end","pageup","pagedown",
		"left","up","right","down",
		"f1","f2","f3","f4","f5","f6","f7","f8","f9","f10","f11","f12",
		"1","2","3","4","5","6","7","8","9","0",
		"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z",
		"Ctrl+a","Ctrl+b","Ctrl+c","Ctrl+d","Ctrl+e","Ctrl+f","Ctrl+g","Ctrl+h","Ctrl+i","Ctrl+j","Ctrl+k","Ctrl+l","Ctrl+m",
		"Ctrl+n","Ctrl+o","Ctrl+p","Ctrl+q","Ctrl+r","Ctrl+s","Ctrl+t","Ctrl+u","Ctrl+v","Ctrl+w","Ctrl+x","Ctrl+y","Ctrl+z",
		"Shift+a","Shift+b","Shift+c","Shift+d","Shift+e","Shift+f","Shift+g","Shift+h","Shift+i","Shift+j","Shift+k","Shift+l",
		"Shift+m","Shift+n","Shift+o","Shift+p","Shift+q","Shift+r","Shift+s","Shift+t","Shift+u","Shift+v","Shift+w","Shift+x",
		"Shift+y","Shift+z",
		"Alt+a","Alt+b","Alt+c","Alt+d","Alt+e","Alt+f","Alt+g","Alt+h","Alt+i","Alt+j","Alt+k","Alt+l",
		"Alt+m","Alt+n","Alt+o","Alt+p","Alt+q","Alt+r","Alt+s","Alt+t","Alt+u","Alt+v","Alt+w","Alt+x","Alt+y","Alt+z",
		"Ctrl+esc","Ctrl+tab","Ctrl+space","Ctrl+return","Ctrl+backspace","Ctrl+scroll","Ctrl+capslock","Ctrl+numlock",
		"Ctrl+insert","Ctrl+home","Ctrl+del","Ctrl+end","Ctrl+pageup","Ctrl+pagedown","Ctrl+left","Ctrl+up","Ctrl+right",
		"Ctrl+down",
		"Ctrl+f1","Ctrl+f2","Ctrl+f3","Ctrl+f4","Ctrl+f5","Ctrl+f6","Ctrl+f7","Ctrl+f8","Ctrl+f9","Ctrl+f10","Ctrl+f11","Ctrl+f12",
		"Shift+esc","Shift+tab","Shift+space","Shift+return","Shift+backspace","Shift+scroll","Shift+capslock","Shift+numlock",
		"Shift+insert","Shift+home","Shift+del","Shift+end","Shift+pageup","Shift+pagedown","Shift+left","Shift+up",
		"Shift+right","Shift+down",
		"Shift+f1","Shift+f2","Shift+f3","Shift+f4","Shift+f5","Shift+f6","Shift+f7","Shift+f8","Shift+f9","Shift+f10","Shift+f11","Shift+f12",
		"Alt+esc","Alt+tab","Alt+space","Alt+return","Alt+backspace","Alt+scroll","Alt+capslock","Alt+numlock",
		"Alt+insert","Alt+home","Alt+del","Alt+end","Alt+pageup","Alt+pagedown","Alt+left","Alt+up","Alt+right","Alt+down",
		"Alt+f1","Alt+f2","Alt+f3","Alt+f4","Alt+f5","Alt+f6","Alt+f7","Alt+f8","Alt+f9","Alt+f10","Alt+f11","Alt+f12"
	];
}
jQuery(document).ready(domo);
jQuery(document).bind('keydown', 'ctrl+s', function(e) {
	e.preventDefault();
	jQuery(".savebtn").click();
	return false;
});
jQuery(document).bind('keydown', 'return', function(e) {
	e.preventDefault();
	jQuery(".mb-control-yes").click();
	return false;
});
jQuery(document).bind('keydown', 'ctrl+left', function(e) {
	e.preventDefault();
	jQuery('#data-prev')[0].click();
	return false;
});
jQuery(document).bind('keydown', 'ctrl+right', function(e) {
	e.preventDefault();
	jQuery('#data-next')[0].click();
	return false;
});
jQuery(document).bind('keydown', 'ctrl+f', function(e) {
	e.preventDefault();
	jQuery('#q').focus();
	jQuery('.sinput').focus();
	return false;
});
jQuery(document).bind('keydown', 'home', function(e) {
	e.preventDefault();
	location.href='?';
	return false;
});
<?php }?>
function loadContent(url, targetElement){
    const loadingHtml = `
        <div class="loading-overlay">
            <p>Yükleniyor...</p>
        </div>
    `;
    $.ajax({
        url: url,
        type: 'GET',
        success: function(response) {
            jQuery(targetElement).html(response);
        },
        error: function(xhr, status, error) {
            jQuery(targetElement).html('<div class="error">İçerik yüklenirken bir hata oluştu.</div>');
            console.error("Hata: ", error);
        }
    });
}
var loadFunction=function(path, did, nedir){
	//jQuery(did).html('<center><img src=""+path+"assets/img/ic_loading.gif"></center>');
	jQuery(did).load(""+path+"?ne=<?php echo $_GET["ne"];?>&islem=<?php echo $_GET["islem"];?>&id=<?php echo $_GET["id"];?>&s5=<?php echo $_GET["s5"];?>&ts1=<?php echo $_GET["ts1"];?>&ts2=<?php echo $_GET["ts2"];?>&iq=<?php echo $_GET["iq"];?>&nedir="+nedir+"");
}
var divload=function(url,did){
	jQuery(did).load(url);
}
jQuery(document).ready(function(){
	jQuery(".loading").click(function() {
		setTimeout(function () {
		jQuery(".loading").attr("disabled", true);
		jQuery(".loading").html('<img src="<?php echo $weburl?>/<?php echo $crmpath?>/assets/img/loading.gif" style="height:16px; margin-top:-5px"> <?php echo ctranslate("Yükleniyor")?>');
		}, 100);
	});
});
function cbox(id){
	if(jQuery(id).is(":checked")){
	jQuery(id).prop("checked", false);
	}else if(jQuery(id).is(":not(:checked)")){
	jQuery(id).prop("checked", true);
}
};
function ifocus(id) {
	jQuery(id).focus();
};
<?php if($_GET["ne"]<>""){?>
jQuery(function() {
	jQuery('.sidebar-right-toggle').click(function (){
<?php if($_GET["islem"]=="ayarlar"){?>
		jQuery('html').toggleClass("sidebar-right-opened");
		jQuery('#sidebar-right').css('margin-right','0px');
<?php }?>
		jQuery('#sidebar-right').load("fonksiyon.php?islem=guide&keys=<?php echo $_SESSION["user"]?>/<?php echo $_GET["ne"]?>/<?php echo $_GET["islem"]?>/<?php echo $_GET["id"]?>");
	});
});
<?php }?>
jQuery(document).ready(function(){
<?php if(count($colors)==1 and $t50<>""){?>
	//alert("#<?php echo ctranslate("Renk Tespit Edildi")?>");
	jQuery("#islem").load("fonksiyon.php?islem=colordedect");
<?php }?>
<?php if($MA<>1){?>
	//sağ tıklama iptal -> diğeri body'de
	jQuery(document).keydown(function (event) {
	if (event.keyCode == 123) { 
	return false;
}
});
//sağ tıklama iptal
<?php }?>
jQuery(".scroller").click(function() {
	var datahref = jQuery(this).attr("data-href");
	jQuery('#set').animate({ scrollTop: jQuery(datahref).offset().top}, 'slow');
});
jQuery('#preloader').fadeOut('slow');		//CrmPlus Preloader
//-- No translate-->
jQuery('input,textarea,select,.bootstrap-tagsinput').addClass('notranslate');
//-- No translate-->
//--Ajax Div Load
jQuery(".dload").each(function(){
	jQuery(this).load($(this).attr('data-load'));
});
//
jQuery(".ufile").hover(function(){
	jQuery(this).addClass('fa fa-upload');
	jQuery(this).find("i").css("display", "none");
	}, function(){
		jQuery(this).removeClass('fa fa-upload');
		jQuery(this).find("i").css("display", "block");
	});
});
function Ajaxs(ID,result,func) {
	var url = jQuery('#xf' + ID + '').attr('action');
	var id = '#xf' + ID + '';
	var fname = 'xf' + ID + '';
	if(func=="AjaxPost"){
		AjaxPost(url,id,result);
	}else if(func=="Pcke"){
		Pcke(url,id,result,fname);
	}
	var button_value = jQuery('#b' + ID + '').html();
	jQuery('#b' + ID + '').html('<i class="fa fa-clock-o"></i>');
	setTimeout(function(){
		jQuery('#b' + ID + '').html(button_value);
		notice('CrmPlus+','<?php echo $sdil[212]?>','fa fa-check','success');
	} , '2000');
}
//Ajaxs('<?php echo $rs["id"];?>','#result','AjaxPost');
function AjaxPost(url,id,result,time,stext,etext){
	if(time==""){ time=3000; }else{ time=time; }
	if(url.substr(8,3)!="xls"){$pload=true;}else{$pload=false;}
	if(stext==""){ stext="<?php echo trim($sdil[212])?>"; }else{ stext=stext; }
	if(etext==""){ etext="<?php echo trim($sdil[9])?>"; }else{ etext=etext; }
	if($pload==true){jQuery('#preload').fadeIn('slow');}
	jQuery.post(url, jQuery(id).serialize())
	.done(function(data) {
	if(result.substr(0,1)!=""){			
		if(result.substr(0,1)=="#"){			
			if (data.trim().length >0){
				jQuery(result).text(stext);
				if($pload==true){jQuery('#preload').fadeOut('slow');}
			}else{
				jQuery(result).text(etext);
			}
		}else if(result.substr(0,1)=="n"){
			if (data.trim().length >0){
				if($pload==true){jQuery('#preload').fadeOut('slow');}
					notice(stext,stext,'fa fa-check-square-o','success');
				}else{
					notice(etext,etext,'fa fa-times','danger');
				}
			}else{
				setTimeout(function(){location.href=result} , time);
			}
		}else{
			setTimeout(function(){location.href="<?php echo $weburl;?>"} , time);
		}
	});
	return false;
}
//result "#" ile başlarsa success yazar, eğer url gönderilirse işlem sonu url gider, url gelmezse, weburl gider
function AjaxGet(url,result,time,stext,etext){
	if(time==""){ time=3000; }else{ time=time; }
	if(url.substr(8,3)!="xls"){$pload=true;}else{$pload=false;}
	if(stext==""){ stext="<?php echo trim($sdil[212])?>"; }else{ stext=stext; }
	if(etext==""){ etext="<?php echo trim($sdil[9])?>"; }else{ etext=etext; }
	if($pload==true){jQuery('#preload').fadeIn('slow');}
	jQuery.get(url)
	.done(function(data) {
	if(result.substr(0,1)!=""){
		if(result.substr(0,1)=="#"){
			if (data.trim().length >0){
				jQuery(result).text(stext);
				if($pload==true){jQuery('#preload').fadeOut('slow');}
			}else{
				jQuery(result).text(etext);
			}
		}else if(result.substr(0,1)=="n"){
			if (data.trim().length >0){
				if($pload==true){jQuery('#preload').fadeOut('slow');}
				notice('<?php echo trim($sdil[212])?>',stext,'fa fa-check-square-o','success');
			}else{
				notice('<?php echo trim($sdil[9])?>',etext,'fa fa-times','danger');
			}
		}else{
			setTimeout(function(){location.href=result} , time);
		}
	}else{
		setTimeout(function(){location.href="<?php echo $weburl;?>"} , time);
	}
	});
	return false;
}
//result "#" ile başlarsa success yazar, eğer url gönderilirse işlem sonu url gider, url gelmezse, weburl gider
/*
url:işlemURL
id:Post formID, boşsa Get olur
result:dönüş divID
*/
function Pcke(url,id,result,fname){
	//jQuery('#preload').fadeIn('slow');
	for(var fname in CKEDITOR.instances)
	CKEDITOR.instances[fname].updateElement();
	jQuery.ajax({
		type: "POST",
		url: url,
		data: jQuery(id).serialize(), success: function (data) {
			//jQuery('#preload').fadeOut('slow');
			notice('CrmPlus+','<?php echo $sdil[212]?>','fa fa-check','success');
			if(data!=""){
				if(data.substr(0,4)=="url:"){
					location.href=data.replace('url:','');
				}else{
					show(result.replace('#',''));
					jQuery(result).html(data);
					setTimeout(function(){hide(result.replace('#',''));} , 3000);
				}
			}
		}
	});
	return false;
}
function AjaxGResult(url,id,result,pl,cke){
	if(cke!=''){
		for(var ckeform in CKEDITOR.instances) CKEDITOR.instances[ckeform].updateElement();
	}
	if(pl!='nopl'){
		jQuery('#preload').fadeIn('slow');
	}
	jQuery.post(url, jQuery(id).serialize())
	.done(function(data){
		if(data.substr(0,4)=="url:"){
			location.href=data.replace('url:','');
		}else if(result.substr(0,1)=="#"){
			hide('preload');
			show(result.replace('#',''));
			/*setTimeout(function(){hide(result.replace('#',''));} , 3000);*/
			jQuery(result).html(data);
		}else if(result.substr(0,5)=="load:" && result.substr(5,5)=="ozet"){
			hide('preload');
		}else{
			hide('preload');
			show(result.replace('#',''));
			/*setTimeout(function(){hide(result.replace('#',''));} , 3000);*/
			jQuery(result).html(data);
		}
	});
	return false;
}

function AjaxPResult(url, id, result, pl, cke, callback) {
	if (cke != '') {
		for (var ckeform in CKEDITOR.instances) {
			CKEDITOR.instances[ckeform].updateElement();
		}
	}
	if (pl != 'nopl') {
		jQuery('#preload').fadeIn('slow');
	}
	var form = jQuery(id);
	var formdata = false;
	if (window.FormData) {
		formdata = new FormData(form[0]);
	}
	jQuery.ajax({
		url: url,
		data: formdata ? formdata : form.serialize(),
		cache: false,
		contentType: false,
		processData: false,
		type: 'POST',
		success: function (data) {
			if (data.substr(0, 4) == "url:") {
				location.href = data.replace('url:', '');
			} else {
				hide('preload');
				show(result.replace('#', ''));
				jQuery(result).html(data);
			}

			if (typeof callback === "function") {
				callback();
			}

			if (typeof loadurl !== "undefined") {
				setTimeout(function () {
					location.href = loadurl;
				}, 500);
			}
		},
		error: function (xhr, status, error) {
			console.error("AJAX Hatası:", status, error);
			if (typeof callback === "function") {
				callback();
			}
		}
	});
	return false;
}

//eğer url: ile başlarsa url, değilse text
function FullScreen(elem) {
  elem = elem || document.documentElement;
  if (!document.fullscreenElement && !document.mozFullScreenElement &&
    !document.webkitFullscreenElement && !document.msFullscreenElement) {
    if (elem.requestFullscreen) {
      elem.requestFullscreen();
    } else if (elem.msRequestFullscreen) {
      elem.msRequestFullscreen();
    } else if (elem.mozRequestFullScreen) {
      elem.mozRequestFullScreen();
    } else if (elem.webkitRequestFullscreen) {
      elem.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
    }
  } else {
    if (document.exitFullscreen) {
      document.exitFullscreen();
    } else if (document.msExitFullscreen) {
      document.msExitFullscreen();
    } else if (document.mozCancelFullScreen) {
      document.mozCancelFullScreen();
    } else if (document.webkitExitFullscreen) {
      document.webkitExitFullscreen();
    }
  }
}
var $s = jQuery.noConflict();
//medya ajax işlem-------------//

$s(document).on('click','a.tresim', function(){
	$s('#preload').fadeOut('slow');
	var _this=$s(this);
	$s.get(_this.data('href'),function(result){
		loadFunction(_this.data('href'),'#mresim','resim');
	});
});
$s(document).on('click', 'a.tvideo', function(){
	var _this=$s(this);
	$s.get(_this.data('href'),function(result){
		loadFunction(_this.data('href'),'#mvideo','video');
	});
});
$s(document).on('click','a.tdosya', function(){
	var _this=$s(this);
	$s.get(_this.data('href'),function(result){
		loadFunction(_this.data('href'),'#mdosya','dosya');
	});
});
$s(document).on('input', '.mresim input', delay(function(){
	var _this=$s(this),
	id=_this.closest('.mresim').data('id'),
	value=_this.val();
	$s.get('<?php echo $weburl."/".$crmpath."/"?>modules/ajax/ajax_medya<?php if($path<>""){echo "_iframe";}?>.php?durum=msira&mid='+ id + '&s3=' + value, function(result){
		loadFunction('<?php echo $weburl."/".$crmpath."/"?>modules/ajax/ajax_medya<?php if($path<>""){echo "_iframe";}?>.php','#mresim','resim');
	});
}, 1000));
$s(document).on('input','.mvideo input', delay(function(){
	var _this=$s(this),
	id=_this.closest('.mvideo').data('id'),
	value=_this.val();
	$s.get('<?php echo $weburl."/".$crmpath."/"?>modules/ajax/ajax_medya<?php if($path<>""){echo "_iframe";}?>.php?durum=msira&mid='+ id + '&s3=' + value, function(result){
		loadFunction('<?php echo $weburl."/".$crmpath."/"?>modules/ajax/ajax_medya<?php if($path<>""){echo "_iframe";}?>.php','#mvideo','video');
	});
}, 1000));
$s(document).on('input','.mdosya input', delay(function(){
	var _this=$s(this),
	id=_this.closest('.mdosya').data('id'),
	value=_this.val();
	$s.get('<?php echo $weburl."/".$crmpath."/"?>modules/ajax/ajax_medya<?php if($path<>""){echo "_iframe";}?>.php?durum=msira&mid='+ id + '&s3=' + value, function(result){
		loadFunction('<?php echo $weburl."/".$crmpath."/"?>modules/ajax/ajax_medya<?php if($path<>""){echo "_iframe";}?>.php','#mdosya','dosya');
	});
}, 1000));
$s(document).on('click','.btn-delete-div', function(){
	var $this=$s(this),
	$div=$this.closest('.mdiv, .hdiv, .cparent'),
	$id=$div.data('id');
	var box = $s("#mb-remove-row");
	box.addClass("open");
	box.find(".mb-control-yes").on("click",function(){
<?php if($_SESSION["V3Server"]<>""){?>
		var logfrm = document.getElementById('logfrm');
		logfrm.src = "<?php echo $weburl?>/crmplus/modules/public/medya_delete.php?mid="+$id+"";
<?php }?>
		$s('#preload').fadeIn('slow');
		box.removeClass("open");
			$s.get($this.data('href'), function(){
				$div.hide("slow",function(){
					$div.remove();
					$s('#preload').fadeOut('slow');
				});
			});
		});
		box.find(".mb-control-close").on("click",function(){
		box.removeClass("open");
	});
});

$s(document).on('click','.mb-add', function(){
	var $this=$s(this);
	var box = $s("#mb-add-row");
	$s('#mb-add-row').fadeIn('show');
	<?php if($module["SpeechText"][1]=="4" or $module["SpeechText"][2]=="4" or $module["SpeechText"][3]=="4"){?>
		speaker('<?php echo ctranslate("Kayıt eklemek istediğinize Eminmisiniz")?>');
	<?php }?>
	box.find(".mb-control-yes").on("click",function(){
		$s('#mb-add-row').fadeOut('slow');
		$s('#preload').fadeIn('slow');
		location.href=$this.data('href');
	});
	box.find(".mb-control-close").on("click",function(){
		$s('#mb-add-row').fadeOut('slow');
	});
});
//medya ajax işlem-------------//	
$s('.mframe').each(function () {
	var $this = $(this);
	$this.on("click", function () {
		document.getElementById['isrc'].src = $(this).data('target');
	});
});

$s(document).on('click', '.btn-delete-row', function(){
	var $this=$s(this),
	$row=$this.closest('tr'),
	$id=$row.data('id');
	var box = $s("#mb-remove-row");
	box.addClass("open");
	<?php if($module["SpeechText"][1]=="4" or $module["SpeechText"][2]=="4" or $module["SpeechText"][3]=="4"){?>
		speaker('<?php echo ctranslate("Silmek istediğinize Eminmisiniz")?>');
	<?php }?>
	var _this=$s(this);
	var form=_this.closest('form');
	var id=_this.closest('tr').data('id');
	var url=_this.closest('tr').data('url');
	var href=_this.closest('tr').data('href');
	var did=_this.closest('tr').data('did');
	var ref_href=_this.closest('tr').data('ref_url');
	var ref_did=_this.closest('tr').data('ref_id');
	var action=_this.closest('tr').data('action');
	box.find(".mb-control-yes").off("click").on("click", function(){ // ✔️ burada düzeltildi
	_this.find('.fa').removeClass('fa-times');
	_this.find('.fa').addClass('fa-clock-o');
	<?php if($_SESSION["V3Server"]<>""){?>
		var logfrm = document.getElementById('logfrm');
		logfrm.src = "<?php echo $weburl?>/crmplus/modules/public/medya_delete.php?id=" + id;
	<?php }?>
	box.removeClass("open");
	$s.get($this.data('href'), function(){
		$row.hide("slow", function(){
			loadFunction(href, did, '');
			if(ref_did != "") {
				loadFunction(ref_href, ref_did, '');
			}
			$row.remove();
			$s('#preload').fadeOut('slow');
		});
	});
});
box.find(".mb-control-close").on("click", function(){
	box.removeClass("open");
});
});

$s(document).on('click', '.btn-all-clear', function(){
	var $this=$s(this);
	var href=$this.data('href');
	var did=$this.data('did');
	var box = $s("#mb-remove-row");
	box.addClass("open");
	<?php if($module["SpeechText"][1]=="4" or $module["SpeechText"][2]=="4" or $module["SpeechText"][3]=="4"){?>
		speaker('<?php echo ctranslate("Silmek istediğinize Eminmisiniz")?>');
	<?php }?>
	box.find(".mb-control-yes").on("click",function(){
		box.removeClass("open");
		$s.get($this.data('href'), function(){
			loadFunction(href,did,'');
		});
	});
	box.find(".mb-control-close").on("click", function(){
		box.removeClass("open");
	});
});
$s(document).on('click', '.btn-undo-row', function(){
	var $this=$s(this),
	$row=$this.closest('tr'),
	$id=$row.data('id');
	var box = $s("#mb-undo-row");
	box.addClass("open");
	var _this=$s(this);
	var form=_this.closest('form');
	var id=_this.closest('tr').data('id');
	var url=_this.closest('tr').data('url');
	var href=_this.closest('tr').data('href');
	var did=_this.closest('tr').data('did');
	var ref_href=_this.closest('tr').data('ref_url');
	var ref_did=_this.closest('tr').data('ref_id');
	var action=_this.closest('tr').data('action');
	box.find(".mb-control-yes").on("click",function(){
		$s('#preload').fadeIn('slow');
		box.removeClass("open");
		$s.get($this.data('href'), function(){
			$row.hide("slow",function(){
				loadFunction(href,did,'');
				if(ref_did != ""){loadFunction(ref_href,ref_did,'');}	//Refresh Div
				$row.remove();
				$s('#preload').fadeOut('slow');
			});
		});
	});
	box.find(".mb-control-close").on("click", function(){
		box.removeClass("open");
	});
});
$s(document).on('click','.btn-update-row', function(){
	//$s('#preload').fadeIn('slow');
	var _this=$s(this);
	var form=_this.closest('form');
	var id=_this.closest('tr').data('id');
	var url=_this.closest('tr').data('url');
	var did=_this.closest('tr').data('did');
	var ref_href=_this.closest('tr').data('ref_url');
	var ref_did=_this.closest('tr').data('ref_id');
	var action=_this.closest('tr').data('action');
	$s.ajax({type: "POST", url: action,
		data: form.serialize(), success: function (data){
			loadFunction(url,did,'');
			if(data!=""){
				if(data.substr(0,4)=="url:"){
					location.href=data.replace('url:','');
				}else{
					if (jQuery("#err").length){ show('err'); }
					jQuery('#err').html(data);
					setTimeout(function(){if (jQuery("#err").length){ hide('err'); }} , 3000);
				}
			}
			$s('#preload').fadeOut('slow');
			if(ref_did != ""){loadFunction(ref_href,ref_did,'');}	//Refresh Div
		}
	});
});

/* Json Resim Upload */
jQuery(document).on('change','.ufiles, #udragdrop',function(e){
	jQuery('#preload').fadeIn('slow');
	e.preventDefault();
	var _this = jQuery(this);
	var id=_this.data('id');
	var input=_this.data('input');
	var dlink=_this.data('dlink');
	var form=_this.closest('form');
	var name=_this.data('name');
	var formData = new FormData();
	formData.append('dosya', _this[0].files[0]);
	jQuery.ajax({
	url: form.attr('action'), 
	data: formData, 
	type: 'POST', 
	contentType: false, 
	processData: false, 
	success:function(data, textStatus){
		jQuery(id).fadeIn('slow');
		jQuery(id).prepend('<img src="'+data.image+'" style="max-width:180px;" />');
		jQuery('#preload').fadeOut('slow');
		jQuery(input).fadeOut('slow');
		jQuery(dlink).fadeIn('slow');
	}
}, 'json');
});
jQuery(document).on('click', '.btn-delete-img', function(){
	var $this=$s(this);
	var box = $s("#mb-remove-row");
	box.addClass("open");				//Mesaj Penceresi Aç
	box.find(".mb-control-yes").on("click",function(){
	box.removeClass("open");		//Mesaj Penceresi Kapat
	jQuery($this.data('h1')).fadeOut('slow');
	jQuery($this.data('h2')).fadeOut('slow');
	$s.get($this.data('href'), function(){});
});
	box.find(".mb-control-close").on("click", function(){
		box.removeClass("open");
	});
});
var $a = jQuery.noConflict();
$a(document).on('click','.sidebar-toggle', function(){
	jQuery('#islem').load('fonksiyon.php?durum=sidebar');
});
$a(document).on('click','.card-action-close', function(){
	var $this=$s(this);
	ID=$this.attr("data-id");
	jQuery('#islem').load('fonksiyon.php?durum=wdisable&ID='+ID);
});

/*
var $loading = $s('#preload').hide();
$a(document)
.ajaxStart(function () {
	$loading.show();
})
.ajaxStop(function () {
	$loading.hide();
});
*/

<?php if($_GET["islem"]=="dkayit" or $_GET["islem"]=="dsayfa" or $_GET["islem"]=="duye" or $_GET["islem"]=="dservice" or substr($_GET["islem"],1)=="fatura"){?>
	$a(document).on('keypress', 'input.form-control', function (e){
	if (e.key === 'Enter') {
	e.preventDefault();
	<?php if($_GET["islem"]=="dkayit" or $_GET["islem"]=="dsayfa"){?>
		//$a(this).closest('#asave').find('.btn-success').click();
	<?php }elseif($_GET["islem"]=="duye"){?>
		$a(this).closest('#ncurrent').find('.btn-update-row').click();
		$a(this).closest('#ecurrent').find('.btn-update-row').click();
		$a(this).closest('#nservice').find('.btn-update-row').click();
		$a(this).closest('#eservice').find('.btn-update-row').click();
	<?php }elseif(substr($_GET["islem"],1)=="fatura" or $_GET["islem"]=="dservice"){?>
		$a(this).closest('.addtr').find('.btn-update-row').click();
		$a(this).closest('.uptr').find('.btn-update-row').click();
	<?php }?>
	//$a(this).closest('.addtr').find('.fa-plus').click();
	//$a(this).closest('.edittr').find('.fa-refresh').click();
}
});
<?php }?>

function AjaxKaydet(fid, fname) {
    // Preload animasyonunu başlat
    $('#preload').fadeIn('slow');
    // Parametreler boşsa varsayılan değerleri ayarla
    if (fid === "") { fid = "#asave"; } else { fid = "#" + fid; }
    if (fname === "") { fname = "aform"; }
    // CKEditor içeriğini güncelle
    for (var editor in CKEDITOR.instances) {
        if (CKEDITOR.instances.hasOwnProperty(editor)) {
            CKEDITOR.instances[editor].updateElement();
        }
    }
    // Ajax isteğini gönder
	$.ajax({
		type: "POST",
		url: $(fid).attr('action'), // Formun action özelliğinden URL alınıyor
		data: $(fid).serialize(),
		success: function (data) {
			// Eğer "data" boş değilse işlemleri kontrol et
			if (data != "") {
				if (data.substr(0, 4) == "url:") {
					// Eğer "data" bir URL içeriyorsa, o URL'ye yönlendirme yap
					location.href = data.replace('url:', '');
				} else {
					// "data" bir içerikse, sonucu göster
					const result = "#result"; // Sonuç gösterilecek eleman (isteğe göre değiştirilebilir)
					show(result.replace('#', ''));
					jQuery(result).html(data);
					setTimeout(function () {
						hide(result.replace('#', ''));
					}, 3000);
				}
			}
			// Preload animasyonunu bitir
			$('#preload').fadeOut('slow');
			// Başarı mesajı göster
			notice('CrmPlus+', '<?php echo $sdil[212]; ?>', 'fa fa-check', 'success');
		}
	});
}
function AjaxKaydetYeni($fid,$fname){
	$a('#preload').fadeIn('slow');
	if($fid==""){ $fid="#asave"; }else{ $fid="#"+$fid+""; }
	if($fname==""){ $fname="aform"; }else{ $fname=$fname; }
	for(var $fname in CKEDITOR.instances)
	CKEDITOR.instances[$fname].updateElement();
	$a.ajax({
		type: "POST",
		url: "?ne=<?php echo $_GET["ne"];?>&islem=<?php echo $_GET["islem"];?>&id=<?php echo $_GET["id"];?>&durum=kaydet",
		data: $a($fid).serialize(),
		success: function () {
			$a('#preload').fadeOut('slow');
			location.href = "?ne=<?php echo $_GET["ne"];?>&islem=<?php if($_GET["islem"]=="dsayfa"){echo "sayfa";}elseif($_GET["islem"]=="dkayit"){echo "kayitlar";}?>&id=<?php echo $_GET["id"];?>&durum=<?php if($_GET["islem"]=="dsayfa"){echo "ysayfa";}elseif($_GET["islem"]=="dkayit"){echo "ykayit";}?>";
		}
	});
}

jQuery(document).ready(function(){
//Zaman//
if(document.getElementById("wsaat")!=undefined){
	digitalsaat();
	var saaat;
	function digitalsaat(){
		var suan = new Date();
		var wsa = suan.getHours();
		var wdk = suan.getMinutes();
		var wsn = suan.getSeconds();
		saaat = wsa + ':' + ((wdk<10) ? '0' : '') + wdk + ':' + ((wsn<10) ? '0' : '') + wsn;
		wsaat.innerHTML = saaat;
		setTimeout(digitalsaat, 1000);
	}
	var tarih=new Date();
	var gun=tarih.getDay();
	var ay=tarih.getMonth();
	var yil=tarih.getFullYear();
	var gunler= ['Pazar', 'Pazartesi', 'Salı','Çarşamba','Perşembe','Cuma','Cumartesi'];
	var aylar= ['Ocak', 'Şubat', 'Mart','Nisan','Mayıs','Haziran','Temmuz','Ağustos','Eylül','Ekim','Kasım','Aralık'];
	jQuery('#wts').html(tarih.getDate()+' '+aylar[ay]+' '+yil+' '+gunler[gun]);
}
var $s = jQuery.noConflict();
	setTimeout(function () { $s('#saveok').fadeIn('slow'); }, 500);
	setTimeout(function () { $s('#saveok').delay(500).fadeOut('slow'); }, 500);
});
//All Check
function Checks(source) {
	//var checkboxes = document.querySelectorAll('input[type="checkbox"]');
	var checkboxes = jQuery(".dchck");
	for (var i = 0; i < checkboxes.length; i++) {
		if (checkboxes[i] != source)
		checkboxes[i].checked = source.checked;
	}
}
//copyToClipboard
var $cc = jQuery.noConflict();
function copyToClipboard(element) {
	var $temp = $cc("<input>");
	$cc("body").append($temp);
	$temp.val($cc(element).text()).select();
	document.execCommand("copy");
	$temp.remove();
	alert('Hafızaya Kopyalandı, Ctrl+V ile Yapıştırabilirsiniz.');
}
//onclick="copyToClipboard(this);"
function SadeceRakam(e, allowedchars){
	var key = e.charCode == undefined ? e.keyCode : e.charCode;
	if ( (/^[0-9]+$/.test(String.fromCharCode(key))) || key==0 || key==13 || isPassKey(key,allowedchars) ){
		return true;
	} else {
		return false;
	}
}
//End SadeceRakam()
function isPassKey(key,allowedchars){
if (allowedchars != null) {
	for (var i = 0; i < allowedchars.length; i++) {
		if (allowedchars[i]  == String.fromCharCode(key))			 
			return true;
		}
	}
	return false;
}
//#DivPrint
function divyaz(divId) {
	var printContents = document.getElementById(divId).innerHTML;
	var originalContents = document.body.innerHTML;
	document.body.innerHTML = "<html><head><title></title></head><body>" + printContents + "</body>";
	window.print();
	document.body.innerHTML = originalContents;
}
function generatePDF(id){
	let specialElementHandlers = {
		'no-export':function(element,renderer){
			return true
		}
	}
	let doc = new jsPDF()
	let source = document.getElementById(id).innerHTML
	let margins = { top:10, bottom:10, left:10, width:595 }
	doc.fromHTML(
		source,
		margins.left,
		margins.top,
		{
			"width":margins.width,
			"elementHandlers":specialElementHandlers
		},
		function(dispose){
			doc.save("output.pdf")
		},margins
	)
}
//generatePDF('id')
function hide(attr = '#preload') {
    if (attr.charAt(0) !== '#' && attr.charAt(0) !== '.') {
        attr = '#' + attr;
    }
    jQuery(attr).fadeOut("slow");
}
function show(attr = '#preload') {
    if (attr.charAt(0) !== '#' && attr.charAt(0) !== '.') {
        attr = '#' + attr;
    }
    jQuery(attr).fadeIn("slow");
}
function vtr(id){var divObject=document.getElementById(id); divObject.style.visibility="visible";divObject.style.display="table-row";}
function htr(id){var divObject=document.getElementById(id); divObject.style.visibility="hidden";divObject.style.display="none";}
function stime(id,islem,sure){
	if(islem=="show"){
		jQuery(id).fadeIn('slow');
	}else{
		jQuery(id).fadeOut('slow');
	}
	if(sure!=""){
		setTimeout(function() {
			jQuery(id).fadeOut('slow');
		},sure);
	}
}
function toggle(id){
	jQuery(id).toggle("slow", function() {
	// Animation complete.
	});
}
jQuery(document).ready(function() {
	for (let a = 0; a <= 10 ; a++) {
		if(a == 0){f = "";}else{f = a;}
		fvalid('dr',a);	//document.ready no alert
		jQuery('form.fcontrol'+f+'').change(function(){
			fvalid('',a);
		});
		jQuery('form.fcontrol'+f+'').keyup(function(){
			fvalid('',a);
		});
	}
	function fvalid(e,a) {
		jQuery('.valert').remove();
		if(a == 0){a = "";}
		let c = 0; let i = 0;
		jQuery('form.fcontrol' + a + ' .icontrol').each(function () {
			jQuery(this).each(function () {
				jQuery(this).removeClass("vclass");
				var valert = jQuery(this).attr('data-alert');
				var type = this.type
				var checked = this.checked
				if(type=="checkbox"){
					if(jQuery(this).is(':checked')){
						jQuery(this).css("filter", "none");
					} else {
						c++;
						if(e!='dr'){
							jQuery(this).addClass('vclass');
							if (typeof valert !== "undefined") {
								jQuery(this).after('<div class="valert">* '+valert+'</div>');
							}
						}
					}
				} else {
					if(jQuery(this).val()==""){
						if(e!='dr'){
							jQuery(this).addClass('vclass');
							if (typeof valert !== "undefined") {
								jQuery(this).after('<div class="valert">* '+valert+'</div>');
							}
						}
						i++;
					} else {
						if(type=="email"){
							var regex = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
							if(!regex.test(jQuery(this).val())) {
							   jQuery(this).after('<div class="valert">* <?php echo ctranslate("Mail Adresi Hatalı!")?></div>');
							}
						}
					}
					
				}
				
			});
			if(c == 0 && i == 0){
				jQuery('form.fcontrol' + a + ' button').prop('disabled',false);
			} else {
				jQuery('form.fcontrol' + a + ' button').prop('disabled',true);
			}
		});
	}	
});
//<form class="fcontrol">
	//<input type="text" class="icontrol">
//</form>
<?php
if($_GET['ne']=="kayit" or $_GET['ne']=="sayfa" or $_GET['ne']=="haber" or $_GET['ne']=="msayfa" or $_GET['ne']=="ayarlar" or $_GET['ne']=="uye" or $_GET['islem']=="tsms"){
if($_GET['file']=="add.php" || $_GET['page']=="scripts"){$fpath="../../";}
?>
//-------------kontrol-->
var $k = jQuery.noConflict();
$k(document).ready(function(){
	$k('.qcontrol').keyup(function(){
	var qcontrol = $k(this).attr("qcontrol");
	var field_value = $k(this).val();
		if (field_value != ''){
			$k.ajax({
				url: '<?php echo $fpath;?>fonksiyon.php?ne=<?php echo $_GET["ne"];?>&islem=kontrol&veri=' + $k(this).val(),
				type: 'POST',
				success: function(result){
					document.getElementById(qcontrol).innerHTML = result;
				}
			});
		}
	});
	$k('#tck').keyup(function(){
		var field_value = $k(this).val();
		if (field_value != ''){
			$k.ajax({
				url: 'fonksiyon.php?ne=<?php echo $_GET["ne"];?>&islem=tck&veri=' + $k(this).val(),
				type: 'POST',
				success: function(result){
					document.getElementById("ctck").innerHTML = result;
				}
			});
		}
	});
});
//-------------kontrol-->
var $txts = jQuery.noConflict();
jQuery(function () {
	var ns1 = 0; // var olan değer
	$txts('.ns1').bind('keydown keyup keypress change', function () {
	var thisValueLength = $txts(this).val().length;
	var saymax = (ns1) + (thisValueLength); // var olan değerin üzerine say
	$txts('#ns1').html(""+saymax+" < 70");
	if (saymax > 70) { // karakter sayısı 70 tan fazla olursa kırmızı yaz
		$txts('.ns1').css({ color: '#ff0000', fontWeight: '' });
	} else { // karakter sayısı 160 tan az ise siyah yaz
		$txts('.ns1').css({ color: '#000000', fontWeight: '' });
	}
});
var ns2 = 0; // var olan değer
$txts('.ns2').bind('keydown keyup keypress change', function () {
	var thisValueLength = $txts(this).val().length;
	var saymax = (ns2) + (thisValueLength); // var olan değerin üzerine say
	$txts('#ns2').html(""+saymax+" < 160");
	if (saymax > 160) { // karakter sayısı 160 tan fazla olursa kırmızı yaz
		$txts('.ns2').css({ color: '#ff0000', fontWeight: '' });
	} else { // karakter sayısı 160 tan az ise siyah yaz
		$txts('.ns2').css({ color: '#000000', fontWeight: '' });
	}
});
var smsx = 0; // var olan değer
$txts('.smsx').bind('keydown keyup keypress change', function () {
	var thisValueLength = $txts(this).val().length;
	var saymax = (smsx) + (thisValueLength); // var olan değerin üzerine say
	$txts('#smsx').html(""+saymax+" < 150");
	if (saymax > 150) { // karakter sayısı 160 tan fazla olursa kırmızı yaz
		$txts('.smsx').css({ color: '#ff0000', fontWeight: '' });
	} else { // karakter sayısı 160 tan az ise siyah yaz
		$txts('.smsx').css({ color: '#000000', fontWeight: '' });
	}
});
var smsy = 0; // var olan değer
$txts('.smsy').bind('keydown keyup keypress change', function () {
	var thisValueLength = $txts(this).val().length;
	var saymax = (smsy) + (thisValueLength); // var olan değerin üzerine say
	$txts('#smsy').html(""+saymax+" < 150");
	if (saymax > 150) { // karakter sayısı 160 tan fazla olursa kırmızı yaz
		$txts('.smsy').css({ color: '#ff0000', fontWeight: '' });
	} else { // karakter sayısı 160 tan az ise siyah yaz
		$txts('.smsy').css({ color: '#000000', fontWeight: '' });
	}
});
var ns3 = 0; // var olan değer
$txts('.ns3').bind('keydown keyup keypress change', function () {
	var thisValueLength = $txts(this).val().length;
	var saymax = (ns3) + (thisValueLength); // var olan değerin üzerine say
	$txts('#ns3').html(""+saymax+" < 70");
	if (saymax > 70) { // karakter sayısı 70 tan fazla olursa kırmızı yaz
		$txts('.ns3').css({ color: '#ff0000', fontWeight: '' });
	} else { // karakter sayısı 70 tan az ise siyah yaz
		$txts('.ns3').css({ color: '#000000', fontWeight: '' });
	}
	});
});
<?php }?>
jQuery(document).keypress(function(e){
	if (e.keyCode == 27){
		jQuery("#myModal").modal('hide');
	}
});
jQuery(function(){
	jQuery(".majx").click(function () {
		var target = jQuery(this).data("target");
		jQuery(target).fadeIn();
		var title = jQuery(this).attr("data-title");
		var width = jQuery(this).attr("data-width");
		jQuery(target).css('width', '');
	<?php if($mobile==""){?>	<!--/mobil hariç data-width ile boyut verme/-->
		if(width != undefined){
			jQuery(target).css('width', width);
		}
	<?php }?>
		jQuery(".v3-modal-title").text(title);
		var theModal = jQuery(this).data("target");
		ajxSRC = jQuery(this).attr("data-url");
		var refSRC = jQuery(this).attr("data-ref");
		if(refSRC != undefined){
			jQuery(theModal + ' .cmdl').attr('onclick', 'location.href=\''+refSRC+'\'');
		}
			jQuery(theModal + ' #modalajax').load(ajxSRC);
			jQuery(theModal + ' .close').click(function () {
		});
	});
	jQuery(".mfrm").click(function(){
		if(jQuery(this).data("ajax")=="mresim"){
			jQuery('.cmdl').attr("url", "<?php echo $weburl."/".$crmpath;?>/modules/ajax/ajax_medya<?php if($path<>""){echo "_iframe";}?>.php?ne=<?php echo $_GET["ne"];?>&islem=<?php echo $_GET["islem"];?>&id=<?php echo $_GET["id"]; ?>&nedir=resim");
			jQuery('.cmdl').attr("result", "mresim"); AjaxKaydet('','');
		}else if(jQuery(this).data("ajax")=="mdosya"){
			jQuery('.cmdl').attr("url", "<?php echo $weburl."/".$crmpath;?>/modules/ajax/ajax_medya<?php if($path<>""){echo "_iframe";}?>.php?ne=<?php echo $_GET["ne"];?>&islem=<?php echo $_GET["islem"];?>&id=<?php echo $_GET["id"]; ?>&nedir=dosya");
			jQuery('.cmdl').attr("result", "mdosya"); AjaxKaydet('','');
		}else if(jQuery(this).data("ajax")=="mvideo"){
			jQuery('.cmdl').attr("url", "<?php echo $weburl."/".$crmpath;?>/modules/ajax/ajax_medya<?php if($path<>""){echo "_iframe";}?>.php?ne=<?php echo $_GET["ne"];?>&islem=<?php echo $_GET["islem"];?>&id=<?php echo $_GET["id"]; ?>&nedir=video");
			jQuery('.cmdl').attr("result", "mvideo"); AjaxKaydet('','');
		}else if(jQuery(this).data("ajax")=="icari"){
			jQuery('.cmdl').attr("url", "<?php echo $weburl."/".$crmpath;?>/modules/clients/ajax_client_current.php?ne=<?php echo $_GET["ne"];?>&islem=<?php echo $_GET["islem"];?>&id=<?php echo $_GET["id"]; ?>");
			jQuery('.cmdl').attr("result", "icari");
		}
		var target = jQuery(this).data("target");
		//jQuery(target).modal("toggle");
		var title = jQuery(this).attr("data-title");
		jQuery(""+target+" .v3-modal-title").text(title);
		var width = jQuery(this).attr("data-width");
		jQuery(target).css('width', '');
	<?php if($mobile==""){?>	<!--/mobil hariç data-width ile boyut verme/-->
		if(width != undefined){jQuery(target).css('width', width);}
	<?php }?>
		var theModal = jQuery(this).data("target");
		frmSRC = jQuery(this).attr("data-url");
		var refSRC = jQuery(this).attr("data-ref");
		if(refSRC != undefined){
			jQuery(theModal + ' .cmdl').attr('onclick', 'location.href=\''+refSRC+'\'');
		}
		jQuery(theModal + ' iframe').attr('src', frmSRC);
		jQuery(theModal + ' .close').click(function () {
			jQuery(theModal + ' iframe').attr('src', 'about:blank');
		});
	});
	jQuery(".cmdl").click(function (){
		jQuery('#preload').fadeIn('slow');
		event.preventDefault();
		if(jQuery('.cmdl').attr('url')){
			jQuery('#'+jQuery('.cmdl').attr("result")+'').load('<?php echo $path;?>'+jQuery('.cmdl').attr("url")+'');
		}else{
			loadFunction('<?php echo $weburl."/".$crmpath;?>/modules/ajax/ajax_medya<?php if($path<>""){echo "_iframe";}?>.php','#mresim','resim');
			loadFunction('<?php echo $weburl."/".$crmpath;?>/modules/ajax/ajax_medya<?php if($path<>""){echo "_iframe";}?>.php','#mvideo','video');
			loadFunction('<?php echo $weburl."/".$crmpath;?>/modules/ajax/ajax_medya<?php if($path<>""){echo "_iframe";}?>.php','#mdosya','dosya');
			jQuery('.modal-body iframe').attr('src', 'about:blank');
		}
		jQuery('#preload').fadeOut('slow');
		jQuery('.modal').removeClass('in');
	});
});
function reload(url,id){	//Modal Açılış linkine tanımlanır reload('url','id'); şeklinde, modal kapanınca reload için.
	jQuery('.cmdl').attr("url", url);
	jQuery('.cmdl').attr("result", id);
	return false;
}