// strParentRule - css rule to find parent elements // strHoverClass - if not empty add this class on mouseover to parent element// strChildRule - css rule to find child element inside parent and apply its href (or href of first found <a> inside child )// dontHide - whether do hide child element// UseLightBox - apply UseLightBox.start instead of window.location changefunction JGNT_LinkBoxes( strParentRule, strHoverClass, strChildRule, dontHide, UseLightBox ) {	var ParentElementArray = $$(strParentRule);	for (var k=0; k<ParentElementArray.length; k++){		if( strHoverClass ){			ParentElementArray[k].observe( 'mouseover', function( event ){ 				this.addClassName( strHoverClass ); } )			ParentElementArray[k].observe( 'mouseout', function( event ){ 				this.removeClassName( strHoverClass ); } )		}				if( strChildRule ){			var targetElement = ParentElementArray[k].select(strChildRule)[0];			if( targetElement ){				var strHref = "";				if( targetElement.readAttribute( "href" ) ){					strHref = targetElement.readAttribute( "href" );					ChildHref = targetElement;				} else {					ChildHref = targetElement.select('[href!=""]')[0];					if( ChildHref )						strHref = ChildHref.readAttribute( "href" );				}								if( strHref != "" ){					if( UseLightBox ){						ParentElementArray[k].observe( 'click', ( function( event ){ UseLightBox.start( this ); } ).bind( ChildHref ) );						ParentElementArray[k].observe( 'keypress', ( function( event ){ UseLightBox.start( ChildHref ); } ).bind( ChildHref ) );					} else {						ParentElementArray[k].observe( 'click', ( function( event ){ window.location = this.href; } ).bind( ChildHref ) );						ParentElementArray[k].observe( 'keypress', ( function( event ){ window.location = this.href; } ).bind( ChildHref ) );					};				}				if( ! dontHide )					targetElement.hide();			}		}	}}var myLightBox;document.observe( 'dom:loaded', function () { 	myLightBox = new Lightbox();	JGNT_LinkBoxes( ".jgnt_child_row", "jgnt_child_row_active", "a" );	JGNT_LinkBoxes( ".jgnt_child_block", "jgnt_child_block_active", "a" );	JGNT_LinkBoxes( ".jgnt_text_child_block", "jgnt_text_child_block_active", "a" );		JGNT_LinkBoxes( ".jgnt_blog_block", "jgnt_blog_block_active", "a.jgnt_block_link" );	JGNT_LinkBoxes( "#jgnt_anounce1", "jgnt_block_anounce_active", "a" );	JGNT_LinkBoxes( ".jgnt_text_gallery_foto", "jgnt_text_gallery_foto_active", "a", 0, myLightBox );		//	JGNT_LinkBoxes( ".gallery_foto_row", "gallery_foto_row_hover", "a", 0, myLightBox );} );