String.prototype.z=function(){var v=this;return v.split("").reverse().join("");};

function getContentById(elementId) {
 var elementContent = "&nbsp;";
 try {
  elementContent = document.getElementById(elementId).innerHTML
 } catch (e) {
  // ignore
 }
 return elementContent;
}

function getElementsByAttribute(attr,val,container)
{
 container = container||document
 var all = container.all||container.getElementsByTagName('*')
 var arr = []
 for(var k=0;k<all.length;k++)
 if(all[k].getAttribute(attr) == val)
 arr[arr.length] = all[k]
 return arr
}

function getElementsByCondition(condition,container)
{
container = container||document
var all = container.all||container.getElementsByTagName('*')
var arr = []
for(var k=0;k<all.length;k++)
{
var elm = all[k]
if(condition(elm,k))
arr[arr.length] = elm
}
return arr
}

function highlight(e) {
  var myTarget;
        if (!e) var e = window.event;
        if (e.target) myTarget = e.target;
        else myTarget = e.srcElement;

  if(   myTarget.style.backgroundColor == "yellow" ) {
    myTarget.style.backgroundColor = "white";
  } else {
    myTarget.style.backgroundColor = "yellow";
  }
}

function c(d) {
	var f = new Array();var e = document.getElementById(d).innerHTML;f = e.split('\.');
	var g = f[0];var h = f[1];
	for ( var i=0; i<f.length; i++ ){f[i] = f[i].split('\x22');}
	var k = new Array(g);for ( var i=0; i<g; i++ ){k[i]='';}
	for ( var j=0; j<h; j++ ){for ( var i=0; i<g; i++ ){if(typeof (f[j+2][i])!='undefined') {k[i] += f[j+2][i];k[i] += "\x20";}}}return k;
}

function getListings() {
  // var listings = getElementsByAttribute('class', 'noindent');
  var listings = getElementsByCondition(function(el){return el.className.indexOf('noindent')>-1});

  for ( var i=0; i<listings.length; i++ ){
    var myUl = listings[i];
    myUl.onmouseover = highlight;
    // myUl.setEvent("onmouseover", "highlight(this)");
  }
}

function merken (titleText) {
    if (window.sidebar) {
        window.sidebar.addPanel(titleText, window.location,"");
    } else if( window.external ) {
        window.external.AddFavorite( window.location, titleText); }
    else if(window.opera && window.print) {
        return true;
    }
}

// tooltip
//
var tt = null;
var visible = false;
var xOffset = -80;
var yOffset = 20;

var mouseDownX = 0;
var mouseDownY = 0;

// param: event - the mouse event
// return: none
// global: set mouseDownX and mouseDownY
function showPosition(event) {
	if (window.event) {
		x = window.event.clientX;
		y = window.event.clientY;
	} else {
		x = event.clientX;
		y = event.clientY;
	}
	mouseDownX = x;
	mouseDownY = y;
}


// param: divName - name of surrounding of the tooltip div
// return: none
function toggleTtName(divName) {
	if(visible == true) {
		tt.style.display = "none";
		visible = false;
	} else {
		// get image inside tooltip (image is used to give the div a name :-/ )
		image = document.getElementsByName(divName)[1];
        if(typeof(image) == "undefined" || image == null) {
          image = document.getElementsByName(divName)[0];
        }

        // get tooltip
		tt = image.parentNode;
		
		tt.style.left = (mouseDownX + xOffset) + "px";
		tt.style.top 	= (mouseDownY + yOffset) + "px";		
		tt.style.display = "block";
		visible = true;
	}	
}

// click
//
function findChild (element, nodeName) {
  return element.getElementsByTagName(nodeName)[0];
}

function mclick(anchor) {
  window.open(anchor.href,'new','width=1000,height=700,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes');
  return null;
}

function mover(element, statusText) {
  element.className='highlight';
  if(navigator.appVersion.indexOf("MSIE")>-1) {
    element.style.cursor='hand';    
  } else {
    element.style.cursor='pointer';
  }
  self.status=statusText;
  return true;
}

function mout(element) {
  element.className='normal';
  element.style.cursor='default';
  self.status='';
  return true;
}

function table_mclick(pos, par, tpl, col, row, kw, uip, ws) {
  table_img=new Image()
  table_img.src="track_table_click.jsp?pos=" + pos + "&par=" + par + "&tpl=" + tpl + "&col=" + col + "&row=" + row + "&kw=" + kw + "&uip=" + uip + "&ws=" + ws;
}

// google
//
var google_rc = {
  format: '180x150_rc',
  width: 180,
  height: 150,
  modules: ['news','searches'],
  color_line: 'B3C98C',
  color_link: '336633',
  color_bg: 'ffffff',
  color_text: '000000',
  color_source: '999999',
  color_header:  'EAFDC8',
  color_footer: 'EAFDC8'
};


// styles
//
function getPreRender() {
 var styleTxt = "<style type=\"text/css\"><!-- \n";
 styleTxt = styleTxt + " di" + "v.p" + "reRender ";
 styleTxt = styleTxt + " { ";
 styleTxt = styleTxt + "  top" + ":" + "-" + "100" + "00px; ";
 styleTxt = styleTxt + " z" + "-" + "index" + ":" + "-" + "10; ";
 styleTxt = styleTxt + "width" + ":" + "400" + "px;";
 styleTxt = styleTxt + "pos" + "ition" + ":" + "abs" + "olute;";
 styleTxt = styleTxt + " } ";
 styleTxt = styleTxt + "\n--></style>";
 return styleTxt;
}