

function getalign(al) {
  var n=parseFloat(al);

  if (n>=1 && n<2) return("Белое братство");
  if (n>=2 && n<3) return("Хаос");
  if (n>=3 && n<4) return("Темное братство");
  if (n>=7 && n<8) return("Нейтральное братство");
  if (n>=50 && n<51) return("Алхимик");
  return("");
}

function getalignurl(al) {
  var n=parseFloat(al);
  if (n==50) return "http://capitalcity.combats.com/encicl/alchemist.html";
  return "http://capitalcity.combats.com/encicl/alignment.html";
}




function openMinWnd(url,name,width,height,returnwindow) {
var options = "width=" + width + ",height=" + height + ",toolbar=no,location=yes,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no";
	if(url.indexOf("?")!=-1) { url= url+"&rnd="+Math.random();}
	else { url= url+"?rnd="+Math.random();}
	name=name+''+parseInt(Math.random()*100000);
	var new_window = window.open(url, name, options);
	window.self.name = "main";
	new_window.focus();
	if (returnwindow != null) {
	   return new_window;
	}
}


blinkingblocks=new Array();
blinkingblocks_state=0;
blinkingblocks_use=0;


function blinkblockstick() {
	if(blinkingblocks.length==0) return;
	for(i in blinkingblocks){
		if(blinkingblocks_state==0)
			blinkingblocks[i][0].style.backgroundColor=blinkingblocks[i][1];
		else 
			blinkingblocks[i][0].style.backgroundColor=blinkingblocks[i][2];
	}
	blinkingblocks_state= (blinkingblocks_state==0) ? 1 : 0 ;
}

function addblinkblock(obj, bgcolor1, bgcolor2) {
	i=blinkingblocks.length;
	blinkingblocks[i] = new Array();
	blinkingblocks[i][0]=obj;
	blinkingblocks[i][1]=bgcolor1;
	blinkingblocks[i][2]=bgcolor2;
	if(blinkingblocks_use==0) {
		blinkingblocks_use=1;
		setInterval("blinkblockstick()",500);
	}
}

function delblinkblock(obj) {
	if(blinkingblocks.length==0) return;
	for(i in blinkingblocks){
		if(blinkingblocks[i][0]==obj){
			blinkingblocks[i][0].style.backgroundColor=blinkingblocks[i][2];
			delete (blinkingblocks[i]);
			
		}
	}
}



function trim(str)
{	return str.replace(/(^\s+)|(\s+$)/g, "");
}



function htf(id,show){
	var showed = document.getElementById("shhd_"+id+"_show");
	var hided = document.getElementById("shhd_"+id);
	var hidedbody = document.getElementById("shhd_"+id+"_body");
	if(show){
		showed.style.display="none";
		hided.style.display="";
		if(hidedbody)
			hidedbody.style.display="";
	}else{
		showed.style.display="";
		hided.style.display="none";
		if(hidedbody)
			hidedbody.style.display="none";
	}
}


//
//Вызов загрузчика после инициализации страницы
//

var flagDocInit = false;
var onDocInit = false;

function onDocumentLoading() {
	if (!flagDocInit)
		setTimeout('onDocumentLoaded()', 10);
}

function onDocumentLoaded() {
	flagDocInit=true;
	if(onDocInit) onDocInit.call();
}

window.onload = onDocumentLoading;




//**********************************


expireDate = new Date;
expireDate.setMonth(expireDate.getMonth()+1);

// Create a cookie with the specified name and value.
function SetCookie(sName, sValue) {
	
	set_val= sName + "=" + escape(sValue) + ";expires=" + expireDate.toGMTString();
    document.cookie = set_val;
}


// Retrieve the value of the cookie with the specified name.
function GetCookie(sName) {
  var aCookie = document.cookie.split("; "); // cookies are separated by semicolons
  for (var i=0; i < aCookie.length; i++) {
    var aCrumb = aCookie[i].split("=");// a name/value pair (a crumb) is separated by an equal sign
    if (sName == aCrumb[0]) 
      return unescape(aCrumb[1]);
  }
  return null;  // a cookie with the requested name does not exist
}


// Delete the cookie with the specified name.
function DelCookie(sName) {
  document.cookie = sName + "=1; expires=Fri, 31 Dec 1999 23:59:59 GMT;";
}





//****************************************


function serialize(value){
	if(typeof(value)=='undefined') return 'undefined';
	var NL = "\r\n", TAB = "\t", out = new Array(), facttype;
	
	if (value instanceof Array) facttype = "array";		//"array";
	else if (value instanceof RegExp) facttype = "regexp";
	else if (value instanceof Function) facttype = "function";
	else if (value instanceof Object) facttype = "object";
	else facttype = typeof(value);
	
	switch(facttype){
		case "array":
			  var real_array = true;
			  //for (var i=0;i<value.length;i++)
			  for (var i in value){
			  	out.push(serialize(value[i]));
			  	if(isNaN(parseInt(i))){//не чистый массив
			  		real_array=false;
			  		break;
			  	}
			  }
			  if(real_array)  return "["+(NL+out.join(","+NL)).replace(/\n/g,"\n"+TAB)+NL+"]";
			  //проваливаемся до объекта
			  out = new Array();
		case "object":
			  for (var i in value)
			  	out.push(serialize(i) + ": " + serialize(value[i]));
			  return "{"+(NL+out.join(","+NL)).replace(/\n/g,"\n"+TAB)+NL+"}";	  
		case "string":
			  var r1 = [/\t/g, /\r/g, /\n/g, /"/g, /\\/g ];
			  var r2 = ["\\t", "\\r", "\\n", "\\\"","\\\\"];
			  while (r1.length) value = value.replace(r1.pop(),r2.pop());
			  return '"' + value +'"';
		default:
		  return value.toString().replace(/\n/g,"\n"+TAB);
	}
}





//****************************************


//document.write("<img class=pauseblock id=pauseblock src='http://services.ritterclan.org/services/css/malta/img/close.gif'>");
document.write("<span onkeydown='_msgBoxKey(event);'><table  class=msgbox id=msgbox><tr><td class=msgbox_title style='width:100%;'><div id=msgbox_title></div></td><td  class=msgbox_title style='width:1px;'><img src='http://services.ritterclan.org/services/css/malta/img/close.gif' onclick='_msgBoxClose();'></td></tr><tr><td colspan=2 class=msgbox_text id=msgbox_text></td></tr><tr><td colspan=2 class=msgbox_buttons id=msgbox_buttons></td></tr></table></span>");
document.write("<div id='pauseblock'></div>");
var msgbox=top.document.getElementById('msgbox');
var msgbox_title=top.document.getElementById('msgbox_title');
var msgbox_text=top.document.getElementById('msgbox_text');
var msgbox_buttons=top.document.getElementById('msgbox_buttons');
var msgbox_result='';
var msgbox_return_function='';
var pauseblock=top.document.getElementById('pauseblock');
var msgbox_move_flag=false;
var first_button='';

function msgBox(title, text,  buttons, top, left, width, height){
	var index, buttons_html='';
	msgbox_result='';
	msgbox_move_flag=false
	
	msgbox_title.innerHTML=title;
	msgbox_text.innerHTML=text;
	if(!buttons) buttons=['OK'];
	first_button='';
	var btn_cnt=0;
	for(index in buttons){
		if(first_button=='') first_button=buttons[index];
		buttons_html+="<input type=button value='"+buttons[index]+"' id=msgbox_btn_"+btn_cnt+" onclick='_msgBoxClick(this);'>"
	}
	msgbox_buttons.innerHTML=buttons_html;
	if(!isNaN(parseInt(top))) msgbox.style.top=parseInt(top)+'px';
	else msgbox.style.top=(document.body.clientHeight/2-msgbox.clientHeight/2+document.body.scrollTop)+'px';
	if(!isNaN(parseInt(left))) msgbox.style.left=parseInt(left)+'px';
	else msgbox.style.left=(document.body.clientWidth/2-msgbox.clientWidth/2+document.body.scrollLeft)+'px';
	if(!isNaN(parseInt(width))) msgbox.style.width=parseInt(width)+'px';
	if(!isNaN(parseInt(height))) msgbox.style.height=parseInt(height)+'px';
	//
	var btns=msgbox_buttons.getElementsByTagName('input');
	for(index=0; index<btns.length; index++){
		if(btns[index].type=='button' && btns[index].clientWidth<75) btns[index].style.width='75px';
	}
	showPauseBlock(998);
	msgbox.style.visibility='visible';
	var def_btn=document.getElementById('msgbox_btn_0');
	if(def_btn)
		def_btn.focus();
}

function msgBoxResult(){
	if(msgbox_result=='') return false;
	else return msgbox_result;
}

function msgBoxSetReturnFunction(func){
	msgbox_return_function=func;
}

function _msgBoxClick(aThis){
	msgbox.style.visibility='hidden';
	hidePauseBlock();
	msgbox_result=aThis.value;
	if(msgbox_return_function!='') {
		if(window.execScript)	window.execScript(msgbox_return_function+"('"+msgbox_result+"')");
		else window.eval(msgbox_return_function+"('"+msgbox_result+"')");
		msgbox_return_function='';
	}
	return false;
}

function _msgBoxClose(defValue){
	msgbox.style.visibility='hidden';
	hidePauseBlock();
	if(defValue) msgbox_result=defValue;
	else msgbox_result="Отмена";
	if(msgbox_return_function!='') {
		if(window.execScript)	window.execScript(msgbox_return_function+"('"+msgbox_result+"')");
		else window.eval(msgbox_return_function+"('"+msgbox_result+"')");
		msgbox_return_function='';
	}
}


function _msgBoxKey(e){
	switch(e.keyCode){
		case 13://Enter
			var val='OK2';
			if(first_button!='') val=first_button;
			_msgBoxClose(val);
			break;
		case 27://Esc
			_msgBoxClose();
			break;
	}
	//alert(e.keyCode)
}



var msgbox_move_delta_x;
var msgbox_move_delta_y;
function _msgBoxStartMove(aEvent){
	//alert(aEvent.x+' - '+parseInt(msgbox.style.top)+' - '+aEvent.y+' - '+msgbox.clientLeft);
	msgbox_move_flag=true;
	msgbox_move_delta_x=aEvent.x-parseInt(msgbox.style.left);
	msgbox_move_delta_y=aEvent.y-parseInt(msgbox.style.top);
	
	//if(window.captureEvents) window.captureEvents(aEvent.MOUSEMOVE); 
	window.onmousemove= _msgBoxMove; 
	xxx.innerHTML+='_Start<br>';
}
function _msgBoxMove(aEvent){
	if(!msgbox_move_flag) return;
	msgbox.style.left=(aEvent.x-msgbox_move_delta_x)+'px';
	msgbox.style.top=(aEvent.y-msgbox_move_delta_y)+'px';
	xxx.innerHTML+='_msgBoxMove<br>';
}
function _msgBoxEndMove(aEvent){
	msgbox_move_flag=false;
	if(window.releaseEvents) window.releaseEvents(aEvent.MOUSEMOVE);
	xxx.innerHTML+='_End<br>';
}


function showPauseBlock(zindex){
	if(!pauseblock) return;
	//if(document.layers) return;
	pauseblock.style.display = "block";
	pauseblock.style.width = document.getElementsByTagName("body")[0].scrollWidth+"px";
	pauseblock.style.height = document.getElementsByTagName("body")[0].scrollHeight+"px";
	//if(zindex) pauseblock.style.zIndex=zindex;
	//pauseblock.style.visibility='visible';
}
function hidePauseBlock(){
	if(!pauseblock) return;
	pauseblock.style.display = "none";
}



//********************************************************************





document.write('<div align="left" id="std_tooltip_div" style="background-color:#FFFFCC; visibility:hidden; z-index: 100; overflow:visible; position:absolute; border-color:#666666; border-style:solid; border-width: 1px; padding: 2px;"></div>');


function std_tooltip_show(_event, _content) {
	if(trim(_content)=='') return;
	var d=document;
	var el=document.getElementById('std_tooltip_div');
	var we= _event;
    var o = _event.target ? _event.target : _event.srcElement;
	var oo = o;
	var rx = we.clientX;
	var ry = we.clientY;

	if(window.frameElement) {
			rx += window.frameElement.offsetLeft;
			ry += window.frameElement.offsetTop;
			//alert("frameElement "+window.frameElement.offsetTop);
	}else if(o.ownerDocument && o.ownerDocument.parentWindow && o.ownerDocument.parentWindow.frameElement){
			x();
			rx += o.ownerDocument.parentWindow.frameElement.style.pixelLeft;
			ry += o.ownerDocument.parentWindow.frameElement.style.pixelTop;
			//alert("ownerDocument "+o.ownerDocument.parentWindow.frameElement.style.pixelTop);
	}else{
			rx += o.ownerDocument.body.scrollLeft;
			ry += o.ownerDocument.body.scrollTop;
			//alert("else "+o.ownerDocument.body.scrollTop);
	}
	//alert(rx+'-'+ry);
    if (el.style.visibility != "visible") {
    	el.innerHTML = '<small>'+_content+'</small>';
	    el.style.width='auto';
	}
   if(el.clientWidth >400) {el.style.width = 400; el.whiteSpace='';}
   // var x = rx + o.offsetWidth + 10;
    var x = rx + 30;
    var y = ry + 10;
    if (x + el.offsetWidth + 30 > d.body.clientWidth + d.body.scrollLeft) { x=(rx - el.offsetWidth - 30); if (x < 0) {x=0}; }
    if (y + el.offsetHeight + 30 > d.body.clientHeight  + d.body.scrollTop) { y=(d.body.clientHeight +  d.body.scrollTop - el.offsetHeight - 10); if (y < 0) {y=0}; }
    el.style.left = x + "px";
    el.style.top  = y + "px";
    if (el.style.visibility != "visible") {
            el.style.visibility = "visible";
    }   
}


function std_tooltip_hide() {
	el=document.getElementById('std_tooltip_div');
	el.style.visibility = 'hidden';
}



//
// Copyright (c) 2008 Paul Duncan (paul@pablotron.org)
// 
/**
 * Persist - top-level namespace for Persist library.
 */

Persist=(function(){var VERSION='0.1.0',P,B,esc,init,empty,ec;ec=(function(){var EPOCH='Thu, 01-Jan-1970 00:00:01 GMT',RATIO=1000*60*60*24,KEYS=['expires','path','domain'],esc=escape,un=unescape,doc=document,me;var get_now=function(){var r=new Date();r.setTime(r.getTime());return r;}
var cookify=function(c_key,c_val){var i,key,val,r=[],opt=(arguments.length>2)?arguments[2]:{};r.push(esc(c_key)+'='+esc(c_val));for(i=0;i<KEYS.length;i++){key=KEYS[i];if(val=opt[key])
r.push(key+'='+val);}
if(opt.secure)
r.push('secure');return r.join('; ');}
var alive=function(){var k='__EC_TEST__',v=new Date();v=v.toGMTString();this.set(k,v);this.enabled=(this.remove(k)==v);return this.enabled;}
me={set:function(key,val){var opt=(arguments.length>2)?arguments[2]:{},now=get_now(),expire_at,cfg={};if(opt.expires){opt.expires*=RATIO;cfg.expires=new Date(now.getTime()+opt.expires);cfg.expires=cfg.expires.toGMTString();}
var keys=['path','domain','secure'];for(i=0;i<keys.length;i++)
if(opt[keys[i]])
cfg[keys[i]]=opt[keys[i]];var r=cookify(key,val,cfg);doc.cookie=r;return val;},has:function(key){key=esc(key);var c=doc.cookie,ofs=c.indexOf(key+'='),len=ofs+key.length+1,sub=c.substring(0,key.length);return((!ofs&&key!=sub)||ofs<0)?false:true;},get:function(key){key=esc(key);var c=doc.cookie,ofs=c.indexOf(key+'='),len=ofs+key.length+1,sub=c.substring(0,key.length),end;if((!ofs&&key!=sub)||ofs<0)
return null;end=c.indexOf(';',len);if(end<0)
end=c.length;return un(c.substring(len,end));},remove:function(k){var r=me.get(k),opt={expires:EPOCH};doc.cookie=cookify(k,'',opt);return r;},keys:function(){var c=doc.cookie,ps=c.split('; '),i,p,r=[];for(i=0;i<ps.length;i++){p=ps[i].split('=');r.push(un(p[0]));}
return r;},all:function(){var c=doc.cookie,ps=c.split('; '),i,p,r=[];for(i=0;i<ps.length;i++){p=ps[i].split('=');r.push([un(p[0]),un(p[1])]);}
return r;},version:'0.2.1',enabled:false};me.enabled=alive.call(me);return me;}());empty=function(){};esc=function(str){return'PS'+str.replace(/_/g,'__').replace(/ /g,'_s');};C={search_order:['gears','localstorage','whatwg_db','globalstorage','flash','ie','cookie'],name_re:/^[a-z][a-z0-9_ -]+$/i,methods:['init','get','set','remove','load','save'],sql:{version:'1',create:"CREATE TABLE IF NOT EXISTS persist_data (k TEXT UNIQUE NOT NULL PRIMARY KEY, v TEXT NOT NULL)",get:"SELECT v FROM persist_data WHERE k = ?",set:"INSERT INTO persist_data(k, v) VALUES (?, ?)",remove:"DELETE FROM persist_data WHERE k = ?"},flash:{div_id:'_persist_flash_wrap',id:'_persist_flash',path:'persist.swf',size:{w:1,h:1},args:{autostart:true}}};B={gears:{size:-1,test:function(){return(window.google&&window.google.gears)?true:false;},methods:{transaction:function(fn){var db=this.db;db.execute('BEGIN').close();fn.call(this,db);db.execute('COMMIT').close();},init:function(){var db;db=this.db=google.gears.factory.create('beta.database');db.open(esc(this.name));db.execute(C.sql.create).close();},get:function(key,fn,scope){var r,sql=C.sql.get;if(!fn)
return;this.transaction(function(t){r=t.execute(sql,[key]);if(r.isValidRow())
fn.call(scope||this,true,r.field(0));else
fn.call(scope||this,false,null);r.close();});},set:function(key,val,fn,scope){var rm_sql=C.sql.remove,sql=C.sql.set,r;this.transaction(function(t){t.execute(rm_sql,[key]).close();t.execute(sql,[key,val]).close();if(fn)
fn.call(scope||this,true,val);});},remove:function(key,fn,scope){var get_sql=C.sql.get;sql=C.sql.remove,r,val;this.transaction(function(t){if(fn){r=t.execute(get_sql,[key]);if(r.isValidRow()){val=r.field(0);t.execute(sql,[key]).close();fn.call(scope||this,true,val);}else{fn.call(scope||this,false,null);}
r.close();}else{t.execute(sql,[key]).close();}});}}},whatwg_db:{size:200*1024,test:function(){var name='PersistJS Test',desc='Persistent database test.';if(!window.openDatabase)
return false;if(!window.openDatabase(name,C.sql.version,desc,B.whatwg_db.size))
return false;return true;},methods:{transaction:function(fn){if(!this.db_created){var sql=C.sql.create;this.db.transaction(function(t){t.executeSql(sql,[],function(){this.db_created=true;});},empty);}
this.db.transaction(fn);},init:function(){var desc,size;desc=this.o.about||"Persistent storage for "+this.name;size=this.o.size||B.whatwg_db.size;this.db=openDatabase(this.name,C.sql.version,desc,size);},get:function(key,fn,scope){var sql=C.sql.get;if(!fn)
return;scope=scope||this;this.transaction(function(t){t.executeSql(sql,[key],function(t,r){if(r.rows.length>0)
fn.call(scope,true,r.rows.item(0)['v']);else
fn.call(scope,false,null);});});},set:function(key,val,fn,scope){var rm_sql=C.sql.remove,sql=C.sql.set;this.transaction(function(t){t.executeSql(rm_sql,[key],function(){t.executeSql(sql,[key,val],function(t,r){if(fn)
fn.call(scope||this,true,val);});});});return val;},remove:function(key,fn,scope){var get_sql=C.sql.get;sql=C.sql.remove;this.transaction(function(t){if(fn){t.executeSql(get_sql,[key],function(t,r){if(r.rows.length>0){var val=r.rows.item(0)['v'];t.executeSql(sql,[key],function(t,r){fn.call(scope||this,true,val);});}else{fn.call(scope||this,false,null);}});}else{t.executeSql(sql,[key]);}});}}},globalstorage:{size:5*1024*1024,test:function(){return window.globalStorage?true:false;},methods:{key:function(key){return esc(this.name)+esc(key);},init:function(){this.store=globalStorage[this.o.domain];},get:function(key,fn,scope){key=this.key(key);if(fn)
fn.call(scope||this,true,this.store.getItem(key));},set:function(key,val,fn,scope){key=this.key(key);this.store.setItem(key,val);if(fn)
fn.call(scope||this,true,val);},remove:function(key,fn,scope){var val;key=this.key(key);val=this.store[key];this.store.removeItem(key);if(fn)
fn.call(scope||this,(val!==null),val);}}},localstorage:{size:-1,test:function(){return window.localStorage?true:false;},methods:{key:function(key){return esc(this.name)+esc(key);},init:function(){this.store=localStorage;},get:function(key,fn,scope){key=this.key(key);if(fn)
fn.call(scope||this,true,this.store.getItem(key));},set:function(key,val,fn,scope){key=this.key(key);this.store.setItem(key,val);if(fn)
fn.call(scope||this,true,val);},remove:function(key,fn,scope){var val;key=this.key(key);val=this.getItem(key);this.store.removeItem(key);if(fn)
fn.call(scope||this,(val!==null),val);}}},ie:{prefix:'_persist_data-',size:64*1024,test:function(){return window.ActiveXObject?true:false;},make_userdata:function(id){var el=document.createElement('div');el.id=id;el.style.display='none';el.addBehavior('#default#userData');document.body.appendChild(el);return el;},methods:{init:function(){var id=B.ie.prefix+esc(this.name);this.el=B.ie.make_userdata(id);if(this.o.defer)
this.load();},get:function(key,fn,scope){var val;key=esc(key);if(!this.o.defer)
this.load();val=this.el.getAttribute(key);if(fn)
fn.call(scope||this,val?true:false,val);},set:function(key,val,fn,scope){key=esc(key);this.el.setAttribute(key,val);if(!this.o.defer)
this.save();if(fn)
fn.call(scope||this,true,val);},load:function(){this.el.load(esc(this.name));},save:function(){this.el.save(esc(this.name));}}},cookie:{delim:':',size:4000,test:function(){return P.Cookie.enabled?true:false;},methods:{key:function(key){return this.name+B.cookie.delim+key;},get:function(key,val,fn,scope){key=this.key(key);val=ec.get(key);if(fn)
fn.call(scope||this,val!=null,val);},set:function(key,val,fn,scope){key=this.key(key);ec.set(key,val,this.o);if(fn)
fn.call(scope||this,true,val);},remove:function(key,val,fn,scope){var val;key=this.key(key);val=ec.remove(key)
if(fn)
fn.call(scope||this,val!=null,val);}}},flash:{test:function(){if(!window.SWFObject||!deconcept||!deconcept.SWFObjectUtil)
return false;var major=deconcept.SWFObjectUtil.getPlayerVersion().major;return(major>=8)?true:false;},methods:{init:function(){if(!B.flash.el){var o,key,el,cfg=C.flash;el=document.createElement('div');el.id=cfg.div_id;document.body.appendChild(el);o=new SWFObject(this.o.swf_path||cfg.path,cfg.id,cfg.size.w,cfg.size.h,'8');for(key in cfg.args)
o.addVariable(key,cfg.args[key]);o.write(el);B.flash.el=document.getElementById(cfg.id);}
this.el=B.flash.el;},get:function(key,fn,scope){var val;key=esc(key);val=this.el.get(this.name,key);if(fn)
fn.call(scope||this,val!==null,val);},set:function(key,val,fn,scope){var old_val;key=esc(key);old_val=this.el.set(this.name,key,val);if(fn)
fn.call(scope||this,true,val);},remove:function(key,fn,scope){var val;key=esc(key);val=this.el.remove(this.name,key);if(fn)
fn.call(scope||this,true,val);}}}};var init=function(){var i,l,b,key,fns=C.methods,keys=C.search_order;for(i=0,l=fns.length;i<l;i++)
P.Store.prototype[fns[i]]=empty;P.type=null;P.size=-1;for(i=0,l=keys.length;!P.type&&i<l;i++){b=B[keys[i]];if(b.test()){P.type=keys[i];P.size=b.size;for(key in b.methods)
P.Store.prototype[key]=b.methods[key];}}
P._init=true;};P={VERSION:VERSION,type:null,size:0,add:function(o){B[o.id]=o;C.search_order=[o.id].concat(C.search_order);init();},remove:function(id){var ofs=C.search_order.indexOf(id);if(ofs<0)
return;C.search_order.splice(ofs,1);delete B[id];init();},Cookie:ec,Store:function(name,o){if(!C.name_re.exec(name))
throw new Error("Invalid name");if(!P.type)
throw new Error("No suitable storage found");o=o||{};this.name=name;o.domain=o.domain||location.hostname||'localhost.localdomain';this.o=o;o.expires=o.expires||365*2;o.path=o.path||'/';this.init();}};init();return P;})();

//----------

var globalRitterStore = new Persist.Store('RitterStore');
var globalRitterStoreName='RitterStore';
var globalReturnValue=null;

//save not only string
function globalRitterInit(section){
	if( globalRitterStoreName == ('Ritter'+section) ) return globalRitterStore;//уже
	globalRitterStore = new Persist.Store('Ritter'+section);
	globalRitterStoreName='Ritter'+section;
	return globalRitterStore;
}

function globalRitterSave(name, value){
	if(!globalRitterStore) return;
	globalRitterStore.set(name, serialize(value));
}

function globalRitterLoad(name){
	if(!globalRitterStore) return null;
	globalReturnValue=null;
	globalRitterStore.get(name, function(ok, val) {
				  //alert(val)	
				  if (ok){
				    if(window.execScript)	window.execScript('globalReturnValue='+val);
					else window.eval('globalReturnValue='+val);
				  }
				});
	return globalReturnValue;
}
