﻿/*
--------------------------------------------------------------------------------
 Holder for Misc $ Functions
--------------------------------------------------------------------------------
*/
function iif( b, v1, v2 )
{
	if(b)
		return v1;
	else
		return v2;	
}

function mmButtons( iLayoutID, bLo, iCount, sClass )
{
	iCount = iif( iCount, iCount, -1)
	//$('#aj-buttons').html('Hello, World!');
	$('#aj-buttons').load('/custom/aja/mmbutton.asp', {id:iLayoutID, lo:iif(bLo,'1','0'), cnt:iCount, cls:sClass }, function(){
	
	});	

}

function mmWebsites( iLayoutID, bLo, iCount, sClass )
{
	iCount = iif( iCount, iCount, -1)
	//$('#aj-websites').html('Hello, World!');
	$('#aj-websites').load('/custom/aja/mmwebsites.asp', {id:iLayoutID, lo:iif(bLo,'1','0'), cnt:iCount, cls:sClass }, function(){
		//alert('done');
	});	

}

function FadeInBigPicture()
{
	// set the div to document height and fade in to create a nice effect
	$('div#big-picture').height($(document).height()).fadeIn(1500);
}

function pdButtons( iLayoutID, bLo, iCount, sClass )
{
	iCount = iif( iCount, iCount, -1)
	//$('#aj-buttons').html('Hello, World!');
	$('#pd-buttons').load('/custom/aja/mmbutton.asp', {id:iLayoutID, lo:iif(bLo,'1','0'), cnt:iCount, cls:sClass }, function(){
	
	});	

}

function cdHorizButtons( iLayoutID, bLo, iCount, sClass )
{
	iCount = iif( iCount, iCount, -1)
	//$('#aj-buttons').html('Hello, World!');
	$('#h-buttons').load('/custom/aja/mmbutton.asp', {id:iLayoutID, lo:iif(bLo,'1','0'), cnt:iCount, cls:sClass }, function(){
	
	});	
}

function cdVertButtons( iLayoutID, bLo, iCount, sClass )
{
	iCount = iif( iCount, iCount, -1)
	//$('#aj-buttons').html('Hello, World!');
	$('#v-buttons').load('/custom/aja/mmbutton.asp', {id:iLayoutID, lo:iif(bLo,'1','0'), cnt:iCount, cls:sClass }, function(){
	});	

}


function startflownews()
{
	// select #flowplanes and make it scrollable. use circular and navigator plugins
	$("#flowpanes").scrollable({ circular: true, mousewheel: true }).navigator({

		// select #flowtabs to be used as navigator
		navi: "#flowtabs",

		// select A tags inside the navigator to work as items (not direct children)
		naviItem: 'a',

		// assign "current" class name for the active A tag inside navigator
		activeClass: 'current',

		// make browser's back button work
		history: true

	});
}


// init Homepage
function initHomepage( date, width, owner )
{
	if( width )	ajCalWidth = width;
	if( owner ) ajCalOwner = owner;
	loadCal( date );
	
}

// init Parks Homepage
function initParks( date, width, owner, post )
{
	if( width )	ajCalWidth = width;
	if( owner ) ajCalOwner = owner;
	if( post ) ajCalPost = post;
	loadCal( date, 'Cal003' );
	
}

// init Library Homepage
function initLibrary( date, width, owner, post )
{
	if( width )	ajCalWidth = width;
	if( owner ) ajCalOwner = owner;
	if( post ) ajCalPost = post;
	loadCal( date, 'Cal004' );
	
}

var use_debug = true;

function debug(){
	if( use_debug && window.console && window.console.log ) console.log(arguments);
}


