// JavaScript Document

function doHide(theObject,theAction) {
	var thisHiding = new getObj(theObject);
	if (theAction == "hidden") {
	thisHiding.obj.className = "make_hidden";	
	}
	else {
	thisHiding.obj.className = "make_none";	
	}
}

function doShow(theObject, theAction) {
	var thisShowing = new getObj(theObject);
	if (theAction == "block") {
	thisShowing.obj.className = "make_block";	
	}
	else {
	thisShowing.obj.className = "make_visible";	
	}
}

function doAddClass(theObject, theAction) {
	var thisDiv = new getObj(theObject);
	thisDiv.obj.className = theAction;
}

function goText(thisItemNum) {
thistext = "<div class='inner_text_box'><h2>" + eval("folio_title" + thisItemNum).toUpperCase() + "<\/h2>" + eval("folio_text" + thisItemNum) + "</div>";
var x = new getObj("left_text");
leftTextHTML = thistext;
if (document.getElementById || document.all) {
x.obj.innerHTML = leftTextHTML;}
else {
x.obj.document.open();
x.obj.document.write(leftTextHTML);
x.obj.document.close();
}	
}

function goRightText(thisitemnum) {
	var writeText = false;
	switch (thisitemnum) {
	case 10:
doHide('right_text_box','none');
doShow('picklist_box','block');
	break;
	case 20:
doHide('picklist_box','none');
doShow('right_text_box','block');
thistext = TermsText;
writeText = true;
	break;
	case 30:
doHide('picklist_box','none');
doShow('right_text_box','block');
thistext = HelpText;
writeText = true;
	break;
}
doHighlight(thisitemnum,'right_tabs');
if (writeText) {
doHide('picklist_box','none');
doShow('right_text_box','block');
var x = new getObj("right_text_box");
if (document.getElementById || document.all) {
x.obj.innerHTML = thistext;}
else {
x.obj.document.open();
x.obj.document.write(thistext);
x.obj.document.close();
}	
}
else {
doHide('right_text_box','none');
doShow('picklist_box','block');	
}
}

function goSplash(thisItemNum) {
if (hasOrderStatus) {goText(1);}
	else {goText(0);}
}

// FUNCTION TO SWITCH TO IMAGE MODE
function goImages(thisitemnum) {
	if(thisitemnum != 0) {
	doShow('imagecontent','block');
	doHide('login_content','none');
	doShow('top_nav_butts_holder','block');
	doShow('nav_butts_holder','block');
	myMode = startMode;
	switchContent(thisitemnum);
	}
	else {
	doHide('imagecontent','none');
	doHide('nav_butts_holder','none');	
	doHide('top_nav_butts_holder','none');
	doShow('login_content','block');	
	goSplash();	
	}
}

function showOrderStuff() {	
	doHide('order_cover','none');
	doShow('order_panel','block');
	hasOrderStatus = true;
	thisRegText = "";
	//document.write('<style type="text\/css">p.text_footer_reg {color: #0f0\;}<\/style>');
	doHighlight(10,'right_tabs');
}

function showPostcodeStuff() {	
	doHide('order_panel','none');
	doShow('order_cover','block');
		//thisRegText = "";
	//document.write('<style type="text\/css">p.text_footer_reg {color: #0f0\;}<\/style>');
		doHighlight(10,'right_tabs2');
}

// FUNCTION TO HIGHLIGHT CURRENT FOLIO LINK
function  doHighlight(thisNavItem, thisNavSection) {
	if (thisNavSection=='left_tabs') {
switch (Math.floor(thisNavItem/100)) {
	case 1:
	thisNavItem=2;
	break;
	case 2:
	thisNavItem=1;
	break;
	case 3:
	thisNavItem=3;
	break;
}
	}
	else {
switch (thisNavItem) {
	case 10:
	thisNavItem=1;
	break;
	case 20:
	thisNavItem=3;
	break;
	case 30:
	thisNavItem=2;
	break;
	}
}
//var x = new getObj("contact_link");
//x.obj.className = "";
var z = new getObj(thisNavSection);
if (!z) return;
var theseTags  = (z.obj.getElementsByTagName('li'));
var y = (theseTags.length);
for (var i=0;i<y;i++) {
theseTags[i].className = "";
}
theseTags[thisNavItem-1].className = "selected";
}

// FUNCTION TO SWITCH TO REQUIRED FOLIO
function switchContent(thisitemnum) {
thisItemNum = thisitemnum;
// now show the right folio
thisfolio = eval("thisfolio" + thisItemNum);
// and the right image titles
if (imageTitles || thumbTitles) {
thistitle = eval("thistitle" + thisItemNum);
//if (thisItemNum != 100 && thisItemNum != 200) {
if (thisItemNum != 100) {
thisfulltitle = eval("thisfulltitle" + thisItemNum);
}
}
//thistext = '';
//if (thisItemNum == 100 || thisItemNum == 200) {
if (thisItemNum == 100) {
thistext = "<div class='inner_text_box'><h2>" + eval("folio_title" + thisItemNum).toUpperCase() + "<\/h2>" + eval("folio_text" + thisItemNum) + thisRegText + "</div>";	
} else {
switch (Math.floor(thisItemNum/100)) {
case 1:
switch (thisItemNum) {
case 137:
case 138:
case 139:
thistext = "<div class='inner_text_box'><h2>" + eval("folio_title" + thisItemNum).toUpperCase() + "<\/h2>" + eval("folio_text" + thisItemNum) + thisRegText + CardTextJJ + CardLinkText + "</div>";
break;
case 136:
case 140:
thistext = "<div class='inner_text_box'><h2>" + eval("folio_title" + thisItemNum).toUpperCase() + "<\/h2>" + eval("folio_text" + thisItemNum) + thisRegText + CardTextGG + CardLinkText + "</div>";
break;
case 120:
thistext = "<div class='inner_text_box'><h2>" + eval("folio_title" + thisItemNum).toUpperCase() + "<\/h2>" + eval("folio_text" + thisItemNum) + thisRegText + CardText120 + CardLinkText + "</div>";
break;
/*case 130:
thistext = "<div class='inner_text_box'><h2>" + eval("folio_title" + thisItemNum).toUpperCase() + "<\/h2>" + eval("folio_text" + thisItemNum) + thisRegText + CardText130 + CardLinkText + "</div>";
break;*/
case 118:
thistext = "<div class='inner_text_box'><h2>" + eval("folio_title" + thisItemNum).toUpperCase() + "<\/h2>" + eval("folio_text" + thisItemNum) + thisRegText + CardText118 + CardLinkText + "</div>";
break;
case 132:
thistext = "<div class='inner_text_box'><h2>" + eval("folio_title" + thisItemNum).toUpperCase() + "<\/h2>" + eval("folio_text" + thisItemNum) + thisRegText + CardText132 + CardLinkText + "</div>";
break;
case 141:
thistext = "<div class='inner_text_box'><h2>" + eval("folio_title" + thisItemNum).toUpperCase() + "<\/h2>" + eval("folio_text" + thisItemNum) + thisRegText + CardText141 + CardLinkText + "</div>";
break;
case 146:
thistext = "<div class='inner_text_box'><h2>" + eval("folio_title" + thisItemNum).toUpperCase() + "<\/h2>" + eval("folio_text" + thisItemNum) + thisRegText + CardText146 + CardLinkText + "</div>";
break;
default:
thistext = "<div class='inner_text_box'><h2>" + eval("folio_title" + thisItemNum).toUpperCase() + "<\/h2>" + eval("folio_text" + thisItemNum) + thisRegText + CardTextHH + CardLinkText + "</div>";
break;
}
break;	
case 2:
/*if (thisItemNum == 201) {
// Only applies to Square Wall Calendars
var thisText = thisnum;
if (startFlag) {thisText = 999;}
switch (thisText) {
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
case 10:
case 11:
case 12:
case 13:
case 14:
case 15:
thistext = "<div class='inner_text_box'><h2>" + eval("folio_title" + thisItemNum).toUpperCase() + "<\/h2>" + eval("folio_text" + thisItemNum + "ICA") + thisRegText + CalendarText + "</div>";
break;
case 16:
case 17:
case 18:
case 19:
case 20:
thistext = "<div class='inner_text_box'><h2>" + eval("folio_title" + thisItemNum).toUpperCase() + "<\/h2>" + eval("folio_text" + thisItemNum + "MAV") + thisRegText + CalendarText + "</div>";
break;
case 21:
case 22:
case 23:
case 24:
case 25:
case 26:
case 27:
case 28:
thistext = "<div class='inner_text_box'><h2>" + eval("folio_title" + thisItemNum).toUpperCase() + "<\/h2>" + eval("folio_text" + thisItemNum + "ST") + thisRegText + CalendarText + "</div>";
break;
default:
thistext = thistext = "<div class='inner_text_box'><h2>" + eval("folio_title" + thisItemNum).toUpperCase() + "<\/h2>" + eval("folio_text" + thisItemNum) + thisRegText + CalendarText + "</div>";
break;
}
}
else {*/
// All other Calendar ranges
thistext = "<div class='inner_text_box'><h2>" + eval("folio_title" + thisItemNum).toUpperCase() + "<\/h2>" + eval("folio_text" + thisItemNum) + thisRegText + CalendarText + "</div>";/**/
/*}*/
break;	
case 3:
thistext = "<div class='inner_text_box'><h2>" + eval("folio_title" + thisItemNum).toUpperCase() + "<\/h2>" + eval("folio_text" + thisItemNum) + thisRegText + WrapText + "</div>";
break;
}	
}
//thistext = thistext + '';
thisimage = thisfolio;
allnum = thisimage.length;
lastnum = allnum;
if (myMode == "full") {
thisImageDir = fullImageDir;
//showthisimage('current');
getimagefile(thisnum);
}
else {
thisImageDir = thumbsImageDir;
//if (thisItemNum == 100 || thisItemNum == 200) {
if (thisItemNum == 100) {
thisLink = 	eval("thisLink" + thisItemNum);
}
showThumbs();
}
doHighlight(thisItemNum, "left_tabs");
}

// Function used?
function getValue(stringtoparse) {
return stringtoparse.substring(2,stringtoparse.length);
}

// FUNCTION THAT CHECKS THE DOM 
function getObj(name){
if (document.getElementById)
{this.obj = document.getElementById(name);}
else if (document.all)
{this.obj = document.all[name];}
else if (document.layers)
{this.obj = document.layers[name];}
}

// FUNCTION THAT GETS THE FULL IMAGES, INCLUDING GO BACK AND GO ON, AND THE TITLE 
function getimagefile(thisreqnum) {
if (document.images) {
	var thisRange = eval("folio_title" + thisItemNum).toUpperCase();
thisHTML = '<table cellpadding="0" cellspacing="0" border="0"><tr><td width="' + imageWidth + '" height="' + imageHeight + '" align="center" valign="middle">';
var imgHTML = '<img src="' + thisImageDir + thisimage[thisreqnum] + '" alt="&copy ' + artistName + '" id="content_image"';
//if (imageTitles) {
//thisHTML = 	thisHTML + ' onLoad="doShow(\'title_box\',\'visible\');"';
//}
//thisHTML = 	thisHTML + '>';
if (hasThumbsLink) {
thisHTML = thisHTML + '<a href="Javascript:doGetThumbs();" onMouseOver="status=\'Click here to view thumbnails\'; return true;" onMouseOut="status=\'\'; return true;">' + imgHTML + '</a>'; 
}
else {
thisHTML = thisHTML + imgHTML;	
}
thisHTML = thisHTML + '</td></tr></table>';
if (imageTitles) {
var thumbTitleContent = thistitle[thisreqnum];
if (thisfulltitle.length == 1) {
var fullTitleContent = thisfulltitle[0];
}
else {
var fullTitleContent = thisfulltitle[thisreqnum];	
}
//thisHTML = thisHTML + '<br /><span class="thumbslabel">' + thumbTitleContent.toUpperCase() + '</span>';
		thisOrderLink = "";
		if(hasOrderStatus) {thisOrderLink = '<a href="Javascript:doDataAction(\'001\',{\'item_ref\':\'' + thumbTitleContent + '\',\'item_range\':\'' + thisRange + '\'});">ORDER</a>';}		
thisHTML = thisHTML + '<div class="full_label"><div class="order_butt">' + thisOrderLink + '</div><div class="full_title">' + fullTitleContent + '</div><div class="item_code">' + thumbTitleContent + '</div></div>';
	}
if ((thisreqnum<(thisimage.length)) && thisreqnum>=0) {
x = new getObj("imagecontent");
// image numbers
//if (imageNumbers) {var numberseq = new getObj("numberseq");}
// image title

// thumbs link
//if (hasThumbsLink) { 
//var thumbsLink = new getObj("thumbsLink");
//var thumbsHTML = '<a href="Javascript:doGetThumbs();" id="thumbsLink" onMouseOver="status=\'Click here to view thumbnails\'; return true;" onMouseOut="status=\'\'; return true;"><span class="chevron"> </span>THUMBNAILS<span class="chevron"> </span></a>'; 
//}
if (document.getElementById || document.all) {
x.obj.innerHTML = thisHTML;
// set image numbers
//if (imageNumbers) {numberseq.obj.innerHTML = (thisnum+1) + " / " + allnum ;}
// set title

// set thumbs link
//if (hasThumbsLink) {
	//thumbsLink.obj.innerHTML = thumbsHTML;
//}
}

else {
x.obj.document.open();
x.obj.document.write(thisHTML);
x.obj.document.close();
// set image numbers
//if (imageNumbers) {
//numberseq.obj.document.open();
//numberseq.obj.document.write(thisnum + " / " + allnum);
//numberseq.obj.document.close();}
// set image title

// set thumbs link
//if (hasThumbsLink) {
//thumbsLink.obj.document.open();
//thumbsLink.obj.document.write(thumbsHTML);
//thumbsLink.obj.document.close();
//}
}
var x = new getObj("left_text");
leftTextHTML = thistext;
if (document.getElementById || document.all) {
x.obj.innerHTML = leftTextHTML;}
else {
x.obj.document.open();
x.obj.document.write(leftTextHTML);
x.obj.document.close();
}
}
// Go Back & Go On links
var thisnext = new getObj("butt_next");
var thistopnext = new getObj("top_butt_next");
var thisprev = new getObj("butt_prev");
var thistopprev = new getObj("top_butt_prev");
if (thisreqnum < (lastnum-1) || imageLoop) 
	{
	thisnextHTML = "<a href='Javascript:showthisimage(\"next\");' onMouseOver=\"status='Click here for the next image'; return true;\" onMouseOut=\"status=''; return true;\">&nbsp;&nbsp;next&nbsp;&nbsp;<span class='chevron'>&gt;</span></a>";
	
	}
else {
thisnextHTML = "";   
}
if (thisreqnum > 0 || imageLoop)
	{
	thisprevHTML = "<a href='Javascript:showthisimage(\"prev\");' onMouseOver=\"status='Click here for the previous image'; return true;\" onMouseOut=\"status=''; return true;\"><span class='chevron'>&lt;</span>&nbsp;&nbsp;prev&nbsp;&nbsp;</a>";
	}
else {
thisprevHTML = "";
}
}
if (document.getElementById || document.all) {
thisnext.obj.innerHTML = thisnextHTML;
thistopnext.obj.innerHTML = thisnextHTML;
//thistopnext.obj.innerHTML = "";
thisprev.obj.innerHTML = thisprevHTML;
thistopprev.obj.innerHTML = thisprevHTML;
//thistopprev.obj.innerHTML = "";
}
else {
thisnext.obj.document.open();
thisnext.obj.document.write(thisnextHTML);
thisnext.obj.document.close();
thistopnext.obj.document.open();
thistopnext.obj.document.write(thisnextHTML);
thistopnext.obj.document.close();
thisprev.obj.document.open();
thisprev.obj.document.write(thisprevHTML);
thisprev.obj.document.close();
thistopprev.obj.document.open();
thistopprev.obj.document.write(thisprevHTML);
thistopprev.obj.document.close();
}
if (folioTitles) {
thisFolioTitle = new getObj("image_title");
thisTopFolioTitle = new getObj("top_image_title");
//if (z == 100 || z == 200 || z == 300) {thisFolioTitleHTML = "Click any range to see the full set of designs";}
//else {
	thisFolioTitleHTML = 'Click <a href="Javascript:doGetThumbs();" onMouseOver="status=\'Click here to view thumbnails\'; return true;" onMouseOut="status=\'\'; return true;"><u>here</u></a> or on the design to return to the full range';
	//}
if (document.getElementById || document.all) {
thisFolioTitle.obj.innerHTML = thisFolioTitleHTML;
thisTopFolioTitle.obj.innerHTML = thisFolioTitleHTML;
//thisTopFolioTitle.obj.innerHTML = "";
}
else {
thisFolioTitle.obj.document.open();
thisFolioTitle.obj.document.write(thisFolioTitleHTML);
thisFolioTitle.obj.document.close();
thisTopFolioTitle.obj.document.open();
thisTopFolioTitle.obj.document.write(thisFolioTitleHTML);
thisTopFolioTitle.obj.document.close();
}
}
}

// FUNCTION TO WRITE THUMBNAILS
function showThumbs() {
var thisHTML = "<div id='thumbsArea'><ul id='thumbslist'>";
var z = thisItemNum;
var thisRange = eval("folio_title" + thisItemNum).toUpperCase();
for (y=thisnum; y<(thisnum+thumbsGrid); y++) {
if (y < allnum) {
//	if (z != 100 && z != 200) {
	if (z != 100) {
		thisOrderLink = "";
		if(hasOrderStatus) {thisOrderLink = '<a href="Javascript:doDataAction(\'001\',{\'item_ref\':\'' + thistitle[y] + '\',\'item_range\':\'' + thisRange + '\'});">ORDER</a>';}
thisHTML = thisHTML + '<li><table><tr><td width="' + thumbwidth + '" height="' + thumbheight + '" align="center" valign="middle" class="thumb_cell"><a href="Javascript:doGetFull(' + y + ');" onMouseOver="status=\'Click here to view the full image\';return true;" onMouseOut="status=\'\';return true;"><img src="' + thumbsImageDir + thisimage[y] + '" alt="&copy; ' + artistName + '" \/></a><\/td><\/tr><\/table>';
if (thumbTitles) {
	var thumbTitleContent = thistitle[y].toUpperCase();
	thisHTML = thisHTML + '<div class="thumbs_label"><div class="order_butt" >' + thisOrderLink + '</div><div class="item_code">' + thumbTitleContent + '<\/div><\/div>';
}
	}
	else {
thisHTML = thisHTML + '<li><table><tr><td width="' + thumbwidth + '" height="' + thumbheight + '" align="center" valign="middle"><a href="Javascript:thisItemNum=' + thisLink[y] + ';thisnum = 0;doGetThumbs(\'first\');" onMouseOver="status=\'Click here to view the designs in this range\';return true;" onMouseOut="status=\'\';return true;"><img src="' + thumbsImageDir + thisimage[y] + '" alt="&copy; ' + artistName + '" border="0"></a><\/td><\/tr><\/table>';	
if (thumbTitles) {
var thumbTitleContent = thistitle[y];
thisHTML = thisHTML + '<div class="thumbs_label">' + thumbTitleContent + '</div>';
	}	
	}
//thisHTML = thisHTML + '<br /><span class="thumbslabel">' + thumbTitleContent.toUpperCase() + '</span>';
thisHTML = thisHTML + '<\/li>';	
}
else {
thisHTML = thisHTML + '<li><img src="gifs/spacer.gif" width="' + thumbwidth + '"  height="' + thumbheight + '" alt="#" border="0"></li>';
}
}
thisHTML = thisHTML + "</ul>";
thisHTML = thisHTML + "</div>";
x = new getObj("imagecontent");
// image numbers
//if (imageNumbers) {
//var thumbsnumberseq = new getObj("numberseq");
//}
if (hasThumbsNav) {
var currentThumbsPageNum = getThumbsStartNum(thisnum)/thumbsGrid;
var totalThumbsPageNum = getThumbsStartNum(allnum)/thumbsGrid;
if (totalThumbsPageNum > 0) {
var thisThumbsPageNum = (currentThumbsPageNum+1) + " / " + (totalThumbsPageNum+1);
}
else {var thisThumbsPageNum = "&nbsp;&nbsp;&nbsp;&nbsp;";}
}
// thumbs link
if (hasThumbsLink) {
//var thumbsLink = new getObj("thumbsLink");
var thumbsHTML = ''; 
}
if (document.getElementById || document.all) {
x.obj.innerHTML = thisHTML;
// set image numbers
if (imageNumbers) {
thumbsnumberseq.obj.innerHTML = thisThumbsPageNum;
}
// set thumb link
if (hasThumbsLink) {
//thumbsLink.obj.innerHTML = thumbsHTML;
}
}
else {
x.obj.document.open();
x.obj.document.write(thisHTML);
x.obj.document.close();
// show image numbers
if (imageNumbers) {
thumbsnumberseq.obj.document.open();
thumbsnumberseq.obj.document.write(thisThumbsPageNum);
thumbsnumberseq.obj.document.close();
}
//if (hasThumbsLink) {
//thumbsLink.obj.document.open();
//thumbsLink.obj.document.write(thumbsHTML);
//thumbsLink.obj.document.close();
//}
}
// GO BACK & GO ON LINKS
var thisnext = new getObj("butt_next");
var thistopnext = new getObj("top_butt_next");
var thisprev = new getObj("butt_prev");
var thistopprev = new getObj("top_butt_prev");
//if (currentThumbsPageNum < totalThumbsPageNum) 
if (y < allnum)
	{
	thisnextHTML = "<a href='Javascript:doGetThumbs(\"next\");' onMouseOver=\"status='Click here for the next page'; return true;\" onMouseOut=\"status=''; return true;\">&nbsp;&nbsp;more&nbsp;&nbsp;<span class='chevron'>&gt;</span></a>";		
	}
else {
//thisnextHTML = "<img src='gifs/spacer.gif' alt='#' width='20' height='13' border='0' />";   
thisnextHTML = ""; 
}
if (currentThumbsPageNum > 0)
	{
	thisprevHTML = "<a href='Javascript:doGetThumbs(\"prev\");' onMouseOver=\"status='Click here for the previous page'; return true;\" onMouseOut=\"status=''; return true;\"><span class='chevron'>&lt;</span>&nbsp;&nbsp;back&nbsp;&nbsp;</a>";
	}
else {
//thisprevHTML = "<img src='gifs/spacer.gif' alt='#' width='20' height='13' border='0' />";
thisprevHTML = "";
}

if (document.getElementById || document.all) {
thisnext.obj.innerHTML = thisnextHTML;
thistopnext.obj.innerHTML = thisnextHTML;
thisprev.obj.innerHTML = thisprevHTML;
thistopprev.obj.innerHTML = thisprevHTML;
}
else {
thisnext.obj.document.open();
thisnext.obj.document.write(thisnextHTML);
thisnext.obj.document.close();
thistopnext.obj.document.open();
thistopnext.obj.document.write(thisnextHTML);
thistopnext.obj.document.close();
thisprev.obj.document.open();
thisprev.obj.document.write(thisprevHTML);
thisprev.obj.document.close();
thistopprev.obj.document.open();
thistopprev.obj.document.write(thisprevHTML);
thistopprev.obj.document.close();
}/**/
if (folioTitles) {
thisFolioTitle = new getObj("image_title");
thisTopFolioTitle = new getObj("top_image_title");
if (z == 100 || z == 200 || z == 300) {thisFolioTitleHTML = "Click any range to see the full set of designs";}
else {thisFolioTitleHTML = "Click on any design to see it larger";}
if (document.getElementById || document.all) {
thisFolioTitle.obj.innerHTML = thisFolioTitleHTML;
thisTopFolioTitle.obj.innerHTML = thisFolioTitleHTML;
}
else {
thisFolioTitle.obj.document.open();
thisFolioTitle.obj.document.write(thisFolioTitleHTML);
thisFolioTitle.obj.document.close();
thisTopFolioTitle.obj.document.open();
thisTopFolioTitle.obj.document.write(thisFolioTitleHTML);
thisTopFolioTitle.obj.document.close();
}
}
var x = new getObj("left_text");
leftTextHTML = thistext;
if (document.getElementById || document.all) {
x.obj.innerHTML = leftTextHTML;}
else {
x.obj.document.open();
x.obj.document.write(leftTextHTML);
x.obj.document.close();
}
if (z == 100 || z == 200 || z == 300) {goBackNum=getThumbsStartNum(thisnum);}
}

function IsValidObject(objToTest) {
if (null == objToTest) {return false;}
if ("undefined" == typeof(objToTest) ) {return false;}
return true;
}

/* Function that sorts out the numbering for go back and go on */
function showthisimage(showwhat) {
	if (imageTitles) {
//hideTitle();
//doHide('title_box','hidden');
	}
// ACTION FOR 'GO BACK' BUTTON
if (showwhat == "prev") {
if (thisnum >= 1) {
	thisnum = thisnum-1;}
	// what to do going < back from first page?
	else {
	if (imageLoop){thisnum = lastnum-1;} 
	//thisnum = lastnum-2 makes it loop round to last page - show button with 'hide button' feature 
	else {thisnum = 0;}
	//thisnum = 0 makes it stop at 1st page - hide button with 'hide button' feature
	}
}
// Function that creates action for Full Image 'go next' button
else if (showwhat == "next" || showwhat == "nextslide") {
if (showwhat == "next") {
}
/*if (showwhat == "nextslide") {showSSStop();}*/
	if (thisnum < lastnum-1) {thisnum = thisnum + 1;}
	// what to do going < on from last page?
	else {
	if (imageLoop) {thisnum = 0;} 
	// thisnum = 0 makes it loop round to 1st page - show button with 'hide button' feature 
	else {thisnum = lastnum-1;}
	// thisnum = lastnum-2 makes it stop at last page - hide button with 'hide button' feature
	}
}	
// DEFAULT ACTION
startFlag = false;
switchContent(thisItemNum);
// shownum = thisnum;
//getimagefile(shownum);
}

// Function that gets Thumbnails page Start Number
function getThumbsStartNum(currentnum) {	
startFlag = true;
var basenum = Math.floor(currentnum/thumbsGrid);
returnnum = basenum*thumbsGrid;
return returnnum;
}

// Function that creates action for Thumbnails 'go next' button
function doGetThumbs(thisDirection) {
	//doHide('navbutts','none');
	//doHide('title_box','hidden');
	//doShow('Copyright','block');
if (thisDirection == "next") 
{
thisnum = (thisnum + thumbsGrid);
}
else if (thisDirection == "prev") 
{
thisnum = (thisnum - thumbsGrid);
}
if (thisnum > allnum) {
thisnum = allnum;
}
startFlag = false;
if (thisnum < 0) {
startFlag = true;
thisnum = 0;
}/* */
myMode='thumbs';
thisnum = getThumbsStartNum(thisnum);
//switchNav('thumbs');
switchContent(thisItemNum);
}

// Image change functions end
//+++++++++++++++++++++++++++++++++++++


function doGetFull(fullNum) {
	//doHide('Copyright','none');
	//doShow('navbutts','block');
myMode='full';
thisnum=fullNum;
startFlag = false;
switchContent(thisItemNum);
}



function nada() {
}

