var doctypetag = false // Turn to true if you have a <!DOCTYPE> tag

var crossbrowser = 0
var nonie = 0
var iedt = 1
if(navigator.appName!="Microsoft Internet Explorer") { crossbrowser = 1; nonie = 1 }
if(doctypetag==true) { crossbrowser = 1; if(nonie==0) { iedt = 0 } }
function createtabs(tabunique, tabnames, tabsize, tabdefault, tabscroll, tabpadding, tabshadow) {
 if(tabsize==null) { tabsize = [500, 500] } if(tabdefault==null) { tabdefault = 1 } if(tabscroll==null) { tabscroll = "auto" } if(tabpadding==null) { tabpadding = "5px" } if(tabshadow==null) { tabshadow = true }
 tabsize[0] = parseInt(tabsize[0])
 tabsize[1] = parseInt(tabsize[1])
 if(tabunique==""||tabunique==null||tabnames.length==0||tabsize[0]<100||tabdefault<1||tabdefault>tabnames.length||tabpadding.indexOf("px")==-1) {
  document.write("<p><strong style=\"background-color:red;color:white;\">&nbsp;An error occured with your setup of XP Tabs&nbsp;</strong></p>")
 } else {
  var tabcode = "<table border=\"0\" width=\"" + tabsize[0] + "\" cellspacing=\"0\" cellpadding=\"0\"><tr>\n"
  var tabcnt = 1; var xtrawidth = true
  var calcwidth = (tabsize[0] - 80) - (78 * (tabnames.length - 1))
  while(tabcnt<=tabnames.length) {
   if(xtrawidth==true) {
    tabcode += "<td style=\"width:3px;\"><div id=\"" + tabunique + "-zerolpad\" class=\"cssline\" style=\"height:" + (22 + iedt) + "px;\"><nobr></nobr></div></td>\n"
   } else {
    tabcode += "<td style=\"width:1px;vertical-align:bottom;\"><div id=\"" + tabunique + "-dots-" + tabcnt + "\" class=\"cssdot\"><nobr></nobr></div></td>\n"
   }
   tabcode += "<td style=\"width:77px;text-align:center;\">\n<div id=\"" + tabunique + "-tabs-" + tabcnt + "\" class=\"tabdiv\" style=\"z-index:1;\" onclick=\"applytab(" + tabcnt + ",'" + tabunique + "'," + tabnames.length + ");\" onmouseover=\"gtmh('" + tabcnt + "','" + tabunique + "');\" onmouseout=\"gtmo('" + tabcnt + "','" + tabunique + "');\">\n"
   tabcode += "<div id=\"" + tabunique + "-gtt-" + tabcnt + "\" class=\"gtmout\"><div id=\"" + tabunique + "-gt-" + tabcnt + "\" class=\"gtmout\"><nobr></nobr></div></div>\n"
   tabcode += "<div id=\"" + tabunique + "-tabcontents-" + tabcnt + "\" style=\"position:static;top:0px;left:0px;\">&nbsp;" + tabnames[(tabcnt - 1)] + "&nbsp;</div>\n"
   tabcode += "<div class=\"curvy\" style=\"top:-1px;left:-1px;background-color:white;\" id=\"" + tabunique + "-curvy-" + tabcnt + "-1\"><nobr></nobr></div>\n"
   tabcode += "<div class=\"curvy\" style=\"top:-1px;left:0px;background-color:#CCCCCC;\" id=\"" + tabunique + "-curvy-" + tabcnt + "-2\"><nobr></nobr></div>\n"
   tabcode += "<div class=\"curvy\" style=\"top:0px;left:-1px;background-color:#CCCCCC;\" id=\"" + tabunique + "-curvy-" + tabcnt + "-3\"><nobr></nobr></div>\n"
   tabcode += "<div class=\"curvy\" style=\"top:0px;left:0px;background-color:#91A7B4;\" id=\"" + tabunique + "-curvy-" + tabcnt + "-4\"><nobr></nobr></div>\n"
   tabcode += "<div class=\"curvy\" style=\"top:-1px;right:" + (-2 + nonie) + "px;background-color:white;\" id=\"" + tabunique + "-curvy-" + tabcnt + "-5\"><nobr></nobr></div>\n"
   tabcode += "<div class=\"curvy\" style=\"top:-1px;right:" + (-1 + nonie) + "px;background-color:#CCCCCC;\" id=\"" + tabunique + "-curvy-" + tabcnt + "-6\"><nobr></nobr></div>\n"
   tabcode += "<div class=\"curvy\" style=\"top:0px;right:" + (-2 + nonie) + "px;background-color:#CCCCCC;\" id=\"" + tabunique + "-curvy-" + tabcnt + "-7\"><nobr></nobr></div>\n"
   tabcode += "<div class=\"curvy\" style=\"top:0px;right:" + (-1 + nonie) + "px;background-color:#91A7B4;\" id=\"" + tabunique + "-curvy-" + tabcnt + "-8\"><nobr></nobr></div>\n</div>\n<div id=\"" + tabunique + "-selbg-" + tabcnt + "\" class=\"hidediv\"><nobr></nobr></div>\n</td>\n"
   tabcnt += 1
   xtrawidth = false
  }
  tabcode += "<td style=\"width:" + calcwidth + "px;vertical-align:bottom;text-align:right;\"><div id=\"" + tabunique + "-trdiv\" class=\"trline\" style=\"width:" + calcwidth + "px;height:3px;\"><nobr></nobr></div></td>\n</tr></table>\n"
  if(crossbrowser==0) {
   tabcode += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"" + (tabsize[0] + 3) + "\" height=\"" + (tabsize[1] + 3) + "\">\n"
  } else {
   tabcode += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"" + (tabsize[0] + 3) + "\" height=\"" + (tabsize[1] + 3) + "\" style=\"position:relative;top:-1px;left:0px;\">\n"
  }
  tabcode += "<tr><td width=\"" + tabsize[0] + "\" height=\"" + tabsize[1] + "\"><div style=\"border-left:solid 1px #919B9C;border-right:solid 1px #919B9C;border-bottom:solid 1px #919B9C;width:" + tabsize[0] + "px;height:" + tabsize[1] + "px;overflow:" + tabscroll + ";\"><div id=\"" + tabunique + "main\" style=\"padding:" + tabpadding + ";\"></div></div></td>\n"
  if(tabshadow==true) {
   tabcode += "<td width=\"3\" height=\"" + tabsize[1] + "\" style=\"vertical-align:bottom;text-align:left;font-size:0px;padding-top:1px;\"><div class=\"shadowY1\" style=\"width:1px;height:" + (tabsize[1] - 1) + "px;\"><div class=\"shadowY2\" style=\"width:1px;height:" + (tabsize[1] - 1) + "px;\"><div class=\"shadowY3\" style=\"width:1px;height:" + ((tabsize[1] - 2) + crossbrowser) + "px;\"></div></div></div></td></tr>\n"
   tabcode += "<tr><td width=\"" + tabsize[0] + "\" height=\"3\" style=\"vertical-align:top;text-align:right;font-size:0px;padding-left:" + ((1 + nonie) + crossbrowser) + "px;\"><div class=\"shadowX1\" style=\"height:1px;width:" + (tabsize[0] - 1) + "px;\"><div class=\"shadowX2\" style=\"height:1px;width:" + (tabsize[0] - 1) + "px;\"><div class=\"shadowX3\" style=\"height:1px;width:" + (tabsize[0] - 2) + "px;\"></div></div></div></td>\n"
   tabcode += "<td width=\"3\" height=\"3\" style=\"vertical-align:top;text-align:left;font-size:0px;\" align=\"left\" valign=\"top\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"3\" height=\"3\">\n"
   tabcode += "<tr><td class=\"shadowM1\"></td><td class=\"shadowM2\"></td><td class=\"shadowM3\"></td></tr>\n"
   tabcode += "<tr><td class=\"shadowM2\"></td><td class=\"shadowM2\"></td><td class=\"shadowM3\"></td></tr>\n"
   tabcode += "<tr><td class=\"shadowM3\"></td><td class=\"shadowM3\"></td><td class=\"shadowM3\"></td></tr>\n"
   tabcode += "</table><br></td></tr>\n</table>\n"
  } else {
   tabcode += "<td width=\"1\" height=\"" + tabsize[1] + "\" style=\"font-size:0px;\"></td></tr>\n"
   tabcode += "<tr><td width=\"" + tabsize[0] + "\" height=\"3\" style=\"font-size:0px;\"></td>\n"
   tabcode += "<td width=\"1\" height=\"3\" style=\"font-size:0px;\">\n"
   tabcode += "<br></td></tr>\n</table>\n"
  }
  tabcode += "<div id=\"" + tabunique + "-lensize\" style=\"display:none;width:" + calcwidth + "px;\"></div>"
  document.getElementById(tabunique + "-nav").innerHTML = tabcode
  var bodycnt = 1
  while(bodycnt<=tabnames.length) { document.getElementById(tabunique + bodycnt).className = "hidediv"; bodycnt += 1 }
  applytab(tabdefault, tabunique, tabnames.length)
 }
}
function gtmh(thegt, tabunique) {
 document.getElementById(tabunique + "-gt-" + thegt).className = "gthover"
 if(document.getElementById(tabunique + "-gtt-" + thegt).className=="gtmout") {
  document.getElementById(tabunique + "-tabs-" + thegt).className = "tabhov"
  document.getElementById(tabunique + "-curvy-" + thegt + "-4").style.backgroundColor = "#E68B2C"
  document.getElementById(tabunique + "-curvy-" + thegt + "-8").style.backgroundColor = "#E68B2C"
 }
}
function gtmo(thegt, tabunique) {
 document.getElementById(tabunique + "-gt-" + thegt).className = "gtmout"
 if(document.getElementById(tabunique + "-gtt-" + thegt).className=="gtmout") {
  document.getElementById(tabunique + "-tabs-" + thegt).className = "tabdiv"
  document.getElementById(tabunique + "-curvy-" + thegt + "-4").style.backgroundColor = "#91A7B4"
  document.getElementById(tabunique + "-curvy-" + thegt + "-8").style.backgroundColor = "#91A7B4"
 }
}
function applytab(thetab, tabunique, tabnamesl) {
 var tabcnt = 1
 while(tabcnt<=tabnamesl) {
  document.getElementById(tabunique + "-tabs-" + tabcnt).className = "tabdiv"
  document.getElementById(tabunique + "-tabs-" + tabcnt).style.zIndex = "1"
  document.getElementById(tabunique + "-tabcontents-" + tabcnt).style.position = "relative"
  document.getElementById(tabunique + "-tabcontents-" + tabcnt).style.top = "-1px"
  document.getElementById(tabunique + "-tabcontents-" + tabcnt).style.left = "0px"
  document.getElementById(tabunique + "-selbg-" + tabcnt).className = "hidediv"
  document.getElementById(tabunique + "-gt-" + tabcnt).className = "gtmout"
  document.getElementById(tabunique + "-gtt-" + tabcnt).className = "gtmout"
  var curvycnt = 1
  while(curvycnt<=8) { document.getElementById(tabunique + "-curvy-" + tabcnt + "-" + curvycnt).className = "curvy"; curvycnt += 1 }
  document.getElementById(tabunique + "-curvy-" + tabcnt + "-4").style.backgroundColor = "#91A7B4"
  document.getElementById(tabunique + "-curvy-" + tabcnt + "-8").style.backgroundColor = "#91A7B4"
  if(tabcnt>1) { document.getElementById(tabunique + "-dots-" + tabcnt).className = "cssdot" }
  tabcnt += 1
 }
 document.getElementById(tabunique + "main").innerHTML = document.getElementById(tabunique + thetab).innerHTML
 document.getElementById(tabunique + "-tabcontents-" + thetab).style.top = "1px"
 document.getElementById(tabunique + "-selbg-" + thetab).className = "selbg"
 document.getElementById(tabunique + "-curvy-" + thetab + "-4").style.backgroundColor = "#E68B2C"
 document.getElementById(tabunique + "-curvy-" + thetab + "-8").style.backgroundColor = "#E68B2C"
 if(thetab==1) {
  document.getElementById(tabunique + "-tabs-" + thetab).className = "zerotabsel"
  document.getElementById(tabunique + "-gtt-" + thetab).className = "zerogttperm"
  document.getElementById(tabunique + "-zerolpad").className = "zerovline"
  document.getElementById(tabunique + "-tabcontents-" + thetab).style.left = "1px"
  var curvycnt = 5
  while(curvycnt<=8) { document.getElementById(tabunique + "-curvy-1-" + curvycnt).style.right = (oe(curvycnt) + 1) + "px"; curvycnt += 1 }
 }
 if(thetab!=1) {
  document.getElementById(tabunique + "-tabs-" + thetab).className = "tabsel"
  document.getElementById(tabunique + "-gtt-" + thetab).className = "gttperm"
  document.getElementById(tabunique + "-zerolpad").className = "cssline"
  document.getElementById(tabunique + "-dots-" + thetab).className = "hidedot"
  var curvycnt = 5
  while(curvycnt<=8) { document.getElementById(tabunique + "-curvy-" + (thetab - 1) + "-" + curvycnt).className = "hidediv"; document.getElementById(tabunique + "-curvy-1-" + curvycnt).style.right = (oe(curvycnt) + nonie) + "px"; curvycnt += 1 }
 }
 if(thetab==tabnamesl) {
  document.getElementById(tabunique + "-trdiv").className = "lentrline"
  document.getElementById(tabunique + "-trdiv").style.width = (parseInt(document.getElementById(tabunique + "-lensize").style.width) - 1) + "px"
 }
 if(thetab!=tabnamesl) {
  document.getElementById(tabunique + "-trdiv").className = "trline"
  document.getElementById(tabunique + "-trdiv").style.width = (parseInt(document.getElementById(tabunique + "-lensize").style.width) + crossbrowser - 1) + "px"
  document.getElementById(tabunique + "-dots-" + (thetab + 1)).className = "hidedot"
  var curvycnt = 1
  while(curvycnt<=4) { document.getElementById(tabunique + "-curvy-" + (thetab + 1) + "-" + curvycnt).className = "hidediv"; curvycnt += 1 }
 }
}
function addxptabstyle() {
 var csscode = "<style type=\"text/css\">\n"
 csscode += ".tabdiv { position: relative; top: 0px; left: 0px; width: " + (77 - (crossbrowser * 2)) + "px; border-left: solid 1px #91A7B4; border-right: solid 1px #91A7B4; border-top: solid 1px #91A7B4; border-bottom: solid 1px #919B9C; background: #fff url(other/xpTab.bmp); background-color: #CCFFFF; }\n"
 csscode += ".tabhov { position: relative; top: 0px; left: 0px; width: " + (77 - (crossbrowser * 2)) + "px; border-left: solid 1px #91A7B4; border-right: solid 1px #91A7B4; border-top: solid 1px #E68B2C; border-bottom: solid 1px #919B9C; background: #fff url(other/xpTab.bmp); background-color: #CCFFFF; cursor: pointer; }\n"
 csscode += ".tabsel { position: relative; top: 0px; left: 0px; width: " + (81 - (crossbrowser * 2)) + "px; border-left: solid 1px #919B9C; border-right: solid 1px #919B9C; border-top: solid 1px #E68B2C; background-color: white; cursor: default; margin-top: -2px; margin-left: -2px; margin-right: -2px; margin-bottom: -2px; }\n"
 csscode += ".zerotabsel { position: relative; top: 0px; left: 0px; width: " + (82 - (crossbrowser * 2)) + "px; border-left: solid 1px #919B9C; border-right: solid 1px #919B9C; border-top: solid 1px #E68B2C; background-color: white; cursor: default; margin-top: -2px; margin-left: " + (-3 - crossbrowser) + "px; margin-right: -2px; margin-bottom: -2px; }\n"
 csscode += ".gthover { width: 75px; height: 2px; background-color: #FFC83C; }\n"
 csscode += ".gtmout { width: 75px; height: 2px; }\n"
 csscode += ".gttperm { width: 79px; height: 2px; background-color: #FFC83C; }\n"
 csscode += ".zerogttperm { width: 80px; height: 2px; background-color: #FFC83C; }\n"
 if(nonie==1) {
  csscode += ".selbg { width: " + (77 - (crossbrowser * 2)) + "px; height: 5px; display: block; }\n"
 } else {
  csscode += ".selbg { width: 77px; height: 5px; display: block; }\n"
 }
 csscode += ".cssline { height: 23px; border-bottom: solid 1px #919B9C; }\n"
 csscode += ".cssdot { width: 1px; height: 1px; background-color: #919B9C; }\n"
 csscode += ".zerovline { width: 3px; height: 23px; border-left: solid 1px #919B9C; }\n"
 csscode += ".trline { border-bottom: solid 1px #919B9C; }\n"
 if(crossbrowser==0) {
  csscode += ".lentrline { border-bottom: solid 1px #919B9C; border-left: solid 1px #919B9C; }\n"
 } else {
  csscode += ".lentrline { border-bottom: solid 1px #919B9C; border-left: solid 1px #919B9C; position: relative; top: 0px; left: 1px; }\n"
 }
 csscode += ".curvy { position: absolute; width: 1px; height: 1px; display: block; }\n"
 csscode += ".hidediv { display: none; }\n"
 csscode += ".hidedot { visibility: hidden; }\n"
 csscode += ".shadowY1 { border-left: solid 1px #CECECE; }\n"
 csscode += ".shadowY2 { border-left: solid 1px #DBDBDB; padding-top: 1px; }\n"
 csscode += ".shadowY3 { border-left: solid 1px #E5E5E5; }\n"
 csscode += ".shadowX1 { border-top: solid 1px #CECECE; }\n"
 csscode += ".shadowX2 { border-top: solid 1px #DBDBDB; padding-left: 1px; }\n"
 csscode += ".shadowX3 { border-top: solid 1px #E5E5E5; }\n"
 csscode += ".shadowM1 { width: 1px; height: 1px; background-color: #CECECE; }\n"
 csscode += ".shadowM2 { width: 1px; height: 1px; background-color: #DBDBDB; }\n"
 csscode += ".shadowM3 { width: 1px; height: 1px; background-color: #E5E5E5; }\n</style>"
 document.write(csscode)
}
function oe(n) { n = (n / 2) + ""; if(n.length>1) { n = -2 } else { n = -1 } return n }