if (document.getElementById && document.getElementsByTagName) {
if (window.addEventListener) window.addEventListener('load', pageName, false);
else if (window.attachEvent) window.attachEvent('onload', pageName);
}
function pageName()
{
var p = window.location.pathname;
var path = p.toString();
slash = path.lastIndexOf('/');
ext = path.lastIndexOf('.cfm');
pageName = path.substring(slash+1, ext);
var li = document.getElementById('holidaysummary').getElementsByTagName('li');
if(pageName.indexOf('payment') == -1 && pageName.indexOf('idealtemplate') == -1 && pageName.indexOf('ideal_process') == -1 && pageName.indexOf('payment_process') == -1)
{
for(var i=0; i
= 0)
{
brkdwn.style.display = 'block';
//doslideout(brkdwn,46,brkdwnblck.offsetHeight);
}
}
}
function expand(t)
{
//get status of div is collapsed, expanded or somewhere in between?
var sumblockht = t.parentNode.childNodes[2].offsetHeight;
/*get class so we know which image to use*/
classname = t.parentNode.className.toString();
if(classname == "norm")
{
var classdown = "norm_down";
var classside = "norm";
}
else
{
var classdown = "red_down";
var classside = "red";
}
if(t.parentNode.childNodes[2].offsetHeight == undefined)
{
var sumblockht = t.parentNode.childNodes[3].offsetHeight;
}
var divheight = sumblockht+20;
var actheight = t.parentNode.offsetHeight;
if(divheight == actheight) //div is expanded
{
var status = "expanded";
}
if(actheight == 20)
{
var status = "collapsed";
}
if(status == "expanded")
{
var endheight = 20;
var startheight=t.parentNode.offsetHeight;
doslidein(t.parentNode,startheight,endheight);
t.parentNode.style.margin = "0 0 0 0";
t.parentNode.className = classside;
}
else if(status == "collapsed" && (sumblockht !== 5 && sumblockht !== 18))
{
var direction = "down";
var startheight = 20;
var endheight = sumblockht;
doslideout(t.parentNode,startheight,endheight);
t.parentNode.style.margin = "0 0 0 0";
t.parentNode.className = classdown;
}
}
function doslideout(element,startheight,endheight)
{
if (element.slide)
{
window.clearInterval(element.slide);
}
element.slide = window.setInterval(
function()
{
startheight = startheight+5;
element.style.height = startheight + 20 + "px";
if(startheight >= endheight)
{
element.style.height = endheight + 20 + "px";
window.clearInterval(element.slide);
}
}
, 1);
}
function doslidein(element,startheight,endheight)
{
if (element.slide)
{
window.clearInterval(element.slide);
}
element.slide = window.setInterval(
function()
{
startheight = startheight-5;
element.style.height = startheight + "px";
if(startheight <= endheight)
{
element.style.height = endheight + "px";
window.clearInterval(element.slide);
}
}
, 1);
}