// JavaScript Document
//template pocetak
function slideSwitch() {
    var $active = $('#slideshow IMG.active');

    if ( $active.length == 0 ) $active = $('#slideshow IMG:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow IMG:first');

    // uncomment the 3 lines below to pull the images in random order
    
    // var $sibs  = $active.siblings();
    // var rndNum = Math.floor(Math.random() * $sibs.length );
    // var $next  = $( $sibs[ rndNum ] );


    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval( "slideSwitch()", 5000 );
});

var blinkImg = function (imgname, s) {
	clearTimeout(blinkImg['blinking' + imgname]);
	var obj = document.images[imgname];
	if (arguments[1] === 'blink') {
		obj.style.visibility = !(blinkImg[s + imgname] = !blinkImg[s + imgname])? '' : 'hidden';
		blinkImg['blinking' + imgname] = setTimeout(function(){blinkImg(imgname, s);}, 500);
	}
	else {
		blinkImg['blink' + imgname] = false;
		obj.style.visibility = '';
	}
};

//template kraj

//index.php pocetak

 //scroller width


   
   
  //index.php kraj
  //vozni_red.php pocetak

function poorman_toggle(id)
{
	var tr;
	var id1;
	
	var i;
	for(i=1;i<=15;i++){
		id1=id.concat(i);
		tr = document.getElementById(id1);
		if (tr==null) { continue; }
			var bExpand = tr.style.display == '';
			tr.style.display = (bExpand ? 'none' : '');
			/*if(bExpand==''){
			$(id1).slideToggle('slow');
		
			}
			else{
				$(id1).slideUp('slow');
			}*/
	}
}

function obojaj(tr_id){
	var str = "child" +  + tr_id + "x";

	var tr = document.getElementById(tr_id);
	var dijete = document.getElementById(str);
	if(dijete==null) {alert("nema djeteta");return;}
	if(tr==null) {alert("nema roditelja");return;}

	if(dijete.style.display==''){
		//tr.getElementsByTagName('td').style ='border-bottom:1px solid black';
		//tr.style.backgroundColor="#ffffff";
	}
	else{
		//tr.getElementsByTagName('td').style ='border-bottom:1px solid black';
		//tr.getElementsByTagName('td').backgroundImage = "url(Slike/back.png)";
		}

}


//vozni_red.php kraj