 function init() {	
	
   Shadowbox.init({ skipSetup: 			true,
				  	handleOversize:		"resize",
				  	animSequence:		"sync",
						resizeDuration:		"0.50"
					});
   
	var pages = ["news","associates","values","services","tools","contacts"]
	$(document).ready(function(){jQuery.each(pages,function(i,pages){$("#tab_"+pages).click(function(){slide(pages);});});if(window.location.hash) {pane=window.location.hash.split('#')[1];slide(pane);}else{pane='news';slide(pane,'init')}});

 }
 
 
function sspLoadAlbum(album,img) {
   a = document.getElementById("ssp");
   a.sspLoadAlbum(album,img);
}
		
function sspGetAlbumData() {
 b = document.getElementById("ssp");
 c = b.sspGetAlbumData();
 return c
}

function sspHalt() {
 d = document.getElementById("ssp");
 d.sspHalt();
}

function sspStart() {
 e = document.getElementById("ssp");
 e.sspStart();
}

function sspSetData() {
	f = document.getElementById("ssp");
	f.sspSetData();
}

function setoverflow(attrib) {
	if (document.styleSheets[2].cssRules) {
		crossrule = document.styleSheets[2].cssRules;
	} else if (document.styleSheets[2].rules) {
		crossrule = document.styleSheets[2].rules;
	}
	
	 crossrule[0].style.overflowY = attrib;
	 crossrule[1].style.overflowY = attrib;

}
	
function slide(pane,nav) {
	
	$(".selected").removeClass("selected");
	$('#tab_' + pane).addClass("selected");
	$(".selectedmenuitem").removeClass("selectedmenuitem");
	$('#nav_'+pane).addClass("selectedmenuitem");

	hHeight = $('#'+pane).height();
  	$('#wrapright').height(hHeight + 30);

  	$('#wrapright').scrollTo("#"+pane, 500, {
		easing:'swing', 
		axis:'x', 
		onAfter:function() { 
			if(nav != "init") {
			   	$.scrollTo({top:'45px'},800);

			}
		}
	});  
	
	t = sspGetAlbumData();
	
	
	if(pane == "associates") {
	   if(t != "niman") { 
	      sspLoadAlbum("niman","Sequential"); 
	      sspHalt();
	   }
	} else if(pane == "contacts") {

	   if(t !="contacts") {
	     sspLoadAlbum("contacts","Sequential");
	     sspHalt();	
	   }	
	} else {
		if(nav == "init") {
			sspLoadAlbum("init","Sequential");
		} else if(t !="main") {
			sspLoadAlbum("main","Random");
		}

	}
	
 
}



function bookmark() {
  var url = "http://www.nimancpa.com"
  var title = "Niman & Associates, Inc: Accountants - Managers - Consultants"  
  if (window.sidebar) { // Mozilla Firefox Bookmark  
     window.sidebar.addPanel(title, url,"");  
  } else if( window.external ) { // IE Favorite  
        window.external.AddFavorite( url, title);  
   } else if(window.opera) { // Opera 7+  
      return false; // do nothing - the rel="sidebar" should do the trick  
   } else { // for Safari, Konq etc - browsers who do not support bookmarking scripts (that i could find anyway)  
   alert('Unfortunately, this browser does not support the requested action, please bookmark this page manually.');  
   }  
}

function resetview() {
   $.scrollTo({top:'0px'},800);
}



function popcontact() {
	
setoverflow('auto');

Shadowbox.open({
        player:     'iframe',
        title:      'Contact Niman &amp; Associates, Inc',
        content:    'assets/forms/contact',
        height:     570,
        width:      700
	
    });

}


function popprivacy() {

setoverflow('auto');

Shadowbox.open({
        player:     'iframe',
        title:      'Legal &amp; Privacy',
        content:    'assets/privacy/privacy.php',
        height:     732,
        width:      642
	
    });

}


function popdisclosure() {

setoverflow('auto');

Shadowbox.open({
        player:     'iframe',
        title:      'IRS Circular 230 Disclosure',
        content:    'assets/disclosure/disclosure.php',
        height:     330,
        width:      642
	
    });

}


function popsubscribe() {
	setoverflow('auto');
	
Shadowbox.open({
        player:     'iframe',
        title:      'Niman &amp; Associates Newsletter',
        content:    'assets/forms/subscribe/',
        height:     350,
        width:      700
	
    });
}


function popcallback() {
		setoverflow('auto');
Shadowbox.open({
        player:     'iframe',
        title:      'Request a Call From Us',
        content:    'assets/forms/call-back/',
        height:     570,
        width:      700
	
    });
}

function poprss(title,url) {
	setoverflow('auto');
Shadowbox.open({
        player:     'iframe',
        title:      title,
        content:    url,
        height:     600,
        width:      1024
	
    });
}

function popforms(title,url) {
	setoverflow('hidden');
Shadowbox.open({
        player:     'iframe',
        title:      title,
        content:    'assets/tool/frammer.php',
        height:     587,
        width:      834
	
    });
}

function popassociate(member,title,height) {
	setoverflow('auto');
Shadowbox.open({
        player:     'iframe',
        title:      title,
        content:    'assets/team/team.php?associate='+member,
        height:     height,
        width:      642
	
    });
}

function popcalc(cat,calc,title) {
setoverflow('auto');
src = "assets/tool/toolrpc.php?cat="+cat+"&calc="+calc;

Shadowbox.open({
        player:     'iframe',
        title:      title,
        content:    src,
        height:     600,
        width:      575
	
    });
}