//###If you wish you can remove all comments from your copy.
//###Start Feature Switching.
//toolTipsMovingMethod = true //true : The tooltips are on and will follow the mouse.
//zoomLinesMethod = true  //true : Zoomlines switched on for all browsers
//dragMethodDisabled = false  //(false adds functionality) true : Zooming can only occur by clicking letting go, moving and reclicking. not dragging (defaults to true for all but IE)
//msgUsingWriteToDiv = false //true : messages appear in a js alert.  Defaults to messages returned to div errorDiv.
//autoCalcContainerDivOffset = true //should always be true. requires a containAllGraphElementsDiv.
//reloadLocationSelf = true //true : reload location becomes self rather than top.
setDefaultsForMaxFeatures() //Set's the above 6
//toolTipsMovingBoundedMethod = true //true : tooltips will not extend outside the graph image div area.
//toolTipsStaticMethod = true  //true : tooltips are on but are stationary (also requires toolTipsMovingMethod = false and a div with id tooltipsDivStatic).
//steplineMethodCheckbox = true //true : required if you have a stepline checkbox.
//steplineMethodRadio = true //true : required if you have stepline/normal radio buttons.
//steplineMethodSelect = true //true : required if you have stepline/normal radio select's
//steplineRadioSelectIndex = 0 //0 or 1. which way round are your normal/stepline radios/selects.
//tooltipDivLineMethod = false //true : ???
//###End Feature Switching.

//###Start Config Values.
tooltipsHTMLBefore = '<table border="0" cellspacing="1" cellpadding="2" style="background-color: #1E8FBF"><tr><td style="font-family: Arial, sans-serif; font-size:11px; background-color: #FFFFFF; color: #1E8FBF"><nobr>'//style the tooltips
tooltipsHTMLAfter = '<span id="tooltipsDivWidthFinder" style="position:relative; left:0px; top:0px; width:0px; height:0px; z-index:5; visibility:visible;"></span></nobr></td></tr></table>'
//defaultReturnPeriod = 4 //index of default select period (note that the first is 0)
//lineThicknessX = 1 //reset's the width of the vertical zoom bars to this many px.
//lineThicknessY = 1 //reset's the height of the horizontal zoom bar(s) to this many px.
//###End Config Values.

function ggPageOnload(){
  //All page specific onloads must go in here. This is called by onloadAllGG()
}
//NOTE::No need to set up comparisons anymore as long as they are named comparison1, comparison2 etc...

//### Enables graphs to reload properly in iframes. Does this by default if reloadLocationSelf true.
//function goToGraphURL(newURL){
//  self.location.href = newURL;
//}

//###Start Rarely Use.
//vars controlling the swapping of text to Day Close
//You'll want to alter these if your intraday graph isn't for the LSE or specifically
//if it shows times that don't start at 8:00 and end at 16:30 (excluding day close point).
//dayOpenTimeSecs = (8 * 60 * 60) //Change to equal the number of minutes till the start of the plotting
//dayCloseTimeSecs = (((16 * 60) + 30) * 60)//Change to equal the number of minutes till the end of the plotting
//tooltipsStaticHTMLBefore = '' //if toolTipsStaticMethod = true text before tooltip info in tooltipsDivStatic.
//tooltipsStaticHTMLAfter = '' //if toolTipsStaticMethod = true text after tooltip info in tooltipsDivStatic.
//setTimeoutDisplay = 0 //delay tooltips from appearing 
//setTimeoutHide = 0 //delay tooltips from hiding
//setLineTimeoutDisplay = 0 
//setLineTimeoutHide = 0 
//###End Rarely Use.

//###Start Other Features.
//Features not included in this js include;
//defaultIdentifier - allow any companys data
//Price and volume in tooltip
//###End Other Features.

function returnCorrectDate(fromYear,fromMonth,fromDay,toYear,toMonth,toDay,fromDateName,toDateName,dateDelimeter){
  if(!fromDateName){fromDateName = 'from'}
  if(!toDateName){toDateName = 'to'}
  if(!dateDelimeter){fromDateName = '/'}
  validFromDate = verifyCompanyDate(fromYear,fromMonth,fromDay)
  validToDate = verifyCompanyDate(toYear,toMonth,toDay)
  if(validFromDate == 'prefloat' || validToDate == 'prefloat'){
    doMsg(getPreFloatMsg());
    return false;
  } else if(validFromDate == 'future'){
    doMsg('The from date is in the future');
    return false;
  } else if(validToDate == 'future'){
    doMsg('The to date is in the future');
    return false;
  } else if(validFromDate && validToDate){
    from = fromDay + dateDelimeter + fromMonth + dateDelimeter +  fromYear;
    to = toDay + dateDelimeter + toMonth + dateDelimeter +  toYear;
    fromDate = new Date(fromYear,fromMonth,fromDay)
    toDate = new Date(toYear,toMonth,toDay)
    if(fromDate < toDate){
      return '&fromDay=' + fromDay + '&fromMonth=' + fromMonth + '&fromYear=' + fromYear + '&toDay=' + toDay + '&toMonth=' + toMonth + '&toYear=' + toYear;
    } else {
      return '&fromDay=' + toDay + '&fromMonth=' + toMonth + '&fromYear=' + toYear + '&toDay=' + fromDay + '&toMonth=' + fromMonth + '&toYear=' + fromYear;

    }
  } else if(!validFromDate){
    doMsg('The from date is not valid');
    return false;
  } else if(!validToDate){
    doMsg('The to date is not valid');
    return false;
  }
}