ï»¿
 
 $(document).ready(function() {


 
	$('div.topNav ul').superfish({
        animation: { height: 'show' },   // slide-down effect without fade-in 
        delay: 1200               // 1.2 second delay on mouseout
    });
	
	
	$("ol.sf_newsList").css("display","none");//normal haberleri gizle
	
	
	
	$("ol.sf_newsList img").each(function() { //küçük resimleri yerleþtir
		var url=this.src;
		var img_id= this.id;
		$('div#haber_liste').append('<div><a href="'+$('a', $(this).parent().next()).attr('href')+'" title="'+$(this).parent().next().text()+'"><img src="'+url+'?width=72&height=72&proportional=true&decreaseOnly=true" onmouseover="haber_degistir(\''+img_id+'\')" onmouseout="haber_degistir3(0)" class="'+img_id+'"/></a></div>');
	});
	
	$("img.list_image").each(function() { 
		this.src += "?width=128&height=128&proportional=true&decreaseOnly=true";
		$(this).show();
		
	});
	
	$("div.topNav ul a").click(function(e) { 
	
		//e.preventDefault();

	});
	

	
	
//ilk resmi yerlestir

	if($("ol.sf_newsList li:first img").length){
		var url=$("ol.sf_newsList li:first img")[0].src;
		$("#haber_image div").html('<img src="'+url+'?width=200&height=200&proportional=true&decreaseOnly=true" />');
		$("#haber_yazi").html($("p.sf_date").html());
		$("#haber_baslik").html($("h4").html());
	}

	
  /* $("ol.sf_newsList li").hover(function() {
     $("#haber_image")[0].src = $("img",this)[0].src + "?width=200&height=200&proportional=true&decreaseOnly=true";
	$("#haber_yazi").html($("p.sf_date",this).html());
	$("#haber_baslik").html($("h4",this).html());
	
   });*/

   $('.pics').cycle({ 
    fx:      'scrollDown', 
    speed:    800, 
    timeout:  6000 
	});
	
	$('#tabs').tabs();

	if($('#carousel').length){
		 $('#carousel').jcarousel({
			auto: 2,
			wrap: 'last',
			initCallback: mycarousel_initCallback
		});
	}
	
	
      $("#topSponsorsList").accordion();
 
        //$('#topSponsorsList').combobox();
	
	
	//FOTO GALERÝ
	$('div.fotolar a').lightBox({
	fixedNavigation:true,
	imageLoading:			'/COB/JS/images/lightbox-ico-loading.gif',		
	imageBtnPrev:			'/COB/JS/images/lightbox-btn-prev.gif',			
	imageBtnNext:			'/COB/JS/images/lightbox-btn-next.gif',			
	imageBtnClose:			'/COB/JS/images/lightbox-btn-close.gif',		
	imageBlank:				'/COB/JS/images/lightbox-blank.gif',
	txtImage:				'Resim',
	txtOf:					' - '		

	});

	
	/*iconlar*/
	
	
	$("#mainBig a[href$='.txt']").addClass("txt");
	$("#mainBig a[href$='.pdf']").addClass("pdf");
	$("#mainBig a[href$='.xls'],#mainBig a[href$='.xlsx']").addClass("xls");
	$("#mainBig a[href$='.doc'],#mainBig a[href$='.docx'],#mainBig a[href$='.rft']").addClass("doc");
	$("#mainBig a[href$='.jpg'],#mainBig a[href$='.gif'],#mainBig a[href$='.png']").addClass("jpg");
	$("#mainBig a[href$='.ppt'],#mainBig a[href$='.pptx'],#mainBig a[href$='.pps']").addClass("ppt");
	$("#mainBig a[href$='.zip'],#mainBig a[href$='.rar']").addClass("zip"); 
	$("#mainBig a[href$='.avi'],#mainBig a[href$='.wmv']").addClass("avi"); 
	$("#mainBig a[href$='.rss.ashx'],#mainBig a[href$='.xml']").addClass("rss"); 
	$("#mainBig a[href$='.html'],#mainBig a[href$='.htm'],#mainBig a[href$='.asp'],#mainBig a[href$='.asp'],#mainBig a[href$='.aspx'],#mainBig a[href$='.jsp'],#mainBig a[href$='.php']").addClass("html"); 
	$("#mainBig a[href^='mailto:']").addClass("email");
	$('#mainBig a').filter(function() {
	    return this.hostname && this.hostname !== location.hostname;
	  }).addClass("ext");
	
	$('div.fotolar a').removeClass("jpg");
	
	
	/*videolar*/
	$.fn.media.defaults.flvPlayer = '/COB/JS/player.swf';
	$('.media').media({	params: { allowfullscreen : 'true'} });
	$(".sf_listItemBody").hide();
	$("h3.sf_listItemTitle").click(function(e) { 
		$(this).next().toggle("slow");
	}).css("cursor","pointer").css("color","#065F5D");	
	/*---videolar*/
	
	/*  if (!$.cookie('bakanMesaj')){
		if($('#bakanMesaj').html().length >20){
			$('#bakanMesaj').dialog({  width: 830, minWidth: 830, modal: true,title: 'Bakan Bey\'den MesajÄ±z Var', buttons: { "Kapat ve Tekrar GÃ¶sterme": function() {
				$.cookie('bakanMesaj'); // get cookie
				$.cookie('bakanMesaj', '1',{ expires: 3 });
				$(this).dialog("close"); 
				} }  });

		}
	} */
	
	/* bakan mesaj	if($('#bakanMesaj').html().length >20){
			$('#bakanMesaj').dialog({  width: 830, minWidth: 830, modal: true, buttons: { "Kapat": function() {
				
				$(this).dialog("close"); 
				} }  });

		
	}
	*/
	
	/* $('#cedUygulama').dialog.({ width: 830, minWidth: 830,  modal: true, buttons: { "Kapat": function() {
				
				$(this).dialog("close"); 
				} }  }); */
	
   });

var timerId = 0;
var haberNo = 0;
haber_degistir2(haberNo);

function UygulamaAc(theURL,winName,features) {
  window.open(theURL,winName,features);
}

function haber_degistir(img_id)
{
	clearTimeout(timerId);
	$("#haber_image").stop(true);
	$("#haber_liste div").css("border-color","#ccc");
	$("#haber_image").fadeTo("fast", 0); 
	$("#haber_image div img")[0].src = $("#"+img_id)[0].src + "?width=200&height=200&proportional=true&decreaseOnly=true";
	$("#haber_yazi").html($('#'+img_id).parent().next().next().html());
	$("#haber_baslik").html($('#'+img_id).parent().next().html());
	$("#haber_image").fadeTo("fast", 1.0); 
}

function mycarousel_initCallback(carousel)
{
    // Disable autoscrolling if the user clicks the prev or next button.
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });

    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    });

    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};



function haber_degistir2(haberNo)
{
	clearTimeout(timerId);
	$("#haber_liste div").css("border-color","#ccc");
	$("#haber_liste div img").eq(haberNo).trigger('mouseover').parent().parent().css("border-color","#000");
	if(haberNo< 6)
		haberNo++; 
	else
		haberNo = 0;
	timerId = setTimeout('haber_degistir2('+haberNo+')', 5000);

}

function haber_degistir3(haberNo)
{
	timerId = setTimeout('haber_degistir2('+haberNo+')', 7000);
}
function baglanti(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function ilSec__(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
  }
