/** JavaScript exchange.css
 * exhange of a link_image
 * @author: M. Paetzel
 * @version: 1.0
 * @date: 10.07.2008  
 */  
var def_image  = "images/icons/arr3.gif";
var over_image = "images/icons/arr4.gif";

var def_bimage1  = "images/icons/btmin2.gif";
var over_bimage1 = "images/icons/btmin.gif";
var def_bimage2  = "images/icons/btmax2.gif";
var over_bimage2 = "images/icons/btmax.gif";
/** Exchange_Hover()
 * sets the image on mouseover
 */ 
function Exchange_Hover()
{
  document.getElementById(this.img_name).src=document.getElementById(this.img_name).img_hover;
}

/** Exchange_Out()
 * resets the image back on mouseout
 */  
function Exchange_Out()
{
  document.getElementById(this.img_name).src=document.getElementById(this.img_name).img_out;
}

/** ProtoExchange()
 * prepares an element for image-exchange
 * string img_name: id of image
 * string link_name: id of link 
 */  
function ProtoExchange(img_name, link_name)
{
  obj_img =document.getElementById(img_name);
  obj_link=document.getElementById(link_name);
  obj_img.img_hover    = over_image;
  obj_img.img_out      = def_image;
  obj_img.img_name     = img_name;
  obj_img.src          = def_image;
  obj_img.lowsrc       = over_image;
  obj_img.onmouseover  = Exchange_Hover;
  obj_img.onmouseout   = Exchange_Out;
  
  obj_link.img_name    = img_name;
  obj_link.onmouseover = Exchange_Hover;
  obj_link.onmouseout  = Exchange_Out;
}

/** InitExchange()
 * prepares all elements for image-exchange
 * int subs_count: count of sub_navigation links
 * int tab_count: count of the tabs 
 */ 
function InitExchange(subs_count, tab_count)
{
  var i=0;
  for(i=1;i<=4;i++)
    ProtoExchange("arr_tnavi"+i,"link_tnavi"+i);
  for(i=1;i<=subs_count;i++)
    ProtoExchange("arr_navi"+i,"link_navi"+i);
  for(i=1;i<=tab_count;i++)
    ProtoExchange("arr_tab"+i,"link_tab"+i);  
}

