.gallerycontainer{
position: relative;
/*Add a height attribute and set to largest image's height to prevent overlaying*/
}
/* 1 */
.thumbnail1 img{
border: 1px solid white;
margin: 0 5px 5px 0;
}

.thumbnail1:hover{
background-color: transparent;
}

.thumbnail1:hover img{
border: 1px solid #333444;
}

.thumbnail1 span{ /*CSS for enlarged image*/
position:absolute;
background-color:000099;
padding: 5px;
left: -1000px;
border: 0px dashed gray;
visibility: hidden;
color: black;
text-decoration: none;
}

.thumbnail1 span img{ /*CSS for enlarged image*/
border-width: 0;
padding: 2px;
}

.thumbnail1:hover span{ /*CSS for enlarged image*/
visibility: visible;
top: -120px;
left: -10px; /*position where enlarged image should offset horizontally */
}

/* 2 */
.thumbnail2 img{
border: 1px solid white;
margin: 0 5px 5px 0;
}

.thumbnail2:hover{
background-color: transparent;
}

.thumbnail2:hover img{
border: 1px solid #333444;
}

.thumbnail2 span{ /*CSS for enlarged image*/
position: absolute;
background-color: lightyellow;
padding: 5px;
left: -1000px;
border: 1px dashed gray;
visibility: hidden;
color: black;
text-decoration: none;
}

.thumbnail2 span img{ /*CSS for enlarged image*/
border-width: 0;
padding: 2px;
}

.thumbnail2:hover span{ /*CSS for enlarged image*/
visibility: visible;
top: -280px;
left: 00px; /*position where enlarged image should offset horizontally */
z-index: 50;
}

/* 3 */
.thumbnail3 img{
border: 1px solid white;
margin: 0 5px 5px 0;
}

.thumbnail3:hover{
background-color: transparent;
}

.thumbnail3:hover img{
border: 1px solid #333444;
}

.thumbnail3 span{ /*CSS for enlarged image*/
position: absolute;
background-color: lightyellow;
padding: 5px;
left: -1000px;
border: 1px dashed gray;
visibility: hidden;
color: black;
text-decoration: none;
}

.thumbnail3 span img{ /*CSS for enlarged image*/
border-width: 0;
padding: 2px;
}

.thumbnail3:hover span{ /*CSS for enlarged image*/
visibility: visible;
top: -200px;
left: 00px; /*position where enlarged image should offset horizontally */
z-index: 50;
}

/* 4 */
.thumbnail4 img{
border: 1px solid white;
margin: 0 5px 5px 0;
}

.thumbnail4:hover{
background-color: transparent;
}

.thumbnail4:hover img{
border: 1px solid #333444;
}

.thumbnail4 span{ /*CSS for enlarged image*/
position: absolute;
background-color: lightyellow;
padding: 5px;
left: -1000px;
border: 1px dashed gray;
visibility: hidden;
color: black;
text-decoration: none;
}

.thumbnail4 span img{ /*CSS for enlarged image*/
border-width: 0;
padding: 2px;
}

.thumbnail4:hover span{ /*CSS for enlarged image*/
visibility: visible;
top: -120px;
left: 00px; /*position where enlarged image should offset horizontally */
z-index: 50;
}

/* 5 */
.thumbnail5 img{
border: 1px solid white;
margin: 0 5px 5px 0;
}

.thumbnail5:hover{
background-color: transparent;
}

.thumbnail5:hover img{
border: 1px solid #333444;
}

.thumbnail5 span{ /*CSS for enlarged image*/
position: absolute;
background-color: lightyellow;
padding: 5px;
left: -1000px;
border: 1px dashed gray;
visibility: hidden;
color: black;
text-decoration: none;
}

.thumbnail5 span img{ /*CSS for enlarged image*/
border-width: 0;
padding: 2px;
}

.thumbnail5:hover span{ /*CSS for enlarged image*/
visibility: visible;
top: -40px;
left: 00px; /*position where enlarged image should offset horizontally */
z-index: 50;
}
