﻿//===============================\\
//===============================\\
/*
this function requires the dojo.js file
must be imported before the function
*/
//===============================\\



dojo.require("dojo.fx");



function animate(whatDiv)
{


    var wipeOut = dojo.fx.wipeOut({node: whatDiv,duration: 350});
    var wipeIn = dojo.fx.wipeIn({node: whatDiv,duration: 350});
    var currentAnimation;
        if(document.getElementById(whatDiv).style.display != "none")
        {
         currentAnimation = wipeOut;   
        toggleCorner(whatDiv,"out");
        }else
        {
       toggleCorner(whatDiv,"in");
         currentAnimation = wipeIn;
        }
    currentAnimation.play({duration:250});
    
    

}   



function toggleCorner(whatDiv,state)
{

var addonStr = "Toggler";
var replaceBgElement = whatDiv+addonStr;


if(state == "out")
{

 //document.getElementById(replaceBgElement).style.className="togglerExpanded"; 
 
//document.getElementById(replaceBgElement).innerHTML ="-";

//local
//document.getElementById(replaceBgElement).style.backgroundImage="url(/efans/js/triangleColapsed.png)";

//live
document.getElementById(replaceBgElement).style.backgroundImage="url(/js/triangleColapsed.png)";

//document.getElementById(replaceBgElement).style.backgroundImage="none";
//document.getElementById(replaceBgElement).innerHTML ="+";
}
else if(state == "in")
{
//document.getElementById(replaceBgElement).style.className="togglerColapsed"; 
//document.getElementById(replaceBgElement).style.backgroundImage="none";
//document.getElementById(replaceBgElement).innerHTML ="-";
//local
//document.getElementById(replaceBgElement).style.backgroundImage="url(/efans/js/triangleExpanded.png)";
//live
document.getElementById(replaceBgElement).style.backgroundImage="url(/js/triangleExpanded.png)";

}

}



