// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

function showLoad()
{
    Effect.Appear('activity')
}

function showPreview(originalRequest)
{
    var retObj = eval(originalRequest.responseText)
    
    Element.setStyle('activity', { display: 'none' })
    Element.setStyle('preview_container', { background: 'url(images/generated/' + retObj['filename'] + ') no-repeat',
                                            height: retObj["height"] + 'px',
                                            width: retObj["width"] + 'px'})
                                            
    $('order_template').value = retObj["template"]
    $('order_line1').value = retObj["line1"]
    $('order_line2').value = retObj["line2"]
    $('order_filename').value = retObj["filename"]
}

function swapTab(id){
  $$('.tab_content').invoke('hide');
  $(id).show();
}