/*'''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Name: SetChecked()
Author: Jgreen
Use: checks or unchecks all checkboxes
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''*/
function SetChecked(blnVal)
{
var sForm = document.frmCompare;
var sLength = sForm.elements.length;
for(var i = 0; i < sLength; i++)
{
var sElement = sForm.elements[i];
if (sElement.name.substr(0,4) == 'comp')
sElement.checked = blnVal;
}
}
/*'''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Name: ValidateChart()
Author: Jgreen
Use: Function Validates that Intraday Times and Frequencies
are only charted vs. each other.
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''*/
function ValidateChart(me)
{
var sFreq = me.control_freq.options[me.control_freq.selectedIndex].value;
var sTime = me.control_time.options[me.control_time.selectedIndex].value;
var iTime = 1;
var iFreq = 1;
var sTimeSubstr = sTime.substr(sTime.length - 2,2);
if ((sTimeSubstr == "hr") || (sTimeSubstr == "dy"))
iTime = 0;
var sFreqSubstr = sFreq.substr(sFreq.length - 2,2);
if ((sFreqSubstr == "mi" ) || (sFreqSubstr == "hr" ))
iFreq = 0;
var iCount = iFreq + iTime;
if (iCount == 1)
{
alert("Intraday Times and Frequencies must be charted together");
return false;
}
else
{
return true;
}
}
/* *****************************************
added by Paul McGeehan
takes into account all necessary CCBN javascript
******************************************** */
function openCapsule(url, name, prop)
{
sizedWindow = window.open(url, name, prop);
{
setTimeout('sizedWindow.focus();', 250);
}
}
function go(where) {
if (where != "-") {
self.location = where;
}
}
function navigate(obj) {
idx = obj.selectedIndex;
url = obj.options[idx].value;
if (url == "URL") {
str = obj.options[idx].text;
i = 0;
finished = false;
while (!finished) {
if (((str.charAt(i) > "A") && (str.charAt(i) < "z")) || i >= str.length)
finished = true;
else
i++;
}
url = window.location.protocol+'//'+window.location.host+"http:/" + str.substring(i,str.length);
}
if (url != "") {
window.location = url;
}
}
/*'''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Author: JDelia
Use: For use with News Navigation
1) write the select drop-down to the page and;
2) handle the changing of the page when an new option is selected
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''*/
function ccbnGetQS(){
var theLocation = self.location;
var ccbn_i, qString = theLocation.search.substr(1);
var queryString = new Object();
if (qString.length > 0) {
var params = qString.replace(/\+/g, " ").split("&");
for (ccbn_i = 0; ccbn_i < params.length; ccbn_i++) {
params[ccbn_i] = unescape(params[ccbn_i]).split("=");
queryString[params[ccbn_i][0]] = params[ccbn_i][1];
}
}
return queryString;
}
function ccbnWriteOption(nyo, year){
var queryString = ccbnGetQS();
document.write('');
}
function ccbnNewsGo(theSelect){
var yearOffset = theSelect.options[theSelect.selectedIndex].value;
var theLocation = self.location;
var tempLocation;
var queryString = ccbnGetQS();
if(yearOffset==-1) return
if(queryString["nyo"]){
var currentNYO="&nyo=" + queryString["nyo"];
var replaceNYO="&nyo=" + yearOffset;
tempLocation = theLocation.href.replace(currentNYO,replaceNYO);
}
else{
tempLocation = theLocation + "&nyo=" + yearOffset
}
if(queryString["t"]){
var currentSearch="&t=" + queryString["t"];
var replaceSearch="";
tempLocation = tempLocation.replace(currentSearch,replaceSearch);
}
location = tempLocation;
}
/*'''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Author: JDelia
Use: Created for Edgar Interactive Charts but can be used
for other functionality going forward
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''*/
/* CONSTANTS */
var CCBN_SHOW = "visible";
var CCBN_HIDE = "hidden";
var CCBN_SHOW_DISPLAY = "block";
var CCBN_HIDE_DISPLAY = "none";
var CCBN_TIMER = 500;
var CCBN_GET_X = 0;
var CCBN_GET_Y = 1;
var CCBN_GET_XY = 2;
var CCBN_BIOHOVER = 0;
var CCBN_NEWSHOVER = 1;
var CCBN_EVENTHOVER = 2;
var CCBN_DEFINITIONHOVER = 3;
var CCBN_OVER = 0;
var CCBN_OUT = 1;
var CCBN_IE = "Microsoft Internet Explorer";
/* CONSTANTS */
/* GLOBALS */
var ccbn_mozMouseX, ccbn_mozMouseY, ccbn_popover_width, ccbn_fhObj, ccbnTimeout, ccbnHoverReady;
var ccbn_appName=navigator.appName;
var ccbn_appVersion=navigator.appVersion;
var ccbn_offsetX=10;
var ccbn_offsetY=5;
var ccbn_no_doctype=false;
/* GLOBALS */
/* used to add new window events (onmouseover, onresize, etc) without
losing any other events that have been set */
function ccbnAddEvent(which, func){
var oldEvent = which;
if(typeof oldEvent != 'function') newEvent = func;
else{
newEvent = function(){
if(oldEvent) oldEvent();
func();
}
}
return newEvent
}
/* used to add new window onload event without
losing any other events that have been set */
function ccbnAddLoadEvent(_function){
var _onload = window.onload;
if ( typeof window.onload != 'function' ){
if ( window.onload ){
window.onload = _function;
}
else{
var _addEventListener = window.addEventListener || document.addEventListener;
var _attachEvent = window.attachEvent || document.attachEvent;
if ( _addEventListener ){
_addEventListener('load', _function, true);
return true;
}
else if ( _attachEvent ){
var _result = _attachEvent('onload', _function);
return _result;
}
else{
//todo: preloading fix for ie5.2 on mac os
return false;
}
}
}
else{
window.onload = function(){
_onload();
_function();
}
}
}
function ccbnCloneToBody(objID){
var obj = ccbnGetObj(objID);
if(obj.parentNode!=document.body){
var tmpNode = obj.cloneNode(true);
tmpNode.style.left=tmpNode.style.top=0;
obj.parentNode.removeChild(obj);
document.body.appendChild(tmpNode);
}
}
function ccbnCloseObj(id){ if(!ccbnGetObj(id)) return; ccbnShowHide(ccbnGetObj(id),CCBN_HIDE); }
/* moves the object to the specified X and Y coordinates */
function ccbnDoMove(objectID, moveToX, moveToY, moveToPx) {
if (document.layers && document.layers[objectID] != null) {
document.layers[objectID].left = moveToX + moveToPx;
document.layers[objectID].top = moveToY + moveToPx;
}
else if (document.all) {
document.all[objectID].style.posLeft = moveToX;
document.all[objectID].style.posTop = moveToY;
}
else if (document.getElementById){
document.getElementById(objectID).style.left = moveToX + moveToPx;
document.getElementById(objectID).style.top = moveToY + moveToPx;
}
}
function ccbnEObj(){return(ccbn_appName=="Netscape"?'event':'\'\'');}
/* finds the position of the object and returns X and Y coordinates in an array */
function ccbnFindPos(obj){
var curleft = curtop = 0;
if (obj.offsetParent) {
curleft = obj.offsetLeft;
curtop = obj.offsetTop;
while (obj = obj.offsetParent){
curleft += obj.offsetLeft;
curtop += obj.offsetTop;
}
}
return [curleft,curtop];
}
/* splits a string based on the & character
returns the parameter / value pair as an object */
function ccbnGetArgs(query){
var args = new Object();
var pairs = query.split("&");
for(ccbn_i=0; ccbn_i ccbn_browser_x) ccbn_x -= ccbn_popover_width;
//move the object
ccbnDoMove(objectID, ccbn_x, ccbn_y, ccbn_px);
}
function ccbnOpenObj(id){
ccbnStopTimer();
ccbnForceHide();
if(!ccbnGetObj(id)) return;
ccbnMoveObj(id,ccbnEObj(),null,null,true);
ccbnShowHide(ccbnGetObj(id),CCBN_SHOW);
}
function ccbnSetInnerHtml(el,inner){ el.innerHTML = inner; }
function ccbnSetupHovers(){
if(!ccbnHoverReady){
// If NS then set up for mouse capture
if(document.captureEvents){ document.captureEvents(Event.MOUSEMOVE); }
// Set-up to use getMouseXY function onMouseMove
document.onmousemove = ccbnAddEvent(document.onmousemove, ccbnGetMouseXY);
ccbnHoverReady=true;
}
}
function ccbnSetupAjax(){
for(ccbn_i=0;ccbn_i -1) CCBN_TIMER = timerOverride;
ccbnTimeout = setTimeout(ccbnForceHide,CCBN_TIMER);
}
/*'''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Author: JDelia
Use: Animated Anchor Jumps
This script originally found at Brand Spanking New:
http://www.brandspankingnew.net/archive/2005/09/animated_anchor.html
Then modified for IE support by Steve Cochrane (hq at stevecochrane dot com)
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''*/
/* needs to be on page or in module
// initializes the script
window.onload = ccbnAddEvent(window.onload, ccbnReplaceAnchorLinks);
*/
/* GLOBALS */
var ccbnScrollInterval;
var ccbnScrTime, ccbnScrSt, ccbnScrDist, ccbnScrDur, ccbnScrInt;
/* GLOBALS */
// Found this script at http://blog.firetree.net/2005/07/04/javascript-find-position/
// Just used here to provide offsetTop functionality for IE
function ccbnFindPosY(obj) {
var curtop = 0;
if(obj.offsetParent)
while(1)
{
curtop += obj.offsetTop;
if(!obj.offsetParent)
break;
obj = obj.offsetParent;
}
else if(obj.y)
curtop += obj.y;
return curtop;
}
function ccbnReplaceAnchorLinks(){
var anchors, ccbn_i, targ, targarr;
if (!document.getElementById) return;
// get all anchors
anchors = document.getElementsByTagName("a");
for (ccbn_i=0;ccbn_i 0;) {
if (cls[--ccbn_i] != classToRemove) {
ar[ar.length] = cls[ccbn_i];
}
}
theObj.className = ar.join(" ");
}
function ccbnIE6TurnHoversOn(){
// Only do this for IE6 or if browser is IE and there is no doctype
if ((document.documentElement && !window.XMLHttpRequest) || (document.all && ccbn_no_doctype)){
var divs = document.getElementsByTagName('div');
var tables = document.getElementsByTagName('table');
//company calendar project
//only enable IE6 hover for cells with ccbnCalButton or ccbnDay class name
var hoverEnabled = new Array("ccbnCalButton", "ccbnDay");
for(ccbn_i=0;ccbn_i < divs.length; ccbn_i++){
if(divs[ccbn_i].id.indexOf("month") != -1){
var tds = divs[ccbn_i].getElementsByTagName('td');
for(ccbn_j=0;ccbn_j < tds.length; ccbn_j++){
for(ccbn_k=0; ccbn_k < hoverEnabled.length; ccbn_k++){
if(tds[ccbn_j].className.indexOf(hoverEnabled[ccbn_k]) != -1){
tds[ccbn_j].onmouseover = function(){ ccbnAddClass(this,ccbnHiliteSuffix); };
tds[ccbn_j].onmouseout = function(){ ccbnRemoveClass(this,ccbnHiliteSuffix); };
}
}
}
}
}
//row highlighting on tables
for(ccbn_i=0;ccbn_i < tables.length; ccbn_i++){
if(tables[ccbn_i].className.indexOf("ccbnRowHoverTbl") != -1){
var trs = tables[ccbn_i].getElementsByTagName('tr');
for(ccbn_j=0;ccbn_j < trs.length; ccbn_j++){
if(trs[ccbn_j].className.indexOf("ccbnBgTblTtl") == -1){ //do not want to highlight the table titles
trs[ccbn_j].onmouseover = function(){ ccbnAddClass(this,ccbnHiliteSuffix); };
trs[ccbn_j].onmouseout = function(){ ccbnRemoveClass(this,ccbnHiliteSuffix); };
}
}
}
}
}
}
//global ajax object
var ccbnAjaxObject = new Array();
//initialize any ajax objects onload
ccbnAddLoadEvent(ccbnSetupAjax);