//** Tab Content script- © Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
//** Last updated: Nov 8th, 06
var freeHeaderTableInitialized = false;
var globalNoSave=true;
var enabletabpersistence=1 //enable tab persistence via session only cookies, so selected tab is remembered?
var currentTab=0;
////NO NEED TO EDIT BELOW////////////////////////
var tabcontentIDs=new Object()
function expandcontent(linkobj ){
var ulid=linkobj.parentNode.parentNode.id //id of UL element
var ullist=document.getElementById(ulid).getElementsByTagName("li") //get list of LIs corresponding to the tab contents
for (var i=0; i').find('.hiddenFields').append(j$fhtable.find("input[type='hidden']"));
}
//j$('').appendTo(j$('.freezeHeader').parent());
//j$(j$(freezeHeaderSelector).parent()[0]).append(j$(freezeHeaderSelector + " input[type='hidden']"));
})
}
//Destroy all freezeHeaders. and re-initialize.
//Do this to solve the bug : When tables are hidden, the headers do not show in their correct position
if (j$.fn.dataTable && j$.fn.dataTable.isDataTable( freezeHeaderSelector )){
j$(freezeHeaderSelector).each(function(index){j$(this).DataTable().destroy()});
}
j$(freezeHeaderSelector).DataTable({
"scrollY": "250px",
"scrollX": true,
"scrollCollapse": true,
"paging": false,
"ordering": false,
"info": false,
"bFilter": false
});
/*
if (j$.fn.dataTable && j$.fn.dataTable.isDataTable( freezeHeaderSelector ) ) {
//Do nothing, the table is already initialized
//dtInstance = j$(freezeHeaderSelector).DataTable();
//dtInstance.destroy();
j$(freezeHeaderSelector).dataTable({
"scrollY": "250px",
"scrollX": true,
"scrollCollapse": true,
"paging": false,
"ordering": false,
"info": false,
"bFilter": false
});
}
else {
j$(freezeHeaderSelector).dataTable({
"scrollY": "250px",
"scrollX": true,
"scrollCollapse": true,
"paging": false,
"ordering": false,
"info": false,
"bFilter": false
});
}*/
}
function expandtab(tabcontentid, tabnumber){ //interface for selecting a tab (plus expand corresponding content)
currentTab = tabnumber;
var thetab=document.getElementById(tabcontentid).getElementsByTagName("a")[tabnumber]
if (thetab.getAttribute("rel"))
expandcontent(thetab)
}
function savetabcontentids(ulid, relattribute){// save ids of tab content divs
if (typeof tabcontentIDs[ulid]=="undefined") //if this array doesn't exist yet
tabcontentIDs[ulid]=new Array()
tabcontentIDs[ulid][tabcontentIDs[ulid].length]=relattribute
}
function saveselectedtabcontentid(ulid, selectedtabid){ //set id of clicked on tab as selected tab id & enter into cookie
if (enabletabpersistence==1) //if persistence feature turned on
setCookie(ulid, selectedtabid)
}
function getullistlinkbyId(ulid, tabcontentid)
{ //returns a tab link based on the ID of the associated tab content
var ullist=document.getElementById(ulid).getElementsByTagName("li")
for (var i=0; i" +
"";
}
}
function getTabNumber( fieldName )
{
var f = document.getElementsByName(fieldName);
var parentNode = f[0].parentNode;
var tabno = '';
var nodeName = '';
while(nodeName!='recursive')
{
parentNode = parentNode.parentNode;
nodeName = parentNode.nodeName;
if(nodeName=='div' || nodeName=='DIV')
{
tabno = parentNode.getAttribute("tabno");
if(tabno>=0)
{
break;
}
}
}
//return f[0].parentNode.getAttribute("tabno");
return parentNode.getAttribute("tabno");
}
function updateButtonStatus(linkobj)
{
var maxSize = document.getElementById('mainTab').getElementsByTagName("a").length;
if(globalNoSave==false)
{
saveDataFromTab();
globalNoSave=true;
}
if (document.getElementById('Next') && document.getElementById('Prev'))
{
if(currentTab==(maxSize-1))
document.getElementById('Next').disabled = true;
if (currentTab != 0)
document.getElementById('Prev').disabled = false;
if (currentTab==0)
document.getElementById('Prev').disabled = true;
if (currentTab != (maxSize-1))
document.getElementById('Next').disabled = false;
}
}