// Simple clean version of the same old thing
function ImagePreload (img)
{
	var a=new Image();
	a.src=img;
	return a;
}

if(pathHtm)
{
    offPath = pathHtm + 'images/nav/off/';
    onPath = pathHtm + 'images/nav/on/';
	homeOff = ImagePreload(offPath + 'home.gif');
	homeOn = ImagePreload(onPath + 'home.gif');
	printsOff = ImagePreload(offPath + 'prints.gif');
	printsOn = ImagePreload(onPath + 'prints.gif');
	aboutOff = ImagePreload(offPath + 'about.gif');
	aboutOn = ImagePreload(onPath + 'about.gif');
	galleryOff = ImagePreload(offPath + 'gallery.gif');
	galleryOn = ImagePreload(onPath + 'gallery.gif');	
	guestBookOff = ImagePreload(offPath + 'guestbook.gif');
	guestBookOn = ImagePreload(onPath + 'guestbook.gif');
	otherWorkOff = ImagePreload(offPath + 'otherwork.gif');
	otherWorkOn = ImagePreload(onPath + 'otherwork.gif');
	contactOff = ImagePreload(offPath + 'contact.gif');
	contactOn = ImagePreload(onPath + 'contact.gif');
	linksOff = ImagePreload(offPath + 'links.gif');
	linksOn = ImagePreload(onPath + 'links.gif');
}

function launch(newURL, newName, newFeatures, orgName) 
{
	var remote = open(newURL, newName, newFeatures);

	if (remote.opener == null){
		remote.opener = window; }

	remote.opener.name = orgName;
	return remote;
} 

function launchPage(page)
{
	NewPage = launch(page, "NewPage", "height=600,width=800,toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1", "body");
}

function launchWWP() 
{
	WWP = launch("http://geoimages.berkeley.edu/wwp/index.html", "WWP", "height=600,width=800,toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1", "body");
}

function launchIAPP() 
{
	IAPP = launch("http://www.panoramicassociation.org", "IAPP", "height=600,width=800,toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1", "body");
}

function launchImg(pathHtm, id)
{
	ImgPage = launch(pathHtm + "imagepopup.php?p_id=" + id + "", "Image", "height=600,width=800,toolbar=0,scrollbars=1,location=1,statusbar=0,menubar=0,resizable=0", "body");
}

function launchPoster(pathHtm,poster)
{
	ImgPage = launch(pathHtm + "posterpopup.php?poster=" + poster + "", "Image", "height=210,width=620,toolbar=0,scrollbars=1,location=1,statusbar=0,menubar=0,resizable=0", "body");
}

function loadValues(item, price)
{
	document.getElementById('item_name').value = "";
	document.getElementById('amount').value = "";
	document.getElementById('item_name').value = item;
	document.getElementById('amount').value = price;
}

function ResetSearchValues(obj)
{
    if(obj.name != "categoryId")
    {
        document._searchform.categoryId.selectedIndex=0;
    }

    if(obj.name != "prodcategoryId")
    {
        document._searchform.prodcategoryId.selectedIndex=0;
    }

    if(obj.name != "search")
    {
       document._searchform.search.value = ""; 
    }
}

document.captureEvents(Event.KEYDOWN);
document.onkeydown = 
    function catchEnter(event){
        if(event.keyCode == 13)
        {
            if(document._searchform)
            {
                KeywordSearch(document._searchform.search.value);
            }
        }
    }
