and WALA!
it works!
/////////////////////
<script>
//var activeTab = null;
function _doMakeActive( object ) {
var layerType = "iframe";
if ( activeTab != null ){
activeTab.style.backgroundColor = "##D4D0C8";
activeTab.childNodes[ 0 ].style.color = "##000";
}
object.style.backgroundColor = "##0A246A";
object.childNodes[0].style.color = "##fff";
activeTab = object;
object.getElementsByTagName( layerType )[ 0 ].style[ "display"
] =
"block";
var listItemCollection = object.parentNode.getElementsByTagName
( "li" );
for ( var i = 0; i < listItemCollection.length; i++ ) {
if (listItemCollection[ i ] != object ) {
listItemCollection[ i ].getElementsByTagName(
layerType )[0].style[
"display" ] = "none";
}
//alert(listItemCollection[ i ].innerHTML );
}
}
function TabbedInterface( identity, instanceName ){
this.activeTab = null;
this.dom = document.createElement( "ul" );
this.dom.id = identity;
this.instance = instanceName;
return this;
}
TabbedInterface.prototype =
{
init:function() {
return this;
},
getInstanceName:function() {
return this.instance;
},
getActiveTab:function() {
return this.activeTab;
},
setActiveTab:function( activeTab ) {
this.setActiveTab = activeTab;
return this;
},
getDOM:function() {
return this.dom;
},
doAddTab:function( linkText, source ) {
var myListItem = document.createElement ( "li" );
var myLink = document.createElement( "a" );
var myIFrame = document.createElement( "iframe" );
//alert(this.getInstanceName());
myLink.onclick = "return false;";
myLink.innerHTML = linkText;
myLink.href = "";
myListItem.onclick = this.getInstanceName() + ".doMakeActive(
this );";
//myListItem.onclick = "doMakeActive( this );";
myListItem.appendChild( myLink );
myIFrame.src = source;
myListItem.appendChild( myIFrame );
this.getDOM().appendChild( myListItem );
return this;
},
//Writes the DOM to the document
doWrite:function() {
document.write( this.getDOM().outerHTML );
alert( this.getDOM().outerHTML );
return this;
},
doMakeActive:function( object, selfReference ) {
alert( 'yup' );
var layerType = "iframe";
var activeTab = this.activeTab;
if ( activeTab != null ) {
activeTab.style.backgroundColor = "##D4D0C8";
activeTab.childNodes[ 0 ].style.color = "##000";
}
object.style.backgroundColor = "#0A246A";
object.childNodes[ 0 ].style.color = "#fff";
this.setActiveTab( object );
object.getElementsByTagName( layerType )[ 0 ].style[
"visibility" ] =
"visible";
var listItemCollection =
object.parentNode.getElementsByTagName( "li" );
for ( var i = 0; i < listItemCollection.length; i++ ) {
if ( listItemCollection[ i ] != object ) {
listItemCollection[ i
].getElementsByTagName( layerType )[0].style[
"visibility" ] = "hidden";
}
}
return this;
}
}
var tabbedInterface = new TabbedInterface("tabbed-interface",
"tabbedInterface" ).init();
//doMakeActive = tabbedInterface.doMakeActive;
tabbedInterface.doAddTab ( "Job", "job-detail.cfm");
tabbedInterface.doAddTab( "Company","company-detail.cfm" );
tabbedInterface.doAddTab( "Skills", "job-skill.cfm" );
tabbedInterface.doAddTab( "Internal","internal.cfm" );
tabbedInterface.doAddTab( "Other", "other.cfm" );
tabbedInterface.doWrite();
</script>
/////////////////////
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"cfaussie" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cfaussie
-~----------~----~----~----~------~----~------~--~---