// JavaScript Document

$(document).ready(function(){

    //doing our auto-init stuff
	base_url=$('base').attr('href');
	//homepage featured images


	var active=0;
	var stopped=0;

	

    $('.fade').innerfade({ speed: 700, timeout: 6500, type: 'sequence', containerheight: '468px'}); 

	

	});



function showLoginWindow(){
	$('#loginPopup').vCenter().fadeIn('slow');
}

function closeLoginPopup() {
	$('#loginPopup').css('display','none');
}

function objDump (obj, except) {
       return _objDump (obj, [obj], 0);
}
function inArray (arr, elt){
       for (var i = 0; i < arr.length; i++) if (elt == arr[i]) return i;
       return false;
}
function _objDump (obj, used, level) {
       var rez = '';
       var spaces = " ";
       for (var i = 0; i < level; i++) spaces += " ";
       rez += spaces+('* Dumping object: ' + obj.toString () + "\n");
       for (var i in obj) {
               if (used && inArray(used ,obj[i]) !== false) {
                       rez += spaces+"->"+"!Self Reference"+"\n";
                       continue;
               }
               rez += (spaces+"  ->" + i + ': ');
               if ( (typeof obj[i]) == "object"){
                       try{
                               rez += _objDump (obj[i], used.slice(0).push(obj[i]), 1 +level) +"\n";
                       }catch (eee) {rez += spaces+"->"+"!Error"+"\n";}
               }else rez +=(spaces+"->"+obj[i] + "\n");
       }
       return rez;
}


function gotoPage(){
	if (window.location.href.lastIndexOf('/page') > 0) 
		window.location = window.location.href.substring(0,window.location.href.lastIndexOf('/page')) + '/page' + document.getElementById('destinationPage').value;
	else
		window.location = window.location.href + '/page' + document.getElementById('destinationPage').value;
}