
	
	
	allTabs = new Array(8);
	//ease = 'easeOutBounce';
	ease = '';



function start(idx){
$('#sub_list'+idx).stop().animate({opacity:0,height:0},{queue:false, duration:10, easing: ease})
}

function teston(idx){
window.clearTimeout(resTimer);
resTimer = null;
showSub(idx);
var rSub = document.getElementById("sub_list"+idx);

$(rSub).stop().animate({opacity:.9,height:rSub.ht},{queue:false, duration:rSub.openTime, easing: ease})
}

function testout(idx){
resTimer = window.setTimeout("restoreProtect()", 300);
$('#sub_list'+idx).stop().animate({opacity:0,height:0},{queue:false, duration:200, easing: ease})
}

function setPos(){
var maxHT = 0;
if(protect > -1){
var tabP = document.getElementById("tab"+protect);
tabP.className = "tabHi"
}
for(i=1;i<allTabs.length;i++){
var tab = document.getElementById("tab"+i);
var tabSub = document.getElementById("sub_list"+i);
tab.defaultStyle = tab.className;
var tabSubDim = getPos(tabSub);
tabSub.ht = tabSubDim[3];
if(tabSub.ht > maxHT){
maxHT = tabSub.ht;
}
start(i);
}

var openT = 600;

for(i=1;i<allTabs.length;i++){
var tabSub = document.getElementById("sub_list"+i);
var perc = (tabSub.ht/maxHT);
tabSub.openTime = Math.round(perc*openT);

}


}


function hideSub(idx){

//document.getElementById("testsub"+idx).style.visibility = "hidden";
}

function showSub(idx){
document.getElementById("sub_list"+idx).style.visibility = "visible";
}
function showPos(chld){
var xy = getPos(chld);
alert(xy[0] + ", " + xy[1] + ", " + xy[2] + ", " + xy[3]);
}


function getPos(chld){
var xyArr = new Array();
var obj = chld;
var curleft = obj.offsetLeft;
var curtop = obj.offsetTop;
var curwidth = obj.offsetWidth;
var curheight = obj.offsetHeight;
while(obj = obj.offsetParent) {
curleft += obj.offsetLeft
curtop += obj.offsetTop

}
//alert(curleft + ", " + curtop);
xyArr[0] = parseInt(curleft);
xyArr[1] = parseInt(curtop);
xyArr[2] = parseInt(curwidth);
xyArr[3] = parseInt(curheight);
return xyArr;
}

var protect = 1;
var resTimer = null;

function tabHiLight(idx){

var rTab = document.getElementById("tab"+idx);
rTab.kill = false;
rTab.offTimer = null;

if(idx == protect){
if($('#tab'+idx).hasClass('tabDesat')){
$('#tab'+idx).removeClass('tabDesat');
}
$('#tab'+idx).addClass('tabHi');
} else {
if(!$('#tab'+idx).hasClass('tabHi')){
$('#tab'+idx).addClass('tabHi');
}
}

if(protect > -1 && idx != protect){
var rTab = document.getElementById("tab"+protect);

rTab.className = "tabDesat";

}


}
function tabLowLight(idx){
var rTab = document.getElementById("tab"+idx);
rTab.kill = true;
rTab.offTimer = window.setTimeout("doTabLowLight("+idx+")", 1);
}

function doTabLowLight(idx){
var rTab = document.getElementById("tab"+idx);

if(rTab.kill){
if($('#tab'+idx).hasClass('tabHi')){
$('#tab'+idx).removeClass('tabHi');
}
}



}


function restoreProtect(){
if(protect > -1){
var rTab = document.getElementById("tab"+protect);
tabHiLight(protect);
}
}

function hiRow(dv){
dv.className = "subLinkHi";
}
function lowRow(dv){
dv.className = "subLink";
}