var MouseX;
var MouseY;
// http://www.howtocreate.co.uk/tutorials/javascript/eventinfo





function cevir(){
        $('#duyuru li.aktif').each(function(){
											
            if ($(this).next('li').attr('class')=='pasif'){
                $(this).toggleClass('aktif');
                $(this).hide();
                $(this).next('li').fadeIn().addClass('aktif');
            }else{
                $(this).toggleClass('aktif');
                $(this).hide();
                $('#duyuru li:first').fadeIn().addClass('aktif');
            }
        });
        
        
    }
	
$(document).ready(function(){
	var hovertipMouseXY=function(e) {
		
	  if( !e ) {
		  
		if( window.event ) {
		  //Internet Explorer
		  
		  e = window.event;
		} else {
		  //total failure, we have no way of referencing the event
		  return;
		}
	  }
	  if( typeof( e.pageX ) == 'number' ) {
		//most browsers
		var xcoord = e.pageX;
		var ycoord = e.pageY;
	  } else if( typeof( e.clientX ) == 'number' ) {
		//Internet Explorer and older browsers
		//other browsers provide this, but follow the pageX/Y branch
		var xcoord = e.clientX;
		var ycoord = e.clientY;
		var badOldBrowser = ( window.navigator.userAgent.indexOf( 'Opera' ) + 1 ) ||
		  ( window.ScriptEngine && ScriptEngine().indexOf( 'InScript' ) + 1 ) ||
		  ( navigator.vendor == 'KDE' );
		if( !badOldBrowser ) {
		  if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
			//IE 4, 5 & 6 (in non-standards compliant mode)
			xcoord += document.body.scrollLeft;
			ycoord += document.body.scrollTop;
		  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
			//IE 6 (in standards compliant mode)
			xcoord += document.documentElement.scrollLeft;
			ycoord += document.documentElement.scrollTop;
		  }
		}
	  } else {
		//total failure, we have no way of obtaining the mouse coordinates
		return;
	  }
	  
	  return [xcoord, ycoord];
	}
	function hovertipMouseUpdate(e) {
	  var mouse = hovertipMouseXY(e);
	  MouseX = mouse[0] + 10;
	  MouseY = mouse[1] - 310;
	}
    $('#duyuru li:first').fadeIn().addClass('aktif');
	$('#bulut').hide();
	$('ul.liste li').mouseover(hovertipMouseUpdate) 
    $('ul.liste li').mousemove(hovertipMouseUpdate) 
	$('ul.liste li').bind('mouseenter',function(){
		if($(this).attr('title')){
			$('#bulut_ic').html($(this).attr('title'));
			$('#bulut').css({'position':'absolute','top': MouseY + 'px','left': MouseX + 'px','z-index':'50'}).show();
		}
	}).bind('mouseleave',function(){
		$('#bulut').hide();
	});
	$('#bulut_ic').corner("round 10px").parent().css('padding', '4px').corner("round 10px");
    setInterval('cevir()',10000);
});

