$(document).ready(function(){
	$(".lightbox").lightbox({ fitToScreen : true });

	
	 $('#menu ul > li').filter(function(index) {
         $(this).each(function() {
             var $this = $(this);
             $(this).hover(function() {
                 setTimeout(function() {
                     //$this.css('background-position', '-142px -' + (index * pos_bg) + 'px');
                     $this.find('a:first').css('color', '#023f85');
                     $this.find('ul').fadeIn(100);
                 }, 100);
             }, function() {
                 setTimeout(function() {
                     //$this.css('background-position', '0px -' + (index * pos_bg) + 'px');
                	 $this.find('a:first').css('color', '#767373');
                     $this.find('ul').fadeOut(100);
                 }, 100);
             });
             
             if (  $this.find('ul').length > 0 ) {
            	 $this.css('background-image', 'url(images/menu_bullet.gif)'); 
             }	 
         });
     });
	

});

var popUpWin=0;

function popUpWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = window.open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

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();
    });
};


