
		function is_child_of(parent, child) {
			if( child != null ) {			
				while( child.parentNode ) {
					if( (child = child.parentNode) == parent ) {
						return true;
					}
				}
			}
			return false;
		}		

	var moving = false;
		
	function showInfo(node, event, text1, text2, imgArray, name, caption)
	{
		var current_mouse_target = null;
		
		if( moving )
			return;
		moving=true;
	
		var a = document.createElement('a');
		a.setAttribute('href', imgArray[0]); 
		a.setAttribute('rel', "lightbox["+name+"]");
		a.setAttribute('title', caption);
		node.appendChild(a);	

		var bg = document.createElement('div');
		bg.setAttribute('class', 'wd'); 		
		a.appendChild(bg);
		
		var img1 = document.createElement('img');
		img1.setAttribute('src', 'images/bg.png');
		img1.setAttribute('width', '160');
		img1.setAttribute('height', '100');
		bg.appendChild(img1);	
		    
		var wd1 = document.createElement('div');
		wd1.setAttribute('class', 'wd'); 
		a.appendChild(wd1);
		      
		var wd2 = document.createElement('div');
		wd2.setAttribute('class', 'block'); 
		wd1.appendChild(wd2);	
		     
		var wk = document.createElement('div');
		wk.setAttribute('class', 'wk'); 
		wk.innerHTML = text1;
		a.appendChild(wk);
		
		var wkk = document.createElement('div');
		wkk.setAttribute('class', 'wkk'); 
		wkk.innerHTML = text2;
		a.appendChild(wkk); 

		for (var i=1;i<imgArray.length;i++)
 		{
		   a = document.createElement('a');
		   a.setAttribute('href', imgArray[i]); 
		   a.setAttribute('rel', "lightbox["+name+"]");
   		   a.setAttribute('title', caption);
		   node.appendChild(a);	
		}
	}
	
	function hideInfo(node,event,imgCount)
	{
			var current_mouse_target = null;
			if( event.toElement ) {				
				current_mouse_target 			 = event.toElement;
			} else if( event.relatedTarget ) {				
				current_mouse_target 			 = event.relatedTarget;
			}
			if( !is_child_of(node, current_mouse_target) && node != current_mouse_target ) {
				for (var i=imgCount;i>=1;i--)
				node.removeChild(node.lastChild);	
				moving=false;
			}
	}		

