﻿function KayitSilinsin(KayitText){
	if (confirm ("Silmek istediğinize eminmisiniz?\n\n" + KayitText)){
		return true;
	}else{
		return false;
	}
}


function Soru(TextMetin){
	if (confirm (TextMetin)){
		return true;
	}else{
		return false;
	}
}





function SecimleriKaydet(){
	Shadowbox.open({
        content:    AppPath + 'firsatlar/secimkaydet.aspx',
        player:     "iframe",
        title:      "Seçimlerimi Kaydet",
        height:     350,
        width:      350,
		modal : true
    });

}







function IcerikYukle(hedef,link){
	$(hedef).load(link);
}


function popupOpen(page,w,h){
	if (w == "")
		w = 700;
	if (h == "")
		h = 500;
	var donus = window.open(page,'pencere','width='+w+',height='+h+',scrollbars=yes');
	return donus;
}


function onOver(obj){
	//obj.className = "onOver";
}
function onOut(obj){
	//obj.className = "onOut";
}

function onOverBtn(obj){
	obj.className = "btnSubmitOver";
}
function onOutBtn(obj){
	obj.className = "btnSubmit";
}



var openShadowbox = function(content, player, title, width, height, modal){
	Shadowbox.open({
		content:    content,
		player:     player,
		title:      title,
		width:		width,
		height:		height,
		modal:		modal
	});
};		




function myPageValid() { 
//asp.net formlarında hata durumunu verir.
//  var valid = false;
//  if (typeof (Page_ClientValidate) == 'function') {
//	  valid = Page_ClientValidate();
//  } else {
//	  valid = true;
//  }
//  return valid;
    var valid=false;
    if (typeof (Page_ClientValidate) == 'function') {
        Page_ClientValidate();
    }
    valid = Page_IsValid;
    return valid;
}







//jquery block scripti
        function DialogMesajGoster(Mesaj, Sure) {
            if (Mesaj == "" || Mesaj == null)
                Mesaj = "Lütfen Bekleyiniz";

				//            Mesaj = '<div class="growlUI_h1">' + Mesaj + '</div>';
				//            $.blockUI({
				//                message: Mesaj,
				//                theme: true,
				//                title: '<div class="growlUI_h2">İşlem</div>',
				//                overlayCSS: { backgroundColor: '#fff' }
				//            });

				$.blockUI({ 
					message: Mesaj, 
					fadeIn: 700, 
					fadeOut: 700, 
					timeout: 3000, 
					showOverlay: false, 
					centerY: false, 
					css: { 
						width: '350px', 
						top: '20%',
						left: '20%',
						right: '10%',
						border: 'none', 
						padding: '5px', 
						backgroundColor: '#AA0000', 
						'-webkit-border-radius': '10px', 
						'-moz-border-radius': '10px', 
						opacity: .9, 
						color: '#fff',
						padding:'20px',
						'text-align':'left',
						'font-size':'15px'
					} 
				});	


            //timeout süresi verilmişse
            if (Sure > 0) {
                setTimeout($.unblockUI, Sure * 1000);
            }
        }

        

        //Form submit edildikten sonra çıkan mesaj
        function DialogMesajGoster_Kaydedildi() {
            var Mesaj = '<div class="growlUI_h1">'
                              + '<img src="' + AppPath + 'images/icons/silk/accept.png" alt=""> '
                              + 'Verileriniz kaydedilmiştir.'
                              + '</div>';
//            $.blockUI({
//                message: Mesaj,
//                theme: true,
//                title: '<div class="growlUI_h2">Kayıt Edildi</div>',
//                overlayCSS: { backgroundColor: '#fff' }
//            });


				$.blockUI({ 
					message: Mesaj, 
					fadeIn: 700, 
					fadeOut: 700, 
					timeout: 3000, 
					title: '<div class="growlUI_h2">Kayıt Edildi</div>',
					showOverlay: false, 
					centerY: false, 
					css: { 
						width: '350px', 
						top: '20%',
						left: '20%',
						right: '10%',
						border: 'none', 
						padding: '5px', 
						backgroundColor: '#AA0000', 
						'-webkit-border-radius': '10px', 
						'-moz-border-radius': '10px', 
						opacity: .9, 
						color: '#fff',
						padding:'20px',
						'text-align':'left',
						'font-size':'15px'
					} 
				});

            setTimeout($.unblockUI, 1000);
        }

        //Bir kayıt silindiğinde çıkan mesaj
        function DialogMesajGoster_KayitSilindi() {
            var Mesaj = "İstediğiniz veriler silinmiştir.";
            Mesaj = '<div class="growlUI_h1">'
                              + '<img src="' + AppPath + 'images/icons/silk/accept.png" alt=""> '
                              + Mesaj
                              + '</div>';
            $.blockUI({
                message: Mesaj,
                theme: true,
                title: '<div class="growlUI_h2">Silindi</div>',
                overlayCSS: { backgroundColor: '#fff' }
            });
            setTimeout($.unblockUI, 2000);
        }

        function MesajGoster(title, message, timeout) {
            if (timeout == undefined || timeout == "") timeout = 9999999999;
            if (title == undefined || title == "") title = "Lütfen Bekleyiniz";
            if (message == undefined || message == "") message = "İŞLEMİNİZ YAPILIYOR";
            //ajax gibi işlemlerde sağ üst ekranda facebook benzeri mesaj çıkartır.
            //$.growlUI(title, message, timeout);
			
				$.blockUI({ 
					message: Mesaj, 
					fadeIn: 700, 
					fadeOut: 700, 
					timeout: timeout, 
					title: title,
					showOverlay: false, 
					centerY: false, 
					css: { 
						width: '350px', 
						top: '20%',
						left: '20%',
						right: '10%',
						border: 'none', 
						padding: '5px', 
						backgroundColor: '#AA0000', 
						'-webkit-border-radius': '10px', 
						'-moz-border-radius': '10px', 
						opacity: .9, 
						color: '#fff',
						padding:'20px',
						'text-align':'left',
						'font-size':'15px'
					} 
				});			
			
        }
//---> jquery block scripti





//////buton onclientclick işlemi  objectPath = '#divalani' veya '.divalani ul' gibi /////////////
    function blockUI(objectPath){
        //'.tabButonSet_Panel'
        //$(objectPath).block({ message: null });
        
      
        if (!myPageValid()) return;

        $(objectPath).block({
                message: '<img src="' + AppPath + 'images/loading1.gif" />',
                overlayCSS: { backgroundColor: '#fff' },
                css: { 
                       width: '35px',
                       height:'35px',
                       border: '0px solid #a00'
                     }
        }); 
    } 
///////////////////









function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function share_FaceBook(pUrl, pTitleTemp) { 
	var pTitle = encodeURIComponent(document.title);
	if (pTitleTemp!=''){
		pTitle += " - " + encodeURIComponent(pTitleTemp);
	}
	pUrl = encodeURIComponent(pUrl);
	var fbUrl = "http://www.facebook.com/sharer.php?u="+pUrl+"&t="+pTitle;
	window.open(fbUrl);
}




$(function() {
    $('.rolloverimage').hover(function() {
        var currentImg = $(this).attr('src');
        $(this).attr('src', $(this).attr('hover'));
        $(this).attr('hover', currentImg);
    }, function() {
        var currentImg = $(this).attr('src');
        $(this).attr('src', $(this).attr('hover'));
        $(this).attr('hover', currentImg);
    });
});


