var GB_ROOT_DIR = "http://artaca.net/greybox/";
// -------------------------------------------------------------------------------------------------------------------
function getApture() {if (document.write) { document.write("<scr"+"ipt language='javascript' src=' http://www.apture.com/js/apture.js?siteToken=9pedsUC' id='aptureScript' charset='utf-8'>"+"</scr"+"ipt>"); }}
// -------------------------------------------------------------------------------------------------------------------
function popWindow(thefile) {
var varWindow = window.open(thefile, 'popWindow', 'toolbar=no, width=620, height=420, directories=no, location=no, status=no, scrollbars=no, resizable=no, menubar=no');
{ varWindow.focus();
}
}
// -------------------------------------------------------------------------------------------------------------------
function popWindow2(thefile) { 
var varWindow2 = window.open('http://en.wikipedia.org/w/index.php?title=' + thefile + '&printable=yes', 'theWindow2', 'toolbar=no, location=no, directories=no, status=no, scrollbars=yes, resizable=no, menubar=no, height=400, width=500');
// var varWindow2 = window.open('http://en.mobile.wikipedia.org/transcode.php?go=' + thefile, 'theWindow2', 'toolbar=no, width=400, height=400, location=no, directories=no, status=no, scrollbars=yes, resizable=yes, menubar=no');
// var varWindow2 = window.open('http://mlvb.net/en.wikipedia.org/wiki/Special:Search?search=' + thefile + '&go=Go', 'theWindow2', 'toolbar=no, width=438, height=400, location=no, directories=no, status=no, scrollbars=yes, resizable=yes, menubar=no');
// var varWindow2 = window.open('http://wikipedia.7val.com/wiki/Special:Search?search=' + thefile + '&go=Go', 'theWindow2', 'toolbar=no, width=438, height=400, location=no, directories=no, status=no, scrollbars=yes, resizable=yes, menubar=no');
{ varWindow2.focus();
}
}
// -------------------------------------------------------------------------------------------------------------------
function ZoomifyPop1() { 
var ZoomifyPop1 = window.open('http://artaca.net/zoomify/popup.html','popWindow','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=430, height=350');
{ ZoomifyPop1.focus();
}
}
// -------------------------------------------------------------------------------------------------------------------
function init() {
if (document.rImage) {
 rotateImage('rImage');
}
}
window.onload = init;

// -------------------------------------------------------------------------------------------------------------------
function searchThisSite() {
document.searchform.cof.value = "S:http://artaca.net;AH:left;LH:60;L:http://artaca.net/images/gtfa_logo2.gif;LW:160";
document.searchform.domains.value = "artaca.net";
document.searchform.sitesearch.value = "artaca.net";
document.searchform.submit();
}
// -------------------------------------------------------------------------------------------------------------------
// RANDOM IMAGE ROTATOR by Robert Bu
var interval = 2.5; // delay between rotating images (in seconds)
var random_display = 0; // 0 = no, 1 = yes
interval *= 1000;

var image_index = 0;
image_list = new Array();
image_list[image_index++] = new imageItem("http://artaca.net/chrisfrench/silverbullet/silverbullet_t.jpg");
image_list[image_index++] = new imageItem("http://artaca.net/alexhamilton/seventyfiveforiv/seventyfiveforiv_t.jpg");
image_list[image_index++] = new imageItem("http://artaca.net/alexhamilton/bombphoons/bombphoons_t.jpg");
image_list[image_index++] = new imageItem("http://artaca.net/alexhamilton/slinkysue/slinkysue_t.jpg");
image_list[image_index++] = new imageItem("http://artaca.net/ronaldwong/typhoonimminent/typhoonimminent_t.jpg");
image_list[image_index++] = new imageItem("http://artaca.net/alexhamilton/firstoftheheavies/firstoftheheavies_t.jpg");
image_list[image_index++] = new imageItem("http://artaca.net/chrisfrench/afarewelltoheathrow/afarewelltoheathrow_t.jpg");
image_list[image_index++] = new imageItem("http://artaca.net/ronaldwong/tornadoalley/tornadoalley_t.jpg");
image_list[image_index++] = new imageItem("http://artaca.net/alexhamilton/sunlitsilence/sunlitsilence_t.jpg");
image_list[image_index++] = new imageItem("http://artaca.net/alexhamilton/scamptonsteel/scamptonsteel_t.jpg");
image_list[image_index++] = new imageItem("http://artaca.net/alexhamilton/lowflyingbrick/lowflyingbrick_t.jpg");
var number_of_image = image_list.length;
function imageItem(image_location) {
this.image_item = new Image();
this.image_item.src = image_location;
}
function get_ImageItemLocation(imageObj) {
return(imageObj.image_item.src)
}
function generate(x, y) {
var range = y - x + 1;
return Math.floor(Math.random() * range) + x;
}
function getNextImage() {
if (random_display) {
image_index = generate(0, number_of_image-1);
}
else {
image_index = (image_index+1) % number_of_image;
}
var new_image = get_ImageItemLocation(image_list[image_index]);
return(new_image);
}
function rotateImage(place) {
var new_image = getNextImage();
document[place].src = new_image;
var recur_call = "rotateImage('"+place+"')";
setTimeout(recur_call, interval);
}
// -------------------------------------------------------------------------------------------------------------------
/*
Simple Image Trail script- By JavaScriptKit.com
Visit http://www.javascriptkit.com for this script and more
This notice must stay intact
*/

var offsetfrommouse=[15,15]; //image x,y offsets from cursor position in pixels. Enter 0,0 for no offset
var displayduration=0; //duration in seconds image should remain visible. 0 for always.
var currentimageheight = 400;	// maximum default image height.

if (document.getElementById || document.all){
	document.write('<div id="trailimageid">');
	document.write('</div>');
}

function gettrailobj(){
if (document.getElementById)
return document.getElementById("trailimageid").style
else if (document.all)
return document.all.trailimagid.style
}

function gettrailobjnostyle(){
if (document.getElementById)
return document.getElementById("trailimageid")
else if (document.all)
return document.all.trailimagid
}

function truebody(){
return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function showtrail(imagename,title,artist,description,width,height) {
	if (height > 0){
		currentimageheight = height;
	}
	document.onmousemove=followmouse;
	newHTML = '<div align="center" style="padding: 9px; background-color: #eeeeee; border: 1px solid #660099; font-style:italic;">';
	newHTML = newHTML + '<div style="padding: 0px 0px 9px 0px;">';
	newHTML = newHTML + '<img src="' + imagename + '"' ;
	newHTML = newHTML + ' height="' + height + '" width="' + width + '"';
	newHTML = newHTML + ' border="0"></div>';
	newHTML = newHTML + '<b>' + title + '</b><br>';
	newHTML = newHTML + 'by <b>' + artist + '</b><br>';
	newHTML = newHTML +  description;
	newHTML = newHTML + '</div>';
	gettrailobjnostyle().innerHTML = newHTML;
	gettrailobj().display="inline";
}

function hidetrail(){
	gettrailobj().innerHTML = " ";
	gettrailobj().display="none"
	document.onmousemove=""
	gettrailobj().left="-500px"
}

function followmouse(e){
	var xcoord=offsetfrommouse[0]
	var ycoord=offsetfrommouse[1]
	var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
	var docheight=document.all? Math.min(truebody().scrollHeight, truebody().clientHeight) : Math.min(window.innerHeight)
	if (typeof e != "undefined") {
		if (docwidth - e.pageX < 380) {
			xcoord = e.pageX - xcoord - 420; // Move to the left side of the cursor. This figure must be about 20 pixels greater than the image width to avoid arratic non-IE behaviour.
		} else {
			xcoord += e.pageX;
		}
		if (docheight - e.pageY < (currentimageheight + 110)){
			// truebody().scrollTop is always zero in Safari 3.1, so we us documnet.body.scrollTop instead
			if ( document.body ){
				scrollTop = Math.max(truebody().scrollTop, document.body.scrollTop);
			} else {
				scrollTop = truebody().scrollTop;
			}
			ycoord += e.pageY - Math.max(0,(110 + currentimageheight + e.pageY - docheight - scrollTop));
		} else {
			ycoord += e.pageY;
		}

	} else if (typeof window.event != "undefined"){
		if (docwidth - event.clientX < 380){
			xcoord = event.clientX + truebody().scrollLeft - xcoord - 420; // Move to the left side of the cursor. This figure must be about 20 pixels greater than the image width to avoid arratic IE behaviour.
		} else {
			xcoord += truebody().scrollLeft+event.clientX
		}
		if (docheight - event.clientY < (currentimageheight + 110)){
			ycoord += event.clientY + truebody().scrollTop - Math.max(0,(110 + currentimageheight + event.clientY - docheight));
		} else {
			ycoord += truebody().scrollTop + event.clientY;
		}
	}
	if(ycoord < 0) { ycoord = ycoord*-1; }
	gettrailobj().left=xcoord+"px"
	gettrailobj().top=ycoord+"px"
}
// -------------------------------------------------------------------------------------------------------------------

