// JavaScript Document
addEvent(window, "load", sortables_init);

var SORT_COLUMN_INDEX;

function sortables_init() {
    // Find all tables with class sortable and make them sortable
    if (!document.getElementsByTagName) return;
    tbls = document.getElementsByTagName("table");
    for (ti=0;ti<tbls.length;ti++) {
        thisTbl = tbls[ti];
        if (((' '+thisTbl.className+' ').indexOf("sortable") != -1) && (thisTbl.id)) {
            //initTable(thisTbl.id);
            ts_makeSortable(thisTbl);
        }
    }
}

function ts_makeSortable(table) {
    if (table.rows && table.rows.length > 0) {
        var firstRow = table.rows[0];
    }
    if (!firstRow) return;
    
    // We have a first row: assume it's the header, and make its contents clickable links
    for (var i=0;i<firstRow.cells.length;i++) {
        var cell = firstRow.cells[i];
        var txt = ts_getInnerText(cell);
        cell.innerHTML = '<a href="#" class="sortheader" onclick="ts_resortTable(this);return false;">'+txt+'<span class="sortarrow">&nbsp;&nbsp;&nbsp;</span></a>';
    }
}

function ts_getInnerText(el) {
	if (typeof el == "string") return el;
	if (typeof el == "undefined") { return el };
	if (el.innerText) return el.innerText;	//Not needed but it is faster
	var str = "";
	
	var cs = el.childNodes;
	var l = cs.length;
	for (var i = 0; i < l; i++) {
		switch (cs[i].nodeType) {
			case 1: //ELEMENT_NODE
				str += ts_getInnerText(cs[i]);
				break;
			case 3:	//TEXT_NODE
				str += cs[i].nodeValue;
				break;
		}
	}
	return str;
}

function ts_resortTable(lnk) {
    // get the span
    var span;
    for (var ci=0;ci<lnk.childNodes.length;ci++) {
        if (lnk.childNodes[ci].tagName && lnk.childNodes[ci].tagName.toLowerCase() == 'span') span = lnk.childNodes[ci];
    }
    var spantext = ts_getInnerText(span);
    var td = lnk.parentNode;
    var column = td.cellIndex;
    var table = getParent(td,'TABLE');
    
    // Work out a type for the column
    if (table.rows.length <= 1) return;
    var itm = ts_getInnerText(table.rows[1].cells[column]);
    sortfn = ts_sort_caseinsensitive;
    if (itm.match(/^\d\d[\/-]\d\d[\/-]\d\d\d\d$/)) sortfn = ts_sort_date;
    if (itm.match(/^\d\d[\/-]\d\d[\/-]\d\d$/)) sortfn = ts_sort_date;
    if (itm.match(/^[£$]/)) sortfn = ts_sort_currency;
    if (itm.match(/^[\d\.]+$/)) sortfn = ts_sort_numeric;
    SORT_COLUMN_INDEX = column;
    var firstRow = new Array();
    var newRows = new Array();
    for (i=0;i<table.rows[0].length;i++) { firstRow[i] = table.rows[0][i]; }
    for (j=1;j<table.rows.length;j++) { newRows[j-1] = table.rows[j]; }

    newRows.sort(sortfn);

    if (span.getAttribute("sortdir") == 'down') {
        ARROW = '&nbsp;&nbsp;&uarr;';
        newRows.reverse();
        span.setAttribute('sortdir','up');
    } else {
        ARROW = '&nbsp;&nbsp;&darr;';
        span.setAttribute('sortdir','down');
    }
    
    // We appendChild rows that already exist to the tbody, so it moves them rather than creating new ones
    // don't do sortbottom rows
    for (i=0;i<newRows.length;i++) { if (!newRows[i].className || (newRows[i].className && (newRows[i].className.indexOf('sortbottom') == -1))) table.tBodies[0].appendChild(newRows[i]);}
    // do sortbottom rows only
    for (i=0;i<newRows.length;i++) { if (newRows[i].className && (newRows[i].className.indexOf('sortbottom') != -1)) table.tBodies[0].appendChild(newRows[i]);}
    
    // Delete any other arrows there may be showing
    var allspans = document.getElementsByTagName("span");
    for (var ci=0;ci<allspans.length;ci++) {
        if (allspans[ci].className == 'sortarrow') {
            if (getParent(allspans[ci],"table") == getParent(lnk,"table")) { // in the same table as us?
                allspans[ci].innerHTML = '&nbsp;&nbsp;&nbsp;';
            }
        }
    }
        
    span.innerHTML = ARROW;
}

function getParent(el, pTagName) {
	if (el == null) return null;
	else if (el.nodeType == 1 && el.tagName.toLowerCase() == pTagName.toLowerCase())	// Gecko bug, supposed to be uppercase
		return el;
	else
		return getParent(el.parentNode, pTagName);
}
function ts_sort_date(a,b) {
    // y2k notes: two digit years less than 50 are treated as 20XX, greater than 50 are treated as 19XX
    aa = ts_getInnerText(a.cells[SORT_COLUMN_INDEX]);
    bb = ts_getInnerText(b.cells[SORT_COLUMN_INDEX]);
    if (aa.length == 10) {
        dt1 = aa.substr(6,4)+aa.substr(3,2)+aa.substr(0,2);
    } else {
        yr = aa.substr(6,2);
        if (parseInt(yr) < 50) { yr = '20'+yr; } else { yr = '19'+yr; }
        dt1 = yr+aa.substr(3,2)+aa.substr(0,2);
    }
    if (bb.length == 10) {
        dt2 = bb.substr(6,4)+bb.substr(3,2)+bb.substr(0,2);
    } else {
        yr = bb.substr(6,2);
        if (parseInt(yr) < 50) { yr = '20'+yr; } else { yr = '19'+yr; }
        dt2 = yr+bb.substr(3,2)+bb.substr(0,2);
    }
    if (dt1==dt2) return 0;
    if (dt1<dt2) return -1;
    return 1;
}

function ts_sort_currency(a,b) { 
    aa = ts_getInnerText(a.cells[SORT_COLUMN_INDEX]).replace(/[^0-9.]/g,'');
    bb = ts_getInnerText(b.cells[SORT_COLUMN_INDEX]).replace(/[^0-9.]/g,'');
    return parseFloat(aa) - parseFloat(bb);
}

function ts_sort_numeric(a,b) { 
    aa = parseFloat(ts_getInnerText(a.cells[SORT_COLUMN_INDEX]));
    if (isNaN(aa)) aa = 0;
    bb = parseFloat(ts_getInnerText(b.cells[SORT_COLUMN_INDEX])); 
    if (isNaN(bb)) bb = 0;
    return aa-bb;
}

function ts_sort_caseinsensitive(a,b) {
    aa = ts_getInnerText(a.cells[SORT_COLUMN_INDEX]).toLowerCase();
    bb = ts_getInnerText(b.cells[SORT_COLUMN_INDEX]).toLowerCase();
    if (aa==bb) return 0;
    if (aa<bb) return -1;
    return 1;
}

function ts_sort_default(a,b) {
    aa = ts_getInnerText(a.cells[SORT_COLUMN_INDEX]);
    bb = ts_getInnerText(b.cells[SORT_COLUMN_INDEX]);
    if (aa==bb) return 0;
    if (aa<bb) return -1;
    return 1;
}


function addEvent(elm, evType, fn, useCapture)
// addEvent and removeEvent
// cross-browser event handling for IE5+,  NS6 and Mozilla
// By Scott Andrew
{
  if (elm.addEventListener){
    elm.addEventListener(evType, fn, useCapture);
    return true;
  } else if (elm.attachEvent){
    var r = elm.attachEvent("on"+evType, fn);
    return r;
  } else {
    alert("Handler could not be removed");
  }
} 




<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  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);
// -->
<!--
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_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_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];}
}

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_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
//-->





<!--
<!--
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
var day="";
var month="";
var ampm="";
var ampmhour="";
var myweekday="";
var year="";
mydate = new Date();
myday = mydate.getDay();
mymonth = mydate.getMonth();
myweekday= mydate.getDate();
weekday= myweekday;
myyear= mydate.getFullYear();
myhours = mydate.getHours();
ampmhour  =  (myhours > 12) ? myhours - 12 : myhours;
if (ampmhour == "0") ampmhour = 12;
ampm =  (myhours >= 12) ? ' PM' : ' AM';
mytime = mydate.getMinutes();
myminutes =  ((mytime < 10) ? ':0' : ':') + mytime;
year = (myyear > 01) ? myyear : 2000 + myyear;
if(myday == 0)
day = " Sunday, ";
else if(myday == 1)
day = " Monday, ";
else if(myday == 2)
day = " Tuesday, ";
else if(myday == 3)
day = " Wednesday, ";
else if(myday == 4)
day = " Thursday, ";
else if(myday == 5)
day = " Friday, ";
else if(myday == 6)
day = " Saturday, ";
if(mymonth == 0) {
month = "January ";}
else if(mymonth ==1)
month = "February ";
else if(mymonth ==2)
month = "March ";
else if(mymonth ==3)
month = "April ";
else if(mymonth ==4)
month = "May ";
else if(mymonth ==5)
month = "June ";
else if(mymonth ==6)
month = "July ";
else if(mymonth ==7)
month = "August ";
else if(mymonth ==8)
month = "September ";
else if(mymonth ==9)
month = "October ";
else if(mymonth ==10)
month = "November ";
else if(mymonth ==11)
month = "December ";

// End -->

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 flvFPW1(){//v1.44
// Copyright 2002-2004, Marja Ribbers-de Vroed, FlevOOware (www.flevooware.nl/dreamweaver/)
var v1=arguments,v2=v1[2].split(","),v3=(v1.length>3)?v1[3]:false,v4=(v1.length>4)?parseInt(v1[4]):0,v5=(v1.length>5)?parseInt(v1[5]):0,v6,v7=0,v8,v9,v10,v11,v12,v13,v14,v15,v16;v11=new Array("width,left,"+v4,"height,top,"+v5);for (i=0;i<v11.length;i++){v12=v11[i].split(",");l_iTarget=parseInt(v12[2]);if (l_iTarget>1||v1[2].indexOf("%")>-1){v13=eval("screen."+v12[0]);for (v6=0;v6<v2.length;v6++){v10=v2[v6].split("=");if (v10[0]==v12[0]){v14=parseInt(v10[1]);if (v10[1].indexOf("%")>-1){v14=(v14/100)*v13;v2[v6]=v12[0]+"="+v14;}}if (v10[0]==v12[1]){v16=parseInt(v10[1]);v15=v6;}}if (l_iTarget==2){v7=(v13-v14)/2;v15=v2.length;}else if (l_iTarget==3){v7=v13-v14-v16;}v2[v15]=v12[1]+"="+v7;}}v8=v2.join(",");v9=window.open(v1[0],v1[1],v8);if (v3){v9.focus();}document.MM_returnValue=false;return v9;}
//-->

<!-- Original:  Eric King (eric_andrew_king&#064;&#104;&#111;&#116;&#109;&#097;&#105;&#108;&#046;&#099;&#111;&#109;) -->
<!-- Website:  http://redrival.com/eak/ -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
//  End -->

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//  End -->


/* 
  ------------------------------------------------
  PopMenu Magic menu scripts
  Copyright (c) 2004-2005 Project Seven Development
  www.projectseven.com
  Version: 1.0
  ------------------------------------------------
*/
function P7_setPM(){ //v1.0 by PVII-www.projectseven.com
 var i,d='',h="<sty"+"le type=\"text/css\">",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<20;i++){d+='ul ';h+="\n#p7PMnav "+d+"{position:absolute;left:-9000px;}";}
 document.write(h+"\n<"+"/sty"+"le>");}}P7_setPM();
function P7_initPM(){ //v1.0 by PVII-www.projectseven.com
 var i,g,tD,tA,tU,pp,lvl,tn=navigator.userAgent.toLowerCase();if(window.opera){
 if(tn.indexOf("opera 5")>-1||tn.indexOf("opera 6")>-1){return;}}else if(!document.getElementById){return;}
 p7PMp=arguments;p7PMct=new Array;tD=document.getElementById('p7PMnav');if(tD){tA=tD.getElementsByTagName('A');
 for(i=0;i<tA.length;i++){tA[i].p7PMcl=p7PMct.length;p7PMct[p7PMct.length]=tA[i];g=tA[i].parentNode.getElementsByTagName("UL");
 tA[i].p7PMsub=(g)?g[0]:false;ev=tA[i].getAttribute("onmouseover");if(!ev||ev=='undefined'){tA[i].onmouseover=function(){
 P7_PMtrig(this);};}ev=tA[i].getAttribute("onfocus");if(!ev||ev=='undefined'){tA[i].onfocus=function(){P7_PMtrig(this);};}
 if(tA[i].p7PMsub){pp=tA[i].parentNode;lvl=0;while(pp){if(pp.tagName&&pp.tagName=="UL"){lvl++;}pp=pp.parentNode;}
 tA[i].p7PMlv=lvl;}}tD.onmouseout=P7_PMclose;P7_PMopen();}
}
function P7_PMtrig(a){ //v1.0 by PVII-www.projectseven.com
 var b,t;if(document.p7PMt){clearTimeout(document.p7PMt);}document.p7PMa=1;b=(a.p7PMsub)?'P7_PMshow(':'P7_PMtg(';
 t='document.p7PMt=setTimeout("'+b+a.p7PMcl+')",160)';eval (t);
}
function P7_PMshow(a,bp){ //v1.0 by PVII-www.projectseven.com
 var u,lv,oft,ofr,uw,uh,pp,aw,ah,adj,mR,mT,wW=0,wH,w1,w2,w3,sct,pw,lc,pwv,xx=0,yy=0,wP=true;
 var iem=(navigator.appVersion.indexOf("MSIE 5")>-1)?true:false,dce=document.documentElement,dby=document.body;document.p7PMa=1;
 if(!bp){P7_PMtg(a);}u=p7PMct[a].p7PMsub;if(u.p7pmax&&u.p7pmax==1){return;}u.p7pmax=1;lv=(p7PMp[0]==1&&p7PMct[a].p7PMlv==1)?true:false;
 p7PMct[a].className=p7PMct[a].className.replace("p7PMtrg","p7PMon");oft=parseInt(p7PMp[3]);ofr=parseInt(p7PMp[4]);
 uw=u.offsetWidth;uh=u.offsetHeight;pp=p7PMct[a];aw=pp.offsetWidth;ah=pp.offsetHeight;while(pp){xx+=(pp.offsetLeft)?pp.offsetLeft:0;
 yy+=(pp.offsetTop)?pp.offsetTop:0;if(window.opera||navigator.userAgent.indexOf("Safari")>-1){
 if(p7PMct[a].p7PMlv!=1&&pp.nodeName=="BODY"){yy-=(pp.offsetTop)?pp.offsetTop:0;}}pp=pp.offsetParent;}
 if(iem&&navigator.userAgent.indexOf("Mac")>-1){yy+=parseInt(dby.currentStyle.marginTop);}adj=parseInt((aw*ofr)/100);mR=(lv)?0:aw-adj;
 adj=parseInt((ah*oft)/100);mT=(lv)?0:(ah-adj)*-1;w3=dby.parentNode.scrollLeft;if(!w3){w3=dby.scrollLeft;}w3=(w3)?w3:0;
 if(dce&&dce.clientWidth){wW=dce.clientWidth+w3;}else if(dby){wW=dby.clientWidth+w3;}if(!wW){wW=0;wP=false;}wH=window.innerHeight;
 if(!wH){wH=dce.clientHeight;if(!wH||wH<=0){wH=dby.clientHeight;}}sct=dby.parentNode.scrollTop;if(!sct){sct=dby.scrollTop;if(!sct){
 sct=window.scrollY?window.scrollY:0;}}pw=xx+mR+uw;if(pw>wW&&wP){mR=uw*-1;mR+=10;if(lv){mR=(wW-xx)-uw;}}lc=xx+mR;if(lc<0){mR=xx*-1;}
 pw=yy+uh+ah+mT-sct;pwv=wH-pw;if(pwv<0){mT+=pwv;}u.style.marginLeft=mR+'px';u.style.marginTop=mT+'px';
 if(p7PMp[2]==1){if(!iem){P7_PManim(a,20);}}u.className="p7PMshow";
}
function P7_PMhide(u){ //v1.0 by PVII-www.projectseven.com
 var i,tt,ua;u.p7pmax=0;u.className="p7PMhide";ua=u.parentNode.firstChild;ua.className=ua.className.replace("p7PMon","p7PMtrg");
}
function P7_PMtg(a,b){ //v532 alpha by PVII-www.projectseven.com
 var i,u,tA,tU,pp;tA=p7PMct[a];pp=tA.parentNode;while(pp){if(pp.tagName=="UL"){break;}pp=pp.parentNode;}if(pp){
 tU=pp.getElementsByTagName("UL");for(i=tU.length-1;i>-1;i--){if(b!=1&&tA.p7PMsub==tU[i]){continue;}else{P7_PMhide(tU[i]);}}}
}
function P7_PMclose(evt){ //v1.0 by PVII-www.projectseven.com
 var pp,st,tS,m=true;evt=(evt)?evt:((event)?event:null);st=document.p7PMa;if(st!=-1){if(evt){
 tS=(evt.relatedTarget)?evt.relatedTarget:evt.toElement;if(tS){pp=tS.parentNode;while(pp){if(pp&&pp.id&&pp.id=="p7PMnav"){m=false;
 document.p7PMa=1;break;}pp=pp.parentNode;}}if(m){document.p7PMa=-1;if(document.p7PMt){clearTimeout(document.p7PMt);}
 document.p7PMt=setTimeout("P7_PMclr()",360);}}}
}
function P7_PMclr(){ //v1.0 by PVII-www.projectseven.com
 var i,tU,tUU;document.p7PMa=-1;tU=document.getElementById('p7PMnav');if(tU){tUU=tU.getElementsByTagName("UL");if(tUU){
 for(i=tUU.length-1;i>-1;i--){P7_PMhide(tUU[i]);}}}
}
function P7_PManim(a,st){ //v1.0 by PVII-www.projectseven.com
 var g=p7PMct[a].p7PMsub,sp=30,inc=20;st=(st>=100)?100:st;g.style.fontSize=st+"%";if(st<100){st+=inc;setTimeout("P7_PManim("+a+","+st+")",sp);}
}
function P7_PMmark(){document.p7PMop=arguments;}
function P7_PMopen(){ //v1.0 by PVII-www.projectseven.com
 var i,x,tA,op,pp,wH,tA,aU,r1,k=-1,kk=-1,mt=new Array(1,'','');if(document.p7PMop){mt=document.p7PMop;}op=mt[0];if(op<1){return;}
 tA=document.getElementById('p7PMnav').getElementsByTagName("A");wH=window.location.href;r1=/index\.[\S]*/i;for(i=0;i<tA.length;i++){
 if(tA[i].href){aU=tA[i].href.replace(r1,'');if(op>0){if(tA[i].href==wH||aU==wH){k=i;kk=-1;break;}}if(op==2){if(tA[i].firstChild){
 if(tA[i].firstChild.nodeValue==mt[1]){kk=i;}}}if(op==3 && tA[i].href.indexOf(mt[1])>-1){kk=i;}if(op==4){for(x=1;x<mt.length;x+=2){
 if(wH.indexOf(mt[x])>-1){if(tA[i].firstChild&&tA[i].firstChild.data){if(tA[i].firstChild.data==mt[x+1]){kk=i;break;}}}}}}}k=(kk>k)?kk:k;
 if(k>-1){pp=tA[k].parentNode;while(pp){if(pp.nodeName=="LI"){pp.firstChild.className="p7PMmark"+" "+pp.firstChild.className;}
 pp=pp.parentNode;}}if(kk>-1){document.p7PMad=1;}P7_PMadma();P7_PMadmb();
}
function P7_PMadma(){ //v1.0 by PVII-www.projectseven.com
 var s,ss,i,j,a,g,b,c,d,t,h,tA,b,tP,r1,r2,tI,bA,aA,tB=new Array(),bC='',x=0,ur=1,mt=document.p7PMad;g=document.getElementById("p7PMnav");
 b=document.getElementById("pmmcrumb");if(g&&b){c=b.getElementsByTagName("A");if(c&&c[0]){tP=c[0].parentNode.childNodes;r1=/<a/i;r2=/\/a>/i;
 tI=c[0].parentNode.innerHTML;j=tI.search(r1);bA=tI.substring(0,j);j=tI.search(r2);aA=tI.substring(j+3);bC+=(bA)?bA:'';s=(aA)?aA:' &gt ';
 if(!c[0].id||c[0].id!="pmmcn"){if(c[0].href!=window.location.href){tB[0]=c[0];x++;ur=2;}}tA=g.getElementsByTagName("A");for(i=0;i<tA.length;i++){
 if(tA[i].className.indexOf("p7PMmark")>-1){tB[x]=tA[i];x++;}}for(i=0;i<tB.length;i++){ss=(i>0)?s:'';a=(i==tB.length-1)?0:1;
 d=(i==0&&c[0].id)?'id="'+c[0].id+'" ':' ';t=tB[i].firstChild.nodeValue;if(a==1||mt==1||x<ur){bC+=ss+'<a '+d+'hr'+'ef="'+tB[i].href+'">'+t+'</a>';
 }else{bC+=ss+t;}}if(mt==1||i<ur){ss=(i>0)?s:'';bC+=ss+document.title;}c[0].parentNode.innerHTML=bC;}}
}
function P7_PMadmb(){ //v1.0 by PVII-www.projectseven.com
 var h='',g,i,tA,b,m=false;g=document.getElementById("p7PMnav");b=document.getElementById("pmmnext");if(g&&b){tA=g.getElementsByTagName("A");
 for(i=tA.length-1;i>-1;i--){if(tA[i].className.indexOf("p7PMmark")>-1){m=true;break;}}if(m){if(i<tA.length-1){i++;}else{i=0;}
 while(tA[i].href==window.location.href+"#"||tA[i].href=="javascript:;"){i++;if(i>tA.length-1){
 i=0;break;}}b.href=tA[i].href;b.innerHTML=tA[i].firstChild.nodeValue;}}	
}




/* 
  ------------------------------------------------
  Tree Menu menu scripts
  Copyright (c) 2004-2005 Project Seven Development
  www.projectseven.com
  Version: 1.0
  ------------------------------------------------
*/
function P7_TMenu(b,og) { //v2.5 by Project Seven Development(PVII)
 var i,s,c,k,j,tN,hh;if(document.getElementById){
 if(b.parentNode && b.parentNode.childNodes){tN=b.parentNode.childNodes;}else{return;}
 for(i=0;i<tN.length;i++){if(tN[i].tagName=="DIV"){s=tN[i].style.display;
 hh=(s=="block")?"none":"block";if(og==1){hh="block";}tN[i].style.display=hh;}}
 c=b.firstChild;if(c.data){k=c.data;j=k.charAt(0);if(j=='+'){k='-'+k.substring(1,k.length);
 }else if(j=='-'){k='+'+k.substring(1,k.length);}c.data=k;}if(b.className=='p7plusmark'){
 b.className='p7minusmark';}else if(b.className=='p7minusmark'){b.className='p7plusmark';}}
}

function P7_setTMenu(){ //v2.5 by Project Seven Development(PVII)
 var i,d='',h='<style type=\"text/css\">';if(document.getElementById){
 var tA=navigator.userAgent.toLowerCase();if(window.opera){
 if(tA.indexOf("opera 5")>-1 || tA.indexOf("opera 6")>-1){return;}}
 for(i=1;i<20;i++){d+='div ';h+="\n#p7TMnav div "+d+"{display:none;}";}
 document.write(h+"\n</style>");}
}
P7_setTMenu();

function P7_TMopen(){ //v2.5 by Project Seven Development(PVII)
 var i,x,d,hr,ha,ef,a,ag;if(document.getElementById){d=document.getElementById('p7TMnav');
 if(d){hr=window.location.href;ha=d.getElementsByTagName("A");if(ha&&ha.length){
 for(i=0;i<ha.length;i++){if(ha[i].href){if(hr.indexOf(ha[i].href)>-1){
 ha[i].className="p7currentmark";a=ha[i].parentNode.parentNode;while(a){
 if(a.firstChild && a.firstChild.tagName=="A"){if(a.firstChild.onclick){
 ag=a.firstChild.onclick.toString();if(ag&&ag.indexOf("P7_TMenu")>-1){
 P7_TMenu(a.firstChild,1);}}}a=a.parentNode;}}}}}}}
}

function P7_TMall(a){ //v2.5 by Project Seven Development(PVII)
 var i,x,ha,s,tN;if(document.getElementById){ha=document.getElementsByTagName("A");
 for(i=0;i<ha.length;i++){if(ha[i].onclick){ag=ha[i].onclick.toString();
 if(ag&&ag.indexOf("P7_TMenu")>-1){if(ha[i].parentNode && ha[i].parentNode.childNodes){
 tN=ha[i].parentNode.childNodes;}else{break;}for(x=0;x<tN.length;x++){
 if(tN[x].tagName=="DIV"){s=tN[x].style.display;if(a==0&&s!='block'){P7_TMenu(ha[i]);
 }else if(a==1&&s=='block'){P7_TMenu(ha[i]);}break;}}}}}}
}

function P7_TMclass(){ //v2.5 by Project Seven Development(PVII)
 var i,x,d,tN,ag;if(document.getElementById){d=document.getElementById('p7TMnav');
 if(d){tN=d.getElementsByTagName("A");if(tN&&tN.length){for(i=0;i<tN.length;i++){
 ag=(tN[i].onclick)?tN[i].onclick.toString():false;if(ag&&ag.indexOf("P7_TMenu")>-1){
 tN[i].className='p7plusmark';}else{tN[i].className='p7defmark';}}}}}
}


// These functions control the tabbed frame tab actions
function synchTab(frameName) {

  var elList, i;

  // Exit if no frame name was given.

  if (frameName == null)
    return;

  // Check all links.

  elList = document.getElementsByTagName("A");
  for (i = 0; i < elList.length; i++)

    // Check if the link's target matches the frame being loaded.

    if (elList[i].target == frameName) {

      // If the link's URL matches the page being loaded, activate it.
      // Otherwise, make sure the tab is deactivated.

      if (elList[i].href == window.frames[frameName].location.href) {
        elList[i].className += " activeTab";
        elList[i].blur();
      }
      else
        removeName(elList[i], "activeTab");
    }
}
function removeName(el, name) {

  var i, curList, newList;

  // Remove the given class name from the element's className property.

  newList = new Array();
  curList = el.className.split(" ");
  for (i = 0; i < curList.length; i++)
    if (curList[i] != name)
      newList.push(curList[i]);
  el.className = newList.join(" ");
}





// This function controls swapping out images for a thumbnail for animated sequence
<!-- Begin

$(function() {
    /*Form Field Value Swap */
    swapValues = [];
    $(".swap_value").each(function(i){
        swapValues[i] = $(this).val();
        $(this).focus(function(){
            if ($(this).val() == swapValues[i]) {
                $(this).val("");
            }
        }).blur(function(){
            if ($.trim($(this).val()) == "") {
                $(this).val(swapValues[i]);
            }
        });
    });
	
		$('#examples').cycle({
			fx:     'fade',
			timeout: 6000,
			delay:  -2000,
			cleartype:  1
		});	
	
 }); 

// End -->


/* 

  ================================================
  PVII TabPanel scripts
  Copyright (c) 2006 Project Seven Development
  www.projectseven.com
  Version: 1.0.8
  ================================================
  
*/

var p7tpa=new Array();
var isIE5=(navigator.appVersion.indexOf("MSIE 5")>-1);
function P7_setTP(){ //v1.0.8 by PVII-www.projectseven.com
 var i,h="<sty"+"le type=\"text/css\">\n";h+=".p7TP_tabs{display: block;}.p7TPcontent div{display:none;}\n";
 h+=".p7TPcontent div div{display:block;}\n";if(document.getElementById){for(i=1;i<11;i++){
 h+="#p7tpc"+i+"_1 {display:block;}\n";}h+="\n<"+"/sty"+"le>";document.write(h);}
}
P7_setTP();
function P7_initTP(){ //v1.0.8 by PVII-www.projectseven.com
 var i,j,tb,tD,tP,tA,pb="p7TP";if(!document.getElementById){return;};p7tpa=arguments;
 for(i=1;i<11;i++){tb=pb+i;tP=document.getElementById(tb);if(tP){tD=tP.getElementsByTagName("DIV");
 if(tD){for(j=0;j<tD.length;j++){if(tD[j].id&&tD[j].id.indexOf("p7tpb")==0){
 tA=tD[j].getElementsByTagName("A");if(tA[0]){tA[0].p7tpn=new Array(i,tD[j].id);
 tA[0].onclick=function(){return P7_TPtrig(this);};}}}}}}
}
function P7_TPtrig(a){ //v1.0.8 by PVII-www.projectseven.com
 var i,tD,tA,tC,c,d,sb,an=p7tpa[1],wP,h,cP,ch,hD,hh;if(typeof(a)!='object'){c=a.replace("p7tpc","p7tpb");
 d=document.getElementById(c);if(d){a=d.getElementsByTagName("A")[0];}}if(a.p7tpn){
 tD=document.getElementById(a.p7tpn[1]);if(tD){tA=tD.parentNode.getElementsByTagName("A");
 if(an==29&&!isIE5){wP=P7_getCD(a);h=P7_getPH(wP);cP=getTPc(a);ch=P7_getPH(cP);hD=h-ch;
 if(window.opera){P7_setPW(wP);}wP.style.height=h+"px";wP.style.overflow="hidden";}
 for(i=0;i<tA.length;i++){if(tA[i].p7tpn){sb=tA[i].p7tpn[1].replace("p7tpb","p7tpc");
 tC=document.getElementById(sb);if(tA[i]==a){tA[i].className="down";
 document.getElementById(tA[i].p7tpn[1]).className="down";if(tC){if(an>0&&an!=29){
 tC.style.visibility="hidden";tC.style.display="block";setTimeout("P7_TPanim('"+tC.id+"')",100);}
 else{tC.style.display="block";}if(an==29&&!isIE5){hh=P7_getPH(tC);P7_TPglide(tC.id,h,hh+hD);}}}
 else{tA[i].className='';document.getElementById(tA[i].p7tpn[1]).className='';if(tC){
 tC.style.display="none";}}}}}}if(typeof(P7_colH2)=='function'){P7_colH2();}
 if(typeof(P7_colH)=='function'){P7_colH();}return false;
}
function P7_TPanim(iD){ //v1.0.8 by PVII-www.projectseven.com
 var i,f,tC,g=new Array(),an=p7tpa[1],ob=document.getElementById(iD);tC=ob.parentNode;
 if(!tC.filters){ob.style.opacity="0.10";ob.style.visibility='visible';
 P7_TPfadeIn(ob.id,0.00);return;}f='progid:DXImageTransform.Microsoft.';d=' Duration=1';
g[0]='Fade';
g[1]='Fade';
g[2]='Wipe(GradientSize=0.5, wipeStyle=0, motion="forward"'+d+')';
g[3]='Pixelate(MaxSquare=50,Duration=1,Enabled=false'+d+')';
g[4]='RandomDissolve('+d+')';
g[5]='Iris(irisstyle="SQUARE", motion="in"'+d+')';
g[6]='Iris(irisstyle="SQUARE", motion="out"'+d+')';
g[7]='Iris(irisstyle="CIRCLE", motion="in"'+d+')';
g[8]='Iris(irisstyle="CIRCLE", motion="out"'+d+')';
g[9]='Blinds(direction="up", bands=1'+d+')';
g[10]='Blinds(direction="down", bands=1'+d+')';
g[11]='Blinds(direction="right", bands=1'+d+')';
g[12]='Blinds(direction="left", bands=1'+d+')';
g[13]='Barn(orientation="vertical", motion="in"'+d+')';
g[14]='Barn(orientation="vertical", motion="out"'+d+')';
g[15]='Barn(orientation="horizontal", motion="in"'+d+')'
g[16]='Barn(orientation="horizontal", motion="out"'+d+')'
g[17]='Strips(motion="leftdown"'+d+')';
g[18]='Strips(motion="leftup"'+d+')';
g[19]='Strips(motion="rightdown"'+d+')';
g[20]='Strips(motion="rightup"'+d+')';
g[21]='RadialWipe(wipeStyle="clock"'+d+')';
g[22]='RadialWipe(wipeStyle="wedge"'+d+')';
g[23]='RadialWipe(wipeStyle="radial"'+d+')';
g[24]='Slide(slideStyle="PUSH", bands=1'+d+')';
g[25]='Slide(slideStyle="SWAP", bands=5'+d+')';
g[26]='Slide(slideStyle="HIDE", bands=1'+d+')';
g[27]='Wheel(spokes=4'+d+')';
g[28]='Wheel(spokes=16'+d+')';
 an=(an>g.length)?3:an;f+=g[an];tC.style.filter=f;if(tC.filters.length<1){
 p7tpa[1]=0;ob.style.visibility='visible';return;}tC.filters[0].Apply();
 ob.style.visibility='visible';tC.filters[0].Play();
}
function P7_TPfadeIn(id,op){ //v1.0.8 by PVII-www.projectseven.com
 var d=document.getElementById(id);op+=.05;op=(op>=1)?1:op;d.style.opacity=op;
 if(op<1){setTimeout("P7_TPfadeIn('"+id+"',"+op+")",60);}
}
function P7_getPH(d){ //v1.0.8 by PVII-www.projectseven.com
 var h,nh,dh,oh;d.style.height="auto";oh=d.offsetHeight;d.style.height=oh+"px";
 nh=d.offsetHeight;if(oh!=nh){nh=(oh-(nh-oh));}d.style.height="auto";return nh;
}
function P7_setPW(d){ //v1.0.8 by PVII-www.projectseven.com
 var w,nw,dw,ow;d.style.width="auto";ow=d.offsetWidth;d.style.width=ow+"px";
 nw=d.offsetWidth;if(ow!=nw){nw=(ow-(nw-ow));}d.style.width=nw+"px";
}
function P7_getCD(a){ //v1.0.8 by PVII-www.projectseven.com
 var g,tP=a.p7tpn[1].replace("p7tpb","p7tpc");g=document.getElementById(tP);return g.parentNode;
}
function getTPc(a){ //v1.0.8 by PVII-www.projectseven.com
 var i,tA,cD,tC=null;tA=a.parentNode.parentNode.getElementsByTagName("A");
 for(i=0;i<tA.length;i++){if(tA[i].className && tA[i].className=="down"){
 cD=tA[i].p7tpn[1].replace("p7tpb","p7tpc");tC=document.getElementById(cD);break;}}
 return tC;
}
function P7_TPglide(pn,ch,th){ //v1.0.8 by PVII-www.projectseven.com
 var tt,inc,dy=10,w,m;w=document.getElementById(pn).parentNode;m=(ch<=th)?0:1;
 tt=Math.abs(parseInt(Math.abs(th)-Math.abs(ch)));inc=(tt*.15<1)?1:tt*.15;
 inc=(m==1)?inc*-1:inc;w.style.height=ch+"px";
 if(ch==th){w.style.height="auto";w.style.overflow="visible";}else{ch+=inc;
 if(m==0){ch=(ch>=th)?th:ch;}else{ch=(ch<=th)?th:ch;}if(w.p7tpG){clearTimeout(w.p7tpG);}
 w.p7tpG=setTimeout("P7_TPglide('"+pn+"',"+ch+","+th+")",dy);}
}



/* 

  ================================================
  PVII Accordian Panel Magic 2 scripts
  Copyright (c) 2007-2009 Project Seven Development
  www.projectseven.com
  Version: 2.1.7 -build 53
  ================================================
  
*/

// define the image swap file naming convention

// rollover image for any image in the normal state
var p7APMover='_over';

// image for any trigger that has an open sub menu -no rollover
var p7APMopen='_down';

// image to be used for current marker -no roll over
var p7APMmark='_overdown';

var p7APMi=false,p7APMa=false,p7APMctl=[];
function P7_APMset(){
	var i,h,sh,hd,x,v;
	if(!document.getElementById){
		return;
	}
	sh='.p7APMcwrapper {height:0px;overflow:hidden;}\n';
	if(document.styleSheets){
		h='\n<st' + 'yle type="text/css">\n'+sh+'\n</s' + 'tyle>';
		document.write(h);
	}
	else{
		h=document.createElement('style');
		h.type='text/css';
		h.appendChild(document.createTextNode(sh));
		hd=document.getElementsByTagName('head');
		hd[0].appendChild(h);
	}
}
P7_APMset();
function P7_APMaddLoad(){
	if(!document.getElementById){
		return;
	}
	if(window.addEventListener){
		document.addEventListener("DOMContentLoaded", P7_initAPM, false);
		window.addEventListener("load",P7_initAPM,false);
		window.addEventListener("unload",P7_APMff,false);
	}
	else if(document.addEventListener){
		document.addEventListener("load",P7_initAPM,false);
	}
	else if(window.attachEvent){
		document.write("<script id=p7ie_apm defer src=\"//:\"><\/script>");
		document.getElementById("p7ie_apm").onreadystatechange=function(){
			if (this.readyState=="complete"){
				if(p7APMctl.length>0){
					P7_initAPM();
				}
			}
		};
		window.attachEvent("onload",P7_initAPM);
	}
	else if(typeof window.onload=='function'){
		var p7vloadit=onload;
		window.onload=function(){
			p7vloadit();
			P7_initAPM();
		};
	}
	else{
		window.onload=P7_initAPM;
	}
}
P7_APMaddLoad();
function P7_APMff(){
	return;
}
function P7_opAPM(){
	if(!document.getElementById){
		return;
	}
	p7APMctl[p7APMctl.length]=arguments;
}
function P7_initAPM(){
	var i,j,cn,tB,tA,tC,iM,sr,x,fnA,fnB,swp,s1,s2,s3;
	if(p7APMi){
		return;
	}
	p7APMi=true;
	document.p7APMpreload=[];
	for(i=0;i<p7APMctl.length;i++){
		tB=document.getElementById('p7APM_'+p7APMctl[i][0]);
		if(tB){
			tB.p7opt=p7APMctl[i];
			if(navigator.appVersion.indexOf("MSIE 5")>-1){
				tB.p7opt[2]=0;
			}
			tB.p7APMcont=new Array();
			tB.p7APMtrig=new Array();
			tB.p7APMmv=false;
			tA=tB.getElementsByTagName('A');
			cn=-1;
			for(j=0;j<tA.length;j++){
				if(tA[j].id&&tA[j].id.indexOf('p7APMt')===0){
					tB.p7APMtrig[tB.p7APMtrig.length]=tA[j];
					tA[j].p7state='closed';
					tA[j].p7APMpr=tB.id;
					tA[j].p7APMct=false;
					tC=document.getElementById(tA[j].id.replace('t','w'));
					tB.p7APMcont[tB.p7APMcont.length]=(tC)?tC:null;
					if(cn==-1){
						P7_APMsetClass(tA[j],'apmfirst');
						P7_APMsetClass(tA[j].parentNode,'apmfirst');
					}
					cn=j;
					if(tC){
						tC.p7state='closed';
						tC.p7APMtrg=tA[j].id;
						tA[j].p7APMct=tC.id;
						if(tB.p7opt[2]==1||tB.p7opt[2]==2){
							tC.style.height='0px';
							tC.p7APMtarget=0;
							tC.p7APMrate=10;
							tC.p7ch=0;
						}
						else{
							tC.style.display='none';
							tC.style.height='auto';
						}
					}
					else{
						P7_APMsetClass(tA[j],'p7APM_ext');
					}
					tA[j].onclick=function(){
						return P7_APMtrig(this);
					};
					if(tB.p7opt[6]==1){
						tA[j].onmouseover=function(){
							var tB=document.getElementById(this.p7APMpr);
							if(this.p7state=='closed'){
								P7_APMopen(this);
							}
						};
					}
					if(tB.p7opt[7]==1){
						tA[j].onmouseout=function(evt){
							var tg,pp,dv,tB,m=true;
							tB=document.getElementById(this.p7APMpr);
							dv=this.id.replace('t','w');
							evt=(evt)?evt:event;
							tg=(evt.toElement)?evt.toElement:evt.relatedTarget;
							if(tg){
								pp=tg;
								while(pp){
									if(pp.id&&pp.id.indexOf(dv)===0){
										m=false;
										break;
									}
									pp=pp.parentNode;
								}
							}
							if(m){
								P7_APMclose(this);
							}
						};
						if(tC){
							tC.onmouseout=function(evt){
								var tg,pp,tA,tB,m=true;
								evt=(evt)?evt:event;
								tg=(evt.toElement)?evt.toElement:evt.relatedTarget;
								tA=document.getElementById(this.p7APMtrg);
								tB=document.getElementById(this.p7APMpr);
								if(tg){
									pp=tg;
									if(tg.id&&tg.id==tA.p7APMpr){
										m=true;
									}
									else{
										while(pp){
											if(pp.id){
												if(pp.id.indexOf('p7APM')===0){
													m=false;
													break;
												}
											}
											pp=pp.parentNode;
										}
									}
									if(m){
										if(tA){
											if(tA.p7state=='open'){
												P7_APMclose(tA);
											}
										}
									}
								}
							};
						}
					}
					tA[j].hasImg=false;
					iM=tA[j].getElementsByTagName("IMG");
					if(iM&&iM[0]){
						sr=iM[0].getAttribute("src");
						swp=tB.p7opt[8];
						iM[0].apmswap=swp;
						x=sr.lastIndexOf(".");
						fnA=sr.substring(0,x);
						fnB='.'+sr.substring(x+1);
						s1=fnA+p7APMover+fnB;
						s2=fnA+p7APMopen+fnB;
						s3=fnA+p7APMmark+fnB;
						if(swp==1){
							iM[0].p7imgswap=[sr,s1,s1,s1];
							P7_APMpreloader(s1);
						}
						else if(swp==2){
							iM[0].p7imgswap=[sr,s1,s2,s2];
							P7_APMpreloader(s1,s2);
						}
						else if(swp==3){
							iM[0].p7imgswap=[sr,s1,s2,s3];
							P7_APMpreloader(s1,s2,s3);
						}
						else{
							iM[0].p7imgswap=[sr,sr,sr,sr];
						}
						iM[0].p7state='closed';
						iM[0].mark=false;
						iM[0].rollover=tB.p7opt[9];
						if(swp>0){
							tA[j].hasImg=true;
							iM[0].onmouseover=function(){
								P7_APMimovr(this);
							};
							iM[0].onmouseout=function(){
								P7_APMimout(this);
							};
						}
					}
				}
			}
			if(cn>0){
				P7_APMsetClass(tA[cn],'apmlast');
				P7_APMsetClass(tA[cn].parentNode,'apmlast');
			}
			if(tB.p7opt[3]==-2){
				P7_APMall(tB.id,'open');
			}
			else if(tB.p7opt[3]==-3){
				P7_APMall(tB.id,'open');
				setTimeout("P7_APMall('"+tB.id+"','close',1)",200);
			}
			else if(tB.p7opt[3]==-1){
				ob=P7_APMrandom(tB.id);
				P7_APMopen(ob,1,1,1);
			}
			else{
				tr=tB.id.replace("_","t")+"_"+tB.p7opt[3];
				ob=document.getElementById(tr);
				if(ob){
					P7_APMopen(ob,1,1,1);
				}
			}
			if(tB.p7opt[5]==1&&tB.p7opt[3]!=-2){
				if(tB.p7opt[3]==-3){
					setTimeout("P7_APMauto('"+tB.id+"')",200);
				}
				else{
					P7_APMauto(tB);
				}
			}
			if(tB.p7opt[10]>0){
				tB.p7rtmr=setTimeout("P7_APMrotate('"+tB.id+"',"+tB.p7opt[10]+")",tB.p7opt[11]);
			}
		}
	}
	for(i=0;i<p7APMctl.length;i++){
		P7_APMurl('p7APM_'+p7APMctl[i][0]);
	}
	p7APMa=true;
}
function P7_APMpreloader(){
	var i,x;
	for(i=0;i<arguments.length;i++){
		x=document.p7APMpreload.length;
		document.p7APMpreload[x]=new Image();
		document.p7APMpreload[x].src=arguments[i];
	}
}
function P7_APMimovr(im){
	var m=false,r=im.rollover;
	if(im.mark){
		m=(r>1)?true:false;
	}
	else if(im.p7state=='open'){
		m=(r==1||r==3)?true:false;
	}
	else{
		m=true;
	}
	if(m){
		im.src=im.p7imgswap[1];
	}
}
function P7_APMimout(im){
	var r=im.rollover;
	if(im.mark){
		if(im.p7state=='open'){
			im.src=im.p7imgswap[2];
		}
		else{
			im.src=im.p7imgswap[3];
		}
	}
	else if(im.p7state=='open'){
		if(r==1||r==3){
			im.src=im.p7imgswap[2];
		}
	}
	else{
		im.src=im.p7imgswap[0];
	}
}
function P7_APMctl(tr,ac,bp,tg,an,rt){
	var tA=document.getElementById(tr);
	if(tA){
		if(ac=='open'){
			if(tA.p7state!='open'){
				P7_APMopen(tA,bp,tg,an,rt);
			}
		}
		else if(ac=='close'){
			if(tA.p7state!='closed'){
				P7_APMclose(tA,bp,tg,an,rt)
			}
		}
		else if(ac=='trigger'){
			P7_APMtrig(tA,bp,tg,an,rt);
		}
	}
	return false;
}
function P7_APMall(dv,ac,rt){
	var i,j,tB,a,tA,an=1;
	if(rt==1){
		an=null;
	}
	if(dv=='all'){
		for(i=0;i<p7APMctl.length;i++){
			tB=document.getElementById('p7APM_'+p7APMctl[i][0]);
			tA=tB.p7APMtrig;
			for(j=0;j<tA.length;j++){
				if(ac=='open'&&tA[j].p7state!='open'){
					P7_APMopen(tA[j],1,1,an);
				}
				else if(ac=='close'&&tA[j].p7state!='closed'){
					P7_APMclose(tA[j],1,1,an);
				}
			}
		}
	}
	else{
		tB=document.getElementById(dv);
		if(tB){
			tA=tB.p7APMtrig;
			for(j=0;j<tA.length;j++){
				if(ac=='open'&&tA[j].p7state!='open'){
					P7_APMopen(tA[j],1,1,an);
				}
				else if(ac=='close'&&tA[j].p7state!='closed'){
					P7_APMclose(tA[j],1,1,an);
				}
			}
		}
	}
}
function P7_APMrandom(dd){
	var i,k,j=0,tB,tA,a,rD=new Array();
	tB=document.getElementById(dd);
	if(tB){
		tA=tB.getElementsByTagName("A");
		for(i=0;i<tA.length;i++){
			if(tA[i].p7APMpr && tA[i].p7APMpr==dd && tA[i].p7APMct){
				rD[j]=tA[i].id;
				j++;
			}
		}
		if(j>0){
			k=Math.floor(Math.random()*j);
			a=document.getElementById(rD[k]);
		}
	}
	return a;
}
function P7_APMrotate(dv,md,pn){
	var i,pl,tB=document.getElementById(dv);
	if(md===0){
		if(tB.p7rtmr){
			clearTimeout(tB.p7rtmr);
		}
		if(tB.p7rtrun){
			tB.p7rtcntr--;
			tB.p7rtrun=false;
		}
		return;
	}
	else{
		if(tB.p7rtrun){
			return;
		}
	}
	if(tB&&tB.p7APMtrig){
		if(md>0){
			tB.p7rtmd=md;
			tB.p7rtcy=1;
			tB.p7rtcntr=1;
		}
		if(!pn||pn<0){
			pn=-1;
			for(i=0;i<tB.p7APMtrig.length;i++){
				if(tB.p7APMtrig[i].p7state=='open'){
					pn=i;
					break;
				}
			}
		}
		else{
			pn--;
		}
		pl=pn;
		pn=(pn<=-1)?0:pn;
		pn=(pn>tB.p7APMtrig.length-1)?tB.p7APMtrig.length-1:pn;
		if(md>0){
			tB.p7rtsp=(pl==-1)?pl:pn;
		}
		if(tB.p7rtmr){
			clearTimeout(tB.p7rtmr);
		}
		tB.p7rtmr=setTimeout("P7_APMrunrt('"+dv+"',"+pn+")",10);
	}
}
function P7_APMrunrt(dv,n){
	var a,tB;
	tB=document.getElementById(dv);
	tB.p7rtrun=true;
	if(tB.p7rtmr){
		clearTimeout(tB.p7rtmr);
	}
	if(n>-1&&n<tB.p7APMtrig.length){
		a=tB.p7APMtrig[n];
		if(a.p7state!="open"){
			P7_APMopen(a,null,null,null,1);
		}
		tB.p7rtcntr++;
	}
	n++;
	if(tB.p7rtcntr>tB.p7APMtrig.length){
		tB.p7rtcy++;
		tB.p7rtcntr=1;
	}
	if(n>=tB.p7APMtrig.length){
		n=0;
	}
	if(tB.p7rtcy>tB.p7rtmd){
		if(tB.p7rtsp==-1){
			tB.p7rtmr=setTimeout("P7_APMall('"+dv+"','close',1)",tB.p7opt[11]);
		}
		else{
			tB.p7rtmr=setTimeout("P7_APMctl('"+	tB.p7APMtrig[n].id+"','open',true,false,false,1)",tB.p7opt[11]);
		}
		tB.p7rtrun=false;
	}
	else{
		tB.p7rtmr=setTimeout("P7_APMrunrt('"+dv+"',"+n+")",tB.p7opt[11]);
	}
}
function P7_APMtrig(a,bp,tg,an,rt){
	var m=false;
	if(!p7APMa&&!bp){
		return false;
	}
	if(!a.p7APMct){
		if(a.href!=window.location.href){
			m=true;
		}
		return m;
	}
	if(a.p7state=='open'){
		P7_APMclose(a,bp,tg,an,rt);
	}
	else{
		P7_APMopen(a,bp,tg,an,rt);
	}
	return m;
}
function P7_APMopen(a,bp,tg,an,rt){
	var i,tB,cT,iM,op;
	if(!p7APMa&&!bp){
		return;
	}
	if(a.p7state=='open'){
		return;
	}
	tB=document.getElementById(a.p7APMpr);
	op=tB.p7opt[2];
	if(!p7APMa||an==1){
		op=0;
	}
	a.p7state='open';
	P7_APMsetClass(a,'p7APMtrig_down');
	if(a.hasImg){
		iM=a.getElementsByTagName("IMG")[0];
		iM.p7state='open';
		iM.src=iM.p7imgswap[2];
	}
	cT=document.getElementById(a.p7APMct);
	if(!cT){
		return;
	}
	if((!tg&&tB.p7opt[1]==1)||rt==1){
		for(i=0;i<tB.p7APMtrig.length;i++){
			if(tB.p7APMtrig[i].p7state=='open'){
				if(tB.p7APMtrig[i]!=a){
					P7_APMclose(tB.p7APMtrig[i],null,1);
				}
			}
		}
	}
	if(cT){
		if(op>0&&P7_APMhasOverflow(cT.getElementsByTagName('DIV')[0])){
			op=0;
		}
		if(op==1||op==2){
			cT.style.height='0px';
			cT.p7ch=0;
			P7_APMsetGlide(a,op,tB.p7opt[12]);
			if(!tB.p7APMrunning){
				tB.p7APMrunning=true;
				tB.p7APMglide=setInterval("P7_APMglide('"+tB.id+"')",cT.p7APMdy);
			}
		}
		else{
			if(tB.p7opt[2]==0){
				cT.style.display='block';
			}
			else{
				cT.style.height='auto';
				P7_APMsetGlide(a,op,tB.p7opt[12]);
				cT.p7ch=cT.p7APMtarget;
			}
		}
	}
}
function P7_APMclose(a,bp,tg,an,rt){
	var i,m=false,tB,cT,iM,op;
	if(!p7APMa&&!bp){
		return;
	}
	if(a.p7state=='closed'){
		return;
	}
	tB=document.getElementById(a.p7APMpr);
	op=tB.p7opt[2];
	if(!p7APMa||an==1){
		op=0;
	}
	if(!tg&&tB.p7opt[4]==1){
		for(i=0;i<tB.p7APMtrig.length;i++){
			if(tB.p7APMtrig[i].p7state=='open'){
				if(tB.p7APMtrig[i]!=a){
					m=true;
					break;
				}
			}
		}
		if(!m){
			return;
		}
	}
	a.p7state='closed';
	P7_APMremClass(a,'p7APMtrig_down');
	if(a.hasImg){
		iM=a.getElementsByTagName("IMG")[0];
		iM.p7state='closed';
		if(iM.mark){
			iM.src=iM.p7imgswap[3];
		}
		else{
			iM.src=iM.p7imgswap[0];
		}
	}
	cT=document.getElementById(a.p7APMct);
	if(cT){
		if(P7_APMhasOverflow(cT.getElementsByTagName('DIV')[0])){
			op=0;
		}
		if(op==1||op==2){
			cT.p7ch=cT.offsetHeight;
			P7_APMsetGlide(a,op,tB.p7opt[12]);
			if(!tB.p7APMrunning){
				tB.p7APMrunning=true;
				tB.p7APMglide=setInterval("P7_APMglide('"+tB.id+"')",cT.p7APMdy);
			}
		}
		else{
			if(tB.p7opt[2]==0){
				cT.style.display='none';
			}
			else{
				cT.style.height='0px';
				cT.p7ch=0;
				P7_APMsetGlide(a,op,tB.p7opt[12]);
			}
		}
	}
}
function P7_APMglide(d){
	var i,ht,tB,tA,tC,st,ch,th,nh,inc,tt,tp,pc=.15,m=false;
	tB=document.getElementById(d);
	tA=tB.p7APMtrig;
	tC=tB.p7APMcont;
	for(i=0;i<tA.length;i++){
		st=tA[i].p7state;
		if(tC[i]){
			ch=tC[i].p7ch;
			if(st=='open'&&tC[i].p7APMtarget==0){
				tC[i].p7APMtarget=tC[i].offsetHeight;
			}
			th=(st=='closed')?0:tC[i].p7APMtarget;
			inc=tC[i].p7APMrate;
			if(tB.p7opt[2]==2){
				tt=Math.abs( parseInt(ch-th) );
				tp=parseInt(tt*pc);
				inc=(tp<1)?1:tp;
			}
			if(st=='closed'&&ch!==0){
				nh=ch-inc;
				nh=(nh<=0)?0:nh;
				m=true;
				tC[i].style.height=nh+'px';
				tC[i].p7ch=nh;
			}
			else if(st=='open'&&ch!=th){
				nh=ch+inc;
				nh=(nh>=th)?th:nh;
				m=true;
				tC[i].style.height=nh+'px';
				tC[i].p7ch=nh;
			}
			else if(st=='open'){
				tC[i].style.height='auto';
			}
			else{
			}
		}
	}
	if(!m){
		tB.p7APMrunning=false;
		clearInterval(tB.p7APMglide);
	}
}
function P7_APMsetGlide(a,op,dur){
	var tC,tS,th,stp,fr,dy;
	dur=(dur>0)?dur:250;
	dy=(op==2)?15:20;
	tC=document.getElementById(a.p7APMct);
	tC.p7APMdy=dy;
	tS=document.getElementById(a.id.replace('t','c'));
	th=tS.offsetHeight;
	tC.p7APMtarget=th;
	stp=dur/dy;
	fr=parseInt(th/stp);
	fr=(fr<=1)?1:fr;
	tC.p7APMrate=fr;
}
function P7_APMurl(dv){
	var i,h,s,x,d='apm',a,n=dv.replace("p7APM_","");
	if(document.getElementById){
		h=document.location.search;
		if(h){
			h=h.replace('?','');
			s=h.split(/[=&]/g);
			if(s&&s.length){
				for(i=0;i<s.length;i+=2){
					if(s[i]==d){
						x=s[i+1];
						if(n!=x.charAt(0)){
							x=false;
						}
						if(x){
							a=document.getElementById('p7APMt'+x);
							if(a&&a.p7state!="open"){
								P7_APMopen(a,1);
							}
						}
					}
				}
			}
		}
		h=document.location.hash;
		if(h){
			x=h.substring(1,h.length);
			if(n!=x.charAt(3)){
				x=false;
			}
			if(x&&x.indexOf(d)===0){
				a=document.getElementById('p7APMt'+x.substring(3));
				if(a&&a.p7state!="open"){
					P7_APMopen(a,1);
				}
			}
		}
	}
}
function P7_APMauto(ob){
	var i,wH,tr,pp,im;
	if (typeof ob!='object'){
		ob=document.getElementById(ob);
	}
	wH=window.location.href;
	if(wH.charAt(wH.length-1)=='#'){
		wH=wH.substring(0,wH.length-1);
	}
	r1=/index\.[\S]*/i;
	tA=ob.getElementsByTagName("A");
	for(i=0;i<tA.length;i++){
		if(tA[i].href==wH){
			if(tA[i].p7APMpr){
				tr=tA[i];
				break;
			}
			else{
				P7_APMsetClass(tA[i],'current_mark');
				pp=tA[i].parentNode;
				while(pp){
					if(pp.id&&pp.id.indexOf('p7APMw')==0){
						tr=document.getElementById(pp.p7APMtrg);
						break;
					}
					pp=pp.parentNode;
				}
				break;
			}
		}
	}
	if(tr){
		P7_APMsetClass(tr,'current_mark');
		P7_APMsetClass(tr.parentNode,'current_mark');
		if(tr.hasImg){
			im=tr.getElementsByTagName('IMG')[0];
			im.mark=true;
			im.src=im.p7imgswap[3];
		}
		P7_APMopen(tr,1);
	}
}
function P7_APMsetClass(ob,cl){
	var cc,nc,r=/\s+/g;
	cc=ob.className;
	nc=cl;
	if(cc&&cc.length>0){
		nc=cc+' '+cl;
	}
	nc=nc.replace(r,' ');
	ob.className=nc;
}
function P7_APMremClass(ob,cl){
	var cc,nc,r=/\s+/g;;
	cc=ob.className;
	if(cc&&cc.indexOf(cl>-1)){
		nc=cc.replace(cl,'');
		nc=nc.replace(r,' ');
		ob.className=nc;
	}
}
function P7_APMhasOverflow(ob){
	var s,m;
	if(navigator.userAgent.toLowerCase().indexOf('gecko')>-1){
		s=ob.style.overflow;
		if(!s){
			if(document.defaultView.getComputedStyle(ob,"")){
				s=document.defaultView.getComputedStyle(ob,"").getPropertyValue("overflow");
			}
		}
	}
	m=(s&&s=='auto')?true:false;
	return m;
}




/* 
 ================================================
 PVII ToolTip Magic scripts
 Copyright (c) 2010-2011 Project Seven Development
 www.projectseven.com
 Version: 1.3.2-build 49
 ================================================
 
*/

var p7TTMctl=[],p7TTMi=false,p7TTMa=false,p7TTMopentmr;
function P7_TTMset(){
	var h,sh,hd,v;
	if (!document.getElementById){
		return;
	}
	sh='.p7TTMbox {position:absolute; visibility:hidden; left:-3000px; top:-9000px; z-index:999999;}\n';
	sh+='.p7TTMcall, .p7TTMclose {display:none;}\n';
	sh+='#p7TTMholder {position:absolute; visibility:hidden; left:-9000px; top:-9000px;}\n';
	sh+='.p7TTMclose {position:absolute;z-index:9999999;}\n';
	sh+='#p7ttm_overlay {display: none;height:100%;left:0;position:fixed;top:0;width:100%;z-index:99999998;display:none;}\n';
	if (document.styleSheets){
		h='\n<st'+'yle type="text/css">\n'+sh+'\n</s' + 'tyle>';
		document.write(h);
	}
	else{
		h=document.createElement('style');
		h.type='text/css';
		h.appendChild(document.createTextNode(sh));
		hd=document.getElementsByTagName('head');
		hd[0].appendChild(h);
	}
}
P7_TTMset();
function P7_opTTM(){
	if(!document.getElementById){
		return;
	}
	p7TTMctl[p7TTMctl.length]=arguments;
}
function P7_TTMaddLoad(){
	if(!document.getElementById||typeof document.createElement=='undefined'){
		return;
	}
	if(window.addEventListener){
		document.addEventListener("DOMContentLoaded",P7_initTTM,false);
		window.addEventListener("resize",P7_TTMrsz,false);
		window.addEventListener("load",P7_initTTM,false);
		window.addEventListener("unload",P7_TTMrf,false);
	}
	else if(window.attachEvent){
		document.write("<script id=p7ie_ttm defer src=\"//:\"><\/script>");
		document.getElementById("p7ie_ttm").onreadystatechange=function(){
			if (this.readyState=="complete"){
				if(p7TTMctl.length>0){
					P7_initTTM();
				}
			}
		};
		window.attachEvent("onload",P7_initTTM);
		window.attachEvent("onresize",P7_TTMrsz);
	}
}
P7_TTMaddLoad();
function P7_TTMrf(){
	return;
}
function P7_initTTM(){
	var i,j,k,num=1,tD,eL,cS,tA,pH,eN,iD,tB,att,tm,cL,rel,dv,tC,wR,tr,m,pN,ea,el;
	if(p7TTMi){
		return;
	}
	p7TTMi=true;
	document.p7TTMboxes=[];
	document.p7TTMtriggers=[];
	document.p7TTMz=999999;
	document.p7TTMall='on';
	el=document.createElement('div');
	el.setAttribute("id","p7ttm_overlay");
	document.getElementsByTagName('body')[0].appendChild(el);
	el=document.getElementById('p7ttm_overlay');
	el.onclick=function(){
		var tB=document.getElementById(this.ttmBox);
		P7_TTMparentClose(tB.id,1);
		if(tB.ttmChildID){
			P7_TTMshutChild(tB.id);
		}
		return false;
	};
	for(j=0;j<p7TTMctl.length;j++){
		eL=p7TTMctl[j][0].split(':');
		cS=p7TTMctl[j][1].split(':');
		tA=[];
		tA.length=0;
		if(eL[0].toLowerCase()=='id'){
			tA[0]=document.getElementById(eL[1]);
		}
		else if(eL[0].toLowerCase()=='att'){
			tA=P7_TTMgetElementsByAttribute(eL[1],eL[2]);
		}
		else if(eL[0].toLowerCase()=='tag'){
			tA=document.getElementsByTagName(eL[1].toUpperCase());
		}
		else if(eL[0].toLowerCase()=='class'){
			tA=P7_TTMgetElementsByClassName(eL[1]);
		}
		if(tA&&tA.length&&tA.length>0&&tA[0]){
			for(i=0;i<tA.length;i++){
				m=false;
				rel=tA[i].getAttribute('rel');
				if(rel&&typeof(rel)=='string'&&rel!==''&&rel.toLowerCase().indexOf('no_tooltip')===0){
					m=false;
				}
				else if(cS[0].toLowerCase()=='id'){
					eN=document.getElementById(cS[1]);
					if(eN){
						tA[i].ttmSourceType='id';
						tA[i].ttmSourceID=cS[1];
						tA[i].ttmSourceATT='';
						m=true;
					}
				}
				else if(cS[0].toLowerCase()=='att'){
					att=tA[i].getAttribute(cS[1]);
					if(att&&typeof(att)=='string'&&att!==''){
						tA[i].ttmSourceType='att';
						tA[i].ttmSourceID='';
						tA[i].ttmSourceATT=cS[1];
						m=true;
					}
				}
				else if(cS[0].toLowerCase()=='attid'){
					att=tA[i].getAttribute(cS[1]);
					if(cS[1]=='class'){
						att=tA[i].className;
					}
					if(att&&typeof(att)=='string'&&att!==''){
						eN=document.getElementById(att);
						if(eN){
							tA[i].ttmSourceType='attid';
							tA[i].ttmSourceID=att;
							tA[i].ttmSourceATT='';
							m=true;
						}
					}
				}
				if(m){
					tA[i].p7TTMopt=null;
					tA[i].p7TTMopt=p7TTMctl[j];
					tA[i].ttmState='closed';
					if(P7_TTMisMobile()){
						tA[i].p7TTMopt[12]=2;
						tA[i].p7TTMopt[10]=1;
					}
					if(!tA[i].ttmTrigNum){
						tA[i].ttmTrigNum=document.p7TTMtriggers.length;
						document.p7TTMtriggers[document.p7TTMtriggers.length]=tA[i];
					}
				}
			}
		}
	}
	tA=document.p7TTMtriggers;
	for(i=0;i<tA.length;i++){
		m=true;
		if(tA[i].ttmSourceType=='id' || tA[i].ttmSourceType=='attid'){
			eN=document.getElementById(tA[i].ttmSourceID);
			pN=eN.parentNode;
			if(pN.id&&pN.id.indexOf('p7TTMcontent_')>-1){
				tB=document.getElementById(pN.id.replace('content','box'));
				if(tB){
					tA[i].ttmBox=tB.id;
					m=false;
				}
			}
		}
		else if(tA[i].ttmSourceType=='att'){
			att=tA[i].getAttribute(tA[i].ttmSourceATT);
			if(!att && tA[i].ttmBox){
				ea='att:'+tA[i].ttmSourceATT;
				if(tA[i].p7TTMopt[1]==ea){
					m=false;
				}
			}
		}
		if(m){
			tA[i].ttmBox=P7_TTMbuild(num);
			tA[i].ttmBoxNum=num;
			tB=document.getElementById(tA[i].ttmBox);
			document.p7TTMboxes[num-1]=tB;
			tB.ttmState='closed';
			tB.p7TTMcloseTmr=null;
			tC=document.getElementById('p7TTMcontent_'+num);
			wR=document.getElementById('p7TTM_inner_'+num);
			tB.style.width=tA[i].p7TTMopt[4]+'px';
			if(tA[i].ttmSourceType=='id'){
				tC.appendChild(eN);
			}
			else if(tA[i].ttmSourceType=='att'){
				tC.innerHTML=att;
			}
			else if(tA[i].ttmSourceType=='attid'){
				tC.appendChild(eN);
			}
			num++;
		}
		else{
			tA[i].ttmBoxNum=tA[i].ttmBox.split('_')[1];
		}
		tA[i].setAttribute('title','');
		tB.isIE5=false;
		if(P7_TTMgetIEver()==5){
			tA[i].p7TTMopt[3]=0;
			tA[i].p7TTMopt[6]=0;
			tB.isIE5=true;
		}
		if(tA[i].p7TTMopt[7]==1&&tA[i].p7TTMopt[12]<2){
			tB.onmouseout=P7_TTMout;
		}
		tB.onmouseover=function(){
			if(this.p7TTMcloseTmr){
				clearTimeout(this.p7TTMcloseTmr);
			}
		};
		cL=document.getElementById('p7TTMclose_'+tA[i].ttmBoxNum);
		cL.ttmBox=tB.id;
		cL.onclick=function(){
			var tB=document.getElementById(this.ttmBox);
			P7_TTMparentClose(tB.id,1);
			if(tB.ttmChildID){
				P7_TTMshutChild(tB.id);
			}
			return false;
		};
		if(tA[i].p7TTMopt[10]==1||tA[i].p7TTMopt[7]!=1){
			cL.style.display='block';
		}
		else{
			cL.style.display='none';
		}
		if(tA[i].p7TTMopt[12]<2){
			if(tA[i].p7TTMopt[15]&&tA[i].p7TTMopt[15]==1){
				tA[i].onmouseover=function(e){
					var tB=document.getElementById(this.ttmBox);
					P7_TTMsetCursorPos(e,this);
					if(p7TTMopentmr){
						clearTimeout(p7TTMopentmr);
					}
					if(tB&&tB.p7TTMcloseTmr){
						clearTimeout(tB.p7TTMcloseTmr);
					}
					if(this.ttmState!='open'){
						p7TTMopentmr=setTimeout(" P7_TTMdelayOpen('"+this.ttmTrigNum+"')",160);
					}
				};
			}
			else{
				tA[i].onmouseover=function(e){
					P7_TTMsetCursorPos(e,this);
					P7_TTMopen(this);
				};
			}
		}
		else if(tA[i].p7TTMopt[12]==2&&tA[i].p7TTMopt[7]==1){
			tA[i].onmouseover=function(e){
				var tB=document.getElementById(this.ttmBox);
				P7_TTMsetCursorPos(e,this);
				if(tB.p7TTMcloseTmr){
					clearTimeout(tB.p7TTMcloseTmr);
				}
			};
		}
		if(tA[i].p7TTMopt[7]==1&&tA[i].p7TTMopt[12]<2){
			tA[i].onmouseout=function(){
				var dl,tB=document.getElementById(this.ttmBox);
				dl=(this.p7TTMopt[15]==1)?400:50;
				if(tB.p7TTMcloseTmr){
					clearTimeout(tB.p7TTMcloseTmr);
				}
				if(this.p7TTMopt[5]!=11&&this.p7TTMopt[5]!=12){
					tB.p7TTMcloseTmr=setTimeout("P7_TTMparentClose('"+tB.id+"')",dl);
				}
			};
		}
		if(tA[i].p7TTMopt[12]==1){
			tA[i].onclick=function(e){
				P7_TTMsetCursorPos(e,this);
				return P7_TTMclick(this,1);
			};
		}
		else{
			tA[i].onclick=function(e){
				P7_TTMsetCursorPos(e,this);
				return P7_TTMclick(this);
			};
		}
	}
	for(i=0;i<tA.length;i++){
		if(tA[i].p7TTMopt[16]&&tA[i].p7TTMopt[16]==1){
			P7_TTMopen(tA[i],null,1);
		}
	}
	P7_TTMurl();
	p7TTMa=true;
}
function P7_TTMsetCursorPos(evt,a){
	var posx,posy;
	evt=(evt)?evt:window.event;
	if(evt.pageX||evt.pageY){
		posx=evt.pageX;
		posy=evt.pageY;
	}
	else if(evt.clientX||evt.clientY){
		posx=evt.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;
		posy=evt.clientY+document.body.scrollTop+document.documentElement.scrollTop;
	}
	if(a){
		a.ttmPosX=posx;
		a.ttmPosY=posy;
	}
}
function P7_TTMctrl(d,ac){
	P7_TTMcontrol(d,ac);
}
function P7_TTMcontrol(d,ac){
	var i,tR;
	if(typeof(d)=='string'){
		tR=document.getElementById(d);
	}
	else if(typeof(d)=='number'){
		d--;
		if(document.p7TTMtriggers.length>d&&d>-1){
			tR=document.p7TTMtriggers[d];
		}
	}
	if(tR&&tR.p7TTMopt){
		if(ac=='open'){
			P7_TTMopen(tR);
		}
		else if(ac=='close'){
			P7_TTMclose(tR.ttmBox);
		}
		else if(ac=='trig'){
			P7_TTMclick(tR);
		}
	}
}
function P7_TTMdelayOpen(n){
	var tR=document.p7TTMtriggers[n];
	P7_TTMopen(tR,1);
}
function P7_TTMopen(tr,bp,ld){
	var i,num,tB,wR,tC,pH,cD,cS,cL,pD,t,l,ti,m=false,an,dur,stp,dy=30,fr,dh=100,ps,ov;
	if((!p7TTMa&&ld!=1)||document.p7TTMall=='off'){
		return;
	}
	num=tr.ttmBoxNum;
	tB=document.getElementById('p7TTMbox_'+num);
	if(tB.p7TTMcloseTmr && bp!=1){
		clearTimeout(tB.p7TTMcloseTmr);
	}
	if(tB.ttmState=='open'){
		if(tB.ttmTrigger!=tr){
			P7_TTMclose(tB.id,1);
		}
		else{
			return false;
		}
	}
	if(tB.ttmTrigger){
		P7_TTMclearClass(tB,tB.ttmTrigger);
	}
	tB.ttmTrigger=tr;
	P7_TTMsetClass(tB,tr.p7TTMopt[2]);
	an=tr.p7TTMopt[3];
	ps=tr.p7TTMopt[5];
	wR=document.getElementById('p7TTM_inner_'+num);
	tC=document.getElementById('p7TTMcontent_'+num);
	pD=P7_TTMhasParent(tr);
	if(pD){
		pD.ttmParentLock=true;
		pD.ttmChildID=tB.id;
		tB.ttmParentID=pD.id;
	}
	tB.style.visibility='hidden';
	tB.style.left='-3000px';
	tB.style.top='-9000px';
	wR.style.width=tr.p7TTMopt[4]+'px';
	if(tB.isIE5){
		tB.style.width=tr.p7TTMopt[4]+'px';
	}
	else{
		tB.style.width='auto';
	}
	if(typeof P7_TPMrsz == 'function'){
		P7_TPMrsz();
	}
	tB.style.zIndex=document.p7TTMz;
	document.p7TTMz++;
	tB.style.overflow='visible';
	P7_TTMsetCallout(tB,tr);
	P7_TTMsetClass(tr,'p7TTM_open');
	tB.style.height='auto';
	tB.style.width='auto';
	tB.ttmTargetHeight=P7_TTMgetOffset(tB,'height');
	tB.ttmTargetWidth=P7_TTMgetOffset(tB,'width');
	P7_TTMposBox(tB);
	tr.ttmState='open';
	tB.ttmState='open';
	if(ps==12){
		ov=document.getElementById('p7ttm_overlay');
		ov.ttmBox=tB.id;
		ov.className=tr.p7TTMopt[2];
		ov.style.display='block';
		tB.style.zIndex='99999999';
	}
	if(an==1){
		tB.style.visibility='visible';
		if(tB.filters){
			tB.style.filter='alpha(opacity=1)';
		}
		else{
			tB.style.opacity=0.01;
		}
		tB.ttmOpacity=1;
		dur=tr.p7TTMopt[11];
		dur=(dur)?dur:300;
		stp=dur/dy;
		fr=parseInt(dh/stp,10);
		fr=(fr<=1)?1:fr;
		tB.ttmFaderFrameRate=fr;
		if(!tB.ttmFaderRunning){
			tB.ttmFaderRunning=true;
			tB.ttmFader=setInterval("P7_TTMfader('"+tB.id+"')",dy);
		}
	}
	else if(an>1){
		P7_TTMsetGrowOpen(tB);
		tB.style.visibility='visible';
		if(!tB.ttmGrowRunning){
			tB.ttmGrowRunning=true;
			tB.ttmGrow=setInterval("P7_TTMGrow('"+tB.id+"')",dy);
		}
	}
	else{
		tB.style.visibility='visible';
	}
	return false;
}
function P7_TTMclose(dv,bp){
	var i,tB,tR,dy=30,an;
	tB=document.getElementById(dv);
	if(tB.ttmParentLock){
		return;
	}
	if(tB.p7TTMcloseTmr){
		clearTimeout(tB.p7TTMcloseTmr);
	}
	tR=tB.ttmTrigger;
	if(tR){
		P7_TTMremClass(tR,'p7TTM_open');
		an=tR.p7TTMopt[3];
		if(tR.p7TTMopt[13]!=1){
			an=0;
		}
		if(bp==1){
			an=0;
			if(tB.ttmGrowRunning){
				clearInterval(tB.ttmGrow);
				tB.ttmGrowRunning=false;
			}
			if(tB.ttmFaderRunning){
				tB.ttmFaderRunning=false;
				clearInterval(tB.ttmFader);
			}
		}
		tR.ttmState='closed';
		tB.ttmState='closed';
		if(tR.p7TTMopt[5]==12){
			document.getElementById('p7ttm_overlay').style.display='none';
		}
		if(an==1){
			if(!tB.ttmFaderRunning){
				tB.ttmFaderRunning=true;
				tB.ttmFader=setInterval("P7_TTMfader('"+tB.id+"')",dy);
			}
		}
		else if(an>1){
			tB.ttmTargetLeft=tB.ttmStartLeft;
			tB.ttmTargetTop=tB.ttmStartTop;
			tB.ttmTargetHeight=tB.ttmStartHeight;
			tB.ttmTargetWidth=tB.ttmStartWidth;
			tB.style.overflow='hidden';
			if(!tB.ttmGrowRunning){
				tB.ttmGrowRunning=true;
				tB.ttmGrow=setInterval("P7_TTMGrow('"+tB.id+"')",dy);
			}
		}
		else{
			tB.visibility='hidden';
			tB.style.left='-3000px';
			tB.style.top='-9000px';
		}
	}
}
function P7_TTMclick(tr,bp){
	var m=false,h,dv,tB,tg;
	tg=tr.nodeName;
	h=tr.getAttribute("href");
	if(h&&h!==''){
		if(h.charAt(h.length-1)!='#'&&h.search(/javas/i)!==0){
			m=true;
		}
	}
	if(!m&&!bp){
		tB=document.getElementById(tr.ttmBox);
		if(tr.ttmState=='open'){
			P7_TTMparentClose(tB.id,1);
			if(tB.ttmChildID){
				P7_TTMshutChild(tB.id);
			}
		}
		else{
			P7_TTMopen(tr);
		}
	}
	if(tg!='A' && tg!='AREA'){
		m=true;
	}
	return m;
}
function P7_TTMshutChild(dv){
	var i,bx=document.p7TTMboxes;
	for(i=0;i<bx.length;i++){
		if(bx[i].ttmState=='open'&&bx[i].ttmParentID&&bx[i].ttmParentID==dv){
			P7_TTMparentClose(bx[i].id,1);
			if(bx[i].ttmChildID){
				P7_TTMshutChild(bx[i].ttmChildID);
			}
		}
	}
}
function P7_TTMclearClass(tB,tr){
	var po,cT=document.getElementById('p7TTMcall_'+tr.ttmBoxNum);
	po=tr.p7TTMopt[5];
	P7_TTMremClass(tB,tr.p7TTMopt[2]);
	P7_TTMremClass(cT,'p7TTM_Arrow_'+po);
	P7_TTMremClass(tB,'Arrow_'+po);
}
function P7_TTMsetCallout(tB,tr){
	var cT,co,po;
	co=tr.p7TTMopt[6];
	po=tr.p7TTMopt[5];
	cT=document.getElementById('p7TTMcall_'+tr.ttmBoxNum);
	if(co==1){
		P7_TTMsetClass(cT,'p7TTM_Arrow_'+po);
		P7_TTMsetClass(tB,'Arrow_'+po);
		cT.style.display='block';
	}
	else{
		P7_TTMremClass(cT,'p7TTM_Arrow_'+po);
		P7_TTMremClass(tB,'Arrow_'+po);
		cT.style.display='none';
	}
}
function P7_TTMposBox(tB){
	var bx,wx;
	if(typeof(tB.ttmTrigger)!='object'){
		return;
	}
	bx=P7_TTMprePos(tB);
	if(tB.ttmTrigger.p7TTMopt[14]==1){
		wx=P7_TTMedge(tB,bx[0],bx[1]);
		if(wx[0]==1&&tB.ttmTrigger.p7TTMopt[6]==1){
			document.getElementById(tB.id.replace('box_','call_')).style.display='none';
			bx=P7_TTMprePos(tB);
			wx=P7_TTMedge(tB,bx[0],bx[1]);
		}
	}
	else{
		wx=[0,bx[0],bx[1]];
	}
	tB.style.top=wx[1]+'px';
	tB.style.left=wx[2]+'px';
}
function P7_TTMprePos(tB){
	var bt,bl,th,tw,p,pp,tl=0,tt=0,bh,bw,tR,rct,ie,ws,tG,hasMap=false,cr,oT,wx;
	p=tB.ttmTrigger.p7TTMopt[5];
	tR=tB.ttmTrigger;
	th=tB.ttmTrigger.offsetHeight;
	tw=tB.ttmTrigger.offsetWidth;
	bh=tB.offsetHeight;
	bw=tB.offsetWidth;
	if(p==11||p==12){
		wx= P7_TTMcenter(bh,bw);
		bt=wx[0];
		bl=wx[1];
	}
	else{
		tG=tR.nodeName;
		if(tG&&(tG=='AREA'||tG=='MAP')){
			if(!tR.p7ttmMapImg){
				P7_TTMgetMapImage(tR,tG);
			}
			if(tR.p7ttmMapImg){
				oT=tR;
				tR=tR.p7ttmMapImg;
				th=tR.offsetHeight;
				tw=tR.offsetWidth;
			}
		}
		ie=P7_TTMgetIEver();
		if(tR.getBoundingClientRect){
			rct=tR.getBoundingClientRect();
			ws=P7_TTMgetWinScroll();
			tl=rct.left+ws[1];
			tt=rct.top+ws[0];
			if(ie>4&&ie<8){
				tl-=2;
				tt-=2;
			}
		}
		else{
			pp=tR;
			while(pp){
				tl+=(pp.offsetLeft)?pp.offsetLeft:0;
				tt+=(pp.offsetTop)?pp.offsetTop:0;
				pp=pp.offsetParent;
			}
		}
		if(tB.ttmTrigger.p7ttmMapImg){
			cr=tB.ttmTrigger.p7ttmCoords;
			tl+=parseInt(cr[0],10);
			tt+=parseInt(cr[1],10);
			tw=parseInt(cr[2],10);
			th=parseInt(cr[3],10);
		}
		if(oT){
			tR=oT;
		}
		if(tR.p7TTMopt[18] && tR.p7TTMopt[18]==1 && tR.ttmPosX){
			tw=3;
			th=3;
			tl=tR.ttmPosX-1;
			tt=tR.ttmPosY-1;
		}
		if(p==1||p==2||p==3){
			bt=tt-bh;
		}
		else if(p==7||p==9){
			bt=tt;
		}
		else if(p==8||p==10){
			bt=tt+((th-bh)/2);
		}
		else{
			bt=tt+th;
		}
		if(p==3||p==6||p==9||p==10){
			bl=tl-bw;
		}
		else if(p==2||p==5){
			bl=tl+((tw-bw)/2);
		}
		else{
			bl=tl+tw;
		}
		bt+=tB.ttmTrigger.p7TTMopt[9];
		bl+=tB.ttmTrigger.p7TTMopt[8];
	}
	return [bt,bl];
}
function P7_TTMcenter(bh,bw){
	var wn,ws,bt,bl;
	wn=P7_TTMgetWinDims();
	ws=P7_TTMgetWinScroll();
	bl=parseInt((wn[1]-bw)/2,10);
	bt=parseInt((wn[0]-bh)/2,10);
	bl+=ws[1];
	bt+=ws[0];
	return [bt,bl];
}
function P7_TTMedge(tB,bt,bl){
	var nt,nl,bh,bw,wn,ws,m=0;
	wn=P7_TTMgetWinDims();
	ws=P7_TTMgetWinScroll();
	bw=tB.offsetWidth;
	if((bl+bw)>(wn[1]+ws[1])){
		m=1;
		nl=wn[1]-bw+ws[1];
	}
	else{
		nl=bl;
	}
	bh=tB.offsetHeight;
	if(((bt+bh)>(wn[0]+ws[0]))){
		m=1;
		nt=wn[0]-bh+ws[0];
	}
	else{
		nt=bt;
	}
	if(nl<ws[1]){
		nl=ws[1];
		m=1;
	}
	if(nt<ws[0]){
		nt=ws[0];
		m=1;
	}
	return [m,nt,nl];
}
function P7_TTMall(md){
	var cm=document.p7TTMall,nm;
	if(md=='on'||md=='off'){
		nm=md;
	}
	else{
		nm=(cm=='on')?'off':'on';
	}
	document.p7TTMall=nm;
}
function P7_TTMout(evt){
	var tB,tg,pp,m=true;
	evt=(evt)?evt:event;
	tg=(evt.relatedTarget)?evt.relatedTarget:evt.toElement;
	if(tg){
		pp=tg;
		while(pp){
			if(pp==this||pp==this.ttmTrigger){
				m=false;
				break;
			}
			pp=pp.parentNode;
		}
	}
	m=(tg)?m:false;
	if(m){
		if(this.p7TTMcloseTmr){
			clearTimeout(this.p7TTMcloseTmr);
		}
		if(this.ttmParentLock){
			this.p7TTMcloseTmr=setTimeout("P7_TTMparentClose('"+this.id+"')",300);
		}
		else{
			this.p7TTMcloseTmr=setTimeout("P7_TTMclose('"+this.id+"')",300);
		}
	}
}
function P7_TTMparentClose(dv,ck){
	var tB=document.getElementById(dv);
	if(!ck&&tB.ttmChildID&&document.getElementById(tB.ttmChildID).ttmState!='closed'){
		if(tB.p7TTMcloseTmr){
			clearTimeout(tB.p7TTMcloseTmr);
		}
		tB.ttmParentLock=true;
		tB.p7TTMcloseTmr=setTimeout("P7_TTMparentClose('"+tB.id+"')",300);
	}
	else{
		tB.ttmParentLock=false;
		P7_TTMclose(tB.id);
	}
}
function P7_TTMhasParent(tr){
	var m=null,pp=tr.parentNode;
	while(pp){
		if(pp&&pp.id&&typeof(pp.id)=='string'){
			if(pp.id.indexOf('p7TTMbox_')===0){
				m=pp;
			}
			if(pp.nodeName=='BODY'){
				break;
			}
		}
		pp=pp.parentNode;
	}
	return m;
}
function P7_TTMrsz(){
	var i,tB;
	if(p7TTMa&&document.p7TTMboxes){
		for(i=0;i<document.p7TTMboxes.length;i++){
			if(document.p7TTMboxes[i].ttmState=='open'){
				P7_TTMposBox(document.p7TTMboxes[i]);
			}
		}
	}
}
function P7_TTMfader(dv){
	var tB,cP,co,ulm=99,llm=1,fr;
	tB=document.getElementById(dv);
	fr=tB.ttmFaderFrameRate;
	co=tB.ttmOpacity;
	if(tB.ttmState=='open'){
		co+=fr;
		co=(co>=ulm)?ulm:co;
	}
	else{
		co-=fr;
		co=(co<=llm)?llm:co;
	}
	tB.ttmOpacity=co;
	if(tB.filters){
		tB.style.filter='alpha(opacity='+(co)+')';
	}
	else{
		tB.style.opacity=(co/100);
	}
	if((tB.ttmState=='open'&&co==ulm)||(tB.ttmState=='closed'&&co==llm)){
		tB.ttmFaderRunning=false;
		clearInterval(tB.ttmFader);
		if(tB.ttmState=='closed'){
			tB.visibility='hidden';
			tB.style.left='-3000px';
			tB.style.top='-9000px';
		}
		if(tB.filters){
			tB.style.filter='';
		}
		else{
			tB.style.opacity=1;
		}
	}
}
function P7_TTMGrow(dv){
	var an,tB,nl,nh,nw,nt,ml=false,mt=false,mh=false,mw=false;
	tB=document.getElementById(dv);
	nl=tB.ttmCurrentLeft;
	if(tB.ttmTargetLeft<tB.ttmCurrentLeft){
		nl-=(tB.ttmState=='open')?tB.ttmFrameRateLeft:tB.ttmFrameRateLeft*2;
		nl=(nl<=tB.ttmTargetLeft)?tB.ttmTargetLeft:nl;
		ml=true;
	}
	else if(tB.ttmTargetLeft>tB.ttmCurrentLeft){
		nl+=(tB.ttmState=='open')?tB.ttmFrameRateLeft:tB.ttmFrameRateLeft*2;
		nl=(nl>=tB.ttmTargetLeft)?tB.ttmTargetLeft:nl;
		ml=true;
	}
	nt=tB.ttmCurrentTop;
	if(tB.ttmTargetTop<tB.ttmCurrentTop){
		nt-=(tB.ttmState=='open')?tB.ttmFrameRateTop:tB.ttmFrameRateTop*2;
		nt=(nt<=tB.ttmTargetTop)?tB.ttmTargetTop:nt;
		mt=true;
	}
	else if(tB.ttmTargetTop>tB.ttmCurrentTop){
		nt+=(tB.ttmState=='open')?tB.ttmFrameRateTop:tB.ttmFrameRateTop*2;
		nt=(nt>=tB.ttmTargetTop)?tB.ttmTargetTop:nt;
		mt=true;
	}
	nh=tB.ttmCurrentHeight;
	if(tB.ttmCurrentHeight<tB.ttmTargetHeight){
		nh+=(tB.ttmState=='open')?tB.ttmFrameRateHeight:tB.ttmFrameRateHeight*2;
		nh=(nh>=tB.ttmTargetHeight)?tB.ttmTargetHeight:nh;
		mh=true;
	}
	else if(tB.ttmCurrentHeight>tB.ttmTargetHeight){
		nh-=(tB.ttmState=='open')?tB.ttmFrameRateHeight:tB.ttmFrameRateHeight*2;
		nh=(nh<=tB.ttmTargetHeight)?tB.ttmTargetHeight:nh;
		mh=true;
	}
	nw=tB.ttmCurrentWidth;
	if(tB.ttmCurrentWidth<tB.ttmTargetWidth){
		nw+=(tB.ttmState=='open')?tB.ttmFrameRateWidth:tB.ttmFrameRateWidth*2;
		nw=(nw>=tB.ttmTargetWidth)?tB.ttmTargetWidth:nw;
		mw=true;
	}
	else if(tB.ttmCurrentWidth>tB.ttmTargetWidth){
		nw-=(tB.ttmState=='open')?tB.ttmFrameRateWidth:tB.ttmFrameRateWidth*2;
		nw=(nw<=tB.ttmTargetWidth)?tB.ttmTargetWidth:nw;
		mw=true;
	}
	if(ml||mt||mh||mw){
		tB.ttmCurrentLeft=nl;
		tB.ttmCurrentTop=nt;
		tB.ttmCurrentWidth=nw;
		tB.ttmCurrentHeight=nh;
		tB.style.left=nl+'px';
		tB.style.top=nt+'px';
		tB.style.width=nw+'px';
		tB.style.height=nh+'px';
	}
	else{
		clearInterval(tB.ttmGrow);
		tB.ttmGrowRunning=false;
		if(tB.ttmState=='closed'){
			tB.visibility='hidden';
			tB.style.left='-3000px';
			tB.style.top='-9000px';
		}
		else{
			tB.style.height='auto';
			tB.style.overflow='visible';
		}
	}
}
function P7_TTMsetGrowOpen(tB){
	var tR,w,h,fr,dy=30,stp,dsw,dsh,frh,frw,an,dur;
	tR=tB.ttmTrigger;
	tB.style.height='auto';
	tB.style.width='auto';
	an=tR.p7TTMopt[3];
	tB.ttmAnimOpt=an;
	dur=tR.p7TTMopt[11];
	stp=dur/dy;
	tB.ttmTargetLeft=parseInt(tB.style.left,10);
	tB.ttmTargetTop=parseInt(tB.style.top,10);
	h=tB.ttmTargetHeight;
	w=tB.ttmTargetWidth;
	dsw=w;
	dsh=h;
	frh=parseInt(dsh/stp,10);
	frh=(frh<=1)?1:frh;
	frw=parseInt(dsw/stp,10);
	frw=(frw<=1)?1:frw;
	tB.ttmFrameRateHeight=frh;
	tB.ttmFrameRateWidth=frw;
	if(an==8){
		if(frh%2){
			frh+=1;
		}
		if(frw%2){
			frw+=1;
		}
		frw=(frw<2)?2:frw;
		frh=(frh<2)?2:frh;
	}
	tB.ttmFrameRateLeft=frw;
	tB.ttmFrameRateTop=frh;
	tB.ttmStartLeft=tB.ttmTargetLeft;
	tB.ttmStartTop=tB.ttmTargetTop;
	tB.ttmStartHeight=tB.ttmTargetHeight;
	tB.ttmStartWidth=tB.ttmTargetWidth;
	if(an==2){
		tB.ttmStartWidth=1;
	}
	else if(an==3){
		tB.ttmStartLeft=tB.ttmTargetLeft+w;
		tB.ttmStartWidth=1;
	}
	else if(an==4){
		tB.ttmStartHeight=1;
	}
	else if(an==5){
		tB.ttmStartHeight=1;
		tB.ttmStartTop=tB.ttmTargetTop+h;
	}
	else if(an==6){
		tB.ttmStartHeight=1;
		tB.ttmStartWidth=1;
	}
	else if(an==7){
		tB.ttmStartHeight=1;
		tB.ttmStartWidth=1;
		tB.ttmStartLeft=tB.ttmTargetLeft+w;
	}
	else if(an==8){
		tB.ttmStartHeight=1;
		tB.ttmStartWidth=1;
		tB.ttmStartLeft=tB.ttmTargetLeft+w/2;
		tB.ttmStartTop=tB.ttmTargetTop+h/2;
		tB.ttmFrameRateLeft=frw/2;
		tB.ttmFrameRateTop=frh/2;
	}
	tB.ttmCurrentLeft=tB.ttmStartLeft;
	tB.ttmCurrentTop=tB.ttmStartTop;
	tB.ttmCurrentWidth=tB.ttmStartWidth;
	tB.ttmCurrentHeight=tB.ttmStartHeight;
	tB.style.left=tB.ttmStartLeft+'px';
	tB.style.top=tB.ttmStartTop+'px';
	tB.style.width=tB.ttmStartWidth+'px';
	tB.style.height=tB.ttmStartHeight+'px';
	tB.style.overflow='hidden';
}
function P7_TTMbuild(n){
	var box,dv,el,ob,a,inr,il,wr,cls,mdl,mdlw,cnt;
	box=document.createElement('div');
	box.setAttribute('id','p7TTMbox_'+n);
	box.className='p7TTMbox';
	inr=document.createElement('div');
	inr.setAttribute('id','p7TTM_inner_'+n);
	inr.className='p7TTM_inner';
	el=document.createElement('div');
	el.className='p7TTMtop';
	dv=document.createElement('div');
	dv.className='p7TTMtopleft';
	el.appendChild(dv);
	dv=document.createElement('div');
	dv.className='p7TTMtiletop';
	el.appendChild(dv);
	dv=document.createElement('div');
	dv.className='p7TTMtopright';
	el.appendChild(dv);
	inr.appendChild(el);
	mdlw=document.createElement('div');
	mdlw.className='p7TTMmiddlewrapper';
	mdl=document.createElement('div');
	mdl.className='p7TTMmiddle';
	cnt=document.createElement('div');
	cnt.setAttribute('id','p7TTMcnt_'+n);
	cnt.className='p7TTMcnt';
	cls=document.createElement('div');
	cls.setAttribute('id','p7TTMclose_'+n);
	cls.className='p7TTMclose';
	a=document.createElement('a');
	a.setAttribute('href','#');
	il=document.createElement('i');
	il.appendChild(document.createTextNode('X'));
	a.appendChild(il);
	cls.appendChild(a);
	cnt.appendChild(cls);
	dv=document.createElement('div');
	dv.setAttribute('id','p7TTMcontent_'+n);
	dv.className='p7TTMcontent';
	cnt.appendChild(dv);
	mdl.appendChild(cnt);
	mdlw.appendChild(mdl);
	inr.appendChild(mdlw);
	el=document.createElement('div');
	el.className='p7TTMbottom';
	dv=document.createElement('div');
	dv.className='p7TTMbottomleft';
	el.appendChild(dv);
	dv=document.createElement('div');
	dv.className='p7TTMtilebottom';
	el.appendChild(dv);
	dv=document.createElement('div');
	dv.className='p7TTMbottomright';
	el.appendChild(dv);
	inr.appendChild(el);
	dv=document.createElement('div');
	dv.setAttribute('id','p7TTMcall_'+n);
	dv.className='p7TTMcall';
	box.appendChild(dv);
	box.appendChild(inr);
	document.getElementsByTagName('body')[0].appendChild(box);
	return 'p7TTMbox_'+n;
}
function P7_TTMgetIEver(){
	var j,v=-1,nv,m=false;
	nv=navigator.userAgent.toLowerCase();
	j=nv.indexOf("msie");
	if(j>-1){
		v=parseInt(nv.substring(j+4,j+6),10);
		if(document.documentMode){
			v=document.documentMode;
		}
	}
	return v;
}
function P7_TTMgetWinDims(){
	var h,w,st;
	if(document.documentElement&&document.documentElement.clientHeight){
		w=document.documentElement.clientWidth;
		h=document.documentElement.clientHeight;
	}
	else if(window.innerHeight){
		if(document.documentElement.clientWidth){
			w=document.documentElement.clientWidth;
		}
		else{
			w=window.innerWidth;
		}
		h=window.innerHeight;
	}
	else if(document.body){
		w=document.body.clientWidth;
		h=document.body.clientHeight;
	}
	return [h,w];
}
function P7_TTMgetWinScroll(){
	var st=0,sl=0,IEver=P7_TTMgetIEver();
	if(navigator.userAgent.toLowerCase().indexOf('iphone')>-1){
		return [0,0];
	}
	st=document.body.parentNode.scrollTop;
	if(!st||IEver==5){
		st=document.body.scrollTop;
		if(!st){
			st=window.scrollY?window.scrollY:0;
		}
	}
	sl=document.body.parentNode.scrollLeft;
	if(!sl||IEver==5){
		sl=document.body.scrollLeft;
		if(sl){
			sl=window.scrollX?window.scrollX:0;
		}
	}
	return [st,sl];
}
function P7_TTMgetOffset(el,md,bb){
	var d=0,v,vv,vr,tx=0,bx=0,lx=0,rx=0;
	if(md=='width'){
		el.style.width='auto';
		v=el.offsetWidth;
		el.style.width=v+'px';
		vv=el.offsetWidth;
		el.style.width='auto';
		vr=vv-v;
		d=v-vr;
	}
	else if(md=='height'){
		el.style.height='auto';
		v=el.offsetHeight;
		el.style.height=v+'px';
		vv=el.offsetHeight;
		el.style.height='auto';
		vr=vv-v;
		d=v-vr;
	}
	return d;
}
function P7_TTMsetClass(ob,cl){
	if(ob){
		var cc,nc,r=/\s+/g;
		cc=ob.className;
		nc=cl;
		if(cc&&cc.length>0){
			if(cc.indexOf(cl)==-1){
				nc=cc+' '+cl;
			}
			else{
				nc=cc;
			}
		}
		nc=nc.replace(r,' ');
		ob.className=nc;
	}
}
function P7_TTMremClass(ob,cl){
	if(ob){
		var cc,nc,r=/\s+/g;
		cc=ob.className;
		if(cc&&cc.indexOf(cl>-1)){
			nc=cc.replace(cl,'');
			nc=nc.replace(r,' ');
			nc=nc.replace(/\s$/,'');
			ob.className=nc;
		}
	}
}
function P7_TTMgetElementsByAttribute(att,val){
	var i,x=0,aL,aT,rS=[];
	aL=document.getElementsByTagName('*');
	for(i=0;i<aL.length;i++){
		aT=aL[i].getAttribute(att);
		if(aT&&aT==val){
			rS[x]=aL[i];
			x++;
		}
	}
	return rS;
}
function P7_TTMgetElementsByClassName(cls){
	var i,x=0,aL,aT,rS=[];
	if(typeof(document.getElementsByClassName)!='function'){
		aL=document.getElementsByTagName('*');
		for(i=0;i<aL.length;i++){
			aT=aL[i].className;
			if(aT&&aT==cls){
				rS[x]=aL[i];
				x++;
			}
		}
	}
	else{
		rS=document.getElementsByClassName(cls);
	}
	return rS;
}
function P7_TTMgetMapImage(tR,tg){
	var i,tMap,tArea,tIM,mp,shp,crd,ml,mt,mw,mh;
	tMap=(tg=='MAP')?tR:tR.parentNode;
	if(tMap.nodeName=='MAP'&&tMap.id){
		tIM=document.getElementsByTagName('IMG');
		for(i=0;i<tIM.length;i++){
			mp=tIM[i].getAttribute('usemap');
			if(mp){
				mp=mp.replace('#','');
				if(mp==tMap.id){
					tR.p7ttmMapImg=tIM[i];
					tR.p7ttmCoords=[0,0,0,0];
					break;
				}
			}
		}
	}
	if(tR.p7ttmMapImg && tg=='AREA'){
		if(tR.coords){
			crd=tR.coords.split(",");
			if(tR.shape.toLowerCase()=='rect'&&crd.length==4){
				ml=crd[0];
				mt=crd[1];
				mw=crd[2]-crd[0];
				mh=crd[3]-crd[1];
			}
			else if(tR.shape.toLowerCase()=='circle'&&crd.length==3){
				ml=crd[0]-crd[2];
				mt=crd[1]-crd[2];
				mw=crd[2]*2;
				mh=mw;
			}
			else if(tR.shape.toLowerCase()=='poly'&&crd.length>1){
				ml=crd[0];
				mt=crd[1];
				mw=20;
				mh=20;
			}
		}
		if(ml){
			tR.p7ttmCoords=[ml,mt,mw,mh];
		}
	}
}
function P7_TTMurl(){
	var i,h,x,param,tT,val,d='ttm',pn,dv,m=false;
	if(document.getElementById){
		h=document.location.search;
		if(h){
			h=h.replace('?','');
			param=h.split(/[=&]/g);
			if(param&&param.length){
				for(i=0;i<param.length;i+=2){
					m=false;
					if(param[i]==d){
						val=param[i+1];
						tT=document.getElementById(val);
						if(tT&&tT.p7TTMopt){
							m=true;
						}
						else{
							x=parseInt(val,10);
							if(x&&x>0&&x<document.p7TTMtriggers.length+1){
								tT=document.p7TTMtriggers[x-1];
								m=true;
							}
						}
						if(m){
							if(tT.p7TTMopt.length>17&&tT.p7TTMopt[17]==1){
								P7_TTMopen(tT,null,1);
							}
						}
					}
				}
			}
		}
		h=document.location.hash;
		m=false;
		if(h){
			if(h.indexOf('ttm_')==1){
				val=h.replace('#ttm_','');
				if(val&&val!==''){
					tT=document.getElementById(val);
					if(tT&&tT.p7TTMopt){
						m=true;
					}
					else{
						x=parseInt(val,10);
						if(x&&x>0&&x<document.p7TTMtriggers.length+1){
							tT=document.p7TTMtriggers[x-1];
							m=true;
						}
					}
					if(m){
						if(tT.p7TTMopt.length>17&&tT.p7TTMopt[17]==1){
							P7_TTMopen(tT,null,1);
						}
					}
				}
			}
		}
	}
}
function P7_TTMisMobile(){
	var i,m=false,ua=navigator.userAgent.toLowerCase();
	var dv=['iphone','ipad','ipod','android','windows ce','iemobile','windowsce','blackberry','palm','symbian','series60',
	'armv','arm7tdmi','opera mobi','opera mini','polaris','kindle','midp','mmp/','portalmmm','smm-mms','sonyericsson','zune'];
	for(i=0;i<dv.length;i++){
		if(ua.search(dv[i])>-1){
			m=dv[i];
			break;
		}
	}
	return m;
}



//handle table row highligthing for Planning Forms page
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='';};}}}}}}
}


