var ie5=document.all && !window.opera;
var opera = window.opera;
var isOverTab = false;
var oldSec = false;
var oldSecShadow = false;
var oldSecMenu = false;

function tabOut() {
	if (!isOverTab) { hideTabs() };
}

function writeMenuItem(txtItem,txtLink,intWidth) {
	document.write("<tr><td class=\"menuCell\"><a href=\"" + txtLink + "\" class=\"menuLink\"  style='text-decoration:hover;color:#0033ff'>");
	document.write("<div class=\"menuCellBG\" onMouseover=\"this.style.backgroundColor='#aaaaaa';\" ");
	document.write(" onMouseout=\"this.style.backgroundColor='#dddddd';\" style=\"hover:underline;width:" + intWidth + "\" "); 
	document.write(" onclick=\"location.href='" + txtLink + "'\">");
	document.write("<div style='margin-left:6px;'>" + txtItem + "</div>");
	document.write("</div></a></td></tr>");
}

function writeTab(themePath, imgPath, imgWidth, imgHeight, txtObjName,txtTitle,txtMenuTitle,arrMenuItems,tabLink,intWidth,intOffset,index) {
	document.write("<div id=\"" + txtObjName + "\" class=\"mainTabDiv\" menuTimer = setTimeout('tabOut()',2000)\">");
	if (arrMenuItems.length>0)
	{
		document.write("<span style=\"position:absolute\" id=\"" + txtObjName + "_wrap\" menuTimer = setTimeout('tabOut()',2000)\">");
		document.write("<span id=\"" + txtObjName + "_menu\" class=\"menuSpan\" style=\"left:" + intOffset + "px;text-indent:" + intOffset + ";\"  menuTimer = setTimeout('tabOut()',2000)\" >");
		document.write("<table style=\"background-color:#000000\" class=\"menuTable\" cellpadding=\"0\" cellspacing=\"0\"  border=1 menuTimer = setTimeout('tabOut()',2000)\" ");
		document.write("width=\"" + intWidth + "\">"); 
		document.write("<tr>");
		document.write("<th>");
		document.write("<div class=\"menuHeader\" style=\"width:" + intWidth + "\">");
		document.write("<div style='margin-left:6px'>" + abc + "</div>");
		document.write("</div>	");
		document.write("</th>");
		document.write("</tr>"); 
		if (arrMenuItems) {
			for (var itemCount = 0; itemCount < arrMenuItems.length; itemCount++) {
				writeMenuItem(arrMenuItems[itemCount][0],arrMenuItems[itemCount][1],intWidth);
			}
		}		
		document.write("</table>");
		document.write("</span>");
		document.write("</span>");
	}
	document.write("<a href=\"");
	if (tabLink) {
		document.write( tabLink + "\" ");
	} else {
		document.write(	"javascript:void(0);\"");
	}
	document.write(">");		
	if (ie5) {
		document.write("<img onmouseout=\"this.src='" + themePath + "jzsxpic"+index+".jpg'\" onmouseover=\"this.src='" + themePath + "jzsxpicOver"+index+".jpg'\" src='" + themePath + "jzsxpic"+index+".jpg' border='0' width='"+imgWidth+"' height='"+imgHeight+"'>"); 
	} else {
		document.write("<img src='" + imgPath + "' border='0' width='"+imgWidth+"' height='"+imgHeight+"'>");   
	}
	document.write("</a>");
	document.write("<img id=\"" + txtObjName + "_shadow\" class=\"tabShadow\" src=\"" + themePath + "images/spacer.gif\">");
	document.write("<br/>");
	document.write("</div>");
}


function hideTabs() {
	if (oldSec)
	{
		oldSec.style.border = "1px solid #ffffff";
		oldSec.style.backgroundColor = "#ffffff";
	}
	if (oldSecShadow && oldSecMenu)
	{
		oldSecMenu.style.visibility = "hidden";
		oldSecShadow.style.visibility = "hidden";
	}
}
function showSection(id)
{
	var secWrap = document.getElementById(id + "_wrap");
	var secTab = document.getElementById(id + "_box");
	var secMenu = document.getElementById(id + "_menu");
	if (!ie5 && !opera) {
		secMenu.style.left =  secMenu.style.textIndent.substring(0,secMenu.style.textIndent.length - 2) - 49;
	}
	secTab.style.backgroundColor = "#dddddd";
	secTab.style.border = "1px solid #d7d7d7";
	if (secMenu!=null)
	{
		secMenu.style.top = secWrap.parentNode.offsetTop - (secMenu.offsetHeight) - secTab.offsetTop - 2; //menu bottom distance from picture
	}
	var secTabShadow = document.getElementById(id + "_shadow");
	if (oldSec != secTab) {
		hideTabs();
	}
	if (secTabShadow!=null && secMenu!=null)
	{
		secMenu.style.visibility = "visible";
		secTabShadow.style.visibility = "visible";
	}
	oldSec = secTab;
	oldSecMenu = secMenu;
	oldSecShadow = secTabShadow;
}		

function miniSecondaryLinks(miniSecondaryLinksTitle,miniSecondaryLinksItems,secondaryImgPath) {
	document.write('<div style="float:left;margin-left:8px;width:180;">');
	document.write('<table cellpadding="0" cellspacing="0" border="0">');
	document.write('<tr>');
	document.write('<td width="200">');
	document.write('<span class="title_emph">');
	document.write('<div style="padding-bottom:4pt">');
	document.write('<br/>');
	document.write(miniSecondaryLinksTitle);
	document.write('</div>');
	document.write('</span>');
	document.write('<table width="200" border="0" cellpadding="0" cellspacing="0">');
	document.write('<tr>');
	document.write('<td>');
	document.write('<table width="100%" border="0" cellpadding="0" cellspacing="0">');

	for (var itemCount = 0; itemCount < miniSecondaryLinksItems.length; itemCount++) {
		document.write('<tr>');
		document.write('<td>');
		document.write('<table cellpadding="1" cellspacing="0" border="0">');
		document.write('<tr>');
		document.write('<td VALIGN="top" WIDTH="5">');
		document.write('<a href="' + miniSecondaryLinksItems[itemCount][1] + '" class="ck_lnk_small">');
		document.write('<img src="'+secondaryImgPath+'" width="4" height="17" border="0"  alt=""/>');
		document.write('</a>');
		document.write('</td>');
		document.write('<td align="left"  valign="middle">');
		document.write('<a href="' + miniSecondaryLinksItems[itemCount][1] + '" class="ck_lnk_small" style="color:#0033ff">');
		document.write(miniSecondaryLinksItems[itemCount][0]);
		document.write('</a>');
		document.write('</td>');
		document.write('</tr>');
		document.write('</table>');
		document.write('</td>');
		document.write('</tr>');
	}
	
	document.write('</table>');
	document.write('</td>');
	document.write('</tr>');
	document.write('</table>');
	document.write('</td>');
	document.write('</tr>');
	document.write('</table>');
}

