
function ag_preloadImages() { //v3.0
  var d=document; 
  if(d.images) { 
    if(!d.ag_p) d.ag_p=new Array();
    var i,j=d.ag_p.length,a=ag_preloadImages.arguments; 
	for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0) { 
	  d.ag_p[j]=new Image; 
	  d.ag_p[j++].src=a[i];
	}
  }
}


function ag_swapImgRestore() { //v3.0
  var i,x,a=document.ag_sr; 
  for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}


function ag_findObj(n, d) { //v4.01
  var p,i,x;  
  if(!d) d=document; 
  if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
  }
  if(!(x=d[n])&&d.all) x=d.all[n]; 
  for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=ag_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); 
  return x;
}


function ag_swapImage() { //v3.0
  var i,j=0,x,a=ag_swapImage.arguments; 
  document.ag_sr=new Array; 
  for(i=0;i<(a.length-2);i+=3)
   if ((x=ag_findObj(a[i]))!= null) {
	   document.ag_sr[j++]=x; 
	   if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];
   }
}


function ag_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}


function ag_openBrWindow(theURL,winName,features) { //v2.0
	window.open(theURL,winName,features);
}


function frame_reload(fr) {
	window.parent.frames[fr].location.reload();
}

function ag_set_style(objName, bgcolor, bgimage, color, border) {
//  obj = document.getElementById(objName);
  obj = ag_findObj(objName);
  if (obj.style)
  {
    if (bgcolor) obj.style.backgroundColor = bgcolor;
	if (color)   obj.style.Color = color;
    if (bgimage) obj.style.backgroundImage = bgimage;
	if (border)  obj.style.border = border;
  }
}

/*function ag_set_styleCSS() {
//  obj = document.getElementById(objName);
  var title = getActiveStyleSheet();
  document.styleSheets[title].rules["bg"].style.backgroundColor = "#eeeeee";
}*/