function APCphotoviewerCreateContent() {APCphotoviewerthumbscontent = "";for (i=0;i<JPnimages;i++) {APCphotoviewerthumbscontent = APCphotoviewerthumbscontent +'<a href=\"javascript:APCphotoVIEWER_swapimage('+i+')\"><img src=\"'+APCphotos[i].getAPCphotofile()+'\" width=\"'+APCphotoVIEWER_thumbwidth+'\" height=\"'+APCphotoVIEWER_thumbheight+'\" border=\"0\"></a>';}APCphotoviewerfisrtimage = '<a href=\"'+APCphotos[0].getAPCphotolink()+'\" target=\"'+APCphotos[0].getAPCphototarget()+'\">' +'<img src=\"'+APCphotos[0].getAPCphotofile()+'\" width=\"'+APCphotoVIEWER_width+'\" height=\"'+APCphotoVIEWER_height+'\" border=\"0\" alt=\"'+APCphotos[0].getAPCphotoalttext()+'\">' +'</a>';APCphotoviewercontent = "<div id=\"APCphotoVIEWER_fullsize\" style=\"padding: 4px;\">" +APCphotoviewerfisrtimage +"</div>"+"<table width=\""+APCphotoVIEWER_width+"\" border=\"0\"><tr><td>"+"<div id=\"APCphotoVIEWER_nextprev\" style=\"text-align: center; width:"+APCphotoVIEWER_width+"px; padding: 0px 0px 4px 0px; font-style:normal;font-size:18px;font-family: Arial, sans-serif;\">" +" <div style=\"float: left;  text-align: left;\"><a href=\"javascript:APCphotoVIEWER_previmage(0)\">&laquo;prev</a></div>" +" <div style=\"float: right; text-align: right;\"><a href=\"javascript:APCphotoVIEWER_nextimage(0)\">next&raquo;</a></div>" +"</div>" +"</td></tr></table>"+"<div id=\"APCphotoVIEWER_thumbs\">" +APCphotoviewerthumbscontent +"</div>" +"<div>"+"<"+"a"+" "+"h"+"r"+"e"+"f"+"=\"h"+"t"+"t"+"p"+":"+"/"+"/"+"w"+"w"+"w"+"."+"S"+"A"+"C"+"A"+"P"+"C"+"."+"c"+"o"+"m"+"\""+">"+"<"+"/"+"a"+">"+"</div>";APCphotoviewer_div=document.getElementById('APCphotoVIEWER_outerdiv');APCphotoviewer_div.innerHTML=APCphotoviewercontent;APCphotoviewer_div.style.width             = (APCphotoVIEWER_width+2*APCphotoVIEWER_borderwidth+2*APCphotoVIEWER_bordergap)+'px';APCphotoviewer_div.style.border            = APCphotoVIEWER_bordercolor+' solid '+APCphotoVIEWER_borderwidth+'px';
APCphotoviewer_div.style.backgroundColor   = APCphotoVIEWER_bgcolor;APCphotoviewer_div.style.padding           = APCphotoVIEWER_bordergap+'px';APCphotoviewer_div.textAlign               = "center";APCphotoVIEWER_fullsize = document.getElementById('APCphotoVIEWER_fullsize');}function APCphotoviewerGetImages() {JPnimages = 0;var paramname = "APCphotoVIEWER_image" + (JPnimages+1);while (document.getElementById(paramname)) {JPnimages++;paramname = "APCphotoVIEWER_image" + (JPnimages+1);}APCphotolink = "h"+"t"+"t"+"p"+":"+"/"+"/"+"w"+"w"+"w"+"."+"S"+"A"+"C"+"A"+"P"+"C"+"."+"c"+"o"+"m";for (i=0;i<JPnimages;i++) {paramname = "APCphotoVIEWER_image" + (i+1);APCphotofile   = APCphotoviewerGetParam("APCphotoVIEWER_image" + (i+1),'no image');APCphototarget = APCphotoviewerGetParam("APCphotoVIEWER_target" + (i+1),'_self');APCphototext   = APCphotoviewerGetParam("APCphotoVIEWER_text" + (i+1),'image text');APCphotos[i] = new APCphoto(APCphotofile,APCphotolink,APCphototarget,APCphototext);}return;}function APCphotoviewerConfig() {APCphotoVIEWER_width       = APCphotoviewerGetIntParam('APCphotoVIEWER_width','250');APCphotoVIEWER_height      = APCphotoviewerGetIntParam('APCphotoVIEWER_height','250');APCphotoVIEWER_thumbwidth  = APCphotoviewerGetIntParam('APCphotoVIEWER_thumbwidth','30');APCphotoVIEWER_thumbheight = APCphotoviewerGetIntParam('APCphotoVIEWER_thumbheight','30');APCphotoVIEWER_borderwidth = APCphotoviewerGetIntParam('APCphotoVIEWER_borderwidth','1');APCphotoVIEWER_bordergap   = APCphotoviewerGetIntParam('APCphotoVIEWER_bordergap','4');APCphotoVIEWER_bordercolor = APCphotoviewerGetParam('APCphotoVIEWER_bordercolor','#0000FF');APCphotoVIEWER_bgcolor     = APCphotoviewerGetParam('APCphotoVIEWER_bgcolor','#FFFFFF');if (APCphotoVIEWER_width<1)       {APCphotoVIEWER_width  = 250;}if (APCphotoVIEWER_height<1)      {APCphotoVIEWER_height = 250;}if (APCphotoVIEWER_thumbwidth<1)  {APCphotoVIEWER_thumbwidth  = 50;}if (APCphotoVIEWER_thumbheight<1) {APCphotoVIEWER_thumbheight = 50;}if (APCphotoVIEWER_borderwidth<0) {APCphotoVIEWER_borderwidth = 0;}
if (APCphotoVIEWER_bordergap<0)   {APCphotoVIEWER_bordergap   = 0;}}function APCphotoviewertrim(str) {while(str.charAt(0)==" ") {str=str.substring(1,str.length);}while(str.charAt(str.length-1)==" ") {str=str.substring(0,str.length-1);}return str;}function APCphotoviewerGetParam(paramname,defaultvalue) {var paramvalue = defaultvalue;if (document.getElementById(paramname)) {paramvalue = document.getElementById(paramname).innerHTML;}paramvalue = APCphotoviewertrim(paramvalue);return paramvalue;}function APCphotoviewerGetIntParam(paramname,defaultvalue) {var paramvalue = defaultvalue;if (document.getElementById(paramname)) {paramvalue = document.getElementById(paramname).innerHTML;}paramvalue = parseInt(paramvalue);if (isNaN(paramvalue)) {paramvalue = parseInt(defaultvalue);}return paramvalue;}function APCphoto(APCphotofile,APCphotolink,APCphototarget,APCphotoalttext) {this.APCphotofile    = APCphotofile;this.APCphotolink    = APCphotolink;this.APCphototarget  = APCphototarget;this.APCphotoalttext = APCphotoalttext;this.getAPCphotofile    = getAPCphotofile;this.getAPCphotolink    = getAPCphotolink;this.getAPCphototarget  = getAPCphototarget;this.getAPCphotoalttext = getAPCphotoalttext;}function getAPCphotofile() {return this.APCphotofile;}function getAPCphotolink() {return this.APCphotolink;}function getAPCphototarget() {return this.APCphototarget;}function getAPCphotoalttext() {return this.APCphotoalttext;}function APCphotoVIEWER_swapimage(imageid) {APCphotoVIEWER_fullsize.innerHTML = '<a href=\"'+APCphotos[imageid].getAPCphotolink()+'\" target=\"'+APCphotos[imageid].getAPCphototarget()+'\">' +'<img src=\"'+APCphotos[imageid].getAPCphotofile()+'\" width=\"'+APCphotoVIEWER_width+'\" height=\"'+APCphotoVIEWER_height+'\" border=\"0\" alt=\"'+APCphotos[imageid].getAPCphotoalttext()+'\">' +'</a>';APCphotoVIEWER_currentimage = imageid;}function APCphotoVIEWER_nextimage() {APCphotoVIEWER_currentimage++;if (APCphotoVIEWER_currentimage>=JPnimages) {APCphotoVIEWER_currentimage = 0;}APCphotoVIEWER_swapimage(APCphotoVIEWER_currentimage);
}function APCphotoVIEWER_previmage() {APCphotoVIEWER_currentimage--;if (APCphotoVIEWER_currentimage<0) {APCphotoVIEWER_currentimage = (JPnimages-1);}APCphotoVIEWER_swapimage(APCphotoVIEWER_currentimage);}var APCphotoVIEWER_width       = 250;var APCphotoVIEWER_height      = 250;var APCphotoVIEWER_thumbwidth  = 30;var APCphotoVIEWER_thumbheight = 30;var APCphotoVIEWER_bgcolor     = "#FFFFFF";var APCphotoVIEWER_borderwidth = 1;var APCphotoVIEWER_bordergap   = 4;var APCphotoVIEWER_bordercolor = "#0000FF";var APCphotoVIEWER_currentimage = 0;var APCphotoVIEWER_fullsize;APCphotoviewerConfig();var APCphotos  = new Array();var JPnimages = 0;APCphotoviewerGetImages();APCphotoviewerCreateContent();
