//Changes color of the wallpaper
function changecolor(id) {
  new Ajax.Updater(
    id, '../controls/cpicker.php',
    {method: 'get', evalScripts:true });
}
//Loads the top mat window
function ontmat(id) {
/*  if(c_transfer>0)
  {
    getFrame().location = 'tab_not_available.php?name=Top Mat';
    return 0;
  }*/
  chelp = 'Mat';
  theMessage = 'tmat';
  new Ajax.Updater(
    id, '../controls/mat_manager.php',
    {evalScripts:true, parameters: 'mtype=topMat' });
}
//Loads the middle mat window
function onmmat(id) {
/*  if(c_transfer>0)
  {
    getFrame().location = 'tab_not_available.php?name=Middle Mat';
    return 0;
  }*/
  chelp = 'Mat';
  theMessage = 'mmat';
  new Ajax.Updater(
    id, '../controls/mat_manager.php',
    {evalScripts:true, parameters: 'mtype=middleMat' });
}
//Loads the bottom mat window
function onbmat(id) {
/*  if(c_transfer>0)
  {
    getFrame().location = 'tab_not_available.php?name=Bottom Mat';
    return 0;
  }*/
  chelp = 'Mat';
  theMessage = 'bmat';
  new Ajax.Updater(
    id, '../controls/mat_manager.php',
    {evalScripts:true, parameters: 'mtype=bottomMat' });
}
//Loads the crop window
function crop(id) {
  var myAjax = new Ajax.Updater(
    id, '../controls/crop_manager.php',
    {method: 'get', evalScripts:true });
}
function advanced_c(id) {
  var myAjax = new Ajax.Updater(
    id, '../controls/advanced_crop.php',
    {method: 'get', evalScripts:true });
}
function my_gallery(id) {
  var myAjax = new Ajax.Updater(
    id, '../controls/my_gallery.php',
    {method: 'get', evalScripts:true });
}
function order_now(id) {
  var myAjax = new Ajax.Updater(
    id, '../controls/order_now.php',
    {method: 'get', evalScripts:true });
}
function frame2image(id) {
  var myAjax = new Ajax.Updater(
    id, '../controls/frame2image.php',
    {method: 'get', evalScripts:true });
}
function cropping(id) {
  var myAjax = new Ajax.Updater(
    parentNode.id, '../controls/cropping.php',
    {method: 'get'});
}
function onsframing(id) {
  getFrame().location = 'suggested_tool.php';
}
//Loads the frame window
function onframe(id) {
 /* if(museum_wrap>0||gal_wrap>0)
  {
    getFrame().location = 'tab_not_available_wrap.php?name=Frame';
    return 0;
  }*/
  chelp = 'Frame';
  new Ajax.Updater(
    id, '../controls/moulding_manager.php',
    {evalScripts:true, parameters: 'type=frame' });
}
//Loads the liner window
function onliner(id) {
/*  if(museum_wrap>0||gal_wrap>0) {
    getFrame().location = 'tab_not_available_wrap.php?name=Liner';
    return 0;
  }*/
  chelp = 'Liner';
  new Ajax.Updater(
    id, '../controls/moulding_manager.php',
    {evalScripts:true, parameters: 'type=liner' });
}
//Loads the fillet window
function onfillet(id) {
/*  if(museum_wrap>0||gal_wrap>0) {
    getFrame().location = 'tab_not_available_wrap.php?name=Fillet';
    return 0;
  }*/
  chelp = 'Fillet';
  new Ajax.Updater(
    id, '../controls/moulding_manager.php',
    {evalScripts:true, parameters: 'type=fillet' });
}
function onstart(id) {
  getFrame().location = 'start_page.php';
  chelp = 'Start Option';
}
function txtOut(id) {
  getFrame().location = 'textout.php';
  chelp = 'Start Option';
}
//Loads the groove window
function ongroove(id) {
  new Ajax.Updater(
    id, '../controls/v_groove_manager.php',
    {method: 'get', evalScripts:true });
}
//Loads the glass panel
function onglass(id) {
//  if(c_transfer>0)getFrame().location = 'tab_not_available.php?name=Glass';
//  else
    new Ajax.Updater(
      id, '../controls/glass_manager.php',
      {evalScripts:true });
  chelp = 'Glass';
//  updateInfo();
}
//Loads the print report window
function onprintreport(id) {
  var p = window.open("report.php","report","width=400,height=520,top=" + (screen.height/2-280) + ",left=" + (screen.width/2-200));
  p.focus();
}

function onupload(id) {
  new Ajax.Updater(
    id, '../controls/upload_control.php',
    {evalScripts:true });
}

function showFramer(url,name) {
  if( screen.width > 800 && screen.height > 600 )
    framer=window.open(url, name,'width=800, height=600, scrollbars=yes');
  else
    framer=window.open(url, name,'fullscreen=yes, scrollbars=yes');
}

