﻿/* This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Created by: Troy Wolf |  */

var lastID = 0;
var num = lastID;
var marqueespeed = 2;  //Specify marquee scroll speed (larger is faster 1-10)
var direction; //specify 1 to move up, 2 to move down and 0 for no direction
var maxslides = 11; //specify the max # of thumbnails and images for display

var pauseit = 1;  //Pause marquee onMousever (0=no. 1=yes)?

////NO NEED TO EDIT BELOW THIS LINE////////////

//var copyspeed = marqueespeed

var copyspeed
var pausespeed = (pauseit == 0) ? copyspeed : 0
var actualheight = ''



function SelectImg(id) {
    if (lastID > 0) {
        document.getElementById(lastID).className = "thumbNormal";
    }
    document.getElementById(id).className = "thumbSelected";
    //document.getElementById('ipHolder').src = document.getElementById(id).src;
    //tc[i].split("|")[0];
    document.getElementById('ipHolder').src = document.getElementById(id).src.split("small")[0] + "Large.jpg";
    document.getElementById('burns').innerHTML = 'Style ' + document.getElementById(id).alt.toString();
    lastID = id;
    num = lastID;

    document.getElementById("prevLink").style.display = 'block';
    if (num == 1) { document.getElementById("prevLink").style.display = 'none'; }

    
    document.getElementById("nextLink").style.display = 'block';
    if (num == maxslides) { document.getElementById("nextLink").style.display = 'none'; }

  }

function LoadTrigger() {
    SelectImg(1);
    copyspeed = 0;
    direction = 1;
}


// Multiple onload function created by: Simon Willison
// http://simonwillison.net/2004/May/26/addLoadEvent/
function addLoadEvent(func) {
    var oldonload = window.onload;
    if (typeof window.onload != 'function') {
        window.onload = func;
    } else {
        window.onload = function() {
            if (oldonload) {
                oldonload();
            }
            func();
        }
    }
}

addLoadEvent(function() {
    LoadTrigger();
});

/* This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Created by: Jay M. Rumsey, OD | http://www.nova.edu/~rumsey */

//var num = 0;


//imgArray = [
 // ['503_0390Large.jpg', 'information', 'The beautiful mountains'],
 // ['503_0394Large.jpg', 'interference', 'The crystal clear lake'],
  //['503_0406Large.jpg', 'message', 'The lonesome, barren tree']
//]

imgArray = [
                ['503_0390', '503_0390Large.jpg', 'information', 'The beautiful mountains'],
                ['503_0394', '503_0394Large.jpg', 'interference', 'The crystal clear lake'],
                ['503_0406', '503_0406Large.jpg', 'message', 'The lonesome, barren tree']
            ]


function slideshow(slide_num) {
    //document.getElementById('mypic').src = imgArray[slide_num][0];
    //document.getElementById('mypic').alt = imgArray[slide_num][1];
    //document.getElementById('burns').innerHTML = imgArray[slide_num][2];
    //document.getElementById(0).src = imgArray[slide_num][0];
    //document.getElementById(0).alt = imgArray[slide_num][1];
    //document.getElementById(0).innerHTML = imgArray[slide_num][2];
    SelectImg(slide_num);
    
}

function slideshowUp() {
    if (num < maxslides) {
           num++;
    } /*else {
    document.getElementById("nextLink").style.display = 'none';
    //num = num % imgArray.length;*/
    slideshow(num);
}

function slideshowBack() {
    if (num > 1) {
        num--;
    } /*else {
    document.getElementById("prevLink").style.display = 'none';
    }
    
    //if (num < 0) {num = imgArray.length - 1; }
    //num = num % imgArray.length;*/
    slideshow(num);
}



/* This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com */
/* -----------------------------------------------
Streaming banners - v.1.1
(c) 2006 www.haan.net
contact: jeroen@haan.net
You may use this script but please leave the credits on top intact.
Please inform us of any improvements made.
When useful we will add your credits.
------------------------------------------------ */

/* usage
<body>
<div id="slideCont" style="position:relative;z-index:1;width:140px;left:0px;overflow:hidden;">
<div id="slideA" style="position:absolute;z-index:1;top:0px;left:0px;width:140px;overflow:hidden;">
your banners (images inside anchor tags)
<div id="slideB" style="position:relative;z-index:1;top:0px;left:0px;width:140px;overflow:hidden;">
your banners (images inside anchor tags)
</div>
</div>
</div>
</body>

In order the have the script working in FireFox as well you need a proper "DTD" to prevent the browser's "quirksmode".

Please see http://www.quirksmode.nl/ for more details.

Or in case you experience problems, copy and paste next line on top of your webpage:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

*/

function clip() {
    // width of the banner container
    var contWidth = 130;
    // height of the banner container
    var contHeight = 419;

    var id1 = document.getElementById('slideA');
    //var id2 = document.getElementById('slideB');
    var height = id1.offsetHeight;

    //-- scroll banner down
    //id1.style.top = parseInt(id1.style.top) - 1 + 'px';
    //id1.style.top = parseInt(id1.style.top) - copyspeed + 'px';

    
      
      
    if (parseFloat(id1.style.top) == 0 && (copyspeed > 0)) {
    //if (parseFloat(id1.style.top) == 0 && (direction = 1)) {
         //--halt the banner when moving the clip up
        copyspeed = pausespeed;
        direction = 1;
    }

    //if (parseFloat(id1.style.top) == +(height / 2)) {
    //if (parseFloat(id1.style.top) == -(height+(contHeight/2))) {
    if ((parseFloat(id1.style.top) <= -(height-contHeight)) && (copyspeed < 0)) {
    //if (parseFloat(id1.style.top) == -(250) && (direction=-1)) {
        //--reset top of the banner if condition above is true when scrolling down
        //id1.style.top = '0px';
        //--halt the banner when moving the clip down
        copyspeed = pausespeed;
        direction = -1;
    }

    //-- move banner up if copy speed is -ve(scroll down), move down if +ve(scroll up)
    id1.style.top = parseInt(id1.style.top) + copyspeed + 'px';

    document.getElementById('slideCont').style.height = contHeight + "px";
    document.getElementById('slideCont').style.clip = 'rect(auto,' + contWidth + 'px,' + contHeight + 'px,auto)';
    //id2.style.display = '';
    //if (parseFloat(id1.style.top) == -(height / 2)) {
    //--reset  top of the banner if condition above is true when scrolling up
    //id1.style.top = '0px';

    //document.getElementById('burns').innerHTML = -(height -(contHeight*2));
    //document.getElementById('burns').innerHTML = parseFloat(id1.style.top);
    
    setTimeout(clip, 50)
}


function moveclip() {
    // width of the banner container
    var contWidth = 150;
    // height of the banner container
    var contHeight = 450;

    var id1 = document.getElementById('slideA');
    //var id2 = document.getElementById('slideB');
    var height = id1.offsetHeight;

    id1.style.top = parseInt(id1.style.top) - 1 + 'px';

    document.getElementById('slideCont').style.height = contHeight + "px";
    document.getElementById('slideCont').style.clip = 'rect(auto,' + contWidth + 'px,' + contHeight + 'px,auto)';
   // id2.style.display = '';
    if (parseFloat(id1.style.top) == -(height / 2)) {
        id1.style.top = '0px';
    }
    setTimeout(clip, 50)
}

function stopclip() {
    // width of the banner container
    var contWidth = 150;
    // height of the banner container
    var contHeight = 450;

    var id1 = document.getElementById('slideA');
   // var id2 = document.getElementById('slideB');
    var height = id1.offsetHeight;

    id1.style.top = parseInt(id1.style.top) - 1 + 'px';

    document.getElementById('slideCont').style.height = contHeight + "px";
    document.getElementById('slideCont').style.clip = 'rect(auto,' + contWidth + 'px,' + contHeight + 'px,auto)';
    //id2.style.display = '';
    if (parseFloat(id1.style.top) == -(height / 2)) {
        id1.style.top = '0px';
    }
    //setTimeout(clip, 50)
}


// Multiple onload function created by: Simon Willison
// http://simon.incutio.com/archive/2004/05/26/addLoadEvent
/*function addLoadEvent(func) {
    var oldonload = window.onload;
    if (typeof window.onload != 'function') {
        window.onload = func;
    } else {
        window.onload = function() {
            if (oldonload) {
                oldonload();
            }
            func();
        }
    }
}*/

addLoadEvent(function() {
    clip();
});


function writetable() {
    var tc = new Array();
    //var models=new Array();
    var numcols = 1;  //specifies the number of columns in the table

    var contentcount = 0; //counts the cells in a table row for Power Tools Content
    var modelcount = 0;  //counts the cells in a table row for Models
    var recordtext;
    var thelink;
    var thetext;
    var displaytext;
    var fileType;
    var whichDirectory;
    var picUrl;
    var a;
    var a1;
    var a2;
    var b;
    var c;
    var d;

    ////////////////////////////////////////////////////////////////////////////////////////
    // The Javascript is to enable easy addition and deletion of content as well as table //
    // configuration. By loading all the content into the arrays, you can use the         //
    // array.sort() method to arrange them alphabetically. The important thing to         //
    // remember is that the .gifs and documents being linked to must have the same name   //
    // as the text used in the link, with the file names using underscores _ in place of  //
    // spaces. All the content must be in the same folder as well.                        //
    ////////////////////////////////////////////////////////////////////////////////////////

   /* tc[0] = "507_0738|8175";
    tc[1] = "509_0969|8187";
    tc[2] = "509_0908|8187";
    tc[3] = "509_0933|8188";
    tc[4] = "509_0981|8190";
    tc[5] = "507_0755|8191";
    tc[6] = "507_0775|8192";
    tc[7] = "503_0390|8194";
    tc[8] = "503_0394|8195";
    tc[9] = "504_0406|8275";
    tc[10] = "508_0852|8277";
    tc[11] = "508_0882|8278";
    tc[12] = "510_1003|8279";
    tc[13] = "504_0417|8282";
    tc[14] = "508_0838|8283";
    tc[15] = "8155_8155|8155";
    tc[16] = "8156_8156|8156";
    tc[17] = "8265_8265|8265";
    tc[18] = "8266_8266|8266";
    tc[19] = "8267_8267|8267";
    tc[20] = "8268_8268|8268";*/

    //tc[15] = "8155|8155";
    //tc[16] = "8156|8156";
    //tc[17] = "8265|8265";
    //tc[18] = "8266|8266";
    //tc[19] = "8267|8267";
    //tc[20] = "8268|8268";

    document.write('<table border="0" valign="top" cellspacing="3">');
    //document.write('<tr>');
    //document.write('<td width="0" valign="top" align="left">&nbsp;</td>');
    //document.write('<td colspan="3">');
    //document.write('<br><h1 style="margin-left:10px;margin-right:10px;">Collection</h1><br><br>');
    //document.write('</td>');
    //document.write('</tr>');
    for (i = 0; i < imgArray.length; i++) {
        if (contentcount == 0) {
            document.write('<tr>');
            //document.write('<td width="0" align="left">&nbsp;</td>');
        }
        //thetext = tc[i].split("|")[0];
        imgArray = imgArray[i][0]
        //displaytext = tc[i].split("|")[1];
        displaytext = imgArray[i][2];
        //picUrl = tc[i] + '|' + i;
        
        thelink = "Images/cImages/venezia/" + thetext.replace(/ /g, "_");
        document.write('<td width="185" valign="top" align="center">');
        //document.write('<A href="javascript:void(0)" onclick="javascript:ImagePopup(' + tc[i] + '|' + i  + ')" >');	

        //document.write('<A href="javascript:ImagePopup('+ picUrl +');">');	
        //		document.write('<A href="javascript:ImagePopup(\'test_0|test|3\');">');	

        //a = tc[i].split("|")[0].toString();
        //a1 = a.split("_")[0].toString();
        //a2 = '\'' + a.split("_")[1].toString() + '\'';
        //c = tc[i].split("|")[1].toString();
        d = i.toString();
        //document.write('<A href="javascript:ImagePopup(' + a1 + ',' + a2 + ',' + c + ',' + d + ');">');
        //document.write('<A href="javascript:void(0)" onclick="javascript:window.open(\'viewimage.asp?' + tc[i] + '|' + i + '\', \'viewRC\',\'resizable=0,scrollbars=0,height=475,width=570,top=20,left=20\')">');
        //document.write('<img src="' + thelink + 'small' + '.jpg" border="0" alt="' + thetext + '"></A><br>');
        document.write('<img' + 'id=' + d + 'class="thumbNormal" src="' + thelink + 'small' + '.jpg" border="0" alt="' + thetext + '"><br>');
        //document.write('<A href="javascript:void(0)" onclick="javascript:window.open(\'viewimage.asp?' + tc[i] + '|' + i + '\', \'viewRC\', \'resizable=0,scrollbars=0,height=475,width=570,top=20,left=20\');window.focus();" >'+ displaytext+'</A></td>');
        //document.write('<A href="javascript:ImagePopup(' + a1 + ',' + a2 + ',' + c + ',' + d + ');">' + displaytext + '</A></td>');
        document.write('</td>');

        contentcount++;
        if (contentcount == numcols) {
            document.write('</tr>');
            contentcount = 0;
        }
    }
    if (contentcount != numcols) {
        for (i = 0; numcols - contentcount > 0; i++) {
            document.write('<td width="185" valign="top" align="center">&nbsp;</td>');
            contentcount++;
        }
        document.write('</tr>');
    }
    document.write('</table>');
}
