// ##########################################
// Common pages functions
// ##########################################

function confirmLink(theLink, theSqlQuery)
{
    var is_confirmed = confirm('Do you really want to\n' + theSqlQuery);
    if (is_confirmed) {
        theLink.href += '&ProcConf=1';
    }
    return is_confirmed;
} // end of the 'confirmLink()' function


function RefreshField(sel, sself, FO) {
	var str = sel.options[sel.selectedIndex].value;
	document.location.href = sself+'?FF='+str+'&FO='+FO;
}

function sel_AddSearchVals2(sself)
{
  document.location.href = sself+'?FF='+document.forma.SeFilterField.options[document.forma.SeFilterField.selectedIndex].value
    + '&FO='+document.forma.SeFilterOp.options[document.forma.SeFilterOp.selectedIndex].value
    + '&FOB='+document.forma.SeFilterOrderBy.options[document.forma.SeFilterOrderBy.selectedIndex].value;
}

function sel_AddSearchVals3(sself)
{
  document.location.href = sself+'?FF='+document.forma.SeFilterField.options[document.forma.SeFilterField.selectedIndex].value
      + '&FO='+document.forma.SeFilterOp.options[document.forma.SeFilterOp.selectedIndex].value
      + '&FV='+document.forma.SeFilterValue.options[document.forma.SeFilterValue.selectedIndex].value
      + '&FOB='+document.forma.SeFilterOrderBy.options[document.forma.SeFilterOrderBy.selectedIndex].value;
}

function href_AddSearchVals(theLink)
{
  theLink.href += '&FF='+document.forma.SeFilterField.options[document.forma.SeFilterField.selectedIndex].value
      + '&FO='+document.forma.SeFilterOp.options[document.forma.SeFilterOp.selectedIndex].value
      + '&FV='+document.forma.SeFilterValue.options[document.forma.SeFilterValue.selectedIndex].value
      + '&FOB='+document.forma.SeFilterOrderBy.options[document.forma.SeFilterOrderBy.selectedIndex].value;
}

function PageSelSubGroupReload(theAddr,ControlName,Control)
{
  document.location.href = theAddr+'?'+ControlName+'='+Control.options[Control.selectedIndex].value;
}

function PageSelClick()
{
  for (x=0; x<PageSelClick.arguments.length; x++)
    theLink.href += '&PsSubGroup'+x+PageSelClick.arguments[x].options[PageSelClick.arguments[x].selectedIndex].value;
}

function GoBack()
{
  history.back();
  return false;
}


// ################################################
//  Functions for highlighting images
// ################################################

var baseopacity=60

function slowhigh(which2){
imgobj=which2
browserdetect=which2.filters? "ie" : typeof which2.style.MozOpacity=="string"? "mozilla" : ""
instantset(baseopacity)
highlighting=setInterval("gradualfade(imgobj)",50)
}

function slowlow(which2){
cleartimer()
instantset(baseopacity)
}

function instantset(degree){
if (browserdetect=="mozilla")
imgobj.style.MozOpacity=degree/100
else if (browserdetect=="ie")
imgobj.filters.alpha.opacity=degree
}

function cleartimer(){
if (window.highlighting) clearInterval(highlighting)
}

function gradualfade(cur2){
if (browserdetect=="mozilla" && cur2.style.MozOpacity<1)
cur2.style.MozOpacity=Math.min(parseFloat(cur2.style.MozOpacity)+0.1, 0.99)
else if (browserdetect=="ie" && cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=10
else if (window.highlighting)
clearInterval(highlighting)
}




