// JavaScript Document
var DHTML = (document.getElementById || document.all || document.layers);

var NNswitch = -1;

function objExists(name) {
  if ((document.getElementById) && (document.getElementById(name))) {
	return true;
  } else if ((document.all) && (document.all[name])) {
	return true;
  } else if ((document.layers) && (document.layers[name])) {
	return true;
  } else
  	return false;
}

function hidestyle(whichid) {
	if (!DHTML) return;
	mainobject = new getObj(whichid);
	mainobject.style.display='none';
}

function showstyle(whichid) {
	if (!DHTML) return;
	mainobject = new getObj(whichid);
	mainobject.style.display='';
}


function ImageOff(whichid) {
	if (!DHTML) return;
	imagesrc = document.images[whichid].src;
	document.images[whichid].src = imagePath + "roundButtonClosed.gif";
}


function ImageOn(whichid) {
	if (!DHTML) return;
	imagesrc = document.images[whichid].src;
	document.images[whichid].src = imagePath + "roundButtonOpen.gif";
}

function getObj(name) {
  if (document.getElementById) {
  		this.obj = document.getElementById(name);
		this.style = document.getElementById(name).style;
  } else if (document.all) {
		this.obj = document.all[name];
		this.style = document.all[name].style;
  } else if (document.layers) {
   		this.obj = document.layers[name];
   		this.style = document.layers[name];
  }
}


function showOne(detailId) {
	if (!DHTML) return;
	showobject = new getObj(detailId);
	objectnamearray = new Array("A01", "A02", "A03", "A04", "A05", "A06", "A07", "A08", "A09", "A10");
	for (var i=0; i<objectnamearray.length; i++){
				if (objExists(objectnamearray[i]+'_detail')) {
					hidestyle(objectnamearray[i]+"_detail");
//					ImageOff(objectnamearray[i] + "_image");
				}
		}

	showobject.style.display='';
	if( typeof( window.innerWidth ) == 'number' ) {
		newW = window.outerWidth+NNswitch;
		newH = window.outerHeight;
		window.resizeTo(newW,newH);
		NNswitch = NNswitch * -1;
	};
//	var uidx = detailId.indexOf('_');
//	imgID = detailId.substring(0,uidx)+"_image";
//	ImageOn(imgID);
}


function showAll() {
	if (!DHTML) return;
	objectnamearray = new Array("A01", "A02", "A03", "A04", "A05", "A06", "A07", "A08", "A09", "A10");
	for (var i=0; i<objectnamearray.length; i++){
				if (objExists(objectnamearray[i]+'_detail')) {
					showstyle(objectnamearray[i]+"_detail");
//					ImageOn(objectnamearray[i] + "_image");
				}
		}
	if( typeof( window.innerWidth ) == 'number' ) {
		newW = window.outerWidth+NNswitch;
		newH = window.outerHeight;
		window.resizeTo(newW,newH);
		NNswitch = NNswitch * -1;
	};
}

