﻿$(document).ready(function(){
	
	if($('.topimg-slide').children().length){
		$('#topimg.topimg-slide').cycle({ 
			fx: 'fade', 
			speed: 3500, 
			timeout: 4500, 
			pause: 1 
		});
	}
	if($('#imageslide-images').children().length){
		$('#imageslide-images').cycle({ 
			fx: 'scrollLeft', 
			speed: 1500, 
			timeout: 0, 
			next: '#next', 
			prev: '#previous'
		});
	}
	//if($('#content a').not('.nofancybox')){
		$('#content a:has(img)').not('.nofancybox').attr('rel', 'fancybox');
	//}

	$("a[rel=fancybox]").fancybox({
		'titlePosition': 'over',
		'titleFormat': function(title, currentArray, currentIndex, currentOpts){
			return '<span id="fancybox-title-over">' + (title.length ? ' &nbsp; ' + title : '') + '</span>';
		}
	});
	$("a[rel=fancybox-html]").fancybox({
		'width': '60%',
		'height': '80%',
        'autoScale': false,
        'transitionIn': 'none',
		'transitionOut': 'none',
		'type': 'iframe'
	});
	
});
