﻿/*
--------------------------------------------------------------------------------
 Holder for Misc $ Functions
--------------------------------------------------------------------------------
*/
function iif( b, v1, v2 )
{
	return ((b)? v1: v2);	
}
function bitset( b )
{
	return ((b) ? 1: 0);
}


function mmButtons( iLayoutID, bLo, iCount, sClass )
{
	iCount = iif( iCount, iCount, -1)
	$('#aj-buttons').load('/custom/aja/mmbutton.asp', {id:iLayoutID, lo:iif(bLo,'1','0'), cnt:iCount, cls:sClass }, function(){
	});	

}


function start_nivoslide()
{
	$('#slider-wrap').load('/custom/aja/nivo-slide.asp', {id:1, cnt:-1 }, function(){
		$('#slider').nivoSlider({
				effect:'fade', //Specify sets like: 'fold,fade,sliceDown'
				slices:15,
				animSpeed:500, //Slide transition speed
				pauseTime:4000,
				startSlide:0, //Set starting Slide (0 index)
				directionNav:false, //Next & Prev
				directionNavHide:true, //Only show on hover
				controlNav:false, //1,2,3...
				controlNavThumbs:false, //Use thumbnails for Control Nav
				controlNavThumbsFromRel:false, //Use image rel for thumbs
				controlNavThumbsSearch: '.jpg', //Replace this with...
				controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
				keyboardNav:true, //Use left & right arrows
				pauseOnHover:true, //Stop animation while hovering
				manualAdvance:false, //Force manual transitions
				captionOpacity:0.8, //Universal caption opacity
				beforeChange: function(){},
				afterChange: function(){},
				slideshowEnd: function(){} //Triggers after all slides have been shown
			});

		});	
}

function start_basicslide()
{
	$('#slider-wrap').load('/custom/aja/basic-slide.asp', {id:1, cnt:-1 }, function(){
		if( $('.basic-images img').size() > 1 ){
			$(function(){
						$('.basic-images img:gt(0)').hide();
						setInterval(function(){
							$('.basic-images :first-child').fadeOut(800)
							 .next('img').fadeIn(800)
							 .end().appendTo('.basic-images');}, 
							4000);
			});
		}		
	});	
}

/* */


var use_debug = false;

function debug(){
	if( use_debug && window.console && window.console.log ) console.log(arguments);
}


