/**
 * DIGITAL NEIGHBORS main JS file
 * 
 * NOTE: This file will work on the preview server. Save it to a *.pack.js version for the live server
 * 
 */

/* Determine links for neighbors sections */	
/* Dynamic links to spill pages and / or other community news sections */
console.log('ready to load function : resendPageWithNewTopic');
function resendPageWithNewTopic(newTopic) { 
	var fullURL;
	console.log('new resend page function');
	fullURL = window.location.protocol + '//' + window.location.hostname + '/' + getThisCityAlias() + "/index-p2.html?topic=" + newTopic; 

	if (newTopic == 'events') {
    	window.open(fullURL, '_blank');
  	} else {
    	window.location.href = fullURL; 
	}
} 

console.log('ready to load function : resendPageWithNewLocation');
function resendPageWithNewLocation(newLocation) {
	var newCityURL = window.location.protocol + "//" + window.location.hostname + "/" + newLocation + "?topic=" + currentTopic;
	window.location.href = newCityURL;
}

console.log('ready to load function : jCarouselLite');
/* Slideshow in Header */
$(function() {
	$("#inside").css('display','inline');
    $(".jcarousel").jCarouselLite({
        btnNext: ".next",
        btnPrev: ".prev",
		visible:3,
		speed:500,
		circular: true,
		scroll: 1
    });
	$("#inside").show();
});

// Testing this to see what happens when GBrowserIsCompatible() isn't available
function safe_GBrowserIsCompatible(){return GBrowserIsCompatible();}