var numLinks = 9;
var fluttercount = 0;
var count = 0;
var oldflutter;
if (typeof(hoverColor) == "undefined") {var hoverColor="#bbbbbb";}
if (typeof (defaultColor) == "undefined") { var defaultColor = "#ffffff"; }
document.write("
");
document.write("
");
document.write("
");
document.write("
");
document.write("
");
document.write("
");
document.write("
");
document.write("
");
document.write("
");
document.write("
");
document.write("
");
document.write("");
if (window.addEventListener) {
window.addEventListener('load', loader, true);
}
else if (window.attachEvent) {
window.attachEvent('onload', loader);
}
//window.onload = loader;
for (var i = numLinks; i >= 1; i--) {
document.getElementById('linktop' + i).onmouseover = ourMouseOver;
document.getElementById('itemtop' + i).onmouseout = itemmouseout;
document.getElementById('itemtop' + i).onclick = itemclick;
}
function loader() {
for (var j = 1; j <= numLinks; j++)
{
document.getElementById('linktop' + j).style.color=defaultColor;
}
flutter();
}
function itemclick(e)
{
e = e || window.event;
keyobj = e.target || e.srcElement;
itemnumber = keyobj.id.charAt(keyobj.id.length - 1);
window.location = document.getElementById("linktop" + itemnumber).href;
}
function ourMouseOver (e) {
var ourDivs = document.getElementsByTagName("div");
for (var i = ourDivs.length - 1; i >= 0; i--) {
if (ourDivs[i].id.substring(0,7) == "itemtop") {
document.id(ourDivs[i].id).set('tween',{property:'height',duration: '300',transition: Fx.Transitions.linear});
document.id(ourDivs[i].id).tween(0);
document.id('linktop' + ourDivs[i].id.charAt(ourDivs[i].id.length - 1)).style.color = defaultColor;
ourDivs[i].style.cursor = 'default';
}
}
var newLeftPos, linkWidth, itemnumber;
e = e || window.event;
keyobj = e.target || e.srcElement;
keyobj.style.color = hoverColor;
itemnumber = keyobj.id.charAt(keyobj.id.length-1);
linkWidth = keyobj.parentNode.offsetWidth;
ourimage = document.getElementById('itemtop' + itemnumber);
newLeftPos = findPosX(keyobj.parentNode) + (linkWidth / 2) - 70;
ourimage.style.left = newLeftPos + "px";
document.id(ourimage.id).set('tween',{property:'height',duration: 500,transition: Fx.Transitions.Bounce.easeOut});
document.id(ourimage.id).tween(145);
ourimage.style.cursor = 'hand';
setTimeout('itemtimeout(' + ourimage.id+ ')', 3000);
};
function itemmouseout(e) {
e = e || window.event;
keyobj = e.target || e.srcElement;
document.id('linktop' + keyobj.id.charAt(keyobj.id.length - 1)).style.color = defaultColor;
document.id(keyobj.id).set('tween', { property: 'height', duration: 500, transition: Fx.Transitions.Bounce.easeIn });
document.id(keyobj.id).tween(0);
keyobj.style.cursor = 'default';
};
function itemtimeout(keyid) {
var keyobj = document.id(keyid);
//alert(keyobj.id);
document.id('linktop' + keyobj.id.charAt(keyobj.id.length - 1)).style.color = defaultColor;
document.id(keyobj.id).set('tween', { property: 'height', duration: 500, transition: Fx.Transitions.Bounce.easeIn });
document.id(keyobj.id).tween(0);
keyobj.style.cursor = 'default';
};
function flutterover(keyobj) {
var newLeftPos, linkWidth, itemnumber;
itemnumber = keyobj.id.charAt(keyobj.id.length - 1);
linkWidth = keyobj.parentNode.offsetWidth;
ourimage = document.getElementById('itemtop' + itemnumber);
newLeftPos = findPosX(keyobj.parentNode) + (linkWidth / 2) - 78;
ourimage.style.left = newLeftPos + "px";
document.id(ourimage.id).set('tween', { property: 'height', duration: 200, transition: Fx.Transitions.Linear });
document.id(ourimage.id).tween(145);
};
function flutterout(keyobj2) {
document.id(keyobj2.id).set('tween',{property:'height',duration: 200,transition: Fx.Transitions.Linear});
document.id(keyobj2.id).tween(0);
};
function findPosX(obj)
{
var curleft = 0;
if(obj.offsetParent)
while(1)
{
curleft += obj.offsetLeft;
if(!obj.offsetParent)
break;
obj = obj.offsetParent;
}
else if(obj.x)
curleft += obj.x;
return curleft;
}
function findPosY(obj)
{
var curtop = 0;
if(obj.offsetParent)
while(1)
{
curtop += obj.offsetTop;
if(!obj.offsetParent)
break;
obj = obj.offsetParent;
}
else if(obj.y)
curtop += obj.y;
return curtop;
}
function flutter() {
fluttercount++;
if (fluttercount <= numLinks+4) {
oldflutter = fluttercount - 4;
if (fluttercount <= numLinks) {
flutterover(document.getElementById('linktop' + fluttercount));
}
if(oldflutter > 0)
{
flutterout(document.getElementById('itemtop' + oldflutter));
}
setTimeout("flutter()", 100);
}
}