/**
* Bismillahirrahmanirrahim diyerekten başlayalım..
* Kodlayan : Ferhat DOĞAN
* E-mail   : sanalbilisim@hotmail.com
* Website  : www.ferhatdogan.com.tr
*/


function manset(id)
{
     var baslik     = $("#mbaslik"+id).text();
     var link       = $("#mlink"+id).text();
     var resim      = $("#mresim"+id).text();
     var aciklama   = $("#maciklama"+id).text();
          
     $(".anaresim img").attr('src',resim);
     $("#mlink").attr({href : link,title: baslik,alt: baslik});
     $(".kisabilgi").html(aciklama);
     $(".mryazi h1").html(baslik);
     
     return true;
}

function slide_goster() 
{
    for(i=0;i<5;i++)
    {
        if (i == selected_slide) 
        { 
            manset(selected_slide); 
        }
        
    } 
} 
function manset_sec(slideId)
{
    if (slideId >= 0)
    {
        clearTimeout(slideTimeout);
        selected_slide = slideId;
        slide_goster();
    }
    else 
    {
        slide_goster();
        selected_slide = selected_slide + 1;
        if(selected_slide >= 4) selected_slide = 0;
        slideTimeout = setTimeout("manset_sec(-1)", '3000');
    } 
} 
var selected_slide = 0;
var slideTimeout =1;

slideTimeout = setTimeout("manset_sec(-1)", '3000'); 


var Timeouts = Array();
Timeouts["show"] = Array();
Timeouts["hide"] = Array();
var Increment = 4; // px
var Temps_timeout = 30; //ms

function logos_showInfo(id)
{
    logos_clearTimeout(id, "hide");
    logos_clearTimeout(id, "show");
    _logos_showInfo(id);
}


function _logos_showInfo(id)
{
    var obj = document.getElementById(id);
    if(!obj) return;

    if(obj.style.display != "block"){
        obj.style.height= "20px";
        obj.style.display = "block";
    }

    var newHeight = parseInt(obj.style.height,10) + Increment;
    if(newHeight > 75) newHeight = 75;
    obj.style.height = newHeight+"px";
    obj.style.top = (200-newHeight) + "px";

    if(newHeight < 20)
    {
        Timeouts["show"][id] = setTimeout("_logos_showInfo('"+id+"')", Temps_timeout);
    }
}


function logos_hideInfo(id)
{
    logos_clearTimeout(id, "hide");
    logos_clearTimeout(id, "show");
    _logos_hideInfo(id);
}


function _logos_hideInfo(id)
{
    var obj = document.getElementById(id);
    if(!obj) return;

    var newHeight = parseInt(obj.style.height,10) - Increment;
    if(newHeight < 0) newHeight = 0;
    obj.style.height = newHeight+"px";
    obj.style.top = (200-newHeight) + "px";

    if(newHeight > 0){
        Timeouts["hide"][id] = setTimeout("_logos_hideInfo('"+id+"')", Temps_timeout);
    }
    else{
        obj.style.display = "none";
    }
}


function logos_clearTimeout(id, tipus)
{
    if(typeof Timeouts[tipus][id] == "undefined") Timeouts[tipus][id] = 0;
    if(Timeouts[tipus][id] != 0){
        clearTimeout(Timeouts[tipus][id]);
        Timeouts[tipus][id] = 0;
    }
}


