// AUTHOR: Evan Small
// DATE: Feb 2005

function viewPic(img)
{ 	
    picfile = new Image(); 
    picfile.src =(img); 
    fileCheck(img); 
}

function fileCheck(img)
{ 	
    if( (picfile.width!=0) && (picfile.height!=0) )
    { 
        makeWindow(img); 
    }
    else 
    {
        funzione="fileCheck('"+img+"')"; 
        intervallo=setTimeout(funzione,50); 
    }
}

function makeWindow(img)
{ 	
    ht = picfile.height + 18;
    wd = picfile.width + 18; 

    var args= "height=" + ht + ",innerHeight=" + ht;
    args += ",width=" + wd + ",innerWidth=" + wd;
    if (window.screen) 
    { 
        var avht = screen.availHeight; 
        var avwd = screen.availWidth;
        var xcen = (avwd - wd) / 2; 
        var ycen = (avht - ht) / 2;
        args += ",left=" + xcen + ",screenX=" + xcen;
        args += ",top=" + ycen + ",screenY=" + ycen + ",resizable=yes"; 	
    }
    return window.open(img, '', args); 
} 

function MM_jumpMenu(targ,selObj,restore)
{
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

var CrossFadeDuration = 3;
var Position1 = new Array(); 
var Caption = new Array(); 

Position1[1]  = 'nav/rand2.jpg';
Position1[2]  = 'nav/rand8.jpg';
Position1[3]  = 'nav/rand1.jpg';
Position1[4]  = 'nav/rand4.jpg';
Position1[5]  = 'nav/rand5.jpg';
Position1[6]  = 'nav/rand6.jpg';
Position1[7]  = 'nav/rand7.jpg';
Position1[8]  = 'nav/rand3.gif';
Position1[9]  = 'nav/rand9.jpg';
Position1[10]  = 'nav/rand10.jpg';
Position1[11]  = 'nav/rand11.jpg';

//randomize array
var i = Position1.length;
while ( --i ) 
{
   var j=0
   do{
   	j = Math.floor( Math.random() * ( i + 1 ) );
   }while (j==0)
   var tempi = Position1[i];
   var tempj = Position1[j];
   Position1[i] = tempj;
   Position1[j] = tempi;
}

var tss;
var iss;
var jss = 1;
var pss = Position1.length-1;

var preLoad1 = new Array();

for (iss = 1; iss < pss+1; iss++)
{
	preLoad1[iss] = new Image();
	preLoad1[iss].src = Position1[iss];
}

function runSlideShow(whichLocation, whatSpeed){
if (document.all){
document.images[whichLocation].style.filter="blendTrans(duration=2)";
document.images[whichLocation].style.filter="blendTrans(duration=CrossFadeDuration)";
document.images[whichLocation].filters.blendTrans.Apply();}
if(whichLocation == "position1") document.images[whichLocation].src = preLoad1[jss].src;
if (document.all) document.images[whichLocation].filters.blendTrans.Play();
jss = jss + 1;
if (jss > (pss)) jss=1;
tss = setTimeout('runSlideShow("' + whichLocation + '",' + whatSpeed + ')', whatSpeed);
}



