// resize fix for ns4
var origWidth, origHeight;
if (document.layers && !document.getElementById) {
origWidth = window.innerWidth; origHeight = window.innerHeight;
window.onresize = function() { if (window.innerWidth != origWidth || window.innerHeight != origHeight) history.go(0); }
}

// scripts for presenting a different featured sculpture for each day of the week
var fadeimages=new Array();
/*
fadeimages[0]="common/images/m_unicorn.jpg";
fadeimages[1]="common/images/m_birth_of_venus.jpg";
fadeimages[2]="common/images/m_nesting.jpg";
fadeimages[3]="common/images/m_phoenix.jpg";
fadeimages[4]="common/images/m_lioness.jpg";
fadeimages[5]="common/images/m_light.jpg";
fadeimages[6]="common/images/m_expulsion_from_eden.jpg";
fadeimages[7]="common/images/m_harp_spirit.jpg";
fadeimages[8]="common/images/m_medusa.jpg";
*/
fadeimages[0]="common/images/m_unicorn.jpg";
fadeimages[1]="common/images/m_birth_of_venus.jpg";
fadeimages[2]="common/images/m_unicorn.jpg";
fadeimages[3]="common/images/m_birth_of_venus.jpg";
fadeimages[4]="common/images/m_unicorn.jpg";
fadeimages[5]="common/images/m_birth_of_venus.jpg";
fadeimages[6]="common/images/m_unicorn.jpg";
fadeimages[7]="common/images/m_birth_of_venus.jpg";
fadeimages[8]="common/images/m_unicorn.jpg";

function swap(id) {
var src=document.getElementById(id).src;
if (src.charAt(src.length-5) == "1") {
src=src.replace("1.gif","2.gif");
} else {
src=src.replace("2.gif","1.gif");
}
document.getElementById(id).src=src;
}

function printDisplayTag() {
// initialize defaults
var imageToDisplay= "common/images/m_unicorn.jpg";
var pageRef="<a href=&#034;../../pages/unicorn.php>";
var day="0";

// find what day of the week it is
dm=new Date();
day= "" + dm.getDay();

// set image tag parameters for day of the week
/*
switch(parseInt(day)) {
case 0:
imageToDisplay=fadeimages[0];
pageRef="<a href=&#034;../../pages/unicorn.php>";
break;case 1:
imageToDisplay=fadeimages[1];
pageRef="<a href=&#034;../../pages/birth_of_venus.php>";
break;case 2:
imageToDisplay=fadeimages[2];
pageRef="<a href=&#034;../../pages/nesting.php>";
break;case 3:
imageToDisplay=fadeimages[3];
pageRef="<a href=&#034;../../pages/phoenix.php>";
break;case 4:
imageToDisplay=fadeimages[4];
pageRef="<a href=&#034;../../pages/lioness.php>";
break;case 5:
imageToDisplay=fadeimages[5];
pageRef="<a href=&#034;../../pages/light.php>";
break;case 6:
imageToDisplay=fadeimages[6];
pageRef="<a href=&#034;../../pages/expulsion_from_eden.php>";
break;case 7:
imageToDisplay=fadeimages[7];
pageRef="<a href=&#034;../../pages/harp_spirit.php>";
break;case 8:
imageToDisplay=fadeimages[8];
pageRef="<a href=&#034;../../pages/medusa.php>";
break;}
*/
switch(parseInt(day)) {
case 0:
imageToDisplay=fadeimages[0];
pageRef="<a href=&#034;../../pages/unicorn.php>";
break;case 1:
imageToDisplay=fadeimages[1];
pageRef="<a href=&#034;../../pages/birth_of_venus.php>";
break;case 2:
imageToDisplay=fadeimages[2];
pageRef="<a href=&#034;../../pages/unicorn.php>";
break;case 3:
imageToDisplay=fadeimages[3];
pageRef="<a href=&#034;../../pages/birth_of_venus.php>";
break;case 4:
imageToDisplay=fadeimages[4];
pageRef="<a href=&#034;../../pages/unicorn.php>";
break;case 5:
imageToDisplay=fadeimages[5];
pageRef="<a href=&#034;../../pages/birth_of_venus.php>";
break;case 6:
imageToDisplay=fadeimages[6];
pageRef="<a href=&#034;../../pages/unicorn.php>";
break;case 7:
imageToDisplay=fadeimages[7];
pageRef="<a href=&#034;../../pages/birth_of_venus.php>";
break;case 8:
imageToDisplay=fadeimages[8];
pageRef="<a href=&#034;../../pages/unicorn.php>";
break;}

// write linked image tag
document.write(pageRef + "<img name='displayImage' border='0' src='" + imageToDisplay + "' alt='Featured Sculpture of the Day' style='position: absolute; top: 61px; left: 222px;  padding: 0px; margin: 0px; z-index: 2;'/></a>");
}
