﻿/* * Coder: Abdullah Tekin * ============================================ * * Copyright (c) by Abdullah Tekin (tekinonline@hotmail.com) * http://www.phpsistem.com * http://www.abdullahtekin.com * http://www.sanalkurs.net * * Her Hakkı Saklıdır, İzinsiz Kullanılamaz! *//* HATA FONKSİYONU *****************************************************************************************************/function hata(msj,zamanasimi,title) {		/*	if($.blockUI){		 $.blockUI({		  message: msj,		  css: { 		   border:'none', padding:'15px', size:'12.0pt',		   backgroundColor:'#900', color:'#fff',		   opacity:'.8','-webkit-border-radius': '10px','-moz-border-radius': '10px'		  }		 });		 window.setTimeout($.unblockUI, zamanasimi);	} else {		alert(msj);		return false;	}	*/		if(title) {		jAlert(msj, title);	} else {		jAlert(msj, 'Hata');	}}/* HABER SAYFASI *****************************************************************************************************/function haber_sayfa(no) {	$("#haberler .kapsa").hide();	$('.ref_loading').show(); 				$.ajax({		type: "GET",		url: "ajax/haberler/ajax.php?sayfalandir&sayfa="+ no, 		success: function(msg) {			$('.ref_loading').hide(); 			$("#haberler .kapsa").fadeIn().html(msg); 		}	});} /* KAMPANYA SAYFASI *****************************************************************************************************/function kampanya_sayfa(no) {	$("#kampanyalar .kapsa").hide();	$('.ref_loading').show(); 				$.ajax({		type: "GET",		url: "ajax/kampanyalar/ajax.php?sayfalandir&sayfa="+ no, 		success: function(msg) {			$('.ref_loading').hide(); 			$("#kampanyalar .kapsa").fadeIn().html(msg); 		}	});} /*function phpSistem_win(element) {	var url   = $(element).attr('href');	var title = $(element).attr('title');	$("#dialog").load(url).dialog('option','width',800).dialog('option','title',title).dialog('open');	return false;}*/// id alanlarını açfunction sayfa_ac(div) {	$(".form_sablon form").fadeOut('fast');	$(div).fadeIn('slow');	return false;}function pencere_ac(w,h,title,html) {	$("#dialog").html(html);	$("#dialog").show();		$("#dialog").dialog({			title: title,			bgiframe: true,			width:w,			height: h,			modal:true		});}function stok_talebi(id) {	if(id) {		  $.ajax({			type: "GET",			url: "ajax/iletisim/ajax.php?stok_talebi="+id,			success: function(msg){				if(msg=="sorun") {					hata("E-Posta gönderilemedi");				} else {					$(".stok_talep"+id+" a#talep"+id+"").remove();					$(".stok_talep"+id+"").html('<span class="talep_iletildi">Talep iletildi</span>');					hata("Stok talebi iletilmiştir. Teşekkür ederiz.",2000,"Stok Talebi");				}			}		  });	} else {		hata("Ürün ID bulunamadı");	}}/* JQUERY *****************************************************************************************************/$(function(){	// Dialog				$('#dialog').dialog({		bgiframe: true,		modal: true,		autoOpen: false,		width: 600	});		// Pencere	$(".win").click(function(){		var url    = $(this).attr('href');		var title  = $(this).attr('title');		var width  = $(this).attr('width');		var height = $(this).attr('height');		$("#dialog").load(url).dialog('option','width',width).dialog('option','height',height).dialog('option','title',title).dialog('open');		return false;			});		// Tab Menüs	$('.tabs').tabs({ spinner: '' }, { ajaxOptions: { async: false } });	// yardım tab menüs	$('.yrd_tab').tabs({ spinner: '' }, { ajaxOptions: { async: false } });	// üye kaydı özel karakterler	$('#havale_form #tutar1, #havale_form #tutar2, #atm_form #tutar3, #atm_form #tutar4, #money_form #tutar5, #money_form #tutar6, .adet, #txtPhoneNumberA, #txtPhoneNumberB, #txtPhoneNumberC').numeric();	$('#havale_form #tarih, input[name=izinli_ip]').numeric({allow:"."});	$('#musteri_kaydi_1 #adsoyad, #musteri_kaydi_1 #sifre').alphanumeric({ichars:'.,\''});		$('#havale_form #tarih, #atm_form #tarih2, #money_form #tarih3').alpha();	$('#havale_form #bilgi, #atm_form #islem').alphanumeric({ichars:'\'\"'});	// takvim	//$("#havale_form #tarih, #atm_form #tarih2, #money_form #tarih3, #gg_form #tarih").datepicker({showOn: 'button', buttonImage: 'images/calendar.gif', buttonImageOnly: true, maxDate: 0});	$("#havale_form #tarih, #atm_form #tarih2, #money_form #tarih3, #gg_form #tarih").datepicker();	/*	$("#txtPhoneNumberA, #txtPhoneNumberB").mask("999");	$("#txtPhoneNumberC").mask("9999");	*/	   // slide kategori   $('.categories ul').hide();   if($.cookie("menu")) {	   $('.categories ul#'+$.cookie("menu")+'').show();   } else {	   $('.categories ul#menu_eu').show();   }   $(".categories h2").click(function(){		var checkElement = $(this).next();		        var menu_adi = $(checkElement).attr("id");        var options = { path: '/', expires: 10 };		$.cookie("menu", menu_adi, options);		if((checkElement.is('ul')) && (checkElement.is(':visible'))) {			return false;		}		if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {			$('.categories ul:visible').slideUp('normal');			checkElement.slideDown('normal');			return false;		}   });   ////////	// video oynatıcı	$('a.media').media( { width: 500 } );	// Banka Hesapları tab aç	$("a.bankacc").click(function(){        $(".tabs").tabs('select', 2);	});	$('textarea.grow').autogrow();	//$('#popup_panel').disableOnSubmit('#popup_ok');	//Adjust panel height	$.fn.adjustPanel = function(){ 		$(this).find("ul, .subpanel").css({ 'height' : 'auto'}); //Reset subpanel and ul height				var windowHeight = $(window).height(); //Get the height of the browser viewport		var panelsub = $(this).find(".subpanel").height(); //Get the height of subpanel			var panelAdjust = windowHeight - 100; //Viewport height - 100px (Sets max height of subpanel)		var ulAdjust =  panelAdjust - 25; //Calculate ul size after adjusting sub-panel (27px is the height of the base panel)				if ( panelsub >= panelAdjust ) {	 //If subpanel is taller than max height...			$(this).find(".subpanel").css({ 'height' : panelAdjust }); //Adjust subpanel to max height			$(this).find("ul").css({ 'height' : ulAdjust}); //Adjust subpanel ul to new size		}		else if ( panelsub < panelAdjust ) { //If subpanel is smaller than max height...			$(this).find("ul").css({ 'height' : 'auto'}); //Set subpanel ul to auto (default size)		}	};		//Execute function on load	$("#chatpanel").adjustPanel(); //Run the adjustPanel function on #chatpanel	$("#alertpanel").adjustPanel(); //Run the adjustPanel function on #alertpanel		//Each time the viewport is adjusted/resized, execute the function	$(window).resize(function () { 		$("#chatpanel").adjustPanel();		$("#alertpanel").adjustPanel();	});		//Click event on Chat Panel + Alert Panel		$("#chatpanel a:first, #alertpanel a:first").click(function() { //If clicked on the first link of #chatpanel and #alertpanel...		if($(this).next(".subpanel").is(':visible')){ //If subpanel is already active...			$(this).next(".subpanel").hide(); //Hide active subpanel			$("#info_bar li a").removeClass('active'); //Remove active class on the subpanel trigger		}		else { //if subpanel is not active...			$(".subpanel").hide(); //Hide all subpanels			$(this).next(".subpanel").toggle(); //Toggle the subpanel to make active			$("#info_bar li a").removeClass('active'); //Remove active class on all subpanel trigger			$(this).toggleClass('active'); //Toggle the active class on the subpanel trigger		}		return false; //Prevent browser jump to link anchor	});		//Click event outside of subpanel	$(document).click(function() { //Click anywhere and...		$(".subpanel").hide(); //hide subpanel		$("#info_bar li a").removeClass('active'); //remove active class on subpanel trigger	});	$('.subpanel ul').click(function(e) { 		e.stopPropagation(); //Prevents the subpanel ul from closing on click	});		//Delete icons on Alert Panel	$("#alertpanel li").hover(function() {		$(this).find("a.delete").css({'visibility': 'visible'}); //Show delete icon on hover	},function() {		$(this).find("a.delete").css({'visibility': 'hidden'}); //Hide delete icon on hover out	});});
