$(function() {
        $('.partnersCycle').cycle({
		fx: 'fade',
                random: 1 
	});

	$(".toggle").hide();
	$(".trigger").click(function(){
             $(this).next(".toggle").slideToggle("slow,"); return false;
	});

$("a[href^='http']").not("[href*='www.iidexneocon.com']").not(".videobox").click(function(){
	window.open(this.href);
	return false;
});

$("a[rel='external']").click(function(){
	window.open(this.href);
	return false;
});

$("a[href*=.pdf]").click(function(){
	window.open(this.href);
	return false;
});

$(".prefilled").focus(function() {  
	this.value = '';
});  

$(".prefilled").blur(function() {  
     if ($.trim(this.value) == ''){  
         this.value = (this.defaultValue ? this.defaultValue : '');  
     }  
});  


        $('a[href*=#]').click(function() {
          if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
            var $target = $(this.hash);
            $target = $target.length && $target
            || $('[name=' + this.hash.slice(1) +']');
            if ($target.length) {
              var targetOffset = $target.offset().top;
              $('html,body')
              .animate({scrollTop: targetOffset}, 1000);
             return false;
            }
          }
        });

       $('.speakersGallery').each(function(){
            $('.lightbox', this).lightBox({
	imageLoading: '/2011/template/images/lightbox-ico-loading.gif',
	imageBtnClose: '/2011/template/images/lightbox-btn-close.gif',
	imageBtnPrev: '/2011/template/images/lightbox-btn-prev.gif',
	imageBtnNext: '/2011/template/images/lightbox-btn-next.gif'
         });
        });

       $('.gallery').each(function(){
            $('.lightbox', this).lightBox({
	imageLoading: '/2011/template/images/lightbox-ico-loading.gif',
	imageBtnClose: '/2011/template/images/lightbox-btn-close.gif',
	imageBtnPrev: '/2011/template/images/lightbox-btn-prev.gif',
	imageBtnNext: '/2011/template/images/lightbox-btn-next.gif'
         });
        });

$(".colorbox").colorbox({transition:"elastic", opacity: 0.5, current:"{current} / {total}"});
$(".videobox").colorbox({iframe:true, innerWidth:425, innerHeight:344, transition:"elastic", opacity: 0.5, current:"{current} / {total}"});

function addSelectChange(){ 
	$("#selector").bind('change', function(){

       var $target= $('[id=' + $(this).val() + ']') ;
            if ($target.length) {
              var targetOffset = $target.offset().top;
              $('html,body')
              .animate({scrollTop: targetOffset}, 1000);
             return false;
            }

    });
};

addSelectChange()

});



