// JavaScript Document
function set_img($object, $imgWidth, $imgHeight, $size) {
	$object = $($object);	

	$containerHeight = $object.parent().parent().height();
	$containerWidth = $object.parent().parent().width();
	
	if ($containerWidth > 300) {
		var tempW = $containerWidth;
		var tempH = $imgHeight*tempW/$imgWidth;
		$object.css({
			'width': tempW,
			'top': ($containerHeight-tempH)/2,
			'left': 0
		});		
	} else {
		if ($imgHeight >= $imgWidth) {
			var tempW = $containerWidth;
			var tempH = $imgHeight*tempW/$imgWidth;
			$object.css({
				'width': tempW,
				'top': ($containerHeight-tempH)/2,
				'left': 0
			});
		} else {
			var tempH = $containerHeight;
			var tempW = $imgWidth*tempH/$imgHeight;
			$object.css({
				'height': tempH,
				'left': ($containerWidth-tempW)/2,
				'top': 0
			});
		}
	}
}

function setGalleryLightbox() {
	$('#cycleGallery a').lightBox();
};
function img_hover(){
	$(".imgBorder").css({'border':'2px solid #777', 'margin':'0', 'background':'url(html/images/zoom.jpg) no-repeat center'});
	$(".imgBorder a").css({'opacity':'0.6'});
}
function img_out($color){
	$(".imgBorder").css({'border':'1px solid '+$color, 'margin':'1px', 'background':'none'});
	$(".imgBorder a").css({'opacity':'1'});
}
$("#cycleValues").cycle({
	pager:	'#cycleNav',
	fx:	'fade',	
	speed:	300, 
    timeout:	15000, 
    pause:	1
});
$("#cycleImages").cycle({
	pager:	'#cycleNavImg',
	fx:	'scrollRight',	
	speed:	300, 
    timeout:	8000, 
    pause:	1,
	next:'#cycleImages'
});
$("#cycleGallery").cycle({
	pager:	'#cycleNavGal',
	fx:	'scrollRight',
	speed: 300, 
    timeout: 8000, 
    pause: 1
});
