<!--
function noErrMsg() {
     return true;
}

window.onerror = noErrMsg;

function browse()
{
  if(self.opener != null) {
       	self.opener.focus();
  }
}

function getCookie(Name) {
   var search = Name + "="
   if (document.cookie.length > 0) { // if there are any cookies
      offset = document.cookie.indexOf(search)
      if (offset != -1) { // if cookie exists
         offset += search.length
         // set index of beginning of value
         end = document.cookie.indexOf(";", offset)
         // set index of end of cookie value
         if (end == -1)
            end = document.cookie.length
         return unescape(document.cookie.substring(offset, end))
      }
   }
}

function open_nav() {
    navwin = window.open("","navwin","width=500,height=410,scrollbars=yes,toolbar=yes,status=yes,resizable=yes,location=yes");
    if(navwin.opener != null) {
	navwin.opener.focus();
     }
    return true;
}


function open_win(el1)
 {
  var hauteur = screen.height/1.3;
  var largeur = screen.width/1.4;
    if(navwindow == null) {
       navwindow = window.open(el1,'nav','top=0,left=0,width='+largeur+',height='+hauteur+',scrollbars=yes,toolbar=yes,status=yes,resizable=yes,location=yes');
     navwindow.focus();	
      return true;
     }
    if(navwindow.closed == true) {
       navwindow = window.open(el1,'nav','top=0,left=0,width='+largeur+',height='+hauteur+',scrollbars=yes,toolbar=yes,status=yes,resizable=yes,location=yes');
     navwindow.focus();	
      return true; } else {
        navwindow.location.href = el1;
     navwindow.focus();	
     }

 }
 
function  mail_win(path)
{
	path = '/control.php/email/' + path + '/';
	var hauteur = 400;
	var largeur = 570;
	if(nav_mail == null) 
	{
		nav_mail = window.open(path,'nav_mail','top=0,left=0,width='+largeur+',height='+hauteur+',scrollbars=no,toolbar=no,status=no,resizable=no,location=no');
		nav_mail.focus();	
//		return true;
	}
	if(nav_mail.closed == true) 
	{
		nav_mail = window.open(path,'nav_mail','top=0,left=0,width='+largeur+',height='+hauteur+',scrollbars=no,toolbar=no,status=no,resizable=no,location=no');
		nav_mail.focus();	
//		return true; 
	} 
	else 
	{
		nav_mail.location.href = path;
		nav_mail.focus();	
	}
}



var navwindow = null;
var nav_mail = null;
var editor = getCookie("editor");

var result;
var last_sel_xcid = "";
var cur_edited_menu_lang = 0;
function on_close_win()
{
	result = false;
}

function getCookieVal( offset )
{
    var endstr = document.cookie.indexOf (";", offset);

    if (endstr == -1)
        endstr = document.cookie.length;
    return unescape(document.cookie.substring(offset, endstr));
}


function getcookie (name)
{
    var arg  = name + "=";
    var alen = arg.length;
    var clen = document.cookie.length;
    var i    = 0;

    while (i < clen)
    {
        var j = i + alen;
        if (document.cookie.substring(i, j) == arg)
          return getCookieVal (j);
        i = document.cookie.indexOf(" ", i) + 1;
        if (i == 0) break;
    }
    return "";
}

var form_win;

function open_form_win(win_name, win_w, win_h)
{
	//alert("Begin");
	if (form_win) form_win.close();
	left_pos = (screen.width - (1*win_w))/2;
	top_pos = (screen.height - (1*win_h))/2;
	set_scrollbars = "no";
	win_add_w = 0;
	if(left_pos<40)
	{
		left_pos = 40;
		win_w = screen.width-80;
		set_scrollbars = "yes";
	}
	tt_win_w = 1*win_w;
	if(top_pos<40)
	{
		top_pos = 20;
		win_h = screen.height-80;
		if(set_scrollbars == "no") tt_win_w += 18;
		set_scrollbars = "yes";
	}
	form_win = open("", win_name,"width="+tt_win_w+",height="+win_h+",left="+left_pos+",top="+top_pos+",resizable=no,status=no,toolbar=no,menubar=no,scrollbars="+set_scrollbars);
	form_win.focus();
}


// -->
