// JavaScript Document

function get_modal_window_size_popup(id, json,width,height)
{
	
	if(width == null || width == undefined)
	{
		width = 400;
		
	}
	
	if(height == null || height == undefined)
	{
		height = 500;
		
	}
	
  if(id != null && id != undefined)
  {    
    try 
    {
      if(json != null && json != undefined)
      {
        Event.observe(window, 'load', function(){
          ctrlmodal = new Control.Modal(id, 
                        {opacity: 0.4, position: 'absolute', width: width, height: height, afterOpen: function(){initialize('largemap', json);}});
        });
      }
      else
      {
        // , afterOpen: function(){send_async_postback(id, locationid);}
        Event.observe(window, 'load', function(){
          ctrlmodal = new Control.Modal(id, {opacity: 0.4, position: 'absolute', width: width, height: height});
        
        });
      }
     
    } 
    catch (e)  
    { 
      alert('RJS error:\n\n' + e.toString()); alert('Event.observe(window,\'load\',function() {\nnew Control.Modal(\"' + id + '\", {});\n});'); 
      throw e 
    }
  }
  
  return false;
}

function close_modal_window()
{
  try 
  {
    Control.Modal.close();
  }
  catch (e) 
  {     
    throw e 
  }
  
  return false;  
}
function register(e)
{
	if (!e) e = window.event;
	if (e.keyCode == 46)
	{
		
		
		remove_selected();
		
	}
}
function delete_event()
{
	
		 window.onload = function() {
		 document.onkeydown = register;	
		 document.onkeyup = register;
		 }
		 
}
function wait_on()
{
	document.getElementById('progress_send').style.display = 'inline';
}

function popup(f_url , f_title , w,h) {
  l_x = screen.availWidth/2 - w/2;
  l_y = screen.availHeight/2 - h/2;
  var popupWindow = window.open(
    f_url ,f_title, "scrollbars=yes,"+ 'width='+ w +',height='+ h + ',left='+ l_x +',top='+ l_y+ ',screenX=' + l_x+ ',screenY=' + l_y);
  //popupWindow.focus();
  //popupWindow.setTimeout("window.print()",1000);
  return false;
}
