/* siteitems.js,v 1.5 2006/01/20 16:47:03 enriqued Exp */
/* pop-up window */
function open_window(url, mywidth, myheight) {
mywin = window.open(url,"win","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=" + mywidth + ",height=" + myheight);
}

/* pop-window close/redirect target to main window */
function targetopener(mylink, closeme, closeonly)
{
if (! (window.focus && window.opener))return true;
window.opener.focus();
if (! closeonly)window.opener.location.href=mylink.href;
if (closeme)window.close();
return false;
}

/* execs tabs  */
if (window.parent && window.parent.synchTab)
  window.parent.synchTab(window.name);

  
/* Events rollover script part 1 */
//Fix Safari Back Button Bug
function P7_fixSafariBB(){ //v1.1 by PVII
if(navigator.userAgent.indexOf("Safari")>-1){
var jj=onload;if(jj){if(onunload==null){
document.body.setAttribute('onunload',jj);}}}
}
//Netscape 4 Resize Fix
function MM_reloadPage(init) {
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

//write NN4 stylesheet if not version5 browser
if(!document.getElementById){
document.write('<link rel="stylesheet" type="text/css" href="/newdesigns/print.css">');
document.close();}

//handle table row highligthing
function P7_rowLite(tb,cl){ //v1.0 by PVII -table row highlighter
 var g,i,x,gr;if(document.getElementById){g=document.getElementsByTagName("TABLE");
 for(x=0;x<g.length;x++){if(g[x].className&&g[x].className==tb){
 gr=g[x].getElementsByTagName("TR");if(gr){for(i=0;i<gr.length;i++){
 if(i>0){gr[i].onmouseover=function(){this.className=cl;};
 gr[i].onmouseout=function(){this.className='';};}}}}}}
}

//handle pop up windows
function P7_infopop(a) { //v1.0 by PVII
 document.p7tutpop = window.open(a,'theInfo','toolbar=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,top=0,left=0,height=500,width=800');
 document.p7tutpop.focus();
}

// P7 Multi-Menu - Copyright 2004 Project Seven Development (PVII)
// Developed by: Gerry Jacobsen-PVII
// beta version 0.85_6a
function P7_setNM2(){var i,d='',h="<sty"+"le type=\"text/css\">";var tA=navigator.userAgent.toLowerCase();if(window.opera){if(tA.indexOf("opera 5")>-1||tA.indexOf("opera 6")>-1){return;}}if(document.getElementById){for(i=1;i<10;i++){d+='ul ';h+="\n.p7sub ul "+d+"{display:none;}";}document.write(h+"\n<"+"/sty"+"le>");}}P7_setNM2();function P7_buildNM(){var i,x,g,theDiv,bb,theS,tA,theU,pp,lvl,tS,opn;tA=navigator.userAgent.toLowerCase();if(window.opera){if(tA.indexOf("opera 5")>-1||tA.indexOf("opera 6")>-1){return;}}document.p7tControl=new Array;opn='';if(document.p7NMopener&&document.p7NMopener.length>5){opn=document.p7NMopener.split(",");}if(document.getElementById){for(x=1;x<10;x++){theDiv=document.getElementById('p7NMnav'+x);if(theDiv){if(theDiv.className&&theDiv.className.indexOf("p7snm")>-1){theS=theDiv.className.split('_');if(theS.length&&theS.length>2){theDiv.p7NMprop=theS.slice(1);}else{alert('Missing NM2 Menu Props:'+theDiv.id);continue;}}else{alert('Missing NM2 Menu Props:'+theDiv.id);continue;}theU=theDiv.getElementsByTagName("UL");for(i=0;i<theU.length;i++){theU[i].p7nmdiv=theDiv.id;theU[i].p7tctrl=document.p7tControl.length;document.p7tControl[document.p7tControl.length]=theU[i];if(i==0){}pp=theU[i].parentNode;lvl=0;while(pp){if(pp.tagName&&pp.tagName=="UL"){lvl++;}if(pp.tagName&&pp.tagName=="DIV"){break;}pp=pp.parentNode;}theU[i].p7nmlvl=lvl;}theA=theDiv.getElementsByTagName("A");for(i=0;i<theA.length;i++){theA[i].p7nmdiv=theDiv.id;bb=P7_getSub(theA[i]);theA[i].p7ulref=(bb!=null)?bb.p7tctrl:-1;theA[i].p7aref=document.p7tControl.length;document.p7tControl[document.p7tControl.length]=theA[i];if(theDiv.p7NMprop[2]==2){theA[i].onmouseover=function(){P7_timeNM2(this);};theA[i].onfocus=function(){P7_timeNM2(this);};}else{if(theA[i].p7ulref<0){theA[i].onclick=function(){P7_toggleNM2(this);};}else{theA[i].onclick=function(){P7_clickNM2(this);};}}}if(theDiv.p7NMprop[1]==1){tS="'"+theDiv.id+"'";for(i=0;i<opn.length;i+=3){if(opn[i]==theDiv.id){tS=tS+","+opn[i+1]+",'"+opn[i+2]+"'";}break;}eval("P7_openNM2("+tS+")");}}}document.body.onmouseover=P7_mainClose;}}function P7_getSub(a){var i,theU=null;var g=a.parentNode.getElementsByTagName("UL");if(g&&g.length){theU=g[0];}return theU;}function P7_showNM2(ob,bp){var i,s,hh,thePc,mk;var g=document.getElementById(ob.p7nmdiv);if(!bp&&g.p7NMprop[3]==1){P7_toggleNM2(ob);}if(ob&&ob.parentNode){thePc=ob.parentNode.childNodes;for(i=0;i<thePc.length;i++){if(thePc[i].tagName=="UL"){if(thePc[i].style.display!="block"){thePc[i].style.display="block";ob.parentNode.style.position="relative";if(g.p7NMprop[0]==0||thePc[i].p7nmlvl<(g.p7NMprop[7])){thePc[i].style.position="absolute";thePc[i].style.left=g.p7NMprop[4];thePc[i].style.top=g.p7NMprop[5];}thePc[i].style.visibility="visible";mk=(ob.className.indexOf("curr")>-1)?"p7minusmarkcurr":"p7minusmark";ob.className=mk;if(g.p7NMprop[6]==1){P7_animSub(thePc[i].p7tctrl,40);}}}}}}function P7_toggleNM2(a,b){var i,g,pp,theU,theA;if(a&&a.parentNode){pp=a.parentNode;while(pp){if(pp.tagName&&pp.tagName=="UL"){break;}pp=pp.parentNode;}if(pp){theU=pp.getElementsByTagName("UL");g=document.getElementById(pp.p7nmdiv);if(g.p7NMprop[0]==1&&b==1){return;}for(i=0;i<theU.length;i++){theA=theU[i].parentNode.firstChild;if(b!=1&&theA==a){continue;}else{if(theU[i].style.display=="block"){P7_hideNM2(theA);}}}}}}function P7_hideNM2(ob){var i,s,hh,thePc,theIm,tt;var g=document.getElementById(ob.p7nmdiv);if(ob&&ob.parentNode){thePc=ob.parentNode.childNodes;for(i=0;i<thePc.length;i++){if(thePc[i].tagName=="UL"){thePc[i].style.display="none";if(g.p7NMprop[0]==0||thePc[i].p7nmlvl<(g.p7NMprop[7])){thePc[i].style.position="static";thePc[i].style.left=0;thePc[i].style.top=0;}thePc[i].style.visibility="hidden";mk=(ob.className.indexOf("curr")>-1)?"p7plusmarkcurr":"p7plusmark";ob.className=mk;tt='setTimeout("P7_dodo('+thePc[i].p7tctrl+')",1)';eval(tt);}}}}function P7_dodo(ct){var g=document.p7tControl[ct];g.parentNode.style.position="static";}function P7_animSub(ct,st){var g=document.p7tControl[ct];var sp=30;var inc=20;st=(st>=100)?100:st;g.style.fontSize=st+"%";if(st<100){st+=inc;setTimeout("P7_animSub("+ct+","+st+")",sp);}}function P7_clickNM2(a){document.p7nmactive=1;document.p7nmadiv=a.p7nmdiv;var i,s,thePc;if(a&&a.parentNode){thePc=a.parentNode.childNodes;for(i=0;i<thePc.length;i++){if(thePc[i].tagName=="UL"){s=thePc[i].style.display;if(s=="block"){P7_hideNM2(a);}else{P7_showNM2(a);}}}}}function P7_timeNM2(a){if(document.p7nmcc){clearTimeout(document.p7nmcc);}document.p7nmactive=1;document.p7nmadiv=a.p7nmdiv;var tg='document.p7nmcc=setTimeout("P7_mouseNM2('+a.p7aref+')",220)';eval(tg);}function P7_mouseNM2(ct){var g=document.p7tControl[ct];if(ct>=0){P7_showNM2(g);}else{P7_toggleNM2(g);}}function P7_mainClose(evt){evt=(evt)?evt:((event)?event:null);var nn,pp,m=true;var st=document.p7nmactive;if(st!=-999){if(evt){var theSrc=(evt.target)?evt.target:evt.srcElement;pp=theSrc.parentNode;while(pp){nn=pp.nodeName;if(nn=="DIV"&&pp.p7NMprop){m=false;document.p7nmactive=1;document.p7nmadiv=pp.id;pp.nmstate=1;break;}pp=pp.parentNode;}if(m){document.p7nmactive=0;document.p7nmadiv='none';}if(document.p7nmc){clearTimeout(document.p7nmc);}document.p7nmc=setTimeout("P7_closeNM2()",300);}}}function P7_closeNM2(){var theA,i,divName,theDiv;if(document.p7nmadiv=='none'){document.p7nmactive=-1;}for(i=1;i<11;i++){divName='p7NMnav'+i;theDiv=document.getElementById(divName);if(theDiv){if(document.p7nmadiv!=theDiv.id){theDiv.nmstate==0;theA=theDiv.getElementsByTagName("A");if(theA){P7_toggleNM2(theA[0],1);}}}}}

//menu auto opener
function P7_openNM2(navDiv,tp,vu){var i,d,ha,pp,m=false;if(document.getElementById){d=document.getElementById(navDiv);if(d){ha=d.getElementsByTagName("A");if(tp==null||tp==0){vu=window.location.href;tp=0;}for(i=0;i<ha.length;i++){if(ha[i].href){if(tp<=0){if(ha[i].href.indexOf(vu)>-1){m=true;break;}}if(tp==1){if(ha[i].href.indexOf(vu)>-1){m=true;break;}}if(tp==2){if(ha[i].firstChild){if(ha[i].firstChild.nodeValue==vu){m=true;break;}}}}}if(m){pp=ha[i].parentNode;if(ha[i].p7ulref<0){ha[i].className="p7currentmark";pp=pp.parentNode;}while(pp){if(pp.nodeName=="LI"){if(pp.firstChild.nodeName=="A"){pp.firstChild.className="p7plusmarkcurr";if(d.p7NMprop[0]==1){P7_showNM2(pp.firstChild,9);}}}pp=pp.parentNode;}}}}}

// P7 Random Background Scroller - Copyright 2004 Project Seven Development (PVII)
// Developed by: Gerry Jacobsen-PVII
// beta version 0.7 -beta
function P7_setRBS(){var theBox="thumbnails";var theShim="thumbs";var theDiv="bgsc1inks";var i,tB,tS,tD,tL,tA,j,np;if(document.getElementById){tB=document.getElementById(theBox);if(tB){tD=document.getElementById(theDiv);if(tD){tB.p7RBS=arguments;if(document.p7RBSdn){tB.p7RBS[0]=document.p7RBSdn;}tL=tD.getElementsByTagName("LI");if(tL){j=tL.length;if(tB.p7RBS[0]==0){i=Math.floor(Math.random()*j);}else{i=(tB.p7RBS[0]>j)?0:tB.p7RBS[0]-1;i=(i<0)?0:i;}tA=tL[i].getElementsByTagName("A");if(tA&&tA.length>1){tB.style.backgroundImage="url("+tA[1].href+")";tS=document.getElementById(theShim);if(tS){tS.setAttribute("alt",tA[0].firstChild.nodeValue);tS.parentNode.setAttribute("href",tA[0].href);}P7_runRBS(tB.id,'Reset');}}}}}}function P7_scrollRBS(ob,tT,np){if(document.getElementById){var theBox=document.getElementById(ob);var tt,nu,tF,lp=0,hp=0,inc=0,dl=theBox.p7RBS[5],m=true;;var tm="theBox.p7BGtm=setTimeout(\"P7_scrollRBS('";if(theBox){if(tT=='H'||tT=='D'){lp=np;}if(tT=='V'||tT=='D'){hp=np;}theBox.style.backgroundPosition=lp+'px '+hp+'px';tF=theBox.p7RBS[4];theBox.p7RBSac+=tF;nu=theBox.p7RBSac+tF;if(theBox.p7RBS[1]=='C'){if(nu>theBox.p7RBS[6]&&theBox.p7RBSac!=theBox.p7RBS[6]){tF=theBox.p7RBS[6]-theBox.p7RBSac;theBox.p7RBSac=theBox.p7RBS[6]-theBox.p7RBS[4];}if(theBox.p7RBSac>=theBox.p7RBS[6]){dl=theBox.p7RBS[7];theBox.p7RBSac=0;theBox.p7RBSc+=1;if(theBox.p7RBSc>theBox.p7RBScc){theBox.p7RBSc=1;}}}theBox.p7RBSae+=tF;inc=(np>=0)?tF:tF*-1;np=np+inc;if(theBox.p7RBSae+tF>theBox.p7RBS[9]){np=(np>=0)?theBox.p7RBS[9]:theBox.p7RBS[9]*-1;}tm+=ob+"','"+tT+"',"+np+")\","+dl+")";theBox.p7RBSres=tm;if(theBox.p7RBS[3]=="N"&&theBox.p7RBSae>theBox.p7RBS[9]){m=false;theBox.p7RBScm=0;if(theBox.p7BGtm){clearTimeout(theBox.p7BGtm);}}if(m){if(theBox.p7RBScm==1){eval(tm);}}}}}function P7_runRBS(ob,cm,op){var lp=0,hp=0,tT,tm,dl;var tm="theBox.p7BGtm=setTimeout(\"P7_scrollRBS('";if(document.getElementById){var theBox=document.getElementById(ob);if(theBox){if(cm=='Stop'){theBox.p7RBScm=0;if(theBox.p7BGtm){clearTimeout(theBox.p7BGtm);}}if(cm=='Resume'){theBox.p7RBScm=1;if(theBox.p7RBSres){eval(theBox.p7RBSres);}}if(cm=='Reset'){theBox.p7RBScm=0;if(theBox.p7BGtm){clearTimeout(theBox.p7BGtm);}theBox.p7RBSres='';np=theBox.p7RBS[8];theBox.p7RBSac=0;theBox.p7RBSae=0;var tT="H";if(theBox.p7RBS[2]=='U'||theBox.p7RBS[2]=='D'){tT="V";}if(tT=='H'||tT=='D'){lp=np;}if(tT=='V'||tT=='D'){hp=np;}theBox.style.backgroundPosition=lp+'px '+hp+'px';np+=theBox.p7RBS[4];if(theBox.p7RBS[2]=="L"||theBox.p7BGs[2]=="U"){np=np*-1;}theBox.p7RBSc=1;theBox.p7RBScc=parseInt(theBox.p7RBS[9]/theBox.p7RBS[6]);theBox.p7RBScm=1;dl=(op)?op:theBox.p7RBS[7];tm+=ob+"','"+tT+"',"+np+")\","+dl+")";theBox.p7RBSres=tm;if(theBox.p7RBS[10]=="Y"){eval(tm);}}}}}  
 
 
/* JS for /Solutions/ tabs, Part 1 */
/* ===================================================
	Copyright (c) 2003-2005 Macromedia Inc.
	global JavaScript functions 
	1.4
==================================================== */
if (window.parent == self)
{
window.name = "MacromediaWindow";
window.focus();
}
var crosslinkWindow;
function openCrosslinkWindow ( url )
{
if (window.opener != null && !window.opener.closed) {
window.opener.location = url;
window.opener.focus();
} else if (typeof crosslinkWindow != "undefined" && crosslinkWindow != null && !crosslinkWindow.closed) {
crosslinkWindow.location = url;
crosslinkWindow.focus();
} else {
crosslinkWindow = window.open(url, "AdobeWindow");
crosslinkWindow.focus();
}
}
var mmWindow;
function openMMWindow ( url )
{
if (window.opener != null && !window.opener.closed) {
window.opener.location = url;
window.opener.focus();
} else if (typeof mmWindow != "undefined" && mmWindow != null && !mmWindow.closed) {
mmWindow.location = url;
mmWindow.focus();
} else {
mmWindow = window.open(url, "mm_window");
mmWindow.focus();
}
}
PNG = function (id,src,altsrc) {
var png = document.createElement('img');
png.setAttribute('id',id);
if (browser.ua.indexOf('msie 5.0') != -1) {
if (altsrc != null) png.src = altsrc;
else return;
} else if ((browser.appN.indexOf('microsoft') != -1) && (browser.ua.indexOf('mac') == -1)) {
png.src = '/images/alpha/blank.gif';
png.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"',sizingMethod='scale');";
} else {
png.src = src;
}
return png;
}
function removeElementFromDOM (id) {
var element = document.getElementById(id);
return element.parentNode.removeChild(element);
}
var cookies;
function parseCookies() {
var cookiesHash = new Object();
var cookiesArray = document.cookie.split(';');
for (i=0; i < cookiesArray.length; i++) {
cookie = cookiesArray[i];
cookie = cookie.split('=');
cookiesHash[cookie[0]] = cookie[1];
}
return cookiesHash;
}
function getCookie (name) {
var value = null;
if (name != null) {
name = name.toUpperCase();
cookies = (cookies) ? cookies : parseCookies();
for (key in cookies) {
if (key.toUpperCase().match(name)) {
value = decodeURI(cookies[key]);
if (value.indexOf('%') != -1) value = unescape(value);
break;
}
}
}
return value;
}
function cookiesToString () { 
cookies = (cookies) ? cookies : parseCookies();
var fvString = new String();
if (arguments.length != 0) {
for (var i=0; i < arguments.length; i++) {
cookieName = arguments[i];
fvString += cookieName +'='+ getCookie(cookieName) +';';
}
} else {
for (cookie in cookies) {
fvString += cookie +'='+ cookies[cookie] +';';
}
}
return fvString;
}
function setCookie (name,value,msec,path,domain,secure) {
if (name != null) {
var now = new Date();
var exp_date = new Date(now.getTime()+(msec?msec:0));
var cookie = name+'='+escape(value)+';';
if (msec) cookie += 'expires='+exp_date.toUTCString()+';';
if (path) cookie += 'path='+path+';';
if (domain) cookie += 'domain='+domain+';';
if (secure) cookie += 'secure;';
document.cookie = cookie;
}
}
Dimensions = function (w,h) { 
this.width = w || 0;
this.height = h || 0;
return this;
}
XYCoords = function (x,y) { 
this.x = x || 0;
this.y = y || 0;	
return this;
}
BoxCoords = function (x1,y1,x2,y2) {
this.x1 = x1 || 0;
this.y1 = y1 || 0;
this.x2 = x2 || 0;
this.y2 = y2 || 0;
return this;
}
function getEventCoords (e) {
var coords = new XYCoords();
if (e.pageX && e.pageY) {
coords.x = e.pageX;
coords.y = e.pageY;
} else if (e.clientX && e.clientY) {
coords.x = e.clientX + document.body.scrollLeft;
coords.y = e.clientY + document.body.scrollTop;
}
return coords;
}
function getElementBoxCoords(domElement) {
this.element = domElement;
this.calculated_offset;
this.calcOffsetFrom = function (element,from,reset) {
if (reset != false) this.calculated_offset = 0;
if (element != null)	{
switch (from) {
case 'top': 
this.calculated_offset += element.offsetTop;
break;
case 'left': 
this.calculated_offset += element.offsetLeft;
break;
}
if ((element.offsetParent == document.body) || (element.offsetParent.tagName == ('HTML'||'BODY'))) {				
return this.calculated_offset;
} else {
return this.calcOffsetFrom(element.offsetParent,from,false);
}
}
}
this.w = this.element.offsetWidth;
this.h = this.element.offsetHeight;
var coords = new BoxCoords();
coords.x1 = this.calcOffsetFrom(this.element,'left',true);
coords.y1 = this.calcOffsetFrom(this.element,'top',true);
coords.x2 = coords.x1 + this.w;
coords.y2 = coords.y1 + this.h;
return coords;
}
function getElementBoxCoordsById(elementID) {
var element = document.getElementById(elementID);
if (element != null) {
return getElementBoxCoords(element);
}
}
function getWindowDimensions () {
var width = (window.innerWidth) ? window.innerWidth : document.body.clientWidth;
var height = (window.innerHeight) ? window.innerHeight : document.body.clientHeight;
return new Dimensions(width,height);
}
function getContentDimensions () {
var width = Math.max(document.body.offsetWidth,document.body.scrollWidth);
var height = Math.max(document.body.offsetHeight,document.body.scrollHeight);
return new Dimensions(width,height);
}
function getScrollPosition () {
var scrollPosition = new XYCoords();
if (window.scrollX && window.scrollY) {
scrollPosition.x = window.scrollX;
scrollPosition.y = window.scrollY;
} else {
var docBody = document.body;
var parent_scrollLeft = (docBody.parentNode.scrollLeft) ? docBody.parentNode.scrollLeft : 0;
var parent_scrollTop = (docBody.parentNode.scrollTop) ? docBody.parentNode.scrollTop : 0;
scrollPosition.x = Math.max(docBody.scrollLeft,parent_scrollLeft);
scrollPosition.y = Math.max(docBody.scrollTop,parent_scrollTop);
}
return scrollPosition;
}
function defineEventHandler (element,eventName,handler,capture) {
try {
if (document.addEventListener) {
element.addEventListener(eventName,handler,capture);
} else if (document.attachEvent) {
eventName = 'on'+eventName;
element.attachEvent(eventName,handler);
}
} catch (ex) {
return;
}
}
function removeEventHandler (element,eventName,handler,capture) {
try {
if (document.removeEventListener) {
element.removeEventListener(eventName,handler,capture);
} else if (document.detachEvent) {
element.detachEvent('on'+eventName,handler);
}	
} catch (ex) {
return;
}
}
var onload_queue = new Array();
function execute_onload () {
for (var i=0; i < onload_queue.length; i++) {
onload_queue[i]();
}
}
function registerOnLoadFunc () {
for (var i=0; i < arguments.length; i++) {
if (typeof arguments[i] == 'function') onload_queue[onload_queue.length] = arguments[i];
}
if (document.addEventListener || document.attachEvent) {
var domElement = (window.opera) ? document : window;
removeEventHandler(domElement,'load',execute_onload,false);
defineEventHandler(domElement,'load',execute_onload,false);
} else {
onload = execute_onload;
}
}
var unload_queue = new Array();
function execute_unload () {
for (var i=0; i < unload_queue.length; i++) {
unload_queue[i]();
}
}
function registerUnLoadFunc () {
for (var i=0; i < arguments.length; i++) {
if (typeof arguments[i] == 'function') unload_queue[unload_queue.length] = arguments[i];
}
if (document.addEventListener || document.attachEvent) {
var domElement = (window.opera) ? document : window;
defineEventHandler(domElement,'unload',execute_unload,false);
} else {
onunload = execute_unload;
}
}
BrowserDescription = function () {
this.appN = navigator.appName.toLowerCase();
this.appV = parseInt(navigator.appVersion);
this.ua = navigator.userAgent.toLowerCase();
this.plt = navigator.platform.toLowerCase();
if (this.ua.indexOf('opera/7') != -1 || this.ua.indexOf('opera 7') != -1) {
this.appV = 7;
}
return this;
}
var browser = new BrowserDescription();


/* JS for /Solutions/ tabs, Part 2 */
/*	Copyright (c) ???? Macromedia Inc.
	Dynamic UI Javascript (in development)
	1.4
*/
function collectTagsAtNode(node, tag)
{
return node.getElementsByTagName(tag);
}
function getNodeWithAttrValue(node, attr, value)
{
var rgx = new RegExp('\\b'+value);
try
{
if(node[attr].search(rgx) > -1) return node;
}
catch(err)
{
try
{
if(node.getAttribute(attr).search(rgx) > -1) return node;
}
catch(err)
{
return null;
}
}
return null;
}
function loopNodesAtNodeForNameWithAttrValue(node, name, attr, value)
{
var i, keeper,
result = new Array();
for(i=0;i<node.childNodes.length;i++)
{
if(node.childNodes[i].nodeName==name)
{
keeper = getNodeWithAttrValue(node.childNodes[i], attr, value);
if(keeper) result[result.length] = keeper;
}
}
return result;
}
function loopTagsAtNodeForTagsWithAttrValue(node, tag, attr, value)
{
var i, tags, keeper,
result = new Array();
if(typeof tag=='object' && tag.length)
{
var group = new Array();
for(i=0;i<tag.length;i++)
{
keeper = collectTagsAtNode(node, tag[i]);
if(keeper) group[group.length] = keeper;
}
tags = group;
}
else
{
tags = collectTagsAtNode(node, tag);
}
for(i=0; i<tags.length;i++)
{
keeper=getNodeWithAttrValue(tags[i], attr, value)
if(keeper) result[result.length] = keeper;
}
return result;
}
function loopNodesForAttrValue(nodes, attr, value, request, count)
{
var i, 
keeper, 
result = new Array();
for(i=0;i<nodes.length;i++)
{
keeper = getNodeWithAttrValue(nodes[i], attr, value);
if(keeper) result[result.length] = keeper;
}
return result;
}
function makeLink(elem, href)
{
if(!elem.getAttribute('href')) elem.setAttribute('href', href);
return href;
}
function nixLink(elem)
{
var href = elem.getAttribute('href');
if(href) elem.removeAttribute('href');
return href;
}
function enableJSCSS(str)
{
try
{
if(document.body.className.indexOf(str) == -1)
{
document.body.className=((document.body.className)) ? " "+str : str;
return str;
}
return str
}
catch( err )
{
document.body.className=str;
return str;
}
return err;
}
var dynui = new Object();
dynui['init'] = function()
{
var jscss = enableJSCSS("js");
var i, r, content, reference, tabs, navs;
var referenceNodes = new Array();
var contentNodes = new Array();
tabs = loopTagsAtNodeForTagsWithAttrValue(document, 'DIV', 'className', 'd-tabsection'); 
for(i=0;i<tabs.length;i++)
{
contentNodes[i] = loopNodesAtNodeForNameWithAttrValue(tabs[i], 'DIV', 'className', 'navTarget');
navs = loopNodesAtNodeForNameWithAttrValue(tabs[i], 'UL', 'className', 'nav');
referenceNodes[i] = loopTagsAtNodeForTagsWithAttrValue(navs[0], 'A', 'className', 'navLabel');
for(r=0;r<referenceNodes[i].length;r++) 
{
reference = referenceNodes[i][r];
reference['referto'] = i;
reference['state'] = null;
reference['href_cue'] = null;
reference.onclick = dynui.doTabEvent;
content = contentNodes[i][r];
content['css_cue'] = content.className;
}
}
if(referenceNodes.length > 0)
{
dynui['dtabs'] = new ViewSwitch();
dynui.dtabs.referenceNodes = referenceNodes;
dynui.dtabs.contentNodes = contentNodes;
dynui.dtabs.init(0);
}
var linkaccents = buildAccentReferencesAtNode(document, 'A', 'rel', 'd-accent');
var areaaccents = buildAccentReferencesAtNode(document, 'AREA', 'rel', 'd-accent');	
}
dynui['doTabEvent'] = function(evt)
{
evt = (evt) ? evt : event;
var elem = ( evt.srcElement ) ? evt.srcElement : evt.target;
if(elem.nodeType == 3) { elem = elem.parentNode }
if( elem ) 
{
return (this.state=='on') ? false : dynui.dtabs.doSwitch(elem, elem.referto);
}
}
function buildAccentReferencesAtNode(node, elem, attr, value)
{
	var elemattr;
	var referenceNodes = loopTagsAtNodeForTagsWithAttrValue(node, elem, attr, value);
	for(i=0;i<referenceNodes.length;i++)
	{
		try
		{
			elemattr = referenceNodes[i].getAttribute(attr);
		}
		catch(err)
		{
			try
			{
				elemattr = referenceNodes[i][attr];
			}
			catch(e)
			{
				elemattr = null;
			}
		}
		if(elemattr==null) continue;
		var pos = elemattr.indexOf(value);
		var str = elemattr.substring(pos+value.length+1);
		var arr = str.split(' ');
		for(r=0;r<arr.length;r++)
		{
			arr[r] = document.getElementById(arr[r].substring(1));
		}
		referenceNodes[i]['hovers'] = arr;
		referenceNodes[i].onmouseover = function(evt)
		{
			dAccentEvent(evt);
		}
		referenceNodes[i].onmouseout = function(evt)
		{
			dAccentEvent(evt);
		}
	}
	return referenceNodes;
}
function dAccentEvent(evt)
{
evt = (evt) ? evt : event;
var elem = ( evt.srcElement ) ? evt.srcElement : evt.target;
if(elem.nodeType == 3) { elem = elem.parentNode }
if( elem ) 
{
switch(evt.type)
{
case "mouseover":
state="on";
break;
case "mouseout":
state="";
break;
}
for(var i=0;i<elem.hovers.length;i++)
{
elem.hovers[i].className=state;
}
}
}
ViewSwitch = function()
{
this.referenceNodes;
this.contentNodes;
}
ViewSwitch.prototype.init = function(state)
{
var i, record;
for(record=0;record<this.referenceNodes.length;record++)
{
this.doSwitch(this.referenceNodes[record][state], record);
}
}
ViewSwitch.prototype.init_tab = function( tabindex, tabselect )
{
this.doSwitch(this.referenceNodes[tabindex][tabselect], tabindex);
}
ViewSwitch.prototype.doSwitch = function(requestor, record)
{
	var i, reference, content;
	for(i=0;i<this.referenceNodes[record].length;i++)
	{
		reference = this.referenceNodes[record][i];
		content = this.contentNodes[record][i];
		//alert(requestor + "\n" + reference);
		if(requestor == reference)
		{
			reference.href_cue = nixLink(reference);
			//alert(reference.href_cue);
			reference.state="on";
		}
		else
		{
			if(reference.state=="on") makeLink(reference, reference.href_cue);
			reference.state="off";
		}
		//reference.parentNode.className=reference.state;
		content.className = content.css_cue+((content.css_cue.length > 0) ? " " : "")+reference.state;
	}	
	return false;
}
registerOnLoadFunc( dynui.init );


