var oldContent;
var oldControl;
var bbTimeOutId;
var aryQuickCal = new Array(3);
var intQuickCal = 0;

// -------------------------
function chooseDate () {
// -------------------------
		document.searchform.Interval.options[0].selected = true;
		document.searchform.Interval.options[document.searchform.Interval.options.length-1].selected = true;
} 	
//---------------------------	
function ResetDate () {
//---------------------------	
 if (document.searchform.Interval.selectedIndex != 0)
 {
  document.searchform.dateselected.value = "";
  document.searchform.mydate.value = document.searchform.Interval.options[document.searchform.Interval.selectedIndex].text;
 }
 if (document.searchform.Interval.selectedIndex != (document.searchform.Interval.options.length-1))
 {
  document.searchform.dateselected.value = "";
 }
}

//---------------------------	
function radioCheck(obj,msg) {
//---------------------------	
 var b = false;
 for(var i=0;i<obj.length;i++)
 {
	if(obj[i].checked==true)
	  b = true;
 }
 if(!b)
	alert(msg); 	
  return b; 	
}

//-------------------
function switchElements(intThisId, strBase, intTotalIds)
//-------------------
{
	document.getElementById(strBase+intThisId).style.display='block';
	for (var i=0; i<=intTotalIds; ++i)
	{
		if (i != intThisId)
		{
			document.getElementById(strBase+i).style.display='none';
		}
	}
}

//---------------------------	
function changeInnerHTML(divId,html)
//---------------------------
{
 if (document.getElementById) {
       document.getElementById(divId).innerHTML= html;
 }else{
     document.layers[divId].document.open();
     document.layers[divId].document.write(html);
     document.layers[divId].document.close();
 }
}

//---------------------------	
function NewWindow(w,h,u) {
//---------------------------	
	window.open(u,"PopUp","menubars=0,scrollbars=1,resizable=1,height="+h+",width="+w);
}

//---------------------------	
function PopIt(nm,url,h,w) {
//---------------------------	
	newwindow=window.open(url,nm,'height='+h+',width='+w);
  if (window.focus) {newwindow.focus()}
	return false;
}

//---------------------------	
function NewWindowGallery(w,h,u) {
//---------------------------	
	window.open(u,"PopUp","menubars=0,scrollbars=1,resizable=1,height="+h+",width="+w);
}

//---------------------------	
function jump(fe){
	//---------------------------	
		var opt_key = fe.selectedIndex;
		var uri_val = fe.options[opt_key].value;
		window.open(uri_val,'_top');
		return true;
}
 	
//-------------------
function ShowHide(id)
//-------------------
 {
    obj = document.getElementsByTagName("div");
    if (obj[id].style.visibility == 'visible'){
    obj[id].style.visibility = 'hidden';
    }
    else {
    obj[id].style.visibility = 'visible';
    }
}

//-------------------
function checkIt(string) {
//-------------------
	var detect = navigator.userAgent.toLowerCase();
	var place,thestring;
	place = detect.indexOf(string) + 1;
	return place;
}