openWin = function(url,name,width,height,xpos,ypos,chrome,scroll,resizable){
  var x, y, w, h, moveX=0, moveY=0, features="";
  chrome = chrome ? "yes" : "no";
  scroll = scroll ? "yes" : "no";
  resizable = resizable ? "yes" : "no";
  features += "toolbar="+chrome+",location="+chrome+",status="+chrome+",menubar="+chrome;
  features += ",scrollbars="+scroll+",resizable="+resizable;
  if(width) features += ",width="+width;
  if(height) features += ",height="+height;
  if(xpos && window.screen){
    w = window.screen.availWidth;
    width = parseInt(width);
    switch(xpos){
      case "left": x = 0; break;
      case "center": x = (w-width)/2; break;
      case "center2": x = ((w-width)/2)+30; break;
      case "center3": x = ((w-width)/2)-30; break;
      case "center4": x = ((w-width)/2)+20; break;
      case "right": x = w-width; break;
      default: x = xpos;
    }
    features += ",screenX="+x+",left="+x;
    var moveX = x;
  }
  if(ypos && window.screen){
    h = window.screen.availHeight;
    height = parseInt(height);
    switch(ypos){
      case "top": y = 0; break;
      case "middle": y = (h-height)/2; break;
      case "middle2": y = ((h-height)/2)-30; break;
      case "middle3": y = ((h-height)/2)+30; break;
      case "middle4": y = ((h-height)/2)-20; break;
      case "bottom": y = h-height; break;
      default: y = ypos;
    }
    features += ",screenY="+y+",top="+y;
    var moveY = y;
  }
  features +=",left="+moveX+",top="+moveY;
  eval("openWinReference = window.open(url, name, features);");  
  openWinReference.focus();
}
function redirect404(){
		document.form1.action="underconstruction.php";
		document.form1.submit();
};

function writeObject(str){
	document.write(str);
};

function openCatalog(URL){
//openWin(URL,"popCatalog",150,150,"center","middle",false,"");
//window.open(URL, 'popCatalog','width=150,height=150,resizable=no,scrollbars=no');
};

function openCatalogPage(URL){
openWin(URL,"Catalog",800,576,"center","middle",false,"");
window.close();
}
function openNotice(URL){
openWin(URL,"Catalog2",400,300,"center3","middle3",false,"");
}
function openNotice2(URL){
openWin(URL,"Catalog",400,300,"center2","middle2",false,"");
}
function openNotice3(URL){
openWin(URL,"Catalog3",400,300,"center","middle",false,"");
}
function openNotice4(URL){
openWin(URL,"Catalog4",400,350,"center4","middle4",false,"");
}


