var tWidth='1000px';                  // width (in pixels)
var tHeight='16px';                  // height (in pixels)
var tcolour='';               // background colour:
var moStop=true;                     // pause on mouseover (true or false)
var fontfamily = 'arial, helvetica, sans-serif'; // font for content
var tSpeed=3;                        // scroll speed (1 = slow, 5 = fast)
var content = "";
var cps=tSpeed; var aw, mq; var fsz = parseInt(tHeight) - 4;
function startticker(){
if (document.getElementById) {var tick = '<div style="position:relative;width:'+tWidth+';height:'+tHeight+';overflow:hidden;background-color:'+tcolour+'"'; if (moStop) tick += ' onmouseover="cps=0" onmouseout="cps=tSpeed"'; tick +='><div id="mq" style="position:absolute;left:0px;top:0px;font-family:'+fontfamily+';font-size:'+fsz+'px;white-space:nowrap;"><\/div><\/div>'; document.getElementById('ticker').innerHTML = tick; mq = document.getElementById("mq"); mq.style.left=(parseInt(tWidth)+10)+"px"; mq.innerHTML='<span id="tx">'+content+'<\/span>'; aw = document.getElementById("tx").offsetWidth; lefttime=setInterval("scrollticker()",50);}} function scrollticker(){mq.style.left = (parseInt(mq.style.left)>(-10 - aw)) ?parseInt(mq.style.left)-cps+"px" : parseInt(tWidth)+10+"px";}

$(document).ready(function() {
if($('#statement').length>0) checkten_j();
if($('.reportlisting').length>0) do_picker();
if($('#loginbanner').length>0) $('h2:first').css("display","none");
if(content.length>0&&(content.length!=365)) startticker();

$('#mainNav li ul').prev().attr('href','javascript:void(0);');
$('#mainNav li ul').prev().bind("click",function() {
	// get all sub navs and check their visibility
	if($(this).next().is(':visible')) {
		$(this).next().slideUp(500);
	} else {
		$('#mainNav li ul').slideUp();
		$(this).next().slideDown(500);
	}
});

 
$('#mainNav A[class="selected first dir"]').next('ul').slideDown(500);
$('#mainNav A[class="selected dir"]').next('ul').slideDown(500);

$('A[rel="link"]').click( function() {
        window.open( $(this).attr('href') );
        return false;
    });
 
  $("h5").bind("click",function(){
    $("#copy div").slideUp(500);
     var answer = $(this).next("div");
   if (answer.is(':visible')) { 
                        answer.slideUp(); 
                        } else { 
                        answer.slideDown(); 
                        } 
  });
 
        var acc = $("h5:first").nextAll();
	var el;
	var counter = 0;
    for( var i = 0, n = acc.length;  i < n;  ++i ) {
        el = acc[i];
	if(el.nodeName=="H5") 
		counter++;
	else 
		el.className=("accordion_" + counter);
	}
 
	// now wrap all elements with the same accordion class in a div
	for(var i=0; i<=counter; i++) {
		$('.accordion_' + i).wrapAll("<div></div>");
	}	 
	$('h5:first').nextAll('div').css("display","none");	
 
 
 
 
});
