function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function $(v) { return(document.getElementById(v)); }
function $S(v) { return($(v).style); }
function $Tag(v) { return(document.getElementsByTagName(v)); }

function setPopupClose() {
    $('galleryPopupBG').onclick=function(){ closePopup() };
}
function closePopup() {
    $S('galleryPopupBG').display='none';
    $S('galleryPopupBOX').display='none';
    $S('orderFormBox').display='none';
    $Tag('body')[0].style.overflow = "visible";
    $('galleryPopupBG').onclick=function(){};
    $Tag('body')[0].style.backgroundColor = "#FFFFFF";
    
    //$('orderForm').innerHTML = '';	
}
function popupBOX(id) {
    setTimeout('setPopupClose()',100);
    $S('galleryPopupBG').display='block';
    $S('galleryPopupBOX').display='block';
    $S(id).display='block';
    $Tag('body')[0].style.backgroundColor = "#000000";
}

//popUp that div start
var amID = "blank";
function showMe(containerId){
	if(amID != "blank" ){
		hideMe(amID);
	}
	if(amID != containerId){
	    amID = containerId;
	    showContainer(containerId);
	}else{
        amID = "blank";
    }
}
function showContainer(containerId){
	obj = MM_findObj(containerId);
	if (!obj) return;
	obj.style.display = 'block';
}
function hideMe(containerId){
	obj2 = MM_findObj(containerId)
	if (!obj2) return;
	obj2.style.display = 'none';
}
//popUp that div end