var windowHandle = null;
var windowHandle_closed = false;


function enlarge(x,y,z){
var imgurl = x;
var bg = x.indexOf('images/gallery/');
var start = bg + 15;
var end = x.indexOf('.jpg',start);
var p=x.substring(start);
var value = "images/gallery/enlarge/enlarge.asp?img="+p;
var dimension;
dimension="width="+z+",height="+y;
windowHandle = window.open(value,'image',dimension); 
if (windowHandle_closed) {
   windowHandle_closed = false;
}
return;
}

function closeWindow() {
    if (windowHandle != null) {
        if (!windowHandle_closed) {
            windowHandle_closed = true;
            windowHandle.close();
        }
    }
}
//Preload images ("yes" or "no"):
var preloadimg="yes"

//Set optional link target to be added to all images with a link:
var optlinktarget=""

//Set image border width
var imgborderwidth=0

//Optionally, change 1.0 and 0.7 below to affect Wipe gradient size and duration in seconds in IE5.5+:

///////No need to edit beyond here/////



function returnimgcode(theimg,mtop,title){
var imghtml=""
var x=mtop
var t=title
var s=theimg[2]
imghtml= "<h4 style=margin-top:"+mtop+"px;margin:bottom:0;letter-spacing:3px;font-weight:bold;font-size:12px;color:#003366;>"+t+ "</h4><a href=\"" +theimg[1]+ "\" onclick=\"enlarge('"+theimg[0]+"',"+theimg[2]+","+theimg[3]+");\">";
imghtml+='<img  src="'+theimg[0]+'"/>'
if (s == "")
imghtml+='</a><br />Sorry, No Enlargment'
else
imghtml+='</a><br />Click Image to Enlarge'
return imghtml
}


function modifyimage(loadarea, imgindex, margin, title,trans){
var filterstring="progid:DXImageTransform.Microsoft.revealTrans(Duration=1.0,Transition="+trans+")"
if (document.getElementById){
var imgobj=document.getElementById(loadarea)
if (imgobj.filters && window.createPopup){
imgobj.style.filter=filterstring
imgobj.filters[0].Apply()
}
imgobj.innerHTML=returnimgcode(dynimages[imgindex],margin,title,imgindex)
if (imgobj.filters && window.createPopup)
imgobj.filters[0].Play()
return false
}
}