//  JSviwewsource contains various call functions for the JSviewer script via the JSviewpoint.htm file.
//
//  A call function will place text, images or thumbnail(s) on the page based on an array specification.
//  On some event, for instance "onclick", it will set the cookie named "show" and go to JSviewpoint.htm, 
//  which in turn inserts the proper slideform based on this cookie and activates JSviewer onload.
//
//  This script should be included in the head of all pages interfacing with the JSviewer 1.3 slideshow.
//  Alternatively, the functions below could be part of the styleswitcher script, used on all pages. 


//  -----------------------------------------------------------------------------------------------------

//  This script detects if shift, ctrl and alt are pressed on mousedown
//  Works with Internet Explorer and Netscape Navigator

if (parseInt(navigator.appVersion)>3) {
 document.onmousedown = mouseDown;
 if (navigator.appName=="Netscape") 
  document.captureEvents(Event.MOUSEDOWN);
}

//  These logic variables are valid for this page

var shiftPr
var ctrlPr
var altPr

//  This function sets the variables

function mouseDown(e) {
 shiftPr=0;
 ctrlPr=0;
 altPr=0;
  if (parseInt(navigator.appVersion)>3) {
  //if (navigator.appName=="Netscape") {
   //var mString =(e.modifiers+32).toString(2).substring(3,6);
   //shiftPr=(mString.charAt(0)=="1");
   //ctrlPr =(mString.charAt(1)=="1");
   //altPr  =(mString.charAt(2)=="1");
   //self.status="modifiers="+e.modifiers+" ("+mString+")"
  //}
  //else {
   shiftPr=event.shiftKey;
   ctrlPr =event.ctrlKey;
   altPr  =event.altKey;
   self.status=""
    +  "shiftKey="+event.shiftKey 
    +", altKey="  +event.altKey 
    +", ctrlKey=" +event.ctrlKey 
  //}
  //if (shiftPr || altPr || ctrlPr)
   //alert ("Mouse clicked with the following keys:\n"
    //+ (shiftPr ? "Shift ":"")
    //+ (ctrlPr ? "Ctrl ":"")
    //+ (altPr ? "Alt ":"")
   //)
 }
 return true;
}
if (parseInt(navigator.appVersion)>3) {
 document.onmousedown = mouseDown;
 if (navigator.appName=="Netscape")
  document.captureEvents(Event.MOUSEDOWN);
}

//  -----------------------------------------------------------------------------------------------------

//  Functions for standard slideshows in the same window

//  Activation of standard slideshow by a text or image link
//  Click on text or image to start at a specified slide

function viewCase(showcase,startslide) {
select(showcase)
slides=slides.join("|")
slides=slides.replace(/;/g,"¤")
document.cookie='show='+slides+';path=/'
document.cookie='pic='+startslide+';path=/'
document.cookie='max='+altPr+';path=/'
document.cookie='full='+ctrlPr+';path=/'
if (ctrlPr) {
  window.open('../scripts/jsview.htm','_blank',
  'fullscreen=1,height='+(screen.availHeight-10)+',width='+
  (screen.availWidth-10)+',screenX=0,screenY=0,left=0,top=0,'+
  'toolbar=0,location=0,directories=0,status=0,menubar=0,'+
  'scrollbars=0,resizable=0');return false
  }
else document.location='../scripts/jsview.htm'
}

//  Activation of standard slideshow by a sample thumb link
//  Click on the specified thumbnail to start at a specified slide

function thumbCase(showcase,thumbnail,startslide) {
select(showcase)
var text = new Array()
text = slides[0].split("|")
path = text[0]
text = slides[thumbnail].split("|")
document.write('<a class="image" href="#" onclick="viewCase('+showcase+','+startslide+')">\
<img src="' + path + 'thumbs/' + text[0] + '" alt="' + text[1] + '" title="' + text[2] + '"/></a> ')
}

//  Activation of standard slideshow by a group of thumb links
//  Click on a thumb to start at the corresponding slide

function groupCase(showcase) {
select(showcase)
var text = new Array()
text = slides[0].split("|")
path = text[0]
for (i = 1; i < slides.length; i++) {
text = slides[i].split("|")
document.write('<a class="image" href="#" onclick="viewCase('+showcase+','+i+')">\
<img class="group" src="' + path + 'thumbs/' + text[0] + '" alt="' + text[1] + '" title="' + text[2] + '"/></a> ')
}
}







