function windowBlank(path) {
  /**
   * tato fce tu musi byt kvuli imageT, ktery ji ma napevno danou, jinak to haze bordel v I
   */     
  return true;
}

function casopis(path)
{
  window.open(path, '_blank', 'left=400, top=100, width=920, height=770, resizable=1');
  return false;
}


/**
 *  Zobrazovani tel. cisla podle aktualni doby, vklada se v texy, neni reseno pres php
 */

function changePhone()
{
	var today = new Date(),
		differentPhone;

	if (today.getDay() >= 1 && today.getDay() <= 5){
		if (today.getHours() >= 7 && today.getHours() <= 18){
            differentPhone = false;
		}
		else {
            differentPhone = true;
		}
	}
	else if (today.getDay() == 6){
		if (today.getHours() >= 7 && today.getHours() <= 14){
            differentPhone = false;
		}
		else {
            differentPhone = true;
		}
	}
	else {
        differentPhone = true;
	}
	return differentPhone;
}

$(document).ready(function(){

  	$('a.lightbox').lightBox(); // Select all links with lightbox class
  	
    $('.link-from-child').each(function() {
        var _this = $(this);
        if (!_this.hasClass('active'))
            return;        
        
        _this.children('a').click(function() {
            _this.find('ul').slideToggle('fast');
            return false;
        });
    });    
    
	/**
	 *  Zmena telefonu na hlavni strance
	 */

	var differentPhone = changePhone();
	if (differentPhone){
  		$('a.pridany_odkaz img').attr("src", "http://www.autopruhonice.com/img/servis-objednavky-top-pane1.jpg");
	}
	
	/**
	 *  Pridani ceniku do menu v detailu novych vozu
	 */
	 
// 	var $el = $('<a>', {
// 	    href: $('div.cenik a').attr("href"),
// 	    class: $('div.cenik a').attr("href"),
// 	    text: "Ceník"
// 	});
	$("div.popis-vozu h2").append($('div.cenik a').clone());
	
	if ($('#foo-cycle').length){
		$("#foo-cycle").cycle({
			fx:    'fade',
			timeout: 5000
		});
	}
	
	
});

