function elemOn(elem_id){
	if(document.getElementById(elem_id).tagName.toLowerCase( ) == 'span')
		elemOnI(elem_id);
	else if(document.getElementById(elem_id))
		document.getElementById(elem_id).style.display = "block";
}
function elemOnI(elem_id){
	if(document.getElementById(elem_id))
		document.getElementById(elem_id).style.display = "inline";
}
function elemOff(elem_id){
	if(document.getElementById(elem_id))
		document.getElementById(elem_id).style.display = "none";
}
document.getElementsByClassName = function(clsName){
	var retVal = new Array();
	var elements = document.getElementsByTagName("*");
	for(var i = 0;i < elements.length;i++){
		if(elements[i].className.indexOf(" ") >= 0){
			var classes = elements[i].className.split(" ");
			for(var j = 0;j < classes.length;j++){
				if(classes[j] == clsName)
					retVal.push(elements[i]);
			}
		}
		else if(elements[i].className == clsName)
			retVal.push(elements[i]);
	}
	return retVal;
}
function getFilename( str )
{
	return( str.substring( str.lastIndexOf( '/', str ) + 1 ) );
}
// This function inserts node after referenceNode 
function insertAfter( referenceNode, node ){
  referenceNode.parentNode.insertBefore(node, referenceNode.nextSibling);
}
// used to retrieve items from a delimited list. list = list of items, itemnum = item to return from list, delim = delimiter
function strtok( list, itemnum, delim )
{
	delim = delim || ','; // default to comma delim if no delim specified
	var splitted = list.split( delim ); // split the list into an array
	return( ( itemnum >= splitted.length ) ? null : splitted[itemnum] ); // if the desired item number exceeds list length return null else return item
}

function imgover( obj )
{
	obj = obj || this;
	if( obj.src.search( /\.gif/ ) != -1 ) //gif
		obj.src = obj.src.replace( /\.gif$/, '_r.gif' );
	else if( obj.src.search( /\.jpg/ ) != -1 ) //jpg
		obj.src = obj.src.replace( /\.jpg$/, '_r.jpg' );
	else if( obj.src.search( /\.png/ ) != -1 ) //png
		obj.src = obj.src.replace( /\.png$/, '_r.png' );
}
function imgout( obj )
{
	obj = obj || this;
	if( obj.src.search( /\.gif$/ ) != -1 ) //gif
		obj.src = obj.src.replace( /_r\.gif$/, '.gif' );
	else if( obj.src.search( /\.jpg$/ ) != -1 ) //jpg
		obj.src = obj.src.replace( /_r\.jpg$/, '.jpg' );
	else if( obj.src.search( /\.png$/ ) != -1 ) //png
		obj.src = obj.src.replace( /_r\.png$/, '.png' );
}
function ptpPopup( url )
{
	var ptpPop = window.open(url,"ptpPop","toolbar=no,location=no,directories=no,status=no,menubar=no,hotkeys=no,scrollbars=yes,resizable=yes,dependent=yes,width=750,height=550");
	ptpPop.focus( );
	return ptpPop;
}
if( typeof $ != 'undefined' )
{
	$( function() {
		$('.nlb_ro').live( 'mouseover', function( ) {
			var firstpart = this.src.substring( 0, this.src.lastIndexOf('.') );
			var lastpart = this.src.substring( this.src.lastIndexOf('.'), this.src.length );
			if( firstpart.indexOf('_ro') == -1 )
				this.src = firstpart+'_ro'+lastpart;
		} );
		$('.nlb_ro').live( 'mouseout', function( ) {
			this.src = this.src.replace( /_ro\./, '.' );
		} );
	} );
}

