/*
	tableruler()
	written by Chris Heilmann for alistapart.
	enables a rollover of rows for each table with the classname "hlrows"
*/

function tableruler()
{
	if (document.getElementById && document.createTextNode)
	{
		var tables=document.getElementsByTagName('table');
		for (var i=0;i<tables.length;i++)
		{
			if(tables[i].className=='cat_table_closed')
			{
				var trs=tables[i].getElementsByTagName('tr');
				for(var j=0;j<trs.length;j++)
				{
					if(trs[j].parentNode.nodeName=='TBODY')
					{
						trs[j].onmouseover=function(){this.className='ruled';return false}
						trs[j].onmouseout=function(){this.className='';return false}
					}
				}
			}
		}
	}
}



var subs = new Array('1', '2');

function toggle_element(id)
{
for (i=0; i<subs.length; i++)
{
document.getElementById(subs[i]).style.display = "none";
}

the_element = document.getElementById(id);
the_element.style.display = 'block';
}




intImage = 1;

function swapImage(id) {

switch (id) {
 case 1:
   IMG1.src = "http://www.gourmantis.de/templates/gourmantisb/images/tab_cat_on.jpg";
   IMG2.src = "http://www.gourmantis.de/templates/gourmantisb/images/tab_wk_off.jpg";
   
   return(false);

case 2:
   IMG1.src = "http://www.gourmantis.de/templates/gourmantisb/images/tab_cat_off.jpg";
   IMG2.src = "http://www.gourmantis.de/templates/gourmantisb/images/tab_wk_on.jpg";
   
   return(false);
 }
}



/*

intImage = 1;

function swapImage() {

switch (intImage) {
 case 1:
   IMG1.src = "http://www4.websale.net/$WS/gourmantis/websale6_shop-gourmantis/benutzer/templates/images/tab_cat_on.jpg";
   IMG2.src = "http://www4.websale.net/$WS/gourmantis/websale6_shop-gourmantis/benutzer/templates/images/tab_wk_off.jpg";
   intImage = 2
   return(false);

case 2:
   IMG1.src = "http://www4.websale.net/$WS/gourmantis/websale6_shop-gourmantis/benutzer/templates/images/tab_cat_off.jpg";
   IMG2.src = "http://www4.websale.net/$WS/gourmantis/websale6_shop-gourmantis/benutzer/templates/images/tab_wk_on.jpg";
   intImage = 1;
   return(false);
 }
}

*/




<!-- Original:  Eddie Traversa (psych3@primus.com.au) -->
<!-- Web Site:  http://dhtmlnirvana.com/ -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
var nn4 = (document.layers);
var nn6 = (document.getElementById && !document.all);
var ie4 = (document.all && !document.getElementById);
var ie5 = (document.all && document.getElementById);
function loadPage(id,nestref,url) {
if (nn4) {
var lyr = (nestref)? eval('document.'+nestref+'.document.'+id) : document.layers[id]
lyr.load(url,lyr.clip.width)
}
else if(ie4) parent.contentFRM.location = url;
else if(ie5 || nn6) document.getElementById('contentFRM').src = url;
}
function showPage(id) {
if (ie4) {
document.all[id].innerHTML = parent.contentFRM.document.body.innerHTML;
}
else if(nn6 || ie5) { 
document.getElementById(id).innerHTML = window.frames['contentFRM'].document.getElementById('theBody').innerHTML;
   }
}
//  End -->


<!-- start /-->
var last_menu = null;
var hide_timeout = null;

function display_menu( target )
{
  if( target )
  {
    if( last_menu )
      hide_menu( );

    if( hide_timeout )
      clearTimeout( hide_timeout );

    var obj = document.getElementById( target );
    var parent = document.getElementById( target + "_parent" );

    obj.style.left = (getPageOffsetLeft( parent ) - 1 -2) + "px";
    obj.style.top = (getPageOffsetTop( parent ) + parent.offsetHeight + 8) + "px";
    obj.style.visibility = "visible";

    last_menu = obj;
  }
  else
    hide_timeout = setTimeout( "hide_menu()", 300 );     
}

function hide_menu( )
{
  last_menu.style.visibility = "hidden";
  last_menu = null;
  clearTimeout( hide_timeout );
}

function hover( el, obj )
{
  el.oldColor = el.style.backgroundColor;
  el.style.backgroundColor = '#FFFFFF';

  if( obj )
    show( obj );
}

function unhover( el, obj )
{
  el.style.backgroundColor = el.oldColor;

  if( obj )
    hide( obj );
}

function getPageOffsetLeft( el )
{
  var x;

  x = el.offsetLeft;
  if( el.offsetParent )
    x += getPageOffsetLeft( el.offsetParent );

  return x;
}

function getPageOffsetTop( el )
{
  var y;

  y = el.offsetTop;
  if( el.offsetParent )
    y += getPageOffsetTop( el.offsetParent );

  return y;
}

function define( what, def )
{
  wnd = window.open( "","","width=400,height=338" );
  wnd.document.writeln( "<font size='+1'><b>" + what + ":</b></font><hr /><br />" );
  wnd.document.writeln( def );
}

function change_vis( obj )
{
  if( navigator.userAgent.indexOf( "MSIE" ) == -1 )
  {
    var o = document.getElementById( obj );
    if( o.style.display == "none" )
      o.style.display = "block";
    else
      o.style.display = "none";
  }
  else
  {
    if( document.all[obj].style.display == "none" )
      document.all[obj].style.display = "block";
    else
      document.all[obj].style.display = "none";
  }
}  

//document.onmousemove = mouseMove;
//if( document.layers ) document.captureEvents( Event.MOUSEMOVE );

var cur_obj;
var x_offset = 5, y_offset = 5;
var x, y;

function show( obj )
{
  cur_obj = obj;

  if( document.all[cur_obj] )
  {
    if( ( x + document.all[cur_obj].offsetWidth + x_offset ) > document.body.clientWidth )
      x -= document.all[cur_obj].offsetWidth + 2*x_offset;
    if( ( y + document.all[cur_obj].offsetHeight + y_offset ) > document.body.clientHeight )
      y -= document.all[cur_obj].offsetHeight + 2*y_offset;

    document.all[cur_obj].style.left = document.body.scrollLeft + x + x_offset;
    document.all[cur_obj].style.top = document.body.scrollTop + y + y_offset;

    document.all[cur_obj].style.visibility = "visible";
  }
}

function hide( obj )
{
  cur_obj = null;

  if( document.all[obj] )
    document.all[obj].style.visibility = "hidden";
}

function mouseMove( e )
{
  x = event.clientX;
  y = event.clientY;

  if( document.all[cur_obj] )
  {
    if( ( x + document.all[cur_obj].offsetWidth + x_offset ) > document.body.clientWidth )
      x -= document.all[cur_obj].offsetWidth + 2*x_offset;
    if( ( y + document.all[cur_obj].offsetHeight + y_offset ) > document.body.clientHeight )
      y -= document.all[cur_obj].offsetHeight + 2*y_offset;

    document.all[cur_obj].style.left = document.body.scrollLeft + x + x_offset;
    document.all[cur_obj].style.top = document.body.scrollTop + y + y_offset;
  }
}
