function setUpSlides() {
	jQuery('div.slides').each(function(i) {
		jQuery(this).css('display', 'none');
		if (typeof slideWait !='undefined') {
			sWait=slideWait;
		}
		else {
			sWait=8000;
		}
		if (typeof slideDur !='undefined') {
			sDur=slideDur;
		}
		else {
			sDur=800;
		}
		if (typeof slideFX !='undefined') {
			sFX=slideFX;
		}
		else {
			sFX='fade';
		}
		
		jQuery(this).fadeIn();
		jQuery(this).cycle({fx: sFX, speed: sDur, timeout: sWait, pause: 1});
		
	});
	return;


}

function checkSize() {
	var vHeight=jQuery(window).height();
	var cHeight=jQuery('#container').height();
	var halfHeight=(cHeight/2);
	var offsetCSS=halfHeight+'px';
	if (jQuery('#container #pageHeader').length>0) {
		theHeight=vHeight;
		theTop=0;
	}
	else {
		theHeight=vHeight-200;
		theTop='100px';
	}
	if (theHeight<cHeight) {
		jQuery('#container').css({
			top: theTop,
			marginTop: 0
		});
		jQuery('body').css({
			overflow: 'auto'
		});
	}
	else {
		jQuery('#container').css({
		top: '50%',
		marginTop: '-'+offsetCSS
		});
	}
	
	return;
}

function addToNavbar() {
	jQuery('#navcontainer').after('<div id="importedNavContent"></div>');
	if (jQuery('#addToNav').length==0) {return;}
	jQuery('#importedNavContent').append(jQuery('#addToNav').html());
	jQuery('#addToNav').empty();
	return;
}


function initSB() {
	Shadowbox.init({
		players: ["html","img","swf","flv","qt","iframe"]
	});
	return;
}

function setUpPhotoAlbumSB() {
	var theLink=jQuery('div.thumbnail-frame a').each(function() {
		theURL=jQuery(this).attr('href').replace(/html/, 'jpg');
		var theTitle=jQuery(this).next('p.thumbnail-caption').text();
		jQuery(this).attr({
			'href': theURL,
			'rel': 'shadowbox[photoSet]',
			'title': theTitle
		});
	});
	return;
}

function fixiDevSB() {
	if (iPhone || iPad) {
	jQuery('#content a').click(function(e) {
		var relTag=jQuery(this).attr('rel');
		if ((/shadowbox/gi.test(relTag)) || (/lightbox/gi.test(relTag))) {
			var wScroll=jQuery(window).scrollTop();
			//wScroll-=30;
			var wScrollCSS=wScroll+'px';
			jQuery('#sb-container').css('top', wScrollCSS);
		}
	});
	}
	return;
}

function fixOpera() {
	if(jQuery.browser.opera) {
			}
	return;
}

function fixRC() {
	if(jQuery('#rcPage').length>0) {
		jQuery('#rcPage').css('height', '100%');
		jQuery('.remooz-box').css('zIndex', '1000');
		jQuery('a.remooz-btn-close').css('display', 'block');
	}
	return;
}
