function viewImage(image, width, height, caption){
    var params = "toolbar=0, scrollbars=1, location=0, statusbar=0, menubar=0, resizable=1, width="+width+", height="+height;
    var popup = window.open("", "imageWindow", params);
    popup.document.write('<html><head><title>American Chinese Martial Arts Federation</title><link rel="stylesheet" type="text/css" href="/images/style.css" /></head><body><p class="subhead" align="center"><img src="'+image.src+'" border="1">');
    if(caption){
	popup.document.write('<br><br>'+caption);
    }
    popup.document.write('<br><br><a href="javascript:self.close()">Close Window</a></p></body></html>');
    popup.document.close();
    popup.resizeTo(width, height);
    popup.focus();
}
function view(){
    return false;
}

function openWindow(url, height, width, titlebar, resizable, scrollbars, toolbar, location){
    if(!url){ return; }

    if(height==null){ height=500; }
    if(width==null){ width=600; }
    if(titlebar==null){ titlebar=1; }
    if(resizable==null){ resizable=1; }
    if(scrollbars==null){ scrollbars=1; }
    if(toolbar==null){ toolbar=1; }
    if(location==null){ location=1; }

    var params = "width="+width+",height="+height+",titlebar="+titlebar+", resizable="+resizable+", scrollbars="+scrollbars+", toolbar="+toolbar+", location="+location;

    var popupName = Math.round(100*Math.random());//for a unique window for each popup
    var popup = window.open(url, popupName, params);
    popup.focus();
}