var ie = (document.all && !window.opera) ? true : false;

function replace(string,text,by) {
// Replaces text with by in string
    var strLength = string.length, txtLength = text.length;
    if ((strLength == 0) || (txtLength == 0)) return string;

    var i = string.indexOf(text);
    if ((!i) && (text != string.substring(0,txtLength))) return string;
    if (i == -1) return string;

    var newstr = string.substring(0,i) + by;

    if (i+txtLength < strLength)
        newstr += replace(string.substring(i+txtLength,strLength),text,by);

    return newstr;
}

function o(data)
{
	var data_array=data.split("|");
	var i=0;
	document.write('<tr>');
	while (i < data_array.length) {
		s = new String(data_array[i]);
		s = replace(s,"_e","title=\"Edit this issue\"");
		s = replace(s,"_j","<a href=\"javascript:");
		s = replace(s,"_n","<br>");
		s = replace(s,"_q","'");
		s = replace(s,"_u","_");
		document.write('<td class="lt1">');
		document.write(s);
		document.write('</td>');
		i+=1;
	}
	document.write('</tr>');
}

function tabs(relpth,sel,data,nmes) {
	var data_array=data.split("|");
	var nme_array=nmes.split("|");
	var i=0;
	while (i < data_array.length) {
		s = new String(data_array[i]);
		t = new String(nme_array[i]);
		if (t == sel) {nme = 'ta'} else {nme = 'ti'};
		document.write('<td><img class="std" src="'+relpth+'/'+nme+'l.gif"></td>');
		document.write('<td background="'+relpth+'/'+nme+'b.gif" class="tab">&nbsp;');
		document.write('<a href="javascript:buttonClick(');
		document.write('\'\',\'');
		document.write(s);
		document.write('\');" class="tab">'+t);
		document.write('</a>&nbsp;</td>');
		document.write('<td><img class="std" src="'+relpth+'/'+nme+'r.gif"></td>');
		i+=1;
	}
}

function checksearch() {
   lbl = document.getElementById("searchlbl");
   frm = document.getElementById("searchfrm");
   lbl.innerHTML = "&nbsp;&nbsp;Searching...";
   frm.style.display="none";
   return true;
}
   
function w(code)
{
	document.write(code);
}

function doSection(idVariable){
//display the section if it's not displayed; hide it if it is displayed
	if (idVariable.style.display=="none") {
		idVariable.style.display="block";
	} else {
		idVariable.style.display="none";
	}
}

function noSection(idVariable){
//remove the section when user clicks in the opened DIV
	if (idVariable.style.display=="block"){idVariable.style.display="none";}
}


function buttonClick(idVariable,url) {
   if (idVariable) {
      if(ie) {
         idVariable.custom(0.25,0.25)
      } else {
         idVariable.custom(0.25,0.25);
      }
   }
   if(ie) {
      pageeffect.custom(0,0);
   } else {
      pageeffect.custom(0.25,0.25);
   }

   if (url) {
      if (url == 'back') {
         setTimeout('history.back(1)',25);
      } else {
         setTimeout('document.location.href = \''+url+'\'',25);
      }
   }
}

function launchPopup(url,defwidth,defheight) {
   var x = screen.width;
   var y = screen.height;
   var width = defwidth;
   var height = defheight;
   var top = parseInt((y-height)/2);
   var left = parseInt((x-width)/2);
   buttonClick('','');
   popup = window.open(url,'popup','toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,scrollbars=no,width='+width+',height='+height+',top='+top+',left='+left);
   if (window.focus) popup.focus();
}

