function cms_get_cms_top()
{
  var handle = window.open('', 'tempwindow'+cms_xsessionid);
  if (handle && !handle.closed)
	 return handle; //handle.location.reload(true);
  else
	return null;
}


function cms_OpenWindow(url, width, height)
{ 
    if ( !width ) { width=750; }
    if ( !height ) { height=600; }
    winvar = open(url,"","width="+width+",height="+height+",toolbar=yes,location=no,resizable=yes,scrollbars=yes");
    return;
}
function cms_select_language( page_url,query, width, height )
{ 
	cms_OpenWindow('/cgnum/select_language/?'+query+'&page_url='+escape(page_url), width, height)
}


function cms_image_delete( val, attribute, img_name )
{  
 document.editMessageForm["U"+val+"_"+attribute].value="";
 document.images["IMAGE"+img_name].src="/cgnum/_images/allgemein/transpix.gif";
}

function cms_auto_image_delete( val, attribute, img_name )
{  
 document.editMessageForm["U"+val+"_"+attribute].value="";
 document.editMessageForm["display_"+val+"_"+attribute].value="";
 document.images["IMAGE"+img_name].src="/cgnum/_images/allgemein/transpix.gif";
 SetClass(attribute,'cms_el_hidden');
}

function cms_TempWindow(url)
{
  var handle_cms_top=cms_get_cms_top();
  handle_cms_top.parent.cms_set_view_and_edit_window(this);
  handle_cms_top.location=url;
  return;
}
function cms_focus_content(uriid, version)
{
  var handle_cms_top=cms_get_cms_top();
  handle_cms_top.parent.cms_set_view_and_edit_window(this);
  handle_cms_top.parent.unset_current_viewandedit();
  handle_cms_top.parent.parent.cms_content.location='/cgnum/manage/?xsessionid='+cms_xsessionid+'&parentid='+uriid+'&version='+version;
  handle_cms_top.parent.parent.cms_content.focus();
}

function cms_form_set_value( name, val )
{
  document.editMessageForm[name].value=val;
}

function cms_linkform_set_value( name, val )
{
  document.editMessageFormLink[name].value=val;
}

function cms_set_top( get_string, uriid, uri, cms_lan, acllist )
{
  var top_host='';
  try {
  if (parent.cms_top && parent.cms_top.set_uri)
    parent.cms_top.set_uri( uriid,uri,0,'view');
 } catch(e) {

 }

  try { 
    top_host=top.cms_top.location.host;

    if (top.cms_top.current_acl!=acllist || top.cms_top.current_cms_lan!=cms_lan ) {
      top.cms_top.location='/cgnum/top/?'+get_string+'&uriid='+uriid+'&uri='+uri+'&tab=view&cms_lan='+cms_lan;
    }
  } catch (e)
  { try { 
      top.cms_top.location='/cgnum/top/?'+get_string+'&uriid='+uriid+'&uri='+uri+'&tab=view';
    } catch (e) {}
  }
}







