// JavaScript Document

// standard page code
var browser = browserDetect();
MM_reloadPage(true);

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

function browserDetect(){
  if (navigator.appName.indexOf("Netscape")!=-1&&parseInt(navigator.appVersion)>=5){
	return "netscape";
  }else if (navigator.appName.indexOf("Microsoft")!=-1&&parseInt(navigator.appVersion)>=4){
	return "explorer";
  }else{
    return "rubbish";
  }
}

// Navigation roll over code - to be completed
function doROver(element){
	document.getElementById(element).style.backgroundColor = rollNav;
	document.getElementById(element).style.color='#570F46';
}

function doROut(element){
	document.getElementById(element).style.backgroundColor = defaultNav;
	document.getElementById(element).style.color='#FFFFFF';
}


// Inventory display code - fade in and out effect.
var the_timeout;
var target,targetout,ibj;

function doFade(t){
  target=document.getElementById(t);
  target.style.visibility='visible';
  the_timeout = setInterval("fadeIn(target)", 50);
}

function fadeIn(imageobject){
  switch(browser){
    case "netscape":
      if (imageobject.style.MozOpacity<0.9){
	    imageobject.style.MozOpacity+=0.9;
  	  }else{
		clearInterval(the_timeout);
      }
	break;
	case "explorer":
	  if (imageobject.filters.alpha.opacity<90){
		imageobject.filters.alpha.opacity+=10;
  	  }else{
		clearInterval(the_timeout);
	  }
	break;
	default: clearInterval(the_timeout);
  }
}

function fadeOut(imageobject){
	targetout=document.getElementById(imageobject);
    if(browser=="netscape")targetout.style.MozOpacity=0;
    if(browser=="explorer")targetout.filters.alpha.opacity=0;
    clearInterval(the_timeout);
    targetout.style.visibility='hidden';
}

//funiture packs display code
function changeMainDisplay(thumb){
	document.getElementById('largeimage').src = "../galleries/"+thumb;
}

//Disable right mouse click Script
//By Maximus (maximus@nsimail.com) w/ mods by DynamicDrive
//For full source code, visit http://www.dynamicdrive.com

var message="Function Disabled!";

///////////////////////////////////
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("alert(message);return false")