var folders=new Array();folders[0] = {   name: "Support", pictures: new Array(), title: "Support", description: "", photo: "images/Support/uploadfail.jpg", sortdate: "2009-05-11 14:20:57", date: "May 11, 2009"}; var pictures=new Array();pictures[0] = {   photo: "images/Support/uploadfail.jpg", date: "March 3, 2007", sortdate: "2007-03-03 17:49:19", filedate: "2009-05-11 14:20:57", description: "<P><CENTER><b>Upload Failed</b></CENTER>  <P><b>Error Message:</b> <FONT COLOR=\'red\'>Upload Failed.  The file could not be copied to: images/folder.<BR>  Check folder permissions.<BR>  Permissions: ###. Owner: name<BR></FONT>  <P>This error can occur if you created the folder using FTP logged in under  \'name\'.  To be able to upload an image using the Photo Gallery Admin  Page you will have to login through an FTP client using \'name\' and change  the permissions (CHMOD) of the category folder to 777.  <P><b>FTP</b> - If you are tyring to upload a photo to a category photo  using FTP and the file never shows up in the folder that means you  probably created the folder using the <b>Photo Gallery Script</b> by  logging in with CTRL-ALT-L.  If that is the case, then you must change  the permissions to that folder to allow upload through FTP: Click on  <b>Edit Category</b> -> <b>Set Folder Permissions to 777</b>.<BR>    ", display: "rows", align: "center", width: "240", filename: "uploadfail.jpg", title: "Upload Failed"};pictures[1] = {   photo: "images/Support/download.jpg", date: "May 5, 2007", sortdate: "2007-05-05 18:40:32", filedate: "2009-05-11 14:20:30", description: "<P><CENTER><B>CTRL+ALT+L is not displaying Login Window</B></CENTER><P>This occurs usually in Internet Explorer.  If the Login Window  does not appear first try clicking on a blank area on the page and then  press CTRL+ALT+L again.", display: "rows", align: "center", width: "240", filename: "download.jpg", title: "No Log In Window"};pictures[2] = {   photo: "images/Support/image.jpg", date: "December 24, 2007", sortdate: "2007-12-24 16:55:23", filedate: "2009-05-11 14:20:50", description: "<P><CENTER><b>Image could not be deleted</b></CENTER><P><b>Error Message:</b> <FONT COLOR=\'red\'>  The image $filename could not be deleted! Permission Denied.  Permissions: .$permissions. Owner: $owner</FONT>  <P>This error usually occurs if you created the folder where you uploaded  $filename using FTP by $owner.  Either change the permissions of that folder  to 777 in order to delete the file through the Photo Gallery Script or delete  the image using FTP.", display: "rows", align: "center", width: "240", filename: "image.jpg", title: "Image Delete"};pictures[3] = {   photo: "images/Support/folder.jpg", date: "June 23, 2007", sortdate: "2007-06-23 15:02:00", filedate: "2009-05-11 14:20:40", description: "<P><CENTER><b>Folder Creation Failed</b></CENTER>  <P><b>Error Message:</b> <FONT COLOR=\'red\'>folder_name folder creation  failed! Please check permissions.</FONT>  <P>This error can occur if you created the root <b>images/</b> folder  using FTP and did not set its permissions to 777.  To resolve the problem,  using an FTP client log into your web server using the same account that  you created the <b>images/</b> folder with and change (CHMOD) its  permissions to 777.  <P><CENTER><b>Folder could not be deleted</b></CENTER>  <P><b>Error Message:</b> <FONT COLOR=\'red\'>  Folder $folder could not be deleted! Permission Denied.  Permissions: $permissions. Owner: $owner</FONT>  <P>This error usually occurs if you created the folder using FTP by $owner.  Either change the permissions of that folder  to 777 in order to delete the folder through the Photo Gallery Script or delete  the folder using FTP.  <P><CENTER><b>Could not create images folder.</b></CENTER>  <P>This error occurs if you uploaded everything to your web server into  a folder but did not create an <b>images</b> folder under that folder.  If this is the case, just login into your web server through your FTP client  and create an <b>images</b> folder in your photo gallery directory.  Or if  you want the photo gallery to create the images folder for you then you have  to CHMOD the folder where you uploaded the photo gallery files to 777.", display: "rows", align: "center", width: "240", filename: "folder.jpg", title: "Folder Errors"};pictures[4] = {   photo: "images/Support/div.jpg", date: "July 17, 2007", sortdate: "2007-07-17 19:06:45", filedate: "2009-05-11 14:20:27", description: "<P><CENTER><b>DIV description does not display under image</b></CENTER> 	<P>If you created an invisible DIV comment and gave it the ID of your 	filename including the extension and the comment does not display there 	are two possibilities: 	<OL>  <LI>You may have placed the invisible DIV after your call to the  mcjpg.php script in your HTML document.  The DIV must be placed before  &lt;SCRIPT TYPE=\"text/javascript\" LANGUAGE=\"JavaScript\" SRC=\"mcjpg.php\"&gt;&lt;/SCRIPT&gt;  in your HTML file or the script will not recognize it.)</LI>  <LI>If you have logged in using CTRL+ALT+L and you are looking at your  photo gallery through <b>admin.php</b> then the DIV descriptions will  not display because they are in your HTML document.  admin.php does  not search through your index HTML document for these DIVs so they will only  display when you logout of admin.php and go back to your public gallery.</LI>  </OL>", display: "rows", align: "center", width: "240", filename: "div.jpg", title: "No DIV Description"};pictures[5] = {   photo: "images/Support/exif.jpg", date: "February 17, 2008", sortdate: "2008-02-17 16:39:04", filedate: "2009-05-11 14:20:35", description: "<P><CENTER><b>EXIF Errors</b></CENTER>  <P><b>Error Message:</b> <FONT COLOR=\'red\'>  Your server does not have EXIF Enabled. 	Please change \"$get_exif=0\" instead of 1. 	Or change Get JPG Exif Comments to <B>No</B> 	in Settings.</FONT> 	<P>or 	<P><b>Error Message:</b> <FONT COLOR=\'red\'> 	Call to undefined function: exif_read_data().</FONT>  <P><b>Solution 1:</b> This is the easy solution.  Your web server\'s PHP was not  compiled with --enable-exif.  You need to recompile PHP 4 with --enable-exif.  My web host was going to charge me $75/hr to do this.  So you can either call your  web host up and tell them you need \"PHP4 recomiled with --enable-exif\" and hope  they don\'t charge too much or you can just <b>not</b> use JPG Exif comments in the  Photo Gallery script. To not use JPG EXIF comments you would have to edit  <b>settings.php</b> and change the line <b>get_exif=1</b> to <b>get_exif=0</b>.  The second solution is how I figured out how to recompile my PHP 4 with --enable-exif  myself.  I offer no warranty of any kind for the second solution.  <P><b>Solution 2:</b> \"How to recompile PHP 4 from WHM\" or  \"How to recompile PHP 4 on a Remote web server\".  There is no warranty of any kind  for using this solution.  It may or may not work.  I have no idea if PHP or your  web server will mess up if you do these steps correctly or incorrectly.  If you want  to see what your server is compiled with you can create a php file possibly named  <b>phpinfo.php</b> and just put the lines <b>&lt;? phpphpinfo(); ?&gt;</b> in it.  Save it  and upload it to your web server and then run it from a browser.  It will tell you all the  functions and libraries included in your PHP installation.  <P>Here are the steps to recompile PHP4 with --enbale-exif through WHM:  <OL>  <LI>First, start WHM - WebHost Manager.  Usually you type in a web browser address something like:  <b>https://server_IP_or_hostname:2087/</b> and login as root.  You’ll need to know the root password from your web host.</LI>  <LI>Click on <b>Software</b> and then <b>EasyApache (Apache Update)</b></LI>  <LI>I received an update notice that I had to close.  Scroll down, make sure \"Previously saved config\" is checked and click on <b>Start  customizing based on profile.</b></LI>  <LI>It said I had Apache 2, so I kept it checked and clicked Next Step</LI>  <LI>It said I had PHP 4, so I kept it checked and clicked Next Step</LI>  <LI>It said I had version 4.4.9 so I kept it checked and clicked Next Step</LI>  <LI>Short options list did not have exif listed so I scrolled down and clicked  on <LI>Exhaustive Options List.</LI>  <LI>Finally, after scrolling way down to PHP 4.4.9 options I could check the box for exif.</LI>  <LI>Then at the bottom I typed in a filename, a display name and description.  I just made them up.  I had to do all three or I got an error that I didn\'t  fill it out.</LI>  <LI>Then I clicked <b>Save and Build</b>.</LI>  <LI>After warning me a few times it started rebuilding.  (Don\'t ask me why the change in lingo from \"compile\" to \"build\".  After 20 minutes of it displaying all its rebuilding text in the browser  it popped up with a window stating: \"configure suexec and PHP\".  I just scrolled to the bottom and clicked on \"save New Configuration.\"  After a minute it said it had generated php.conf.  I clicked on close.</LI>  <LI>Now my exif functions worked on my web server!</LI>  </OL>", display: "rows", align: "center", width: "240", filename: "exif.jpg", title: "EXIF Errors"};pictures[6] = {   photo: "images/Support/mysql.jpg", date: "May 7, 2007", sortdate: "2007-05-07 19:27:56", filedate: "2009-05-11 14:20:53", description: "<P><CENTER><b>Could not connect to MySQL</b></CENTER>  <P><b>Error Message:</b> <FONT COLOR=\'red\'>Could not connect to MySQL.  If you are not using MySQL then change $use_sql = 0 instead of 1.<BR>  </FONT>  <P>This error usually occurs if the <b>settings.php</b>  variables <b>$sql_username</b> and <b>$sql_password</b> are not set  correctly or the username has not been created.  <P><CENTER><b>Could not open database</b></CENTER>  <P><b>Error Message:</b> <FONT COLOR=\'red\'>Could not open database $sql_database.  Make sure the database has been created. If you are not using MySQL then change  $use_sql = 0 instead of 1.<BR></FONT>  <P>This error occurs if $sql_databse is not set correctly in <b>settings.php</b>  or the sql_databse has not been created in your CPANEL or $sql_username has  not been assigned to that databse in CPANEL.", display: "rows", align: "center", width: "240", filename: "mysql.jpg", title: "MySQL Errors"};pictures[7] = {   photo: "images/Support/gd-jpg.jpg", date: "July 17, 2007", sortdate: "2007-07-17 19:04:31", filedate: "2009-05-11 14:20:43", description: "<P><CENTER><b>Photo Description changed to CREATOR: gd-jpeg</b></CENTER> 	<P>Your photo JPG EXIF photo comment may have changed to 	<B>CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), quality = 90</B> 	after you upload it using the Photo Gallery Script.  There are a few 	causes and a few solutions to this problem. 	<OL>  <LI><b>Cause:</b> You uploaded the image using the Photo Gallery Script  \"Upload\" button and the image was very large so it was resized by  the Photo Gallery Script using the GD library function.  PHPs GD  Library automatically adds these comments to JPG photos when it resizes  or creates an image.  <ol type=\"A\">  <LI><b>Solution:</b> If you are using MySQL with the photo gallery and you  create a JPG EXIF comment before you upload the image then the  photo gallery will save this comment in the MySQL database before  it resizes the image, so that your original comment is displayed as  the photo description because it retrieves it from the MySQL database.</LI>  <LI><b>Solution:</b> Use FTP to upload the photo then it will not be  resized using the GD Library and your original EXIF comment will remain.</LI>  <LI><b>Solution:</b> Resize the photo to a reasonable web display size  before uploading it using the Photo Gallery \"Upload\" button, that way  it will not be resized and the original comment will stay the same.</LI>  <LI><b>Solution:</b> I do not recommend this if your photo is very large  but you could just uncheck the \"Resize\" switch in the \"Upload\" menu and  then the GD library will not resize the image and the comment will be  unaltered.</LI>  </ol>  </OL><BR>   ", display: "rows", align: "center", width: "240", filename: "gd-jpg.jpg", title: "CREATOR: gd-jpeg"};pictures[8] = {   photo: "images/Support/ie-error.jpg", date: "March 15, 2008", sortdate: "2008-03-15 18:33:49", filedate: "2009-05-11 14:20:46", description: "<P><CENTER><b>Internet Explorer Cannot Open the Internet Site Operation Aborted</b></CENTER>  <P>This is an error that I do not understand.  I\'m not sure which Internet Explorer  browser versions this happens in yet.  But I know it happens in IE 6.0.  <BR>  <b>The Cause: </b> If you make a description for a photo and you forget to close  a HTML tag then Internet Explorer makes this error and will not allow you to  display the page.  For example: If you make a description with HTML tags like:  <DIV STYLE=\'background-color: #AABBFF\'>  &lt;CENTER&gt;This is a description  </DIV>  and you forget the closing &lt;/CENTER&gt; tag then Internet Explorer will have this error.  <P><b>The Reason: </b>I do not know.  <P><B>The solution: </B> Be very careful with your HTML tags in photo descriptions.  If you get this error then you will have to go back to the thumbnails of the photos  and click on <b>Edit Photo</b> and try to edit the photo description again and fix the problem.  If you are diplaying descriptions of photos in thumbnails view, then you may not be able to  fix the problem this way because the error will occur.  If this happens you will have to  go to the root page of your gallery and click on <b>Settings</b> and change  <b> Display Photo Descriptions in Thumbnail View?:  </b> to No.  Then you can delete the photo  or edit its description.  Or if you are not using MySQL you may have to edit  <b>settings.php</b> and change the variable <b>$thumb_desc</b> to <b>0</b>. <BR>  <b>Another Solution:</b> If the above solutions do not work you may have to login to  your web servers cpanel and edit your MySql photo gallery database and look for the  description and edit or delete it there.  <P><SUB>(Note: I have not seen this error occur in Firefox, so you may be able to  fix the problem in a Firefox browser if you are not able to fix it in IE.)</SUB>", display: "rows", align: "center", width: "240", filename: "ie-error.jpg", title: "Internet Explorer Error"};for (var i in pictures)folders[0].pictures[i] = pictures[i];delete pictures;folders[1] = {   name: "CSS", pictures: new Array(), title: "CSS", description: "", photo: "images/CSS/css.jpg", sortdate: "2009-05-11 13:25:14", date: "May 11, 2009"}; var pictures=new Array();pictures[0] = {   photo: "images/CSS/css.jpg", date: "April 5, 2008", sortdate: "2008-04-05 14:31:13", filedate: "2009-05-11 13:52:33", description: "<P><CENTER><B>CSS - Cascading Style Sheets</B></CENTER>  <P>Both the Standard Edition (mcjpg.php) and the Picasa Web Albums Edition (mcjpg.js)  of <B>more<FONT COLOR=\"#0000FF\">Than</FONT>A Cool Javascript Photo Gallery</B>  assign CSS Classes to different elements of the Photo Gallery so that you can  fully customize the look of the gallery.  <P>You may download a CSS file with many of the possibilities here:  <A HREF=\'mcjpg.css\'>mcjpg.css</A>  <P>(Note: The Admin Login (CTRL-ALT-L) loads admin.php which automatically looks for  mcjpg.css for the CSS of the Admin pages.  So name your style sheet mcjpg.css or  you can do a search for \'mcjpg.css\' in admin.php and change it to your style sheet  filename. Also the sample index.html is also looking for \'mcjpg.css\'.)<BR>", display: "rows", align: "center", width: "320", filename: "css.jpg", title: "CSS - Cascading Style Sheets"};pictures[1] = {   photo: "images/CSS/next2.gif", date: "May 11, 2009", sortdate: "2009-05-11 13:25:13", filedate: "2009-05-11 13:25:13", description: " <P><CENTER><B>Navigation Arrows</B></CENTER><P>If you would rather use arrows for \'Next\' and \'Prev\' photo buttons  then here are some arrows you can download: <A HREF=\'arrows.zip\'>arrows.zip</A> <P>And you can use the following  CSS:<BR><DIV STYLE=\'overflow: scroll; height: 300px; width: 640px; background-color: #DDDDFF;\'><PRE><CODE>    <BR>.photo_table input.next_btn <font color=\"#008000\"><i>/* button for next photo */</i></font><BR>&#x007B;<BR><BR>   cursor: pointer;<BR>   background: transparent url(next.gif) no-repeat center top;<BR>   padding: 25px 0px 0px 0px;<BR>   overflow: hidden;<BR>   border: 0px;<BR>   width: 50px;<BR>   height: 25px;<BR>   margin: 0px; <BR>}<BR>.photo_table a:hover input.next_btn <font color=\"#008000\"><i>/* next photo button hover */</i></font><BR>&#x007B;<BR>   background: transparent url(next2.gif) no-repeat center top; </i></font><BR>}<BR>.photo_table input.prev_btn <font color=\"#008000\"><i>/* button for previous photo */</i></font><BR>&#x007B;<BR>   cursor: pointer;<BR>   background: transparent url(prev.gif) no-repeat center top;<BR>   padding: 25px 0px 0px 0px;<BR>   overflow: hidden;<BR>   border: 0px;<BR>   width: 50px;<BR>   height: 25px;<BR>   margin: 0px; <BR>}<BR>.photo_table a:hover input.prev_btn <font color=\"#008000\"><i>/* previous photo button hover */</i></font><BR>&#x007B;<BR>   background: transparent url(prev2.gif) no-repeat center top; <BR>}<BR></PRE></CODE></DIV>", display: "thumbnails", align: "center", width: "50", filename: "next2.gif", title: "Arrows"};pictures[2] = {   photo: "images/CSS/next.gif", date: "May 11, 2009", sortdate: "2009-05-11 13:25:13", filedate: "2009-05-11 13:25:13", description: "", display: "rows", align: "center", width: "50", filename: "next.gif", title: "Arrows"};pictures[3] = {   photo: "images/CSS/prev.gif", date: "May 11, 2009", sortdate: "2009-05-11 13:25:14", filedate: "2009-05-11 13:25:14", description: "", display: "rows", align: "center", width: "50", filename: "prev.gif", title: "Arrows"};pictures[4] = {   photo: "images/CSS/prev2.gif", date: "May 11, 2009", sortdate: "2009-05-11 13:25:13", filedate: "2009-05-11 13:25:13", description: "", display: "rows", align: "center", width: "50", filename: "prev2.gif", title: "Arrows"};for (var i in pictures)folders[1].pictures[i] = pictures[i];delete pictures;folders[2] = {   name: "Documentation", pictures: new Array(), title: "Documentation", description: "", photo: "images/Documentation/photos.jpg", sortdate: "2009-05-11 13:24:08", date: "May 11, 2009"}; var pictures=new Array();pictures[0] = {   photo: "images/Documentation/categories.jpg", date: "November 25, 2006", sortdate: "2006-11-25 14:17:57", filedate: "2009-05-11 15:26:36", description: "<P><CENTER><B>Creating Categories</B></CENTER><P>The easiest way to create a category is to make a new folder in the default  images folder using FTP.  (Note: If you make a folder using FTP you will not  be able to upload to it using the photo gallery script unless you CHMOD the  folder persmissions to 777.)  <P>The next way to create a category is to use the Photo Gallery script by  logging in using CTRL-ALT-L.  Then click on <b>Make Category</b>. (Note: If  you create a category using the Photo Gallery script then you will not be  able to upload photos to it using FTP unless you set the folder persmissions  to 777 by clicking on a category then <b>Edit Category</b> -> Check  <b>Change folder permission to 777.</b> -> <b>OK</b>.)  <P><CENTER><B>Category Titles</B></CENTER>  <P>There are two ways to create a category title:  <OL>  <LI><b>MySQL</b> - If you have MySQL setup then you can create a title  by clicking on a category then <b>Edit Category</b>. Fill in the title.  Click OK.</LI>  <LI><b>&lt;cattitle&gt;</b> - In the JPG IPTC Caption or the  JPG EXIF comments of a photo that  you upload to that category you can put: <b>&lt;cattitle  =\"This is a title\"&gt;</b> before you upload the photo.  Or in an invisbile DIV in your HTML document  you could create a DIV with the same ID as a photo you upload to that  category and use <b>cattitle=</b>. Example:<BR>  <DIV STYLE=\'background-color: #AAAAAA; padding:5px;\'>  <font color=\"#0000a0\"><b>&lt;DIV</b></font> <b>ID</b>=<b>\'photo.jpg\'  STYLE</b>=<b>\'display</b>:<b>none</b>;<b>\'</b>&gt;<BR>  <b>&lt;cattitle=\"This is a title\"&gt;</b><BR>  <font color=\"#0000a0\"><b>&lt;/DIV&gt;</b></font><BR></DIV>  (Note: The DIV must be placed before  &lt;SCRIPT TYPE=\"text/javascript\" LANGUAGE=\"JavaScript\" SRC=\"mcjpg.php\"&gt;&lt;/SCRIPT&gt;  in your HTML file or the script will not recognize it.)</LI>  </OL> ", display: "rows", align: "left", width: "240", filename: "categories.jpg", title: "Categories"};pictures[1] = {   photo: "images/Documentation/categories2.jpg", date: "April 5, 2005", sortdate: "2005-04-05 14:31:13", filedate: "2009-05-11 15:19:19", description: "<P><CENTER><B>Category Descriptions</B></CENTER>  <P>There are three ways to create a category description:  <OL>  <LI><b>MySQL</b> - If you have MySQL setup then you can create a description  by clicking on a category then <b>Edit Category</b>. Fill in the description.  Click OK.</LI>  <LI><b>&lt;catdescription&gt;</b> - In the JPG IPTC Caption or the  JPG EXIF comments of a photo that  you upload to that category you can put: <b>&lt;catdescription  =\"This is a description.\"&gt;</b>. Or in an invisbile DIV in your HTML document  you could create a DIV with the same ID as a photo you upload to that  category and use <b>catdescription=</b>. Example:<BR>  <DIV STYLE=\'background-color: #AAAAAA; padding:5px;\'>  <font color=\"#0000a0\"><b>&lt;DIV</b></font> <b>ID</b>=<b>\'photo.jpg\'  STYLE</b>=<b>\'display</b>:<b>none</b>;<b>\'</b>&gt;<BR>  <b>&lt;catdescription=\"This is a description.\"&gt;</b><BR>  <font color=\"#0000a0\"><b>&lt;/DIV&gt;</b></font><BR></DIV>  (Note: The DIV must be placed before  &lt;SCRIPT TYPE=\"text/javascript\" LANGUAGE=\"JavaScript\" SRC=\"mcjpg.php\"&gt;&lt;/SCRIPT&gt;  in your HTML file or the script will not recognize it.)</LI>  <LI><b>Invisible DIV with ID of folder name</b> - You can create an invisible DIV  in your document with the ID of the folder name. Example:<BR>  <DIV STYLE=\'background-color: #AAAAAA; padding:5px;\'>  <font color=\"#0000a0\"><b>&lt;DIV</b></font> <b>ID</b>=<b>\'foldername\'  STYLE</b>=<b>\'display</b>:<b>none</b>;<b>\'</b>&gt;<BR>  <b>Everything in this DIV will be a description for foldername.</b><BR>  <font color=\"#0000a0\"><b>&lt;/DIV&gt;</b></font><BR></DIV>  </OL>  <P><CENTER><B>Category Photo</B></CENTER>  <P>There are two ways to set a category photo:  <OL>  <LI><b>MySQL</b> - If you are logged in click on a category and then click on  a photo in the category and click on <b>Edit Photo</b> . Under <b>Set as  category photo</b> click on <b>Yes</b>.</LI>  <LI><b>&lt;catphoto&gt;</b> - In the JPG IPTC Caption or the  JPG EXIF comments of a photo that  you upload to that category you can put: <b>&lt;catphoto&gt;</b>.  Or in an invisbile DIV in your HTML document  you could create a DIV with the same ID as a photo you upload to that  category folder and use <b>catphoto</b>. Example:<BR>  <DIV STYLE=\'background-color: #AAAAAA; padding:5px;\'>  <font color=\"#0000a0\"><b>&lt;DIV</b></font> <b>ID</b>=<b>\'photo.jpg\'  STYLE</b>=<b>\'display</b>:<b>none</b>;<b>\'</b>&gt;<BR>  <b>&lt;catphoto&gt;</b><BR>  <font color=\"#0000a0\"><b>&lt;/DIV&gt;</b></font><BR></DIV>  (Note: The DIV must be placed before  &lt;SCRIPT TYPE=\"text/javascript\" LANGUAGE=\"JavaScript\" SRC=\"mcjpg.php\"&gt;&lt;/SCRIPT&gt;  in your HTML file or the script will not recognize it.)</LI>  <P><CENTER><B>Delete Category</B></CENTER>  <P><b>FTP</b> - If you created a category folder with FTP then you must delete it with  your FTP program or if you want to delete it with the Photo Gallery Script then you  must set the permissions (CHMOD) of the folder to 777 through FTP first.  <P><b>Photo Gallery Script</b> - If you created the folder with the Photo Gallery Script  then you must delete it with the Photo Gallery Script or if you want to delete it with  FTP then you must change the permissions to the category to 777 by clicking on  the category then <b>Edit Category</b> -> Check <b>Change folder permission to 777.  </b> -> <b>OK</b>.  <P><CENTER><B>Exclude List</B></CENTER>  <P>You can exclude category folders from showing up in the photo gallery by using the  <b>Exclude List</b>.  You can edit the exclude list by editing <b>settings.php</b>  and scrolling down to:<BR>  <DIV STYLE=\'background-color: #AAAAAA; padding:5px;\'>  $<b>exclude_list</b> = <b>array</b>(<b>\'none\'</b>, <b>\'nothing\'</b>, <b>\'nothing2\'</b>);  </DIV>  <P>If you are using MySQL then you can edit the exclude list by Logging In with  CTRL-ALT-L and then clicking on <b>Settings</b> and then scroll down and click on  <b>Exclude List</b>.", display: "rows", align: "right", width: "240", filename: "categories2.jpg", title: "Categories"};pictures[2] = {   photo: "images/Documentation/photos3.jpg", date: "April 5, 2008", sortdate: "2008-04-05 14:21:15", filedate: "2009-05-11 15:19:30", description: "<P><CENTER><B>Other Photo Settings</B></CENTER>  <TABLE BORDER=\'1\'>  <TR>  <TD>Align</TD><TD>To align a photo with regard to the screen and text you can use  <b>Edit Photo</b> in the Photo Gallery Script or if you are not using MySQL then  you can set the align command in a JPG comment of the photo or in an invisble DIV  in your HTML document. Example:  <P><b>&lt;align=\"center\"&gt;</b>  <P>Possible options are center, left or right.  <P><SUB>(See above examples in <b>Photo Descriptions</b> for more help  on JPG EXIF Comment or Invisible DIV)</SUB></TD>  </TR>  <TR>  <TD>Width</TD><TD>To set display width of a photo you can click on  <b>Edit Photo</b> in the Photo Gallery Script or if you are not using MySQL then  you can set the width command in a JPG comment of the photo or in an invisble DIV  in your HTML document. Example:  <P><b>&lt;width=\"640\"&gt;</b>  <P><SUB>(See above examples in <b>Photo Descriptions</b> for more help.)</SUB></TD>  </TR>  <TR>  <TD>Display</TD><TD>To set how photos with duplicate titles will display on  the same page you can click on  <b>Edit Photo</b> in the Photo Gallery Script or if you are not using MySQL then  you can set the display command in a JPG comment of the photo or in an invisble DIV  in your HTML document. Example:  <P><b>&lt;display=\"rows\"&gt;</b>  <P>Possible options are \"rows\" or \"thumbnails\".  <P><SUB>(See above examples in <b>Photo Descriptions</b> for more help.)</SUB></TD>  </TR>  </TABLE>  <P><CENTER><B>Delete Photos</B></CENTER>  <P><B>Photo Gallery Script</B> - To delete a photo using the photo gallery script  click on <b>Edit Photo</b> and then <b>Delete Photo</b>.  (Note: If the category  folder that the image is in was created through an FTP client then you may not  be able to delete the photo using the photo gallery script unless you set the  folder permissions to 777 through FTP first.)  <P><b>FTP</b> - To delete a photo using FTP you must have created the folder that  the photo is in with FTP.  If you used the Photo Gallery Script to create the folder  then you would have to change the permissions of the folder in the Photo Gallery  Script to 777 by clicking on a category then <b>Edit Category</b> -> Check  <b>Change folder permission to 777.</b> -> <b>OK</b>.)", display: "rows", align: "center", width: "240", filename: "photos3.jpg", title: "Edit Photos"};pictures[3] = {   photo: "images/Documentation/uploading.jpg", date: "February 27, 2007", sortdate: "2007-02-27 15:26:22", filedate: "2009-05-11 13:24:08", description: "<P><CENTER><B>Uploading Photos</B></CENTER>  <P><b>FTP</b> - To upload a photo using FTP you must create the category folder  using FTP or if you create the folder using the Photo Gallery Script  then you must change the folder permission to 777 by clicking on the category then  <b>Edit Category</b> -> Check <b>Change folder permission to 777.  </b> -> <b>OK</b>.  <P><b>Photo Gallery Script</b> - To upload a photo using the Photo Gallery Script  you must Log In with CTRL-ALT-L and then click on a category and then click on  <b>Upload</b> . The category folder must have been created with the Photo Gallery  Script.  If the category folder was created with FTP then you must use FTP to  change permissions (CHMOD) of the folder to 777 before you can upload to it using  the Photo Gallery Script.  <P><CENTER><B>Upload File Size Limits</B></CENTER>  <P>If you are uploading your images through <b>FTP</b> then you do not have to worry about file  size limits.  However, I recommend that you resize your photos to a good web display  size such as 1024x768 or 800x600 before uploading your images with FTP. This will make  them smaller and quicker to upload and view.  You can resize your photos with programs like  <b>IrfanView</b> or <b>Faststone Photo Resizer</b>.  <P>If you are using the <b>Photo Gallery Script</b> to upload your photos then you have to edit  a variable in <b>settings.php</b> called $sizelimit .  This variable is set in KB, so if  you want the upload size limit to be 2MB then you would calculate 2 * 1024. Example:<BR>  <DIV STYLE=\'background-color: #AAAAAA; padding:5px;\'>  <b>$sizelimit = 2048;</b><BR></DIV>  Also you might have a size limit set in your web servers <b>php.ini</b> file.  This is  usually placed in your root www folder. The line to edit looks like:  <DIV STYLE=\'background-color: #AAAAAA; padding:5px;\'>  <b>upload_max_filesize = 2M</b></DIV>", display: "rows", align: "center", width: "240", filename: "uploading.jpg", title: "Uploading Photos"};pictures[4] = {   photo: "images/Documentation/login.jpg", date: "May 5, 2007", sortdate: "2007-05-05 18:40:32", filedate: "2009-05-11 16:01:10", description: "<P><CENTER><B>Log In</B></CENTER><P>Logging in is only available with moreThanA Cool Javascript Photo Gallery  <b>Standard</b> Edition.  The Picasa Web Albums Edition does not need to login to  upload and change settings because you can do all those settings through  your Picasa Web Albums account.  <P>In order to Log In, go to either your INDEX.HTML file or ADMIN.PHP and  press <b>CTRL-ALT-L</b>.  This will pop up a Log In Window.  Type in the  admin name and password that were setup in <b>settings.php</b>.  <P>(If IE does not pop up the Log In Windows then try clicking on a blank  area in the document and then press <b>CTRL-ALT-L</b> again.)", display: "rows", align: "center", width: "240", filename: "login.jpg", title: "Log In"};pictures[5] = {   photo: "images/Documentation/photos.jpg", date: "November 25, 2006", sortdate: "2006-11-25 14:46:20", filedate: "2009-05-11 15:38:13", description: "<P><CENTER><B>Photo Titles</B></CENTER><P>There are four ways to create a photo title:  <OL>  <LI><b>MySQL</b> - If you have MySQL setup then you can create a title  by clicking on a category then <b>Edit Photo</b>. Fill in the title.  Click OK.</LI>  <LI><b>JPG IPTC Caption</b> -  If your photo is a JPG file then BEFORE  you upload it you could edit the JPG IPTC title or comment.  You have a few choices for editing IPTC jpg photo comments.  You can download programs that can edit the comments such as  <A HREF=\"http://www.irfanview.com/\" TARGET=\"_blank\">irfanview</A>.  In  Irfanview open the jpg photo and then click on <B>Image</B> ->  <B>Information</B> -> <B>IPTC Info</B>. Then write a title in the <b>Headline</b>  field.  Click on <B>Write</B>.  Then upload your photo to the gallery.<b>*</b></LI>  <LI><b>JPG EXIF Comment</b> -  If your photo is a JPG file then BEFORE  you upload it you could edit the JPG EXIF title or comment.  You have a few choices for editing exif jpg photo comments.  You can download programs that can edit the comments such as  <A HREF=\"http://www.irfanview.com/\" TARGET=\"_blank\">irfanview</A>.  In  Irfanview open the jpg photo and then click on <B>Image</B> ->  <B>Information</B> -> <B>Comment</B>. Then write a comment in the window.  If you put <b>&lt;title=\'a photo title\'&gt;</b> in the comment and click  on <B>Write</B> then \'a photo title\' will become the title for that photo.<b>*</b></LI>  <LI>You may also use <FONT COLOR=\"BLUE\">Windows XP</FONT> to edit a jpg EXIF title. In your images  folder <B>right click </B>on the jpg filename and click on <B>Properties</B>.  Click on the  <B>Summary</B> tab.  If it says <B>&lt;&lt; Simple</B> click on that so that it says  <B>Advanced &gt;&gt;</B>.  There you will find a title field.  Click in it and write your  title, then click <B>OK</B>.</LI><b>*</b></LI>  <P><SUB>*Note: Windows XP and Irfanview write jpg exif titles in different places on the jpg file. Here is the order that the Photo Gallery Script looks for a JPG description.  <OL>  <LI>The script looks for an IPTC Headline and makes that the image title.  If that is not found then...</LI>  <LI>The script looks for a Windows XP Title and makes that the image title.  If that is not found then...</LI>  </OL>  However, if you place <b>&lt;title=\'a photo title\'&gt;</b> in a photo comment then  that becomes the title.  </SUB>  <LI><b>Invisbile DIV</b> - In your HTML document  you could create a DIV with the same ID as a photo you upload to that  category and use <b>&lt;title=\'a title\'&gt;</b>. Example:<BR>  <DIV STYLE=\'background-color: #AAAAAA; padding:5px;\'>  <font color=\"#0000a0\"><b>&lt;DIV</b></font> <b>ID</b>=<b>\'photo.jpg\'  STYLE</b>=<b>\'display</b>:<b>none</b>;<b>\'</b>&gt;<BR>  <b>&lt;title=\"This is a photo title\"&gt;</b><BR>  <font color=\"#0000a0\"><b>&lt;/DIV&gt;</b></font><BR></DIV>  (Note: The DIV must be placed before  &lt;SCRIPT TYPE=\"text/javascript\" LANGUAGE=\"JavaScript\" SRC=\"mcjpg.php\"&gt;&lt;/SCRIPT&gt;  in your HTML file or the script will not recognize it.)</LI>  </OL>", display: "rows", align: "center", width: "240", filename: "photos.jpg", title: "Edit Photos"};pictures[6] = {   photo: "images/Documentation/photos2.jpg", date: "June 23, 2007", sortdate: "2007-06-23 15:06:49", filedate: "2009-05-11 15:34:42", description: "<P><CENTER><B>Photo Descriptions</B></CENTER>  <P>There are four ways to create a photo description:  <OL>  <LI><b>MySQL</b> - If you have MySQL setup then you can create a description  by clicking on a category then <b>Edit Photo</b>. Fill in the description.  Click OK.</LI>  <LI><b>JPG IPTC Caption</b> -  If your photo is a JPG file then BEFORE  you upload it you could edit the JPG IPTC title or comment.  You have a few choices for editing IPTC jpg photo comments.  You can download programs that can edit the comments such as  <A HREF=\"http://www.irfanview.com/\" TARGET=\"_blank\">irfanview</A>.  In  Irfanview open the jpg photo and then click on <B>Image</B> ->  <B>Information</B> -> <B>IPTC Info</B>. Then write a comment in the <b>Caption</b>  field.  Click on <B>Write</B>.  Then upload your photo to the gallery.<b>*</b></LI>  <LI><b>JPG EXIF Comment</b> -  If your photo is a JPG file then BEFORE  you upload it you could edit the JPG EXIF title or comment.  You have a few choices for editing exif jpg photo comments.  You can download programs that can edit the comments such as  <A HREF=\"http://www.irfanview.com/\" TARGET=\"_blank\">irfanview</A>.  In  Irfanview open the jpg photo and then click on <B>Image</B> ->  <B>Information</B> -> <B>Comment</B>. Then write a comment in the window  and click on <B>Write</B>.<b>*</b></LI>  <LI>You may also use <FONT COLOR=\"BLUE\">Windows XP</FONT> to edit a jpg comment.  In your images  folder <B>right click </B>on the jpg filename and click on <B>Properties</B>.  Click on the  <B>Summary</B> tab.  If it says <B>&lt;&lt; Simple</B> click on that so that it says  <B>Advanced &gt;&gt;</B>.  There you will find a comment field.  Click in it and write your  description, then click <B>OK</B>.<b>*</b></LI> 	<P><SUB>*Note: Windows XP and Irfanview write jpg exif comments in different places on the jpg 	file. Here is the order that the Photo Gallery Script looks for a JPG description.  <OL>  <LI>The script looks for an IPTC Caption and makes that the image description.  If that is not found then...</LI>  <LI>The script looks for a Windows XP Comment and makes that the image description.  If that is not found then...</LI>  <LI>The script looks for a standard EXIF Comment and makes that the image description.</LI>  </OL>  </SUB>  <LI><b>Invisbile DIV</b> - In your HTML document  you could create a DIV with the same ID as a photo you upload to that  category and use <b>&lt;title=\'a title\'&gt;</b>. Example:<BR>  <DIV STYLE=\'background-color: #AAAAAA; padding:5px;\'>  <font color=\"#0000a0\"><b>&lt;DIV</b></font> <b>ID</b>=<b>\'photo.jpg\'  STYLE</b>=<b>\'display</b>:<b>none</b>;<b>\'</b>&gt;<BR>  <b>&lt;title=\"This is a photo title\"&gt;</b><BR>  <font color=\"#0000a0\"><b>&lt;/DIV&gt;</b></font><BR></DIV>  (Note: The DIV must be placed before  &lt;SCRIPT TYPE=\"text/javascript\" LANGUAGE=\"JavaScript\" SRC=\"mcjpg.php\"&gt;&lt;/SCRIPT&gt;  in your HTML file or the script will not recognize it.)</LI>  </OL>", display: "rows", align: "center", width: "240", filename: "photos2.jpg", title: "Edit Photos"};for (var i in pictures)folders[2].pictures[i] = pictures[i];delete pictures;folders[3] = {   name: "Download", pictures: new Array(), title: "Download", description: "<CENTER><B>Download</B></CENTER>  <UL>  <LI>moreThanA Cool Javascript Photo Gallery Standard Edition:  <A HREF=\'download/mcjpg.zip\'>mcjpg.zip</A></LI>  <LI>moreThanA Cool Javascript Photo Gallery Picasa Web Albums Edition:  <A HREF=\'download/mcjpg.js\'>mcjpg.js</A></LI>  </UL><BR>  ", photo: "images/Download/download.jpg", sortdate: "2009-05-11 12:55:55", date: "May 11, 2009"}; var pictures=new Array();pictures[0] = {   photo: "images/Download/download.jpg", date: "May 5, 2007", sortdate: "2007-05-05 18:40:32", filedate: "2009-05-11 19:52:59", description: "<CENTER><B>Download</B></CENTER>  <UL>  <LI>moreThanA Cool Javascript Photo Gallery Standard Edition:  <A HREF=\'download/mcjpg.zip\'>mcjpg.zip</A></LI>  <LI>moreThanA Cool Javascript Photo Gallery Picasa Web Albums Edition:  <A HREF=\'download/mcjpg.js\'>mcjpg.js</A></LI>  </UL><BR>  ", display: "rows", align: "center", width: "240", filename: "download.jpg", title: "Download"};for (var i in pictures)folders[3].pictures[i] = pictures[i];delete pictures;folders[4] = {   name: "Features", pictures: new Array(), title: "Features", description: "<CENTER><B>Features</B></CENTER>  <UL>  <LI>Dynamically loads and resizes photos and thumbnails using <U>PHP</U>.</LI>  <LI><U>Picasa Web Albums</U> Edition of the Photo Gallery dynamically loads  albums and photos from your Picasa Web Albums account.</LI>  <LI>Switch photos with left and right arrow keys.</LI>  <LI>Display JPG <U>IPTC</U> Captions and Headlines or<BR>  JPG <U>EXIF</U> Comments and Titles.</LI>  <LI>Creates Categories from Folders.</LI>  <LI>Get JPG EXIF <U>Date</U> and <U>Time</U> of when photo was taken.</LI>  <LI>Edit Comments, Titles and Dates using <U>MySQL</U>.</LI>  <LI>Customize the look of the gallery with <U>CSS</U>.</LI>  <LI>Upload photos through Photo Gallery Script or <U>FTP</U>.</LI>  <LI>Make folders using Photo Gallery Script if desired.</LI>  <LI>Exclude folders(Categories) at any time.</LI>  <LI>Display photos with duplicate titles on same page in a row or  with clickable thumbnails.</LI>  <LI>Create photo comments and settings in invisble HTML DIVs.</LI>  </UL><BR>", photo: "images/Features/logo.jpg", sortdate: "2009-05-11 12:25:55", date: "May 11, 2009"}; var pictures=new Array();pictures[0] = {   photo: "images/Features/features.jpg", date: "June 23, 2008", sortdate: "2008-06-23 11:08:20", filedate: "2009-05-11 15:45:41", description: "<CENTER><B>Features</B></CENTER>  <UL>  <LI>Dynamically loads and resizes photos and thumbnails using <U>PHP</U>.</LI>  <LI><U>Picasa Web Albums</U> Edition of the Photo Gallery dynamically loads  albums and photos from your Picasa Web Albums account.</LI>  <LI>Switch photos with left and right arrow keys.</LI>  <LI>Display JPG <U>IPTC</U> Captions and Headlines or<BR>  JPG <U>EXIF</U> Comments and Titles.</LI>  <LI>Creates Categories from Folders.</LI>  <LI>Get JPG EXIF <U>Date</U> and <U>Time</U> of when photo was taken.</LI>  <LI>Edit Comments, Titles and Dates using <U>MySQL</U>.</LI>  <LI>Customize the look of the gallery with <U>CSS</U>.</LI>  <LI>Upload photos through Photo Gallery Script if desired or <U>FTP</U>.</LI>  <LI>Make folders using Photo Gallery Script if desired.</LI>  <LI>Exclude folders(Categories) at any time.</LI>  <LI>Display photos with duplicate titles on same page in a row or  with clickable thumbnails.</LI>  <LI>Create photo comments and settings in invisble HTML DIVs.</LI>  </UL>", display: "rows", align: "center", width: "240", filename: "features.jpg", title: "Features"};pictures[1] = {   photo: "images/Features/logo.jpg", date: "May 11, 2009", sortdate: "2009-05-11 13:56:57", filedate: "2009-05-11 13:56:57", description: "", display: "rows", align: "center", width: "426", filename: "logo.jpg", title: "logo.jpg"};for (var i in pictures)folders[4].pictures[i] = pictures[i];delete pictures;folders[5] = {   name: "Setup", pictures: new Array(), title: "Setup", description: "", photo: "images/Setup/standard.jpg", sortdate: "2009-05-11 13:01:21", date: "May 11, 2009"}; var pictures=new Array();pictures[0] = {   photo: "images/Setup/standard.jpg", date: "March 20, 2009", sortdate: "2009-03-20 12:07:30", filedate: "2009-05-11 19:13:09", description: "<CENTER><B>Setup</B></CENTER><P><B>moreThanA Cool Javascript Photo Gallery Standard Edition:</B>  <OL>  <LI>After you download the ZIP file, extract the files from it.  (mcjpg.php, admin.php, settings.php, index.html, mcjpg.css)</LI>  <LI>Edit settings.php in a standard text editor such as Notepad.exe and  change the following variables:<DIV STYLE=\'background-color: #AAAAAA; padding:5px;\'> <CODE> $<b>admin</b> = <font color=\"#0000ff\">&quot;admin&quot;</font>; // <b>This is the admin name for when you press CTRL</b>-<b>ALT</b>-<b>L in the Gallery</b><BR> $<b>password</b> = <font color=\"#0000ff\">&quot;password&quot;</font>; // <b>This is the admin password</b><BR> $<b>use_sql</b> = <font color=\"#ff0080\">1</font>; // <font color=\"#ff0080\">0</font> = <b>Do not use mysql database</b>; <font color=\"#ff0080\">1</font> = <b>use mysql database</b><BR> // <b>if</b> $<b>use_sql is set to</b> <font color=\"#ff0080\">0</font> <b>then</b> $<b>sql_username</b>, $<b>sql_password and</b> $<b>sql_database are ignored</b><BR> $<b>sql_username</b>=<font color=\"#0000ff\">&quot;name&quot;</font>; // <b>You must set this user up in your web server Cpanel</b><BR> $<b>sql_password</b>=<font color=\"#0000ff\">&quot;password&quot;</font>; // <b>You must set a password for the above user in Cpanel</b><BR> $<b>sql_database</b>=<font color=\"#0000ff\">&quot;gallery&quot;</font>; // <b>You must create a database and assign the user above to it</b><BR> $<b>folder</b> = <font color=\"#0000ff\">&quot;images/&quot;</font>; // <b>if your photo folders are in a different folder specify it here</b><BR> // <b>example</b>: <b>var folder</b> = <b>\'images</b>/<b>\'</b>;<BR> // <b>or same folder as this file then</b>: <b>var folder</b> = <b>\'</b>./<b>\'</b>;<BR> </CODE></DIV> 	<LI>You can create your own index.html file and paste the following code in it 	where you want the photo gallery to appear in the document:<BR>  <DIV STYLE=\'background-color: #AAAAAA; padding:5px;\'>  <font color=\"#0000a0\"><b>&lt;SCRIPT</b></font>  <b>TYPE</b>=<font color=\"#0000ff\">&quot;text/javascript&quot;</font>  <b>LANGUAGE</b>=<font color=\"#0000ff\">&quot;JavaScript&quot;</font>  <b>SRC</b>=<font color=\"#0000ff\">&quot;mcjpg.php&quot;</font>&gt;<font color=\"#0000a0\">  <b>&lt;/SCRIPT</b></font>&gt;</DIV></LI>  <LI>Upload all the files to your web server.</LI>  <LI>In the folder where you uploaded the photo gallery files create a folder  named <B>images</B> and set the permissions (CHMOD)  of this folder to 777.  (Note: In settings.php you can specify a different  folder instead of <B>images</B> in the $folder variable.)</LI>  <LI>You may create subfolders in the <b>images</b> folder using FTP.  These folders will become Categories  for the Photo Gallery.  Remember to CHMOD the permissions of these folders  you create to 777 if you want to be able to upload to them using the photo  gallery script, otherwise you may just upload using FTP.</LI>  <LI>You may also upload photos into the folders you create by using FTP.</LI>  <LI>Go to you web page and run either your index.html file or admin.php.  If you  wish to Login press CTRL-ALT-L.</LI>  </OL><BR>  ", display: "rows", align: "center", width: "240", filename: "standard.jpg", title: "moreThanA Cool Javascript Photo Gallery Standard Edition"};pictures[1] = {   photo: "images/Setup/pwa.jpg", date: "April 5, 2008", sortdate: "2008-04-05 12:49:17", filedate: "2009-05-11 13:07:49", description: "<CENTER><B>Setup</B></CENTER><P><B>moreThanA Cool Javascript Photo Gallery Picasa Web Albums Edition:</B>  <OL>  <LI>After you have downloaded the javascript (.js) file, open it in a standard  text editor such as Notepad.exe and change <B>var username = \"username\";</B>  Change \"username\" to your Picasa Web Albums username such as:<BR>  <B>var username = \"myusername\";</B></LI>  <LI>Edit other variables in the script to customize it.</LI>  <LI>Paste the following in your HTML document where you want the script to appear:<BR>  <DIV STYLE=\'background-color: #AAAAAA; padding:5px;\'>  <font color=\"#0000a0\"><b>&lt;SCRIPT</b></font>  <b>TYPE</b>=<font color=\"#0000ff\">&quot;text/javascript&quot;</font>  <b>LANGUAGE</b>=<font color=\"#0000ff\">&quot;JavaScript&quot;</font>  <b>SRC</b>=<font color=\"#0000ff\">&quot;mcjpg.js&quot;</font>&gt;<font color=\"#0000a0\">  <b>&lt;/SCRIPT</b></font>&gt;</DIV></LI>  </OL><BR>", display: "rows", align: "center", width: "320", filename: "pwa.jpg", title: "moreThanA Cool Javascript Photo Gallery Picasa Web Albums Edition"};for (var i in pictures)folders[5].pictures[i] = pictures[i];delete pictures;var folder = "images/";var use_sql = 1;var allow_del = 1;var allow_upload = 1;var allow_mkdir = 1;var album_desc = 0;var quality = 90;var get_exif = 1;var get_iptc = 1;var album_photo = 1;var thumb_desc = 0;var album_thumb = 160;var photo_thumb = 160;var photosize = 240;var cat_date = 1;var th_photo_date = 0;var photo_date = 0;var num_photos = 1;var side_menu = "right";var side_menu_px = 160;var side_opt = 1;var side_move = 1;var pixels = 200;var add_title = 1;var sort_cat_by = 1;var sort_cat_order = 0;var sort_by = 2;var sort_order = 0;var align = "center";var display = "rows";var exclude_list = new Array();exclude_list[0] = "none";exclude_list[1] = "nothing";exclude_list[2] = "nothing2";
//<script type="text/javascript" language="JavaScript">



/* DO NOT EDIT VARIABLES BELOW THIS LINE */
var pictures = new Array();
var duplicates = new Array();
var url = window.location.pathname;
cur_pic = get('item');
var cat_title; // becomes category title without stripping spaces
var by; // sort by which element id
var isCtrl = false;
var isAlt = false;
var win_div = document.createElement("div"); // window DIV for login and settings
var menu_top = 0; // for moving side menu

// this is a document.write function... but I want it to output a <BR> also
function $(data)
{
	document.write(data+"<BR>");	
} // end function $(data)


document.onkeyup=function(ev){
    var key = (!ev? event.keyCode:ev.which);
	if(key == 17) isCtrl=false;
	if(key == 18) isAlt=false;
}

 
document.onkeydown=function(ev){
	var key = (!ev? event.keyCode:ev.which);
	if(key == 17) isCtrl=true;
	if(key == 18) isAlt=true;

	if(key == 76 && isAlt == true && isCtrl == true) // L
	{
	   show_login();
       return false;
    }
	
	if (key == 39 && cat_title && win_div.style.display != "block") // right arrow
	changepic(1); // next
	if (key == 37 && cat_title && win_div.style.display != "block") // left arrow
	changepic(2); // prev
	//document.getElementById('photo').innerHTML += key;

} // end function check_key(ev)



function create_div(dwidth, dheight)
{
    if (document.documentElement.scrollTop) // Needed if you use doctype loose.htm
	current_top = document.documentElement.scrollTop;
	else 
	current_top = document.body.scrollTop;
	
    if (document.getElementById('win_div'))
    {
        win_div = document.getElementById('win_div');
    }
    else
    { 
	    win_div.id = "win_div";
	    win_div.style.position = 'absolute';
        document.body.appendChild(win_div);
        win_div.className = 'win_div';
	    //alert(win_div.currentStyle.borderStyle);
	    //alert(document.defaultView.getComputedStyle(win_div,'').getPropertyValue('padding-top'));
	    if ((win_div.currentStyle // if IE
            && win_div.currentStyle.backgroundColor == 'transparent')
            || (window.getComputedStyle // if Firefox
            && document.defaultView.getComputedStyle(win_div,'').getPropertyValue('background-color') == 'transparent'))
                win_div.style.backgroundColor = 'white';
         if ((win_div.currentStyle // if IE
            && win_div.currentStyle.borderStyle == 'none')
            || (window.getComputedStyle // if Firefox
            && document.defaultView.getComputedStyle(win_div,'').getPropertyValue('border-top-style') == 'none'))
                win_div.style.border = '3px double black'; 
	     if ((win_div.currentStyle // if IE
            && win_div.currentStyle.padding == '0px')
            || (window.getComputedStyle // if Firefox
            && document.defaultView.getComputedStyle(win_div,'').getPropertyValue('padding-top') == '0px'))
                win_div.style.padding = '5px'; 
    }
    
    win_div.style.width = dwidth;
	win_div.style.height = dheight;
    win_div.style.top = current_top + 10;
	win_div.style.left = 10;
	win_div.style.overflow = 'auto';
	win_div.style.display = "block";

} // end function create_div()


function show_login()
{
    var searchpath = window.location.search;
    var path = url + window.location.search;
    create_div(400, 200);
    win_div.innerHTML = "<CENTER><B>LOGIN</B></CENTER><BR>"+
        "<FORM NAME='fm' ACTION='admin.php"+searchpath+"'"+
        " METHOD='post'>"+
        "<INPUT TYPE='hidden' NAME='public_url' VALUE='"+path+"'>"+
        "User name: <INPUT TYPE='text' NAME='uid' SIZE='25' MAXLENGTH='50'><BR><BR>"+
        "Password: <INPUT TYPE='password' NAME='password' SIZE='25' MAXLENGTH='50'><BR><BR>"+
        "<A HREF='#'><INPUT TYPE='submit' CLASS='submit' NAME='Login' VALUE='Login'></A>"+
        "<A HREF='#'><INPUT TYPE='button' CLASS='cancel' VALUE='Cancel'"+
        " onClick='win_div.style.display = \"none\"'></A>"+
        "</FORM>";
    document.fm.uid.focus();

} // end function show_login()



// This function gets the data on the url search string
// and returns the one called 'name'
function get(name) 
{
	var string = window.location.search;
	
	//unescape converts the %20 (space) and %26 (&) etc.
	string = unescape(string);
	
	if (string) // if there is search paramaters
	{
    	// Drop the leading '?'
    	string = string.substr(1);
    	
    	// create an array containing each item
	var string_array = string.split('&'); 
    	
    	for (i = 0; i < string_array.length; i++)
    	{
		// split the name from the data
		result_array = string_array[i].split('=');
		// if it is the name we are looking for
		if (result_array[0] == name)
		return(result_array[1]); // then return the data
	}
	}
	// return false if the name is not found
	return(false);    	
} // end function get(name)


// this is the sortBy element ID function, but you
//have to make 'by' global and you have to give it
//the name of the element you want to sort by
function sortBy(a, b) {
    var x = a[by].toLowerCase();
    var y = b[by].toLowerCase();
	  
    if (x < y) return -1;
  	if (x > y) return 1;
  	if (x == y) return 0;
  	//document.write(x);
  	// reverse the -1 and the 1 to do reverse order list
}  // end function sortBy


function displayfolders()
{
    // This function was just used for my testing
    // It is not used anymore. The commented part
    // was a way of going through arrays in php
    // without knowing the associative? element names.
    /*for (var i in folders)
    {
        $(i);
        for (var j in folders[i])
        {    
            $('&nbsp;&nbsp;'+j+' : '+folders[i][j]);
            for (var k in folders[i][j])
            {
                $('&nbsp;&nbsp;&nbsp;&nbsp;'+k+' : '+folders[i][j][k]);
                for (var l in folders[i][j][k])
                    $('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'+l+' : '+folders[i][j][k][l]);
            }
        }   
    
    }*/
    
    for (i = 0; i < folders.length; i++)
    {
        $(folders[i].name+' '+folders[i].date);
        for (j = 0; j < folders[i].pictures.length; j++)
            $('&nbsp;&nbsp;&nbsp;&nbsp;'+j+'. '+
                folders[i].pictures[j].filename+
                ' sortdate: '+folders[i].pictures[j].sortdate+
                ' filedate: '+folders[i].pictures[j].filedate);
    }
}  // end function displayfolders()


// find_duplicates looks for duplicated titles in pictures
// and puts them in array duplicates and takes
// them out of pictures array.
function find_duplicates()
{
	
	for (i = 0; i < (pictures.length-1); i++) // search through every photo title 
	{
	for (b = i+1; b < pictures.length; b++)
	{

		//$(b+'. '+pictures[b].summary);
		if (pictures[i].title.toLowerCase() == pictures[b].title.toLowerCase())
		{
		//document.write(b+'. '+pictures[b].title);
		// add duplicate to duplicates array
		duplicates[duplicates.length] = {	photo: pictures[b].photo,
						id_base: pictures[b].id_base,
						title: pictures[b].title,
						description: pictures[b].description,
						summary: pictures[b].summary,
						date: pictures[b].date,
						sortdate: pictures[b].sortdate,
						filedate: pictures[b].filedate,
						filename: pictures[b].filename,
						display: pictures[b].display,
						align: pictures[b].align,
                                                width: pictures[b].width};
		pictures.splice(b, 1); // remove duplicate from pictures array
		b--;
		}  // end if
	} // end for
	} // end for
	
	
} // end function find_duplicates(i)


function setup_titles()
{
	// This function is really only needed for photos so that
	// we can add titles to photos
	for (ii = 0; ii < folders.length; ii++)
	{
        // Add the first photo in each category to the folder.photo
        if (folders[ii].photo == '' && typeof folders[ii].pictures[0] != 'undefined')
            folders[ii].photo = folders[ii].pictures[0].photo;
        // If there is an invisble DIV on the HTML doc with the same ID as the folder name then its HTML contents
	    // are added to the description. (Note the DIV must be before the script is called in the HTML doc)
    	if (document.getElementById(folders[ii].name))
            folders[ii].description += document.getElementById(folders[ii].name).innerHTML;         
    
    for (i = 0; i < folders[ii].pictures.length; i++) 
	{
        		
	// If there is an invisble DIV on the HTML doc with the same ID as the filename then its HTML contents
	// are added to the description. (Note the DIV must be before the script is called in the HTML doc)
	if (document.getElementById(folders[ii].pictures[i].filename))
	{
		folders[ii].pictures[i].description += document.getElementById(folders[ii].pictures[i].filename).innerHTML;
	
	}
	if (typeof(description) != 'string') // Sometimes there is no description
	description = '';	
	
	/*temp2 = description.replace(/<trans[^>]*>/gi, '');
	temp2 = temp2.replace(/<effect[^>]*>/gi, '');
	temp2 = temp2.replace(/<title[^>]*>/gi, '');
	temp2 = temp2.replace(/<time[^>]*>/gi, '');
	temp2 = temp2.replace(/<display[^>]*>/gi, '');
	temp2 = temp2.replace(/<align[^>]*>/gi, ''); */
	temp = folders[ii].pictures[i].title.replace(/ = /gi, '='); // Bug in my code?
	temp2 = folders[ii].pictures[i].description.replace(/ = /gi, '=');
	
	
    if (folders[ii].pictures[i].description)
	{
	functions = folders[ii].pictures[i].description.split('<'); // ex: <title='liverworst'>
	for (f = 0; f < functions.length; f++)
	{
		
		ftype = functions[f].split('='); // ex: title    /   'liverworst'>
		if (ftype[1])
		{
		ftype[1] = ftype[1].replace(/['')']/gi, ''); // ex: liverworst
		ftype[1] = ftype[1].replace(/>[\s\S]*/gi, '');
		
		ftype[0] = ftype[0].toLowerCase();

		if (ftype[0] == 'display')
		{	
		folders[ii].pictures[i].display = ftype[1].toLowerCase();

		}
		if (ftype[0] == 'align')
		{	
		folders[ii].pictures[i].align = ftype[1].toLowerCase();
		//alert(folders[ii].pictures[i].title);
		}
		if (ftype[0] == 'width')
		{	
		folders[ii].pictures[i].width = ftype[1];
		//alert(folders[ii].pictures[i].title);
		}
		if (ftype[0] == 'title')
		{	
		folders[ii].pictures[i].title = ftype[1];
		//alert(folders[ii].pictures[i].title);
		}
		if (ftype[0] == 'cattitle')
		{	
		folders[ii].title = ftype[1];
		//alert(folders[ii].pictures[i].title);
		}
		if (ftype[0] == 'catdescription')
		{	
		folders[ii].description = ftype[1];
		//alert(folders[ii].pictures[i].title);
		}
	    if (ftype[0] == 'catphoto')
		{	
		folders[ii].photo = pictures[i].photo;
		//alert(folders[ii].pictures[i].title);
		}
		} // end if (ftype[1])
	} // end for
	temp2 = folders[ii].pictures[i].description.replace(/<trans[^>]*>/gi, '');
	temp2 = temp2.replace(/<effect[^>]*>/gi, '');
	temp2 = temp2.replace(/<title[^>]*>/gi, '');
	temp2 = temp2.replace(/<time[^>]*>/gi, '');
	temp2 = temp2.replace(/<display[^>]*>/gi, "");
	temp2 = temp2.replace(/<align[^>]*>/gi, "");
        temp2 = temp2.replace(/<width[^>]*>/gi, "");  
        temp2 = temp2.replace(/<cattitle[^>]*>/gi, "");
	temp2 = temp2.replace(/<catphoto[^>]*>/gi, "");
        temp2 = temp2.replace(/<catdescription[^>]*>/gi, ""); 
	folders[ii].pictures[i].description = temp2;
	} // end if folders[ii].pictures[i].description
	} // end pictures.length for
    } // end folders.length for
} // end function setup_titles()


// This function replaces read_picasa_data()
function setup()
{

	cat = get('cat');
	
    setup_titles();	
    
	
  	
  	if (sort_cat_by == 1)    
  	{
        by = 'sortdate';
        folders.sort(sortBy);
    }  
    if (sort_cat_by == 2)    
  	{
        by = 'name';
        folders.sort(sortBy);
    } 
    if (sort_cat_by == 3)    
  	{
        by = 'title';
        folders.sort(sortBy);
    } 
    if (sort_cat_order == 1)
        folders.reverse();
        
    // loop through current category if there is one and put it
    // in pictures array
    if (cat && typeof folders[cat] != 'undefined')    
        for (ii = 0; ii < folders[cat].pictures.length; ii++)
	        pictures[ii] = folders[cat].pictures[ii];
	        
    if (sort_by == 1)
  	{
        by = 'sortdate';
        //for (ii = 0; ii < folders.length; ii++)
        pictures.sort(sortBy);
    }
    if (sort_by == 2)
  	{
        by = 'filename';
        //for (ii = 0; ii < folders.length; ii++)
        pictures.sort(sortBy);
    }
    if (sort_by == 3)
  	{
        by = 'title';
        //for (ii = 0; ii < folders.length; ii++)
        pictures.sort(sortBy);
    }
        if (sort_by == 4)
  	{
        by = 'filedate';
        //for (ii = 0; ii < folders.length; ii++)
        pictures.sort(sortBy);
    }
    
        
    if (sort_order == 1)
        pictures.reverse();
        
    //displayfolders();
    
    if (get('cat'))
        find_duplicates(); // remove all duplicate titles and put in duplicates array
	  
	   	
} // end function read_picasa_data(j)



function menu(where)
{
	cat = get('cat');  // cateogry title with stripped spaces and chars
	
	document.write("<DIV STYLE='position:relative; float: left; width: "+side_menu_px+"px;'>");
	
	document.write("<DIV ID='side_menu' STYLE='position:absolute;'>");
	document.write("<TABLE CLASS='side_menu'>");
	
	if (side_opt == 1)	
	{
	document.write("<TR><TH>Categories</TH></TR>");
	for (i = 0; i < folders.length; i++)
	{
            
            if (cat && folders[cat].title == folders[i].title) //if listing the folder we are viewing
                document.write("<TR><TD>&#x25BA; "+folders[i].title+"</TD></TR>");
            else
                document.write("<TR><TD><A HREF='"+url+"?cat="+i+"'>"+
                    folders[i].title+"</A></TD></TR>");     
        }
	    
    }
	
	if (where == 'item' || where == 'photo')
        document.write("<TR><TH>Items</TH></TR>");
	
	if (where == 'item' || where == 'photo')
    for (i = 0; i < pictures.length; i++)
	{
	if (i == cur_pic && where == 'photo') // if listing the photo we are viewing
		document.write("<TR><TD>&#x25BA; "+pictures[i].title+"</TD></TR>");
	else
	       document.write("<TR><TD><A HREF='"+url+"?cat="+cat+"&item="+i+"'>"+
		     pictures[i].title+"</A></TD></TR>");			
	
	}
	
	document.write("</TABLE>");
	document.write("</DIV></DIV>");
	    
	if (side_move)
        t = setInterval('move_menu();', 1000); 
	
} // end function menu(where)


function move_menu()
{
    if (document.documentElement.scrollTop) // Needed if you use doctype loose.htm
	   current_top = document.documentElement.scrollTop;
	else 
	   current_top = document.body.scrollTop;
    
    menu = document.getElementById('side_menu');
    
    //document.getElementById('top').style.height = 'auto';
    menu_top = parseFloat(menu.offsetParent.offsetTop);
    menu_height = parseFloat(menu.offsetHeight);
    // Firefox always sets photo_height to 0
    photo_height = parseFloat(document.getElementById('top').offsetHeight);
    
    if (photo_height == 0)
        photo_height = 700; // For Firefox
    else if (photo_height < menu_height) 
        photo_height = menu_height; 
        
    //document.getElementById('side_menu').innerHTML += "Top: "+photo_height;
    if (current_top > menu_top && current_top <= photo_height - menu_height)
        menu.style.top = current_top - menu_top;
    else if (current_top <= menu_top)
        menu.style.top = 0;
    else if (current_top > photo_height - menu_height)
        menu.style.top = photo_height - menu_height;   

    
          
} // end function move_menu()



function formula(letter, n)
{
	// if I put all these characters together it is a total of 89
	var letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" +  // 24
		"abcdefghijklmnopqrstuvwxyz" +  // 24 + 24 = 48
		"1234567890" +  //  10 + 48 = 58
		"`-=\[];',./" +  // 11 + 58 = 69
		"~!@#$%^&*()";   // 11 + 69 = 80
	var inc = 10;
	var pos;
	
	
		// ** SP ** Should be > 32
		if (letter >= 32 && letter < 127)
			inc = 10;
		else return 0;
		
	if ((pos = letters.indexOf(String.fromCharCode(n))) == -1)
	if ((pos = letters2.indexOf(String.fromCharCode(n))) == -1)
	if ((pos = numbers.indexOf(String.fromCharCode(n))) == -1)
	if ((pos = symbols.indexOf(String.fromCharCode(n))) == -1)
	if ((pos = symbols2.indexOf(String.fromCharCode(n))) == -1)
		pos = 4;  // if not found in any of the above characters
	
		if (letter - pos - inc <= 31) // ** SP ** should be 32
			return pos + inc + (-95); // ** SP ** should be 94
		else 
			return pos + inc;
	
	
} // end formula(n)


function jb()
{
	textbox = "z!`'2&%|gGTUOyomWXVmTDACQEFYEDNMQTTFQSnBONmGBKLFQYg|0PVESDD`!Yz^MPQE5GAO _$NOM^*BUATBRJOT`/HPSO`&AMKESX{o }|m$*5}";
	newtextbox = new String;
	var key = "123";
	var n = 0; // position in key
	var letter;
			
	newtextbox = ""; // blank newtextbox string
	
    for (i = 0; i < textbox.length; i++)
	{
		letter = textbox.charCodeAt(i);
		
		c = textbox.charCodeAt(i) - formula(letter, key.charCodeAt(n));
	
		newtextbox += String.fromCharCode(c);			

		if (letter >= 32 && letter < 127)
			n++;
		if (n >= key.length)
			n = 0;	

		if (n >= key.length)
			n = 0;
	} // end for
	
    document.write('<DIV STYLE="clear: both; background-color: #DDDDFF">');
    document.write(newtextbox);
    document.write('</DIV>');
	
} // end function jb


function list_albums()
{	 	
	var morepixels = 0;
	if (side_menu != 'none')
	morepixels = side_menu_px;
	morepixels += pixels;
	
	columns = Math.floor((screen.width-morepixels) / album_thumb); // columns for table
  
	col = 1; // current column

	setup();

	document.write("<DIV ID='top' STYLE='width: "+Math.floor(screen.width-pixels)+"px;'>");
	
	if (side_menu == 'left')
	menu('cat');	
	
	document.write("<DIV STYLE='float: left; width: "+Math.floor(screen.width-morepixels)+"px;'>");
	
	document.write("<TABLE CLASS='cat_table'><TR>");
	
	document.write("<TH COLSPAN='"+columns+"'>Categories</TH></TR><TR>");
	
	for (i = 0; i < folders.length; i++)
	{

	document.write("<TD>");
	if (album_photo == 1)
	{
	document.write("<A HREF='"+url+"?cat="+i+"'>");
	document.write("<img src='/gallery/mcjpg.php?image="+folders[i].photo+"&width="+album_thumb+"'><BR></A>");
	}
	document.write("<A HREF='"+url+"?cat="+i+"'>");
	document.write("<B>"+folders[i].title+"</B><BR></A>");
	if (album_desc == 1)
	   document.write(folders[i].description+"<BR>");
	if (num_photos == 1)
	   document.write("("+folders[i].pictures.length+" photos)<BR>");
	if (cat_date == 1)
	   document.write(folders[i].date+"<BR>");
	document.write("<BR>");
	document.write("</TD>");
	col++;
	if (col == columns)
	{
	document.write("</TR><TR>");
	col = 1;
	}


  	}  // end for loop

	document.write("</TR></TABLE>");  // close gallery table
    document.write("</DIV>");
	
	if (side_menu == 'right')
	menu('cat');
	
	document.write("</DIV>");jb();
	
}  // end function list_albums()


function list_photos()
{
	var desc;
    var morepixels = 0;
	
    if (side_menu != 'none')
	morepixels = side_menu_px;
	morepixels += pixels;
	
	
	columns = Math.floor((screen.width-morepixels) / photo_thumb); // columns for table

	col = 1; // current column

	setup();
	
	document.write("<DIV ID='top' STYLE='width: "+Math.floor(screen.width-pixels)+"px;'>");
	
	if (side_menu == 'left')
	menu('item');
	
	document.write("<DIV STYLE='float: left; width: "+Math.floor(screen.width-morepixels)+"px;'>");	
	
    var cat = get('cat');
    	
	if (typeof folders[cat] == 'undefined')
	   document.write('<P><A HREF="'+url+'">Click here to return to Categories</A>');   
        //window.location = url;
    
    desc = folders[cat].description; // Album Description
	if (typeof(desc) != 'string') // Sometimes there is no description
	    desc = ''; 
    
    
	document.write("<DIV CLASS='cat_header'>");
	document.write("<B><FONT SIZE='+1'><A HREF='"+url+"'>Category:</A> "+folders[cat].title+"</B></FONT><BR>");
	document.write(desc+"<BR><BR>"); // display album description
	document.write("</DIV>");
	
	
    document.write("<TABLE CLASS='item_table'><TR>");
	
	for (i = 0; i < pictures.length; i++)
	{
	document.write("<TD>");
	document.write("<A HREF='"+url+"?cat="+cat+
	"&item="+i+"'>");
	document.write("<img src='/gallery/mcjpg.php?image="+pictures[i].photo+"&width="+photo_thumb+"'><BR>");
	if (pictures[i].title)
	document.write("<B>"+pictures[i].title+"</B><BR>");
	document.write("</A>");
	if (thumb_desc == 1 && (pictures[i].title != pictures[i].description))
	document.write(pictures[i].description+"<BR>");
	if (th_photo_date == 1)
	document.write(pictures[i].date+"<BR>");
	document.write("<BR>");
	document.write("</TD>");
	col++;
	if (col == columns)
	{
	document.write("</TR><TR>");
	col = 1;
	}
	
  	}  // end for loop
  
    document.write("</TR></TABLE>");  // close gallery table
    
    document.write("</DIV>");
	
	if (side_menu == 'right')
	menu('item');
	
	document.write("</DIV>");jb();	
	
	if (add_title == 1)
	document.title += " :: "+folders[cat].title;
	
} // end function list_photos()


function change_duplicate(item, which)
{
	// This function puts a thumbnail image in the large photo's place
	// after the thumbnail is clicked on. Also adds description
	var temp;
	//set current top position of browser screen
	/*if (document.documentElement.scrollTop) // Needed if you use doctype loose.htm
	document.documentElement.scrollTop += -100;
	else 
	document.body.scrollTop += -100; */
	document.getElementById('photo').innerHTML = '';
                               
	if (which == 0) // Orginal photo
	{
	if (pictures[item].align == 'center')
		temp = "<center><img width='"+pictures[item].width+
	                        "' src='/gallery/mcjpg.php?image="+pictures[item].photo+
	                        "&width="+pictures[item].width+"'></A><BR></center>";
	else if (pictures[item].align == 'left' || pictures[item].align == 'right')
		temp = "<img width='"+pictures[item].width+
	                        "' align='"+pictures[item].align+
	                        "' src='/gallery/mcjpg.php?image="+pictures[item].photo+
	                        "&width="+pictures[item].width+"'></A>";
	else
		temp = "<img width='"+pictures[item].width+
	                        "' src='/gallery/mcjpg.php?image="+pictures[item].photo+
	                        "&width="+pictures[item].width+"'></A><BR>";
	
	document.getElementById('photo').innerHTML += "<A HREF='"+pictures[item].photo+"'>"+
			temp+
			pictures[item].description+"<BR>";
	if (photo_date == 1)
		document.getElementById('photo').innerHTML += pictures[item].date+"<BR>";
	if (pictures[item].align == 'left' || pictures[item].align == 'right')
		document.getElementById('photo').innerHTML += "<BR clear='both'>";
	document.getElementById('photo').innerHTML += "<BR>";

	}
	else if (which == 1) // duplicate photo
	{
	if (duplicates[item].align == 'center')
		temp = "<center><img width='"+duplicates[item].width+
	                        "' src='/gallery/mcjpg.php?image="+duplicates[item].photo+
	                        "&width="+duplicates[item].width+"'></A><BR></center>";
	else if (duplicates[item].align == 'left' || duplicates[item].align == 'right')
		temp = "<img width='"+duplicates[item].width+
	                        "' align='"+duplicates[item].align+
	                        "' src='/gallery/mcjpg.php?image="+duplicates[item].photo+
	                        "&width="+duplicates[item].width+"'></A>";
	else
		temp = "<img width='"+duplicates[item].width+
	                        "' src='/gallery/mcjpg.php?image="+duplicates[item].photo+
	                        "&width="+duplicates[item].width+"'></A><BR>";
		
	document.getElementById('photo').innerHTML += "<A HREF='"+duplicates[item].photo+"'>"+
			temp+
			duplicates[item].description+"<BR>";
	if (photo_date == 1)
		document.getElementById('photo').innerHTML += duplicates[item].date+"<BR>";
		if (duplicates[item].align == 'left' || duplicates[item].align == 'right')
		document.getElementById('photo').innerHTML += "<BR clear='both'>";
		document.getElementById('photo').innerHTML += "<BR>";
	}
	

}  // change_duplicate(item)


function display_duplicates(item)
{
	// This function is used to display photos with duplicate titles
	// on the single photo display.  This way you can have numerous
	// photos in a row under one title.
	var temp;
	var count = 1;
	var thumbs = document.getElementById('thumbs').innerHTML;
	var pwidth = parseFloat(document.getElementById('photo_table').style.width);
	columns = Math.floor(pwidth / photo_thumb); // columns for table
	col = 1; // current column
	
	for (i = 0; i < duplicates.length; i++)
	{
	if (pictures[item].title.toLowerCase() == duplicates[i].title.toLowerCase())
	{
		count++;
		
		if (pictures[item].display == 'thumbnails') 
		{
		if (count == 2)
		{
			thumbs += "<TABLE><TR>";
			// display current photo as thumbnail also	
			thumbs += "<TD>";
			thumbs += "<A HREF='#'>"+
				"<img src='/gallery/mcjpg.php?image="+pictures[item].photo+"&width="+photo_thumb+"'"+
				"onClick='change_duplicate("+item+", 0); return false;'>"+
				"</A></TD>";
			col++;
		}
		col++;
		thumbs += "<TD>";
        thumbs += "<A HREF='#'>"+
			"<img src='/gallery/mcjpg.php?image="+duplicates[i].photo+"&width="+photo_thumb+"'"+
			"onClick='change_duplicate("+i+", 1); return false;'>"+
			"</A></TD>";
		if (col == columns)
		{
			thumbs += ("</TR><TR>");
			col = 1;
		}
		}
		else // display photos in a row (vertical)
		{
                            
            if (duplicates[i].align == 'center')
		temp = "<center><img width='"+duplicates[i].width+
	                        "' src='/gallery/mcjpg.php?image="+duplicates[i].photo+
	                        "&width="+duplicates[i].width+"'></A><BR></center>";
		else if (duplicates[i].align == 'left' || duplicates[i].align == 'right')
		temp = "<img width='"+duplicates[i].width+
	                        "' align='"+duplicates[i].align+
	                        "' src='/gallery/mcjpg.php?image="+duplicates[i].photo+
	                        "&width="+duplicates[i].width+"'></A>";
		else
		temp = "<img width='"+duplicates[i].width+
	                        "' src='/gallery/mcjpg.php?image="+duplicates[i].photo+
	                        "&width="+duplicates[i].width+"'></A><BR>";
		
            document.getElementById('photo').innerHTML += "<A HREF='"+duplicates[i].photo+"'>"+
			temp+
			duplicates[i].description+"<BR>";
		if (photo_date == 1)
		document.getElementById('photo').innerHTML += duplicates[i].date+"<BR>";
		if (duplicates[i].align == 'left' || duplicates[i].align == 'right')
		document.getElementById('photo').innerHTML += "<BR clear='both'>";
		document.getElementById('photo').innerHTML += "<BR>";
            
		}
	} // end if
	} // end for
		
	// close thumbs table
	if (pictures[item].display == 'thumbnails' && count >= 2)
	thumbs += "</TR></TABLE>";
	
	if (count > 1)
	document.getElementById('howmany').innerHTML = " ("+count+" photos)";
	
	document.getElementById('thumbs').innerHTML = thumbs;
	
} // end function display_duplicates(item)


function changepic(direction)
{
	
	if (direction == 1) // next
	{
	cur_pic++;
	if (cur_pic >= pictures.length)
		cur_pic = 0;
	}
	else // direction == 2 prev
	{
	cur_pic--;
	if (cur_pic < 0)
		cur_pic = pictures.length - 1;	
	}	
	
	window.location = url+"?cat="+cat+"&item="+cur_pic;

} // end function changepic(direction)


function display_photo()
{
	var morepixels = 0;
	if (side_menu != 'none')
	morepixels = side_menu_px;
	morepixels += pixels;
	
	setup();
	
	var cat = get('cat');
	var item = get('item');
	
	if (typeof folders[cat] == 'undefined')
	   document.write('<P><A HREF="'+url+'">Click here to return to Categories</A>');   
        //window.location = url;
	
	//document.write("<DIV STYLE='width: "+(photosize+side_menu_px+25)+"px;'>");
	document.write("<DIV ID='top' STYLE='width: "+Math.floor(screen.width-pixels)+"px;'>");
	
	if (side_menu == 'left')
	menu('photo');
	
	//document.write("<DIV CLASS='photo_table' STYLE='float: left; width: "+photosize+"px;'>");	
	document.write("<DIV STYLE='float: left; width: "+Math.floor(screen.width-morepixels)+"px;'>");
	    
    document.write("<DIV CLASS='item_header'>");
    document.write("<B><FONT SIZE='+1'><A HREF='"+url+"'>Category:</A> "+folders[cat].title+"</B></FONT><BR>");
	document.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
	document.write("&#x2514;&#x2500;&#x25BA;"); 
	document.write("<B><FONT SIZE='+1'><A HREF='"+url+"?cat="+cat+"'>Item:</A> "+item+". "+pictures[item].title);
	document.write(" <SPAN ID='howmany'> </SPAN></B></FONT><BR><BR>");
	document.write("</DIV>"); 
    	
    	
	document.write('<TABLE ID="photo_table" CLASS="photo_table" WIDTH="100%" BORDER="0">');
	document.write('<TR><TD ALIGN="left">'+
	'<A HREF="#"><INPUT TYPE="button" CLASS="prev_btn" onClick="changepic(0); return false;" VALUE="Prev"></A>'+
	'</TD><TD ALIGN="right">'+
	'<A HREF="#"><INPUT ID="next" TYPE="button" CLASS="next_btn" onClick="changepic(1); return false;" VALUE="Next"></A>'+
	'</TD></TR></TABLE>'); 
	document.getElementById('next').focus(); // focus on next button so we can use enter key 
	
	document.write("<DIV CLASS='photo' ID='photo'>");

    document.write("<A HREF='"+pictures[item].photo+"'>");
    
    if (pictures[item].align == 'center')
	document.write("<center><img width='"+pictures[item].width+
                        "' src='/gallery/mcjpg.php?image="+pictures[item].photo+
                        "&width="+pictures[item].width+"'></A><BR></center>");
	else if (pictures[item].align == 'left' || pictures[item].align == 'right')
	document.write("<img width='"+pictures[item].width+
                        "' align='"+pictures[item].align+
                        "' src='/gallery/mcjpg.php?image="+pictures[item].photo+
                        "&width="+pictures[item].width+"'></A>");
	else
	document.write("<img width='"+pictures[item].width+
                        "' src='/gallery/mcjpg.php?image="+pictures[item].photo+
                        "&width="+pictures[item].width+"'></A><BR>");

	document.write(pictures[item].description+"<BR>");
	if (photo_date == 1)
	   document.write(pictures[item].date+"<BR>");
	if (pictures[item].align == 'left' || pictures[item].align == 'right')
	   document.write("<BR clear='both'>");
	document.write("<BR>");
	   
	document.write("</DIV>"); // close photo  DIV

	document.write("<DIV ID='thumbs' CLASS='thumbnails' STYLE='float: none;'> </DIV>");
	
	display_duplicates(item);	

    
	document.write("</DIV>"); // close photo_table DIV
	
	if (side_menu == 'right')
	menu('photo');

	document.write("</DIV>");jb();
	
	if (add_title == 1)
	document.title += " :: "+folders[cat].title+" :: "+pictures[item].title;
	
} // end function display_photo()

//document.write(escape(get('cat'))+"<BR>");
//document.write(get('item')+"<BR>");

cat_title = get('cat');

if (!get('cat') && !get('item'))
    list_albums();
else if (get('cat') && !get('item'))
    list_photos();
else if (get('cat') && get('item'))
    display_photo();

/*by = 'date';
folders.sort(sortBy);


by = 'sortdate';
for (ii = 0; ii < folders.length; ii++)
    folders[ii].pictures.sort(sortBy);
    
displayfolders();*/

//</script>
 
