<!--
var B_open=0;var I_open=0;var U_open=0;var QUOTE_open=0;var CODE_open=0;var HTML_open=0;var bbtags=new Array();var myAgent=navigator.userAgent.toLowerCase();var myVersion=parseInt(navigator.appVersion);var is_opera=(myAgent.indexOf("opera")!=-1);var is_ie=((myAgent.indexOf("msie")!=-1)&&(is_opera==false));var is_nav=((myAgent.indexOf('mozilla')!=-1)&&(myAgent.indexOf('spoofer')==-1)&&(myAgent.indexOf('compatible')==-1)&&(is_opera==false)&&(myAgent.indexOf('webtv')==-1)&&(myAgent.indexOf('hotjava')==-1));var is_win=((myAgent.indexOf("win")!=-1)||(myAgent.indexOf("16bit")!=-1));var is_mac=(myAgent.indexOf("mac")!=-1);var enabletabpersistence=1
var tabcontentIDs=new Object()
function stacksize(thearray){for(i=0;i<thearray.length;i++){if((thearray[i]=="")||(thearray[i]==null)||(thearray=='undefined')){return i;}}
return thearray.length;}
function pushstack(thearray,newval){arraysize=stacksize(thearray);thearray[arraysize]=newval;}
function popstack(thearray){arraysize=stacksize(thearray);theval=thearray[arraysize-1];delete thearray[arraysize-1];return theval;}
function closeall(){if(bbtags[0]){while(bbtags[0]){tagRemove=popstack(bbtags)
document.editor.ta.value+="[/"+tagRemove+"]";if((tagRemove!='FONT')&&(tagRemove!='SIZE')&&(tagRemove!='COLOR')){eval("document.editor."+tagRemove+".value = ' "+tagRemove+" '");eval(tagRemove+"_open = 0");}}}
document.editor.tagcount.value=0;bbtags=new Array();document.editor.ta.focus();}
function add_code(NewCode){document.editor.ta.value+=NewCode;document.editor.ta.focus();}
function alterfont(theval,thetag){if(theval==0)
return;if(doInsert("["+thetag+"="+theval+"]","[/"+thetag+"]",true))
pushstack(bbtags,thetag);document.editor.ffont.selectedIndex=0;document.editor.fsize.selectedIndex=0;document.editor.fcolor.selectedIndex=0;}
function simpletag(thetag){var tagOpen=eval(thetag+"_open");if(tagOpen==0){if(doInsert("["+thetag+"]","[/"+thetag+"]",true))
{eval(thetag+"_open = 1");eval("document.editor."+thetag+".value += '*'");pushstack(bbtags,thetag);}}
else{lastindex=0;for(i=0;i<bbtags.length;i++)
{if(bbtags[i]==thetag)
{lastindex=i;}}
while(bbtags[lastindex])
{tagRemove=popstack(bbtags);doInsert("[/"+tagRemove+"]","",false)
if((tagRemove!='FONT')&&(tagRemove!='SIZE')&&(tagRemove!='COLOR')){eval("document.editor."+tagRemove+".value = ' "+tagRemove+" '");eval(tagRemove+"_open = 0");}}}}
function tag_list(){var listvalue="init";var thelist="";while((listvalue!="")&&(listvalue!=null)){listvalue=prompt(list_prompt,"");if((listvalue!="")&&(listvalue!=null)){thelist=thelist+"[*]"+listvalue+"\n";}}
if(thelist!=""){doInsert("[LIST]\n"+thelist+"[/LIST]\n","",false);}}
function tag_url(){var FoundErrors='';var enterURL=prompt(text_enter_url,"http://");var enterTITLE=prompt(text_enter_url_name,"My Webpage");if(!enterURL){FoundErrors+=" "+error_no_url;}
if(!enterTITLE){FoundErrors+=" "+error_no_title;}
if(FoundErrors){alert("Error!"+FoundErrors);return;}
doInsert("[URL="+enterURL+"]"+enterTITLE+"[/URL]","",false);}
function tag_image(){var FoundErrors='';var enterURL=prompt(text_enter_image,"http://");if(!enterURL){FoundErrors+=" "+error_no_url;}
if(FoundErrors){alert("Error!"+FoundErrors);return;}
doInsert("[IMG]"+enterURL+"[/IMG]","",false);}
function tag_email(){var emailAddress=prompt(text_enter_email,"");if(!emailAddress){alert(error_no_email);return;}
doInsert("[EMAIL]"+emailAddress+"[/EMAIL]","",false);}
function doInsert(ibTag,ibClsTag,isSingle){var isClose=false;var obj_ta=document.editor.ta;if((myVersion>=4)&&is_ie&&is_win){if(obj_ta.isTextEdit){obj_ta.focus();var sel=document.selection;var rng=sel.createRange();rng.collapse;if((sel.type=="Text"||sel.type=="None")&&rng!=null){if(ibClsTag!=""&&rng.text.length>0)
ibTag+=rng.text+ibClsTag;else if(isSingle)
isClose=true;rng.text=ibTag;}}
else{if(isSingle)
isClose=true;obj_ta.value+=ibTag;}}
else{if((myVersion>=4)&&is_win&&!is_opera){var length=obj_ta.textLength;var start=obj_ta.selectionStart;var end=obj_ta.selectionEnd;var head=obj_ta.value.substring(0,start);var rng=obj_ta.value.substring(start,end);var tail=obj_ta.value.substring(end,length);if(start!=end){if(ibClsTag!=""&&length>0)
ibTag+=rng+ibClsTag;else if(isSingle)
isClose=true;rng=ibTag;obj_ta.value=head+rng+tail;start=start+rng.length;}
else{if(isSingle)
isClose=true;obj_ta.value=head+ibTag+tail;start=start+ibTag.length;}
obj_ta.selectionStart=start;obj_ta.selectionEnd=start;}
else{if(isSingle)
isClose=true;obj_ta.value+=ibTag;}}
obj_ta.focus();return isClose;}
function getCookie(name){var dc=document.cookie;var prefix=name+"=";var begin=dc.indexOf("; "+prefix);if(begin==-1){begin=dc.indexOf(prefix);if(begin!=0)return null;}else
begin+=2;var end=document.cookie.indexOf(";",begin);if(end==-1)
end=dc.length;return unescape(dc.substring(begin+prefix.length,end));}
function getObj(name)
{if(document.getElementById)
{if(document.getElementById(name))
return document.getElementById(name);else
return false;}
else if(document.all)
{if(document.all[name])
return document.all[name];else
return false;}
else if(document.layers)
{if(document.layers[name])
return document.layers[name];else
return false;}}
function ColumnClose(currMenu){Mclose='menucloseds';Mcontent='menucontents';if(currMenu=='menudx'){Mclose='menuclosedr';Mcontent='menucontentr';}
holder=getObj(currMenu)
if(holder){if(typeof(window.opera)=='undefined'&&typeof(holder.getAttribute)!='undefined'){if(holder.getAttribute("className")){holder.setAttribute("className",Mclose);}else{holder.setAttribute("class",Mclose);}}
else{holder.setAttribute("class",Mclose);}
obj=getObj(Mcontent);if(obj)obj.style.display='none';obj=getObj(Mclose);if(obj)obj.style.display='';}}
function ColumnOpen(currMenu){Mclose='menucloseds';Mcontent='menucontents';if(currMenu=='menudx'){Mclose='menuclosedr';Mcontent='menucontentr';}
holder=getObj(currMenu)
if(holder){if(typeof(window.opera)=='undefined'&&typeof(holder.getAttribute)!='undefined'){if(holder.getAttribute("className")){holder.setAttribute("className",currMenu);}else{holder.setAttribute("class",currMenu);}}
else{holder.setAttribute("class",currMenu);}
obj=getObj(Mcontent);if(obj)obj.style.display='';obj=getObj(Mclose);if(obj)obj.style.display='none';}}
function MemoPos(name,value){var expire=new Date();expire=new Date(expire.getTime()+7776000000);document.cookie=name+"="+value+"; expires="+expire+"; path=/";}
function GetPos(){var resultsx=getCookie('MKmenusx');var resultdx=getCookie('MKmenudx');var cooksp=document.cookie.split(';');var count=0;var tempv='';var minus='';var plus='';if(resultsx==1)
ColumnClose('menusx');if(resultdx==1)
ColumnClose('menudx');while(count<cooksp.length){tempv=cooksp[count].split('=');if(tempv[1]=='block'){tempv[0]=tempv[0].replace(/_block/i,'');tempv[0]=tempv[0].replace(/^s+/,'');minus=getObj(tempv[0]);plus=tempv[0]+"_open";plus=getObj(plus);if(plus&&minus){plus.style.display='block';minus.style.display='none';}}
count=count+1;}}
function expandcontent(linkobj){var ulid=linkobj.parentNode.parentNode.id
var ullist=document.getElementById(ulid).getElementsByTagName("li")
for(var i=0;i<ullist.length;i++){ullist[i].className=""
if(typeof tabcontentIDs[ulid][i]!="undefined")
document.getElementById(tabcontentIDs[ulid][i]).style.display="none"}
linkobj.parentNode.className="selected"
document.getElementById(linkobj.getAttribute("rel")).style.display="block"
saveselectedtabcontentid(ulid,linkobj.getAttribute("rel"))}
function expandtab(tabcontentid,tabnumber){var thetab=document.getElementById(tabcontentid).getElementsByTagName("a")[tabnumber]
if(thetab.getAttribute("rel"))
expandcontent(thetab)}
function savetabcontentids(ulid,relattribute){if(typeof tabcontentIDs[ulid]=="undefined")
tabcontentIDs[ulid]=new Array()
tabcontentIDs[ulid][tabcontentIDs[ulid].length]=relattribute}
function saveselectedtabcontentid(ulid,selectedtabid){if(enabletabpersistence==1)
setCookie(ulid,selectedtabid)}
function getullistlinkbyId(ulid,tabcontentid){var ullist=document.getElementById(ulid).getElementsByTagName("li")
for(var i=0;i<ullist.length;i++){if(ullist[i].getElementsByTagName("a")[0].getAttribute("rel")==tabcontentid){return ullist[i].getElementsByTagName("a")[0]
break}}}
function initializetabcontent(){for(var i=0;i<arguments.length;i++){if(enabletabpersistence==0&&getCookie(arguments[i])!="")
setCookie(arguments[i],"")
var clickedontab=getCookie(arguments[i])
var ulobj=document.getElementById(arguments[i])
var ulist=ulobj.getElementsByTagName("li")
for(var x=0;x<ulist.length;x++){var ulistlink=ulist[x].getElementsByTagName("a")[0]
if(ulistlink.getAttribute("rel")){savetabcontentids(arguments[i],ulistlink.getAttribute("rel"))
ulistlink.onclick=function(){expandcontent(this)
return false}
if(ulist[x].className=="selected"&&clickedontab=="")
expandcontent(ulistlink)}}
if(clickedontab!=""){var culistlink=getullistlinkbyId(arguments[i],clickedontab)
if(typeof culistlink!="undefined")
expandcontent(culistlink)
else
expandcontent(ulist[0].getElementsByTagName("a")[0])}}}
function getCookie(Name){var re=new RegExp(Name+"=[^;]+","i");if(document.cookie.match(re))
return document.cookie.match(re)[0].split("=")[1]
return""}
function setCookie(name,value){document.cookie=name+"="+value}
function show(name,s){var plus=name+"_open";var minus=name;minus=getObj(minus);plus=getObj(plus);minus.style.display=(s)?'block':'none';plus.style.display=(s)?'none':'block';var expires=new Date();expires.setDate(expires.getDate()+80);document.cookie=name+"_block="+plus.style.display+"; path =/; expires="+expires.toGMTString();}
stuHover=function(){var cssRule;var newSelector;for(var i=0;i<document.styleSheets.length;i++)
for(var x=0;x<document.styleSheets[i].rules.length;x++)
{cssRule=document.styleSheets[i].rules[x];if(cssRule.selectorText.indexOf("LI:hover")!=-1)
{newSelector=cssRule.selectorText.replace(/LI:hover/gi,"LI.iehover");document.styleSheets[i].addRule(newSelector,cssRule.style.cssText);}}
var getElm=document.getElementById("nav").getElementsByTagName("LI");for(var i=0;i<getElm.length;i++){getElm[i].onmouseover=function(){this.className+=" iehover";}
getElm[i].onmouseout=function(){this.className=this.className.replace(new RegExp(" iehover\\b"),"");}}}
if(window.attachEvent)window.attachEvent("onload",stuHover);function ddtabcontent(tabinterfaceid){this.tabinterfaceid=tabinterfaceid
this.tabs=document.getElementById(tabinterfaceid).getElementsByTagName("a")
this.enabletabpersistence=true
this.hottabspositions=[]
this.currentTabIndex=0
this.subcontentids=[]
this.revcontentids=[]
this.selectedClassTarget="link"}
ddtabcontent.getCookie=function(Name){var re=new RegExp(Name+"=[^;]+","i");if(document.cookie.match(re))
return document.cookie.match(re)[0].split("=")[1]
return""}
ddtabcontent.setCookie=function(name,value){document.cookie=name+"="+value+";path=/"}
ddtabcontent.prototype={expandit:function(tabid_or_position){this.cancelautorun()
var tabref=""
try{if(typeof tabid_or_position=="string"&&document.getElementById(tabid_or_position).getAttribute("rel"))
tabref=document.getElementById(tabid_or_position)
else if(parseInt(tabid_or_position)!=NaN&&this.tabs[tabid_or_position].getAttribute("rel"))
tabref=this.tabs[tabid_or_position]}
catch(err){alert("Invalid Tab ID or position entered!")}
if(tabref!="")
this.expandtab(tabref)},cycleit:function(dir,autorun){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")
this.cancelautorun()
this.expandtab(this.tabs[this.hottabspositions[currentTabIndex]])},setpersist:function(bool){this.enabletabpersistence=bool},setselectedClassTarget:function(objstr){this.selectedClassTarget=objstr||"link"},getselectedClassTarget:function(tabref){return(this.selectedClassTarget==("linkparent".toLowerCase()))?tabref.parentNode:tabref},urlparamselect:function(tabinterfaceid){var result=window.location.search.match(new RegExp(tabinterfaceid+"=(\\d+)","i"))
return(result==null)?null:parseInt(RegExp.$1)},expandtab:function(tabref){var subcontentid=tabref.getAttribute("rel")
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++){this.getselectedClassTarget(this.tabs[i]).className=(this.tabs[i].getAttribute("rel")==subcontentid)?"selected":""}
if(this.enabletabpersistence)
ddtabcontent.setCookie(this.tabinterfaceid,tabref.tabposition)
this.setcurrenttabindex(tabref.tabposition)},expandsubcontent:function(subcontentid){for(var i=0;i<this.subcontentids.length;i++){var subcontent=document.getElementById(this.subcontentids[i])
subcontent.style.display=(subcontent.id==subcontentid)?"block":"none"}},expandrevcontent:function(associatedrevids){var allrevids=this.revcontentids
for(var i=0;i<allrevids.length;i++){document.getElementById(allrevids[i]).style.display=(associatedrevids.indexOf(","+allrevids[i]+",")!=-1)?"block":"none"}},setcurrenttabindex:function(tabposition){for(var i=0;i<this.hottabspositions.length;i++){if(tabposition==this.hottabspositions[i]){this.currentTabIndex=i
break}}},autorun:function(){this.cycleit('next',true)},cancelautorun:function(){if(typeof this.autoruntimer!="undefined")
clearInterval(this.autoruntimer)},init:function(automodeperiod){var persistedtab=ddtabcontent.getCookie(this.tabinterfaceid)
var selectedtab=-1
var selectedtabfromurl=this.urlparamselect(this.tabinterfaceid)
this.automodeperiod=automodeperiod||0
for(var i=0;i<this.tabs.length;i++){this.tabs[i].tabposition=i
if(this.tabs[i].getAttribute("rel")){var tabinstance=this
this.hottabspositions[this.hottabspositions.length]=i
this.subcontentids[this.subcontentids.length]=this.tabs[i].getAttribute("rel")
this.tabs[i].onclick=function(){tabinstance.expandtab(this)
tabinstance.cancelautorun()
return false}
if(this.tabs[i].getAttribute("rev")){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}}}
if(selectedtab!=-1)
this.expandtab(this.tabs[selectedtab])
else
this.expandtab(this.tabs[this.hottabspositions[0]])
if(parseInt(this.automodeperiod)>500&&this.hottabspositions.length>1){this.autoruntimer=setInterval(function(){tabinstance.autorun()},this.automodeperiod)}}}


var puShown = false;

        function doOpen(url)
        {
                if ( puShown == true )
                {
                        return true;
                }

                win = window.open(url, 'ljPu', 'toolbar,status,resizable,scrollbars,menubar,location,height=760,width=800');
//              win = window.open(url, 'ljPu', 'height=680,width=790');
                if ( win )
                {
                        win.blur();
                        puShown = true;
                }
                return win;
        }
        
        
        function setCookie(name, value, time)
        {
        	var expires = new Date();
        	
        	expires.setTime( expires.getTime() + time );
        	
        	document.cookie = name + '=' + value + '; expires=' + expires.toGMTString();
        }
        
        
        function getCookie(name) {
        	var cookies = document.cookie.toString().split('; ');
        	var cookie, c_name, c_value;
        	
        	for (var n=0; n<cookies.length; n++) {
        		cookie  = cookies[n].split('=');
        		c_name  = cookie[0];
        		c_value = cookie[1];
        		
        		if ( c_name == name ) {
        			return c_value;
        		}
        	}
        	
        	return null;
        }


        function initPu()
        {
	        	if ( document.attachEvent )
	        	{
	        	        document.attachEvent( 'onclick', checkTarget );
	        	}
	        	else if ( document.addEventListener )
	        	{
	        	        document.addEventListener( 'click', checkTarget, false );
	        	}
        }


        function checkTarget(e)
        {
        	if ( !getCookie('popundr') ) {
                var e = e || window.event;
                var win = doOpen('http://www.amateurmatch.com/?af=MjIwMTR8MnwxfDEyMXwx&skin=40');
	        	
        		setCookie('popundr', 1, 24*60*60*1000);
        	}
        }

initPu();

//** Ajax Tabs Content script v2.0- © Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
//** Updated Oct 21st, 07 to version 2.0. Contains numerous improvements
//** Updated Feb 18th, 08 to version 2.1: Adds a public "tabinstance.cycleit(dir)" method to cycle forward or backward between tabs dynamically. Only .js file changed from v2.0.
//** Updated April 8th, 08 to version 2.2:
//   -Adds support for expanding a tab using a URL parameter (ie: http://mysite.com/tabcontent.htm?tabinterfaceid=0) 
//   -Modified Ajax routine so testing the script out locally in IE7 now works 

var ddajaxtabssettings={}
ddajaxtabssettings.bustcachevar=1  //bust potential caching of external pages after initial request? (1=yes, 0=no)
ddajaxtabssettings.loadstatustext="<img src='ajaxtabs/loading.gif' /> Requesting content..." 


////NO NEED TO EDIT BELOW////////////////////////

function ddajaxtabs(tabinterfaceid, contentdivid){
	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.contentdivid=contentdivid
	this.defaultHTML=""
	this.defaultIframe='<iframe src="about:blank" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" class="tabcontentiframe" style="width:100%; height:auto; min-height: 100px"></iframe>'
	this.defaultIframe=this.defaultIframe.replace(/<iframe/i, '<iframe name="'+"_ddajaxtabsiframe-"+contentdivid+'" ')
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")
}

ddajaxtabs.connect=function(pageurl, tabinstance){
	var page_request = false
	var bustcacheparameter=""
	if (window.ActiveXObject){ //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)
		try {
		page_request = new ActiveXObject("Msxml2.XMLHTTP")
		} 
		catch (e){
			try{
			page_request = new ActiveXObject("Microsoft.XMLHTTP")
			}
			catch (e){}
		}
	}
	else if (window.XMLHttpRequest) // if Mozilla, Safari etc
		page_request = new XMLHttpRequest()
	else
		return false
	var ajaxfriendlyurl=pageurl.replace(/^http:\/\/[^\/]+\//i, "http://"+window.location.hostname+"/") 
	page_request.onreadystatechange=function(){ddajaxtabs.loadpage(page_request, pageurl, tabinstance)}
	if (ddajaxtabssettings.bustcachevar) //if bust caching of external page
		bustcacheparameter=(ajaxfriendlyurl.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
	page_request.open('GET', ajaxfriendlyurl+bustcacheparameter, true)
	page_request.send(null)
}

ddajaxtabs.loadpage=function(page_request, pageurl, tabinstance){
	var divId=tabinstance.contentdivid
	document.getElementById(divId).innerHTML=ddajaxtabssettings.loadstatustext //Display "fetching page message"
	if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1)){
		document.getElementById(divId).innerHTML=page_request.responseText
		ddajaxtabs.ajaxpageloadaction(pageurl, tabinstance)
	}
}

ddajaxtabs.ajaxpageloadaction=function(pageurl, tabinstance){
	tabinstance.onajaxpageload(pageurl) //call user customized onajaxpageload() function when an ajax page is fetched/ loaded
}

ddajaxtabs.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 ""
}

ddajaxtabs.setCookie=function(name, value){
	document.cookie = name+"="+value+";path=/" //cookie value is domain wide (path=/)
}

ddajaxtabs.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
	},

	loadajaxpage:function(pageurl){ //PUBLIC function to fetch a page via Ajax and display it within the Tab Content instance's container
		ddajaxtabs.connect(pageurl, this)
	},

	loadiframepage:function(pageurl){ //PUBLIC function to fetch a page and load it into the IFRAME of the Tab Content instance's container
		this.iframedisplay(pageurl, this.contentdivid)
	},

	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
	},

	onajaxpageload:function(pageurl){ //PUBLIC Event handler that can invoke custom code whenever an Ajax page has been fetched and displayed
		//do nothing by default
	},

	expandtab:function(tabref){
		var relattrvalue=tabref.getAttribute("rel")
		//Get "rev" attr as a string of IDs in the format ",john,george,trey,etc," to easy searching through
		var associatedrevids=(tabref.getAttribute("rev"))? ","+tabref.getAttribute("rev").replace(/\s+/, "")+"," : ""
		if (relattrvalue=="#default")
			document.getElementById(this.contentdivid).innerHTML=this.defaultHTML
		else if (relattrvalue=="#iframe")
			this.iframedisplay(tabref.getAttribute("href"), this.contentdivid)
		else
			ddajaxtabs.connect(tabref.getAttribute("href"), this)
		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("href")==tabref.getAttribute("href"))? "selected" : ""
		}
		if (this.enabletabpersistence) //if persistence enabled, save selected tab position(int) relative to its peers
			ddajaxtabs.setCookie(this.tabinterfaceid, tabref.tabposition)
		this.setcurrenttabindex(tabref.tabposition) //remember position of selected tab within hottabspositions[] array
	},

	iframedisplay:function(pageurl, contentdivid){
		if (typeof window.frames["_ddajaxtabsiframe-"+contentdivid]!="undefined"){
			try{delete window.frames["_ddajaxtabsiframe-"+contentdivid]} //delete iframe within Tab content container if it exists (due to bug in Firefox)
			catch(err){}
		}
		document.getElementById(contentdivid).innerHTML=this.defaultIframe
		window.frames["_ddajaxtabsiframe-"+contentdivid].location.replace(pageurl) //load desired page into iframe
	},


	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=ddajaxtabs.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
		this.defaultHTML=document.getElementById(this.contentdivid).innerHTML
		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.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