function isString() {
	if (typeof arguments[0] == 'string') return true;
	if (typeof arguments[0] == 'object') {
		var criterion = arguments[0].constructor.toString().match(/string/i);
		return (criterion != null);  
	}
	
	return false;
}
function hasClass ( _object , _className ) {
	if ( isString( _object.className ) )
		if ( _object.className.search(_className) != -1 ) return true;

	return false;
}

function addClass ( _object , _className ) {
	_object.className += ' '+_className;
}

function removeClass ( _object , _className ) {
	_rexp = new RegExp ("\s?"+_className+"" , "i" );
	_object.className = _object.className.replace( _rexp , "" );
}

function getParentByClassName ( _object , _className ) {
	_parentModule = _object;
	while ( _parentModule.className.search (_className) == -1 ) {
		_parentModule = _parentModule.parentNode;
	}

	return _parentModule;
}

function getFirstChildByClassName ( _object , _className ) {
	_bodyId = 0;
	_continue = -1;
	do {
		_bodyId++;
		_target = _object.childNodes[ _bodyId ];
		if ( isString(_target.className) ) _continue = _target.className.search(_className);
	} while ( _continue == -1 );

	return _target;
}

function hover ( _object , _classNameArg ) {
	_className = _classNameArg || "hover";
	if ( hasClass ( _object , _className ) ) {
		removeClass ( _object , _className );
	} else
		addClass ( _object , _className );
}

function inputFocus ( _object ) {
	if ( ( _object.value == _object.defaultValue ) ) {
		_object.value = '';
	}
	else { if ( _object.value == '' ) {
			_object.value = _object.defaultValue;
		}
	}
}

function showTab ( _object ) {
	_parent = getParentByClassName ( _object , 'info' );
	_target = document.getElementById ( _object.id + 'Tab' );
	_test=0;

	for ( i = 0 ; i < _parent.childNodes.length ; i++ ) {
		_this = _parent.childNodes[i];
		_test += _parent.childNodes[i].className+' ';
		if ( _this.tagName == 'INPUT' ) {
			document.getElementById( _this.id + 'Tab' ).style.display = 'none';
			removeClass( _this , 'active' );
		}
	}

	removeClass( _object , 'active' );
	addClass( _object , 'active' );
	_target.style.display = 'block';
}

function showHide ( _objectID , _displayValueArg ) {
	_object = document.getElementById( _objectID );
	_displayValue = _displayValueArg || "inline";

	if( _object.style.display == 'none' || _object.style.display == '' ) {
		_object.style.display = 'inline';
	} else {
		_object.style.display = 'none';
	}
}

function chnapni(obj) {
	if (obj && ((obj.nextSibling.nodeType == 1 && obj.nextSibling.innerHTML) || obj.nextSibling.nodeType == 3)) {
		obj.nextSibling.style.display = "block";
	}
}

function pustto(obj) {
	if (obj) {
		obj.nextSibling.style.display = "none";
	}
}
var itmp = new Image();
itmp.src = "http://www.zvirecimilacci.cz/img/pseudotransparent_e7e7e7.png";

