$(document).ready(function(){
    /*setFooterPosition(".footer");
    $(window).resize(function() {
      setFooterPosition(".footer");
    });*/
  if($('.slideshow_partners').size() > 0){
    if($('.sympal_slot_bar').size() == 0){
      $return = '<div class="slideshow_partners_content">';
      $return += '<div class="list_pictures">';
      $('.slideshow_partners img').each(function(index){
        if(index % 4 == 0 && index != 0)
            {
              $return += '</div>';
              $return += '<div class="list_pictures">';
            }
            $return += '<img src="'+$(this).attr('src')+'" alt="'+$(this).attr('alt')+'" />'
      });
      $return += '</div>';
      $return += '</div>';
      $return += '<img class="prev" src="/sfSympalBossSiteModel1Plugin/images/global/arrow_partners_prev.gif" alt="&gt;" />';
      $return += '<img class="next" src="/sfSympalBossSiteModel1Plugin/images/global/arrow_partners_next.gif" alt="&gt;" />';
      $('.slideshow_partners').html($return);
      $('.slideshow_partners .slideshow_partners_content').cycle({
			fx:'scrollHorz',
			timeout: 4000,
			next:  '.slideshow_partners .next',
			prev:  '.slideshow_partners .prev'
	 });
    }
  }
  $('a.popup:not(.edit)').fancybox({
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'speedIn'		:	600,
		'speedOut'		:	200,
		'overlayShow'	:	false
	});
  ind = 0;
  while($('#anim_image'+(ind+1)).size() > 0){
    $('#anim_image'+(ind+1)+' .anim_image_slideshow').cycle({
        fx:'fade',
        timeout: (Math.floor(Math.random()*10000+1)),
        random: 1
     });
     ind++;

}

$('#prospectform input[type=checkbox], #reductionform input[type=checkbox]').each(function(){
    $(this).attr("value",1);
  });
  
});
function setFooterPosition($footer){
    windowH = jQuery(window).height();
    bodyH = $('.global').height();
    footerH = $($footer).height();
    if(windowH > bodyH){
        $($footer).css('top',windowH - footerH);
    }else {
        $($footer).css('top',bodyH);
    }
    $($footer).css('display','block');
} 
