

var nomwidth = 240;
var nomheight = 180;
var nomthumbwidth = 40;
var nomthumbheight = 30;
var nomsliderate = 8;

var thumbstore0 = new Array();
var thumbstore1 = new Array();
var thumbstore2 = new Array();
var imagestore_bigpic0 = new Array();
var imagestore_bigpic1 = new Array();
var imagestore_bigpic2 = new Array();
var startimage = 0;

var Misc_Path = new Array(); // 0 for All (self contained); 1 for Slides (video on SS); 2 for all on ss
Misc_Path[0] = new Array("localvideos/");
Misc_Path[1] = new Array("SSVideos/");
Misc_Path[2] = new Array("SSVideos/");


function initstartpage(){

	pickupArgs();
	PageArgs['CurPage'] = 1;
	SIndex = parseInt(PageArgs['CurSet']);
	setStartConditions(nomthumbwidth, nomthumbheight, nomwidth, nomheight, nomsliderate,"",pathswitch);
//	setsize();//must be after pickupPickSize

/*	for (var tmpIndex=0; tmpIndex<3; tmpIndex++){
		startimage = parseInt(PageArgs['Set_Img'][tmpIndex]);
    	if (!loadthumbs("thumbstore"+tmpIndex,  tmpIndex, "BP_Index",  "dxthumb"+tmpIndex,"thumbstable0","tdthumb1")){ //plant all thumbs
    		mainimageload(tmpIndex);
		}
	}
*/

	loadthumbs("thumbstore"+0,  0, "BP_Index",  "dxthumb"+0,"thumbstable0","tdthumb1");
	planthtmltable();
}

function followthumbsload(csd){
	
	switch (csd){
		case 0:
			loadthumbs("thumbstore"+1,  1, "BP_Index",  "dxthumb"+1,"thumbstable0","tdthumb1");
			break;
		case 1:
			loadthumbs("thumbstore"+2,  2, "BP_Index",  "dxthumb"+2,"thumbstable0","tdthumb1");
			break;
		case 2:
			firstmainimages();
			break;
		default:
			firstmainimages();
	}
}			

function firstmainimages(){
		for (var n = 0; n<3; n++){
			var simg = parseInt(PageArgs['Set_Img'][n]);
			loadimages( "imagestore_bigpic"+n, simg, n, "BP_Index");//preload images and first image
		}
}

//called from cursor key advance or initial setup
function replaceimg(newpic){
			var csl = PageArgs['CurSet'];
			replacepic(newpic, csl ,"BP_Index", "imagestore_bigpic"+csl,"Picture"+csl,  "dxthumb"+csl, "tdthumb1Lit", "tdthumb1");//main picture planting
			replacetxt(newpic, csl, "BP_Index", "caption"+csl, "");//corresponding group and detail text planting
			PageArgs['Set_Img'][csl] = newpic;//update common index for main picture
		
}

//called from click on thumbs
function replacemainpic(nextpic, tqs){
			PageArgs['CurSet'] = tqs;
			PageArgs['Set_Img'][tqs]= nextpic;
			replaceimg(nextpic);
}
	

function planthtmltable(){
//plant the html for the table - what others are doing
	var jumpcode1 = "";
	var jumpcode2 = "";
    var odslength = U_Index.length;
    var n = 0;
    var odcolumns = 3;

    var odrows = (odslength/odcolumns);
    var odcol = 0;
    var odrow = 0;
    if ((odrows*odcolumns) < odslength){
        odrows++;
    }
    var UniTitleArray,UniTitle,UniThumb,UniSummary;
    
    var othersdoingtable = "<table class=\"tu2\">";
    for (arow = 0; arow  < odrows; arow++){
        if (arow == 0){
            othersdoingtable = othersdoingtable + "<tr>";
        }else{
            othersdoingtable = othersdoingtable + "</tr><tr>";
        }
        for (odcol = 0; odcol < odcolumns; odcol++){

            	jumpcode1 = "";
                jumpcode2 = "";
                UniTitleArray = U_Index[n][0];
                UniTitle = eval(UniTitleArray)[0];

        	   if (eval(UniTitleArray)[2]>""){
		          jumpcode1 = "<div onmouseover=\"this.className=\'f5\'\" onmouseout=\"this.className=\'f4\'\">"+"<a href=\"javascript:jumpuni_infodetails("+n+");\">";
		          jumpcode2 = "</a></div>";
                }
            othersdoingtable = othersdoingtable + "<td class=\"td5b\" text-align=\"left\"" + "<b>"+jumpcode1+UniTitle+"</b>"+jumpcode2 +"</td>";
            n++;
            
            //if (n >= odslength){ odcol = 10; arow = 10;}//copout of loop
            }
        }
  
//following kept for reference as to how to use backslash to escape quotes:
//	document.getElementById(en).innerHTML = "<a  href=\"#\" onclick = \"javascript:jumpuni_infodetails(2) ;return false;\">me</a>"//

    othersdoingtable = othersdoingtable + "</tr></table>";
    document.getElementById("odlist").innerHTML = othersdoingtable;

}

function jumpmodels(){
	var modelpath = Misc_Path[pathswitch];
		window.location.href= eval(modelpath) + "models/models.html";
}
function jumpProShow(){var proshowpath = Misc_Path[pathswitch];
	window.location.href= eval(proshowpath) + "proshow/proshow.html";
}

//----------------------------
function pgup(){jumpstartpage();}
function pgdn(){}
function homekey(){jumpstartpage();}
function clt(){}
function crt(){}
function cup(){}//inc image size
function cdn(){}//dec image size
function pos(){}
function neg(){}
function ret(){}//restore default
function esc(){}//restore default
function space(){}

function lsqbrkt(){} //interval rate down
function rsqbrkt(){} //interval rate up
function hlp(){}//help toggle
function fade(){}//