
// Mars scripts for journal/slider
var journalFetched="";
function toggleSlider(_b3){
if(_b3=="sliderWrapper"){
//	alert("this is the sliderWrapper slider");
otherWrap="jsliderWrapper";
wrapH=135;
wrapHT="-136px";
wrapHTO="-136.00px";
z="100";
zo = "110";
}else if (_b3=="jsliderWrapper"){
//		alert("this is the jsliderWrapper slider");

if(journalFetched==""){
new Effect.Appear("biglight_loading");
journalFetched=new Ajax.Updater("journal_accordion","/ajax_journal.php?date=now",{evalScripts:true,asynchronous:true,onComplete:function(){
accordion_init("jnal_accordion");
openFirstPanel();
new Effect.Fade("biglight_loading");
}});
}
otherWrap="sliderWrapper";
wrapH=502;
wrapHT="-503px";
wrapHTO="-503.00px";
z = "100";
zo = "110";
}
else if (_b3 == "optionsWrapper")
{
//	alert("this is the optionsWrapper slider");
wrapH=143;
wrapHT="-144px";
wrapHTO="-144.00px";
z= "1";	
zo = "1";
}
sliderTop=Element.getStyle(_b3,"top");
//alert(sliderTop);
if(sliderTop==wrapHT||sliderTop==wrapHTO){
new Effect.MoveBy(_b3,wrapH,0,{duration:2,transition:Effect.Transitions.slowstop});
Element.setStyle(_b3,{zIndex:zo});
if (_b3 != "optionsWrapper")
	Element.setStyle(otherWrap,{zIndex:"100"});
}else{
new Effect.MoveBy(_b3,-wrapH,0,{duration:1.5,transition:Effect.Transitions.slowstop});
Element.setStyle(_b3,{zIndex:z});
}
};
function accordion(el){
if(Element.hasClassName(el.parentNode.id+"-body","visible")){
Element.removeClassName(el.parentNode.id+"-body","visible");
var _b5=el.parentNode.id+"-body";
new Effect.SlideUp(_b5,{duration:0.7});
}else{
var _b6=el.parentNode.id+"-body";
var _b7=document.getElementsByClassName("panel_body",el.parentNode.parentNode);
for(var i=0;i<_b7.length;i++){
if(Element.hasClassName(_b7[i].parentNode.id+"-body","visible")){
var _b5=_b7[i].parentNode.id+"-body";
}
}
if(_b5){
new Effect.Parallel([new Effect.SlideUp(_b5),new Effect.SlideDown(_b6)],{duration:0.5});
}else{
new Effect.SlideDown(_b6,{duration:0.5});
}
Element.removeClassName(_b5,"visible");
Element.addClassName(_b6,"visible");
}
};
function openFirstPanel(){
new Effect.SlideDown("panel0-body",{duration:0.5});
Element.addClassName("panel0-body","visible");
};
function accordion_init(id){
var _ba=document.getElementsByClassName("panel_body",id);
for(var i=0;i<_ba.length;i++){
_ba[i].style.display="none";
}
};
function updateJournal(_bc){
new Effect.Appear("biglight_loading");
Element.setStyle("biglight_loading",{background:"url(/wp-content/themes/mars/images/biglight_loading_bg.png) 0 0 no-repeat"});
new Ajax.Updater("journal_accordion","/ajax_journal.php?date="+_bc,{evalScripts:true,asynchronous:true,onComplete:function(){
accordion_init("jnal_accordion");
openFirstPanel();
new Effect.Fade("biglight_loading");
}});
};


// Additional Scriptaculous Effects

Effect.DropIn=function(_f8){
_f8=$(_f8);
var _f9=_f8.style.top;
var _fa=_f8.style.left;
var pos=Position.cumulativeOffset(_f8);
return new Effect.Parallel([new Effect.MoveBy(_f8,100,0,{sync:true}),new Effect.Opacity(_f8,{sync:true,from:0,to:1})],Object.extend({duration:0.5,beforeSetup:function(_fc){
Element.makePositioned(_fc.effects[0].element);
Element.setOpacity(_f8,0);
_f8.style.position="absolute";
_f8.style.top=(pos[1]-100)+"px";
}},arguments[1]||{}));
};
Effect.PhaseIn=function(_fd){
_fd=$(_fd);
new Effect.BlindDown(_fd,arguments[1]||{});
new Effect.Appear(_fd,arguments[2]||arguments[1]||{});
};
Effect.PhaseOut=function(_fe){
_fe=$(_fe);
new Effect.Fade(_fe,arguments[1]||{});
new Effect.BlindUp(_fe,arguments[2]||arguments[1]||{});
};
Effect.Phase=function(_ff){
_ff=$(_ff);
if(_ff.style.display=="none"){
new Effect.PhaseIn(_ff,arguments[1]||{},arguments[2]||arguments[1]||{});
}else{
new Effect.PhaseOut(_ff,arguments[1]||{},arguments[2]||arguments[1]||{});
}
};
Effect.SlideRight=function(_100){
_100=$(_100);
Element.cleanWhitespace(_100);
var _101=Element.getStyle(_100.firstChild,"right");
var _102=Element.getDimensions(_100);
return new Effect.Scale(_100,100,Object.extend({scaleContent:false,scaleY:false,scaleFrom:0,scaleMode:{originalHeight:_102.height,originalWidth:_102.width},restoreAfterFinish:true,afterSetup:function(_103){
with(Element){
makePositioned(_103.element);
makePositioned(_103.element.firstChild);
if(window.opera){
setStyle(_103.element,{top:""});
}
makeClipping(_103.element);
setStyle(_103.element,{width:"0px"});
show(_100);
}
},afterUpdateInternal:function(_104){
with(Element){
setStyle(_104.element.firstChild,{right:(_104.dims[0]-_104.element.clientWidth)+"px"});
}
},afterFinishInternal:function(_105){
with(Element){
undoClipping(_105.element);
undoPositioned(_105.element.firstChild);
undoPositioned(_105.element);
setStyle(_105.element.firstChild,{right:_101});
}
}},arguments[1]||{}));
};
Effect.SlideLeft=function(_106){
_106=$(_106);
Element.cleanWhitespace(_106);
var _107=Element.getStyle(_106.firstChild,"right");
return new Effect.Scale(_106,0,Object.extend({scaleContent:false,scaleY:false,scaleMode:"box",scaleFrom:100,restoreAfterFinish:true,beforeStartInternal:function(_108){
with(Element){
makePositioned(_108.element);
makePositioned(_108.element.firstChild);
if(window.opera){
setStyle(_108.element,{top:""});
}
makeClipping(_108.element);
show(_106);
}
},afterUpdateInternal:function(_109){
with(Element){
setStyle(_109.element.firstChild,{right:(_109.dims[0]-_109.element.clientWidth)+"px"});
}
},afterFinishInternal:function(_10a){
with(Element){
[hide,undoClipping].call(_10a.element);
undoPositioned(_10a.element.firstChild);
undoPositioned(_10a.element);
setStyle(_10a.element.firstChild,{right:_107});
}
}},arguments[1]||{}));
};

