/**
 * FlashObject v1.3d: Flash detection and embed - http://blog.deconcept.com/flashobject/
 *
 * FlashObject is (c) 2006 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof com=="undefined"){var com=new Object();}
if(typeof com.deconcept=="undefined"){com.deconcept=new Object();}
if(typeof com.deconcept.util=="undefined"){com.deconcept.util=new Object();}
if(typeof com.deconcept.FlashObjectUtil=="undefined"){com.deconcept.FlashObjectUtil=new Object();}
com.deconcept.FlashObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a,_b){
if(!document.createElement||!document.getElementById){return;}
this.DETECT_KEY=_b?_b:"detectflash";
this.skipDetect=com.deconcept.util.getRequestParameter(this.DETECT_KEY);
this.params=new Object();
this.variables=new Object();
this.attributes=new Array();
this.useExpressInstall=_7;
if(_1){this.setAttribute("swf",_1);}
if(id){this.setAttribute("id",id);}
if(w){this.setAttribute("width",w);}
if(h){this.setAttribute("height",h);}
if(_5){this.setAttribute("version",new com.deconcept.PlayerVersion(_5.toString().split(".")));}
this.installedVer=com.deconcept.FlashObjectUtil.getPlayerVersion(this.getAttribute("version"),_7);
if(c){this.addParam("bgcolor",c);}
var q=_8?_8:"high";
this.addParam("quality",q);
var _d=(_9)?_9:window.location;
this.setAttribute("xiRedirectUrl",_d);
this.setAttribute("redirectUrl","");
if(_a){this.setAttribute("redirectUrl",_a);}
};
com.deconcept.FlashObject.prototype={setAttribute:function(_e,_f){
this.attributes[_e]=_f;
},getAttribute:function(_10){
return this.attributes[_10];
},addParam:function(_11,_12){
this.params[_11]=_12;
},getParams:function(){
return this.params;
},addVariable:function(_13,_14){
this.variables[_13]=_14;
},getVariable:function(_15){
return this.variables[_15];
},getVariables:function(){
return this.variables;
},createParamTag:function(n,v){
var p=document.createElement("param");
p.setAttribute("name",n);
p.setAttribute("value",v);
return p;
},getVariablePairs:function(){
var _19=new Array();
var key;
var _1b=this.getVariables();
for(key in _1b){_19.push(key+"="+_1b[key]);}
return _19;
},getFlashHTML:function(){
var _1c="";
if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){
if(this.getAttribute("doExpressInstall")){
this.addVariable("MMplayerType","PlugIn");
}
_1c="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\"";
_1c+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";
var _1d=this.getParams();
for(var key in _1d){_1c+=[key]+"=\""+_1d[key]+"\" ";}
var _1f=this.getVariablePairs().join("&");
if(_1f.length>0){_1c+="flashvars=\""+_1f+"\"";}
_1c+="/>";
}else{
if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");}
_1c="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\">";
_1c+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";
var _20=this.getParams();
for(var key in _20){_1c+="<param name=\""+key+"\" value=\""+_20[key]+"\" />";}
var _22=this.getVariablePairs().join("&");
if(_22.length>0){_1c+="<param name=\"flashvars\" value=\""+_22+"\" />";
}_1c+="</object>";}
return _1c;
},write:function(_23){
if(this.useExpressInstall){
var _24=new com.deconcept.PlayerVersion([6,0,65]);
if(this.installedVer.versionIsValid(_24)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){
this.setAttribute("doExpressInstall",true);
this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));
document.title=document.title.slice(0,47)+" - Flash Player Installation";
this.addVariable("MMdoctitle",document.title);}
}else{this.setAttribute("doExpressInstall",false);}
if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){
var n=(typeof _23=="string")?document.getElementById(_23):_23;
n.innerHTML=this.getFlashHTML();
}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}}};
com.deconcept.FlashObjectUtil.getPlayerVersion=function(_26,_27){
var _28=new com.deconcept.PlayerVersion(0,0,0);
if(navigator.plugins&&navigator.mimeTypes.length){
var x=navigator.plugins["Shockwave Flash"];
if(x&&x.description){_28=new com.deconcept.PlayerVersion(x.description.replace(/([a-z]|[A-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}
}else{
try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
for(var i=3;axo!=null;i++){
axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+i);
_28=new com.deconcept.PlayerVersion([i,0,0]);}}
catch(e){}
if(_26&&_28.major>_26.major){return _28;}
if(!_26||((_26.minor!=0||_26.rev!=0)&&_28.major==_26.major)||_28.major!=6||_27){
try{
_28=new com.deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
}catch(e){}}}
return _28;
};
com.deconcept.PlayerVersion=function(_2c){
this.major=parseInt(_2c[0])||0;
this.minor=parseInt(_2c[1])||0;
this.rev=parseInt(_2c[2])||0;
};
com.deconcept.PlayerVersion.prototype.versionIsValid=function(fv){
if(this.major<fv.major){return false;}
if(this.major>fv.major){return true;}
if(this.minor<fv.minor){return false;}
if(this.minor>fv.minor){return true;}
if(this.rev<fv.rev){return false;}
return true;
};
com.deconcept.util={getRequestParameter:function(_2e){
var q=document.location.search||document.location.hash;
if(q){var _30=q.indexOf(_2e+"=");
var _31=(q.indexOf("&",_30)>-1)?q.indexOf("&",_30):q.length;
if(q.length>1&&_30>-1){
return q.substring(q.indexOf("=",_30)+1,_31);}}return "";
},removeChildren:function(n){
while(n.hasChildNodes()){
n.removeChild(n.firstChild);}}};
if(Array.prototype.push==null){
Array.prototype.push=function(_33){
this[this.length]=_33;
return this.length;};}
var getQueryParamValue=com.deconcept.util.getRequestParameter;
var FlashObject=com.deconcept.FlashObject;

/* 
============================================
DHTML Support
============================================
*/

// Detect Client Browser type
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
jsVersion = 1.1;

// Detect DOM
var isDHTML = 0;
var isAll = 0;
var isID = 0;

if (document.getElementById) {isID = 1; isDHTML = 1;}
else
{
	if (document.all) {isAll = 1; isDHTML = 1;}
}

function findDOM(objectID, withStyle) {
	if (withStyle == 1) 
	{
		if (isID) { return (document.getElementById(objectID).style); }
		else 
		{
			if (isAll) { return (document.all[objectID].style); }
		}
	}
	else
	{
		if (isID) { return (document.getElementById(objectID)); }
		else 
		{
			if (isAll) { return (document.all[objectID]); }
		}
	}
}

/*
===========================================
Event Handlers and Functions
===========================================
*/

function doStart()
{    
	doSIFR();
	doSitecore();
        if (document.getElementsByTagName('title')[0].innerHTML == 'NETGEAR Management') {
        	loadImages();
        }
    /* Eloqua Partner Login Integration */  
    eloquaGUID();        
 
}

function eloquaGUID()
{   
    
    if (typeof eloquaIntegration != 'undefined') {       
        if (this.GetElqCustomerGUID)
        {
            if (document.forms["mainform"].elements["ctl06$ctl06$elqCustomerGUID"] != null)
                document.forms["mainform"].elements["ctl06$ctl06$elqCustomerGUID"].value = GetElqCustomerGUID();
            if (document.forms["mainform"].elements["ctl06$ctl03$elqCustomerGUID"] != null)
                document.forms["mainform"].elements["ctl06$ctl03$elqCustomerGUID"].value = GetElqCustomerGUID();
        }                    
     }

}


function popProduct(objSelect) {
    if (objSelect != null) {
        for (i = 0; i < objSelect.options.length; i++) {
            if (objSelect.options[i].selected) {
		if (objSelect.options[i].value != '') {
                	window.location = objSelect.options[i].value;
		}
            }
        }
    }
}
function centerPopUp(intOffset, booHeight) {
    if (booHeight == true) {
        var vOffset = (screen.height / 2) - (intOffset / 2);
        if (vOffset > 0) {
            return vOffset;
        } else {
            return 0;
        }
    } else {
        var hOffset = (screen.width / 2) - (intOffset / 2);
        if (hOffset > 0) {
            return hOffset;
        } else {
            return 0;
        }
    }
}
function popProduct(objSelect) {
    if (objSelect != null) {
        for (i = 0; i < objSelect.options.length; i++) {
            if (objSelect.options[i].selected) {
		if (objSelect.options[i].value != '') {
                	window.location = objSelect.options[i].value;
		}
            }
        }
    }
}

function getElementsByClassName(clsName) 
{ 
	var arr = new Array(); 
	var elems = document.getElementsByTagName("*");
	for ( var cls, i = 0; ( elem = elems[i] ); i++ )
	{
		if ( elem.className == clsName )
		{
			arr[arr.length] = elem;
		}
	}
	return arr;
}
function loadImages() {
	//pre-load images
		path = "/Upload/About/Management/";
		var lo_casual = new Image();
		lo_casual.src = path + "lo_casual.jpg";
		var falcon_casual = new Image();
		falcon_casual.src = path + "falcon_casual.jpg";
		var gorjanc_casual = new Image();
		gorjanc_casual.src = path + "gorjanc_casual.jpg";
		var liu_casual = new Image();
		liu_casual.src = path + "liu_casual.jpg";
		var merrill_casual = new Image();
		merrill_casual.src = path + "merrill_casual.jpg";
		var olson_casual = new Image();
		olson_casual.src = path + "olson_casual.jpg";
		var soares_casual = new Image();
		soares_casual.src = path + "soares_casual.jpg";
		var werdann_casual = new Image();
		werdann_casual.src = path + "werdann_casual.jpg";
		var williams_casual = new Image();
		williams_casual.src = path + "williams_casual.jpg";
	//end pre-load
	for (i = 0; i < document.images.length; i++) {	
		document.images[i].onmouseover = function() {
			if (this.id == "") {
				var name = this.name;
                        	if (this.src.indexOf('business') > -1 && name != "") {
					document.getElementById(name).src = '/upload/about/management/' + name + "_business.jpg";
				} else if (this.src.indexOf('casual') > -1 && name != "") {
					document.getElementById(name).src = eval(name + '_casual' + '.src');
				}   
			}
		}
	}
	for (i = 0; i < getElementsByClassName('up-a').length; i++) {
		getElementsByClassName('up-a')[i].onmouseover = function() {
			if (this.id == "") {
				var name = this.name;
				if (this.href.indexOf('business') > -1 && name != "") {
					document.getElementById(name).src = '/upload/about/management/' + name + "_business.jpg";
				} else if (this.href.indexOf('casual') > -1 && name != "") {
                    document.getElementById(name).src = eval(name + '_casual' + '.src');
				}
			}
		}
	}
}
function doSIFR()
{
	sIFR.replaceElement(named({sSelector:".sIFR-Me", sFlashSrc:"/futuraMdBT.swf", sColor:"#333333", sLinkColor:"#333333", sBgColor:"#ffffff", sWmode:"transparent", sHoverColor:"#000080"}));	
	sIFR.replaceElement(named({sSelector:".sIFR-h1", sFlashSrc:"/futuraMdBT.swf", sColor:"#333333", sLinkColor:"#333333", sBgColor:"#ffffff", sWmode:"transparent", sHoverColor:"#000080"}));	
	sIFR.replaceElement(named({sSelector:".sIFR-ModelName", sFlashSrc:"/futuraBdBT.swf", sColor:"#333333", sLinkColor:"#333333", sBgColor:"#ffffff", sWmode:"transparent", sHoverColor:"#000080"}));	
	sIFR.replaceElement(named({sSelector:".sIFR-Yellow", sFlashSrc:"/futuraBdBT.swf", sColor:"#FDAD33", sLinkColor:"#FDAD33", sBgColor:"#ffffff", sWmode:"transparent", sHoverColor:"#FDAD33"}));
// for success page
    sIFR.replaceElement(named({sSelector:".SIFR_light", sColor:"#333333", sFlashSrc:"/images/success/flash/sifr_FuturaBTLight_3.swf", sWmode:"transparent"}));
	sIFR.replaceElement(named({sSelector:".SIFR_med", sColor:"#333333", sFlashSrc:"/images/success/flash/sifr_FuturaBTMed_3.swf", sWmode:"transparent"}));
	sIFR.replaceElement(named({sSelector:".SIFR_bold", sColor:"#242424", sFlashSrc:"/images/success/flash/sifr_FuturaBTBold_3.swf", sWmode:"transparent"}));

}

function doSitecore()
{
	if (findDOM("__PreviewMenu"))
	{
		objMenu = findDOM("__PreviewMenu", 1)
		
		objMenu.height = 1440;
		// next line for debugging Sitecore Client only Remove before flight
		objMenu.width = 700;
		objMenu.zIndex = 500;
	}
	else if (findDOM("__Debugger"))
	{
		objMenu = findDOM("__Debugger", 1)
		
		objMenu.height = 1440;
		// next line for debugging Sitecore Client only Remove before flight
		objMenu.width = 700;
		objMenu.zIndex = 500;
	}
}

function searchRedirect(Text, Href, Target)
{
	Text = trim(Text);

	if (Text.length > 0)
	{
	    // trim the text and encode special characters
		Text = encodeURIComponent(Text);
		
		if (Href.indexOf("$search$") > -1)
		{
			Href = Href.replace("$search$", Text);
		}
		else
		{
			Href = Href + "?text=" + Text;
		}
		
		if (Target != "")
		{
			// We have to make a new window
			window.open(Href, Target);
		}
		else
		{
			location.href = Href;
		}
	}
}

function openPriceGrabber(url)
{
		openPopUp(url, 'winPriceGrabber', 'width=840,height=500,toolbar=0,location=1,directories=0,status=1,menuBar=0,scrollBars=1,resizable=1');
}

function open360(url)
{
		openPopUp(url, 'win360', 'resizable=0,width=650,height=450,left=400,top=300,toolbar=0,location=0,directories=0,status=1,menuBar=0,scrollBars=0');
}

function openDemo(url)
{
		openPopUp(url, 'winDemo', 'resizable=0,width=450,height=350,left=400,top=300,toolbar=0,location=0,directories=0,status=1,menuBar=0,scrollBars=0');
}

function openMorePhotos(url)
{
		openPopUp(url, 'winMorePhotos', 'width=300,height=400,left=400,top=300,toolbar=0,location=0,directories=0,status=1,menuBar=0,scrollBars=0,resizable=1');
}

function openCompare(url)
{
		openPopUp(url, 'winCompare', 'width=650,height=450,toolbar=0,location=0,directories=0,status=1,menuBar=0,scrollBars=0,resizable=0');
}

function openDisclaimer(url)
{
    openPopUp(url, "winDisclaimer", "width=600px,height=630px,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0");
}


// For a custom pop-up, use this function
function openPopUp(url, name, options)
{
	newWindow = window.open(url, name, options);
	if (newWindow) 
	{
		newWindow.focus();
	}
}
var offcontent = false
//this function shows the key benenfits rollover
function showkeybenefits()
{
     document.getElementById("rolloverdisplayarea").innerHTML = document.getElementById("rollovercontent").innerHTML;	 
	 document.getElementById("keybenefits").background = "images/gradient.jpg";
}
//this function hides the key benefits 
function hidekeybenefits()
{
     if(offcontent==false)
     {
  	     document.getElementById("rolloverdisplayarea").innerHTML = "";
	     document.getElementById("keybenefits").background = "";
	     offcontent = true;
	 }
}
function changeoffcontent()
{
    offcontent = false;
}
function showcontent(content, clicked)
{
     document.getElementById('rollovercontentarea').innerHTML = document.getElementById(content).innerHTML;
    parent = clicked.parentNode; 
    siblings = parent.parentNode.childNodes;
    for( var x in siblings ) {
        if( new String(siblings[x].className).indexOf("NavCell") != -1 )
            siblings[x].className = "ExtranetKeyFeaturesNavCell";
    }
    parent.className = "ExtranetKeyFeaturesNavCellSelected";
}
function hidecontent()
{     
     document.getElementById('rollovercontentarea').innerHTML = document.getElementById('tempdiv').innerHTML;
    clicked.parentNode.parentNode.className = "ExtranetKeyFeaturesNavCell";
}

// for success pages

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

/*
===========================================
Utility Functions
===========================================
*/

function wasEnterPressed(e)
{
    if(!e)
        e = event;
        
    var keyCode = null
    
    if(e.which)
        keyCode = e.which;
    else if(e.keyCode)
        keyCode = e.keyCode;
        
    var wasPressed = false;
    
    if(keyCode == 13)
        wasPressed = true;
        
    return wasPressed;
}

function trim(stringToTrim)
{
    // ^\s+ means leading white-spaces
    // \s+$ means trailing white-spaces
    stringToTrim = stringToTrim.replace(/^\s+/, "");
    return stringToTrim.replace(/\s+$/, "");
}

function addFavorite(url, title)
{
    // if firefox
    if(window.sidebar)
        window.sidebar.addPanel(title, url, "");
    // if IE
    else if(window.external)
        window.external.AddFavorite(url, title);
}

function ddtabcontent(tabinterfaceid){
	this.tabinterfaceid=tabinterfaceid //ID of Tab Menu main container
	this.tabs=document.getElementById(tabinterfaceid).getElementsByTagName("a") //Get all tab links within container
	this.enabletabpersistence=true
	this.hottabspositions=[] //Array to store position of tabs that have a "rel" attr defined, relative to all tab links, within container
	this.currentTabIndex=0 //Index of currently selected hot tab (tab with sub content) within hottabspositions[] array
	this.subcontentids=[] //Array to store ids of the sub contents ("rel" attr values)
	this.revcontentids=[] //Array to store ids of arbitrary contents to expand/contact as well ("rev" attr values)
	this.selectedClassTarget="link" //keyword to indicate which target element to assign "selected" CSS class ("linkparent" or "link")
}

ddtabcontent.getCookie=function(Name){ 
	var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair
	if (document.cookie.match(re)) //if cookie found
		return document.cookie.match(re)[0].split("=")[1] //return its value
	return ""
}

ddtabcontent.setCookie=function(name, value){
	document.cookie = name+"="+value+";path=/" //cookie value is domain wide (path=/)
}

ddtabcontent.prototype={

	expandit:function(tabid_or_position){ //PUBLIC function to select a tab either by its ID or position(int) within its peers
		this.cancelautorun() //stop auto cycling of tabs (if running)
		var tabref=""
		try{
			if (typeof tabid_or_position=="string" && document.getElementById(tabid_or_position).getAttribute("rel")) //if specified tab contains "rel" attr
				tabref=document.getElementById(tabid_or_position)
			else if (parseInt(tabid_or_position)!=NaN && this.tabs[tabid_or_position].getAttribute("rel")) //if specified tab contains "rel" attr
				tabref=this.tabs[tabid_or_position]
		}
		catch(err){alert("Invalid Tab ID or position entered!")}
		if (tabref!="") //if a valid tab is found based on function parameter
			this.expandtab(tabref) //expand this tab
	},

	cycleit:function(dir, autorun){ //PUBLIC function to move foward or backwards through each hot tab (tabinstance.cycleit('foward/back') )
		if (dir=="next"){
			var currentTabIndex=(this.currentTabIndex<this.hottabspositions.length-1)? this.currentTabIndex+1 : 0
		}
		else if (dir=="prev"){
			var currentTabIndex=(this.currentTabIndex>0)? this.currentTabIndex-1 : this.hottabspositions.length-1
		}
		if (typeof autorun=="undefined") //if cycleit() is being called by user, versus autorun() function
			this.cancelautorun() //stop auto cycling of tabs (if running)
		this.expandtab(this.tabs[this.hottabspositions[currentTabIndex]])
	},

	setpersist:function(bool){ //PUBLIC function to toggle persistence feature
			this.enabletabpersistence=bool
	},

	setselectedClassTarget:function(objstr){ //PUBLIC function to set which target element to assign "selected" CSS class ("linkparent" or "link")
		this.selectedClassTarget=objstr || "link"
	},

	getselectedClassTarget:function(tabref){ //Returns target element to assign "selected" CSS class to
		return (this.selectedClassTarget==("linkparent".toLowerCase()))? tabref.parentNode : tabref
	},

	urlparamselect:function(tabinterfaceid){
		var result=window.location.search.match(new RegExp(tabinterfaceid+"=(\\d+)", "i")) //check for "?tabinterfaceid=2" in URL
		return (result==null)? null : parseInt(RegExp.$1) //returns null or index, where index (int) is the selected tab's index
	},

	expandtab:function(tabref){
		var subcontentid=tabref.getAttribute("rel") //Get id of subcontent to expand
		//Get "rev" attr as a string of IDs in the format ",john,george,trey,etc," to easily search through
		var associatedrevids=(tabref.getAttribute("rev"))? ","+tabref.getAttribute("rev").replace(/\s+/, "")+"," : ""
		this.expandsubcontent(subcontentid)
		this.expandrevcontent(associatedrevids)
		for (var i=0; i<this.tabs.length; i++){ //Loop through all tabs, and assign only the selected tab the CSS class "selected"
			this.getselectedClassTarget(this.tabs[i]).className=(this.tabs[i].getAttribute("rel")==subcontentid)? "selected" : ""
		}
		if (this.enabletabpersistence) //if persistence enabled, save selected tab position(int) relative to its peers
			ddtabcontent.setCookie(this.tabinterfaceid, tabref.tabposition)
		this.setcurrenttabindex(tabref.tabposition) //remember position of selected tab within hottabspositions[] array
	},

	expandsubcontent:function(subcontentid){
		for (var i=0; i<this.subcontentids.length; i++){
			var subcontent=document.getElementById(this.subcontentids[i]) //cache current subcontent obj (in for loop)
			subcontent.style.display=(subcontent.id==subcontentid)? "block" : "none" //"show" or hide sub content based on matching id attr value
		}
	},

	expandrevcontent:function(associatedrevids){
		var allrevids=this.revcontentids
		for (var i=0; i<allrevids.length; i++){ //Loop through rev attributes for all tabs in this tab interface
			//if any values stored within associatedrevids matches one within allrevids, expand that DIV, otherwise, contract it
			document.getElementById(allrevids[i]).style.display=(associatedrevids.indexOf(","+allrevids[i]+",")!=-1)? "block" : "none"
		}
	},

	setcurrenttabindex:function(tabposition){ //store current position of tab (within hottabspositions[] array)
		for (var i=0; i<this.hottabspositions.length; i++){
			if (tabposition==this.hottabspositions[i]){
				this.currentTabIndex=i
				break
			}
		}
	},

	autorun:function(){ //function to auto cycle through and select tabs based on a set interval
		this.cycleit('next', true)
	},

	cancelautorun:function(){
		if (typeof this.autoruntimer!="undefined")
			clearInterval(this.autoruntimer)
	},

	init:function(automodeperiod){
		var persistedtab=ddtabcontent.getCookie(this.tabinterfaceid) //get position of persisted tab (applicable if persistence is enabled)
		var selectedtab=-1 //Currently selected tab index (-1 meaning none)
		var selectedtabfromurl=this.urlparamselect(this.tabinterfaceid) //returns null or index from: tabcontent.htm?tabinterfaceid=index
		this.automodeperiod=automodeperiod || 0
		for (var i=0; i<this.tabs.length; i++){
			this.tabs[i].tabposition=i //remember position of tab relative to its peers
			if (this.tabs[i].getAttribute("rel")){
				var tabinstance=this
				this.hottabspositions[this.hottabspositions.length]=i //store position of "hot" tab ("rel" attr defined) relative to its peers
				this.subcontentids[this.subcontentids.length]=this.tabs[i].getAttribute("rel") //store id of sub content ("rel" attr value)
				this.tabs[i].onclick=function(){
					tabinstance.expandtab(this)
					tabinstance.cancelautorun() //stop auto cycling of tabs (if running)
					return false
				}
				if (this.tabs[i].getAttribute("rev")){ //if "rev" attr defined, store each value within "rev" as an array element
					this.revcontentids=this.revcontentids.concat(this.tabs[i].getAttribute("rev").split(/\s*,\s*/))
				}
				if (selectedtabfromurl==i || this.enabletabpersistence && selectedtab==-1 && parseInt(persistedtab)==i || !this.enabletabpersistence && selectedtab==-1 && this.getselectedClassTarget(this.tabs[i]).className=="selected"){
					selectedtab=i //Selected tab index, if found
				}
			}
		} //END for loop
		if (selectedtab!=-1) //if a valid default selected tab index is found
			this.expandtab(this.tabs[selectedtab]) //expand selected tab (either from URL parameter, persistent feature, or class="selected" class)
		else //if no valid default selected index found
			this.expandtab(this.tabs[this.hottabspositions[0]]) //Just select first tab that contains a "rel" attr
		if (parseInt(this.automodeperiod)>500 && this.hottabspositions.length>1){
			this.autoruntimer=setInterval(function(){tabinstance.autorun()}, this.automodeperiod)
		}
	} //END int() function

} //END Prototype assignment

