/*	#########	Глобальные переменные	########	*/
var setHsb = '';
var $browser	= {};
var $cnf = {
	'flDebug': 1
	,'debug': 'destroy66'
	,'parentLev': 4
	,'noDrag': 0
	,'noCash': 1
	,'effects': {
		'grow': 1
		,'shrink': 1
	}
	,'uploadFileMaxSize': 1024000
	,'gist': {
		'dx': 2
		,'dy': 2
		,'cHSB': '89,4,4'
		,'sHSB': '89,4,4'
		,'chsb': '358,95,95'
		,'shsb': '358,95,95'
		,'hue': false
	}
	,'drag': {
		'mDown': 0
		,'iObj': null
		,'dObj': null
		,'ipar': { x: 0, y: 0 }
		,'cpar': { x: 0, y: 0 }
		,'activeID': null
		,'dragObj': null
		,'tEv': null
	}
	,'animate': {
		'Refr': 50
		,'vel': 1
		,'tmp': {}
	}

	,'sHelp': {
		'zTime': 500
		,'runCnt': 0
		,'vel': 1
		,'tmp': {}
	}
	,'sbArr': []
	,'hsArr': []
	,'favHash': {}
	,'uSess': null
	,'tStamp': null
	,'zStamp': null
	,'zdTime': 50
	,'HistoryLen': 8
	,'reconpage': 36
	,'tMin': 10
	,'resFunc': null
	,'lang': 'rus'
	,'nsc': 0
	,'hsvHash': {}
	,'mouse': { move:{}, up:{}, x:null, y:null }
};
var $gHash = {
	test: []
	,env: {
		'sProg': '/cgi-bin/artisite/art.fcgi'
/*		'sProg': '/cgi-bin/artisite/art.pl'*/
		,'sHost': 'http://artisite.com'
		,'sScript': ''
		,'imgUrl': ''
		,'xmlhttp': null
		,'xmlhttp1': null
	},env1: {
		'xmlhttp': {}
	},tab: {
		'curSelect': 'picker01'
	},curItems: {
		'iDomObj':{}
		,'iObj':{}
		,'iHash':{}
	},favItems: {
	}
	,'escObj': null
	,'cashMeImg': ['css/blank.gif']
	,'tmp': { ImgCash:{} }
};

/*	#########	Begin: Утилиты	########	*/

function _browser() {	//	Тип Браузера
	var c_debug = 'browser';
if($cnf.debug == c_debug) alert('browser: 1 ' + this); //showPropOld(this.document.scripts[3].attributes.accessKey); }
	var b = navigator.userAgent.toLowerCase();

	var brArr = ['safari', 'opera', 'msie', 'mozilla'];
	// Figure out what browser is being used
	$browser = {
		version: (b.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/) || [])[1],
		safari: /webkit/.test(b),
		opera: /opera/.test(b),
		msie: /msie/.test(b) && !/opera/.test(b),
		mozilla: /mozilla/.test(b) && !/(compatible|webkit)/.test(b)
	};

	// Check to see if the W3C box model is being used
	var boxModel = !$browser.msie || document.compatMode == "CSS1Compat";
	var styleFloat = ($browser.msie ? "styleFloat" : "cssFloat");

	$browser.props = {
		"for": "htmlFor",
		"class": "className",
		"float": styleFloat,
		cssFloat: styleFloat,
		styleFloat: styleFloat,
		innerHTML: "innerHTML",
		className: "className",
		value: "value",
		disabled: "disabled",
		checked: "checked",
		readonly: "readOnly",
		selected: "selected",
		maxlength: "maxLength"
	};

	for(var i=0; i<brArr.length; i++){
		if($browser[brArr[i]]) { $browser.type = brArr[i]; break; }
	}

//var tt = document.body.innerHTML;for(var i=0; i<10000; i++){	$gHash.test[i] = i + tt;}

if($cnf.debug == c_debug) alert('browser: 2');

return $browser;
}

function _ev_fun(par) {	//	Функции событий
	var c_debug = 'ev_fun';

//var tstr = Dumper(2, $browser, 'usrParam');
//alert('tstr1=' + tstr);
if($cnf.debug == c_debug) alert('_ev_fun: 1');
	var res = 0;
	switch (par.com) {
		case 'init':
			document.onkeydown = kEsc;
			window.onbeforeunload = _destroy;
			var gObj = document.getElementById('iGist');
			if(gObj) {
				gObj.onmousemove =  _mGistMove;
				gObj.onclick =  _mGistClick;
			}
			var hObj = document.getElementById('hue2');
			if(hObj) {
//alert('gObj=' + hObj);
				hObj.onmousemove =  _mHueMove;
				hObj.onclick =  _mHueClick;
				var iObj = document.getElementById('hline');
				if(iObj) iObj.onclick =  _mHueClick;

				var iObj = document.getElementById('mask2');
				if(iObj) iObj.onmousemove =  _mMaskMove;
//				if(iObj) iObj.onmousemove =  _mMaskClick;
				if(iObj) iObj.onclick =  _mMaskClick;

				if($browser.msie) {
					var iObj = document.getElementById('mask2');
					if(iObj) {
						iObj.src = 'css/blank.gif';
						_css(iObj, { 'filter':"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='css/pickerbg1.png', sizingMethod='scale')"});
					}
//				} else {
				}
			}
			break;
		case 'destroy':
			break;
		default:
			break;
	}

if($cnf.debug == c_debug) alert('_ev_fun: 3');
return res;
}

function kEsc(e) {	// Нажатие Esc
	var tEv = e || event;
	if(tEv.keyCode == 27)	dHide($gHash.escObj, 1);
}


var fHashInit = {
	'opacity': 100
	,'opacityDX': 2
	,'opacityLimit': 10
	,'zTime': 20
	,'timerID': null
};
var fHash = {};

function _setFilter(hObj, iHash) {
	if(!hObj || !iHash || !iHash.iObj) return false;
	if(typeof(iHash.iObj) == 'string') iHash.iObj = document.getElementById(iHash.iObj);
	if(!iHash.iObj) return;

//	if(fHash.iObj) {		_css(fHash.iObj, { 'filter':100 });	}

	for(var prop in fHashInit)	fHash[prop] = fHashInit[prop];
	for(var prop in iHash)		fHash[prop] = iHash[prop];
	fHash.iObj = iHash.iObj;
	fHash.hObj = hObj;

//_css(iObj.parentNode, { 'filter':100 });

//_html('status2', ' fHash.opacity ' + fHash.opacity);
//alert(fHash.zTime);

	if(fHash.timerID) clearInterval(fHash.timerID);
	fHash.timerID = setInterval("_sFilterOver()", fHash.zTime);
}

function _sFilterOver(e) {
	var iObj = fHash.iObj;
	if(fHash.opacity > fHash.opacityLimit) {
		fHash.opacity -= fHash.opacityDX;
//_html('status2', fHash.zTime + ' fHash.opacity2 ' + fHash.opacity);
		_css(iObj, { 'filter':fHash.opacity });
	} else {
//		if(fHash.iObj) {			_css(fHash.iObj, { 'filter':100 });		}
		if(fHash.timerID) clearInterval(fHash.timerID);
		fHash.hObj.Filter = 1;

//		if(fHash.callback) window.setTimeout(fHash.callback, 1);

//		_css(iObj, { 'filter':100 });
//fHash = fHashInit;
//alert(iObj);
//_html('status2', fHash.zTime + ' fHash.opacity1 ' + fHash.opacity);
	}
}

function _css(it, iHash) {	//	css всякие
	var c_debug = '_css';
	if(typeof(it) == 'string') it = document.getElementById(it);
	if(!it) return;

	var pxHash = { 'top':1, 'left':1, 'height':1, 'width':1 };
	for(var prop in iHash) {
		var zn = iHash[prop];
		if(!zn) continue;
		if(zn && pxHash[prop]) {
if($cnf.debug == c_debug) alert(prop + ' ccc: ' + zn);


			var tm = String(zn).match(/^(\-*)(\d+)/);
			if(tm) {
				zn = tm[1] + tm[2] + 'px';
if($cnf.debug == c_debug) alert(tm[1] + ' : ' + tm[2]);
			}
		}
		if(prop == 'filter') {
//			if(zn == 100) {
//				it.style[prop] = undefined;
//				continue;
//			}

			if($browser.mozilla) {	zn /= 100; prop = 'opacity';
			} else if(zn>0) { zn = 'alpha(opacity='+zn+')';
			}
		}
//alert(prop + ': ' + zn);

		it.style[prop] = zn;
	}
return it;
}

function _html(it, item) {	//	html
	if(typeof(it) != 'object') it = document.getElementById(it);
	if(!it) return;
	it.innerHTML = item;
return it;
}

function _destroy() {	//	Очистка
	var c_debug = 'destroy';
	saveServCook('logout');
if($cnf.debug == c_debug) alert('_destroy: 1');
	delete $browser;
	delete $gHash;
if($cnf.debug == c_debug) alert('_destroy: 2');
	delete $cnf;
}

/* ### Begin: Управление классами стилей */
function name2node(nodeName) {
	return (typeof(nodeName) == 'string' ? document.getElementById(nodeName) : nodeName);
}

function ClassChkSub(node, subclass_name) { node = name2node(node); if(!node) return; return new RegExp('\\b'+subclass_name).test(node.className) };
function ClassChk(node, class_name) {node = name2node(node); if(!node) return;	 return new RegExp('\\b'+class_name+'\\b').test(node.className) };
function ClassAdd(node, class_name) {node = name2node(node); if(!node) return;	if(!node.className){ node.className=class_name; } else if(!ClassChkSub(node,class_name)) { var className=node.className+" "+class_name; node.className=className.split(/\s+/).join(' '); } return node; };
function ClassSet(node, class_name) {node = name2node(node); if(!node) return;	node.className=class_name; return node; };
function ClassDel(node, class_name) {node = name2node(node); if(!node) return;	var className=node.className;if(className){className=className.replace(new RegExp('\\b'+class_name+'\\b'),'');className=className.replace(/\s+/g,' ');node.className=className.replace(/\s+$/g,'')} return node; };

function dHide(it, fl) {	// Показать/скрыть слой
	it = name2node(it);
//alert('a44rt_load: ' + it.id);
	if(!it) return;
	var chClass = 'Hide';
	if(fl == undefined) fl = (ClassChkSub(it, chClass) ? 0 : 1);
	if(fl) ClassAdd(it, chClass);
	else { ClassDel(it, chClass); }
return it;
}


function readCookie(name) {
	var nameEQ = name+"=";
	var ca = document.cookie.split(';');
//alert('document.cookie: ' + document.cookie);
	for(var i=0;i<ca.length;i++) {
		var c=ca[i];
		while(c.charAt(0)==' ') { c=c.substring(1,c.length) }
		if(c.indexOf(nameEQ)==0){ return unescape(c.substring(nameEQ.length,c.length))}
	}
return null;
}

function createCookie(name, value, days) {
	if(days) {
		var date=new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires="; expires="+date.toGMTString();
	} else {
		expires="";
	}
	document.cookie = name+"="+escape(value)+expires+"; path=/;"
}

function _getSPage(recHash) {	// get some data from URL

	var ddd = new Date(); var dd = ddd.getTime();
	var dp = parseInt($cnf.zStamp, 10) + parseInt($cnf.zdTime, 10);
	var gUrl = recHash["gUrl"];

	if($cnf.uSess) gUrl += '&uSess='+$cnf.uSess;
	if($gHash.par.extSearch == 1) gUrl += '&extSearch=1';
//	if($cnf.noCash == 1) gUrl += '&tStamp=' + dd;
	if($cnf.noCash == 1 && !recHash.data) gUrl += '&tStamp=' + $cnf.tStamp;

var c_debug = '_getSPage';
if($cnf.debug == c_debug) alert(c_debug + ': ' + gUrl); // Отладка

	dHide('NoData', 1);
	dHide('loading', 1);
	if(dd < dp) return;
//	if(dd < dp) { alert('Wait please!'); return; }
	$cnf.zStamp = dd;
	dHide('loading');

//var xml = window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();

var xmlhttp
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
  try {
  xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
  try {
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  } catch (E) {
   xmlhttp=false;
  }
 }
@else
 xmlhttp=false
 @end @*/
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
		try { xmlhttp = new XMLHttpRequest();
		} catch (e) { xmlhttp=false;
		}
//		if(xmlhttp && xmlhttp.overrideMimeType) xmlhttp.overrideMimeType('text/xml');
	}
	if (!xmlhttp && window.createRequest) {
		try { xmlhttp = window.createRequest();
		} catch (e) { xmlhttp=false;
		}
	}

// If need Referer send
//xmlhttp.open("GET\thttp://127.0.0.1:8083/CPIpath/4B955BB4-0D41-E1F1-9D7A-904F05831A9F_image0006.gif\tHTTP/1.0\r\nHost:\thttp://127.0.0.1:8083\r\nReferer:\thttp://127.0.0.1:8083/CPIpath/4B955BB4-0D41-E1F1-9D7A-904F05831A9F.html\r\n\r\nGET\thttp://127.0.0.1:8083/\tHTTP/1.0\r\nFoobar:","http://127.0.0.1:8083/",false);



//alert(dd + ' gUrl= ' + gUrl);
	if(!recHash.metod) recHash.metod = 'GET';
	xmlhttp.open(recHash.metod, gUrl, true);
//	xmlhttp.open(recHash.metod, gUrl, false);

//	xmlhttp.setRequestHeader('Accept','image/jpeg')
	xmlhttp.setRequestHeader('Accept', recHash["mime"] || 'text/html')

	var rNum = recHash.rNum || 0;
	$gHash.env1.xmlhttp[rNum] = xmlhttp;

//	if(recHash.rNum) $gHash.env.xmlhttp1 = xmlhttp;
//	else $gHash.env.xmlhttp = xmlhttp;
	xmlhttp.onreadystatechange = recHash["ans"] || _getAnswer;

	if(!recHash.data) recHash.data = null;
	xmlhttp.send(recHash.data);

return xmlhttp;
}


function _getAnswer() {	//	Ответ от сервера
	var c_debug = '_ajaxAnswer';
return;
	var recRes = '';
alert('_ajaxAnswer: ' + $gHash.env.xmlhttp.readyState);
	if ($gHash.env.xmlhttp.readyState == 4) {
		recRes = $gHash.env.xmlhttp.responseText;
//		$gHash.env.xmlhttp = null;
alert('_ajaxAnswer: ' + recRes);
	}
}

function toHex(v) { v=Math.round(Math.min(Math.max(0,v),255)); return("0123456789ABCDEF".charAt((v-v%16)/16)+"0123456789ABCDEF".charAt(v%16)); }
function rgb2hex(r) { return(toHex(r[0])+toHex(r[1])+toHex(r[2])); }
function hsv2hex(h) { return(rgb2hex(hsv2rgb(h))); }	

function hsv2rgb_b(r) { // easyrgb.com/math.php?MATH=M21#text21

//    var R,B,G,S=r[1]/100,V=r[2]/100,H=r[0]/360;
//    var R,B,G,S=0.003+r[1]/100,V=0.003+r[2]/100,H=0.003+r[0]/360;
//r[2] = 100 - r[2];

	var R,B,G,S=0.003+r[1]/100,V=0.003+r[2]/100,H=0.003+r[0]/360;
//V = 1/V;
    if(S>0) { if(H>=1) H=0;

        H=6*H; F=H-Math.floor(H);
        A=Math.round(255*V*(1.0-S));
        B=Math.round(255*V*(1.0-(S*F)));
        C=Math.round(255*V*(1.0-(S*(1.0-F))));
        V=Math.round(255*V); 

        switch(Math.floor(H)) {

            case 0: R=V; G=C; B=A; break;
            case 1: R=B; G=V; B=A; break;
            case 2: R=A; G=V; B=C; break;
            case 3: R=A; G=B; B=V; break;
            case 4: R=C; G=A; B=V; break;
            case 5: R=V; G=A; B=B; break;

        }

        return([R?R:0,G?G:0,B?B:0]);

    }
    else return([(V=Math.round(V*255)),V,V]);

}


 function hsv2rgb(r) { 

	var h = r[0];
	var s = r[1]/100;
	var v = r[2]/100;

//   # limit this to h values between 0 and 360 and s/v values 
//   # between 0 and 1 

	var rgb = [255,255,255];
   if(h<0 || h>360) return rgb;
   if(s<0 || s>1) return rgb;
   if(v<0 || v>1) return rgb;

//   my $r; my $g; my $b; 

//   # 0.003 is less than 1/255; use this to make the floating point 
//   # approximation of zero, since the resulting rgb values will 
//   # normally be used as integers between 0 and 255.  Feel free to 
//   # change this approximation of zero to something else, if this 
//   # suits you. 

	if (s < 0.003) { rgb[0] = rgb[1] = rgb[2] = v; 
	} else { 
		h /= 60; 
		var sector = Math.floor(h); 
		var fraction = h - sector; 
		var p = v * (1 - s); 
		var q = v * (1 - (s * fraction)); 
		var t = v * (1 - (s * (1 - fraction))); 
		if (sector == 0) {		rgb[0] = v; rgb[1] = t; rgb[2] = p; 
		} else if (sector == 1) {	rgb[0] = q; rgb[1] = v; rgb[2] = p; 
		} else if (sector == 2) {	rgb[0] = p; rgb[1] = v; rgb[2] = t; 
		} else if (sector == 3) {	rgb[0] = p; rgb[1] = q; rgb[2] = v;
		} else if (sector == 4) {	rgb[0] = t; rgb[1] = p; rgb[2] = v; 
		} else {				rgb[0] = v; rgb[1] = p; rgb[2] = q; 
		}
	}

//	# Convert the r/g/b values to all be between 0 and 255; use the 
//	# ol' 0.003 approximation again, with the same comment as above. 

	rgb[0] = (rgb[0] < 0.003 ? 0.0 : rgb[0] * 255); 
	rgb[1] = (rgb[1] < 0.003 ? 0.0 : rgb[1] * 255); 
	rgb[2] = (rgb[2] < 0.003 ? 0.0 : rgb[2] * 255); 

	rgb[0] = Math.floor(rgb[0]+0.5); 
	rgb[1] = Math.floor(rgb[1]+0.5); 
	rgb[2] = Math.floor(rgb[2]+0.5); 
return rgb; 
} 

function rgb2hsv(r) { 
// alert(' rgb ' + r[0] + ',' + r[1] + ',' + r[2]);
   r[0] = r[0] / 255; r[1] = r[1] / 255; r[2] = r[2] / 255; 

   var max = (r[0] > r[1] ? (r[0]>r[2] ? r[0] : r[2]) : (r[1]>r[2] ? r[1] : r[2]));
   var min = (r[0] < r[1] ? (r[0]<r[2] ? r[0] : r[2]) : (r[1]<r[2] ? r[1] : r[2]));
   var delta = max - min; 
   var h; var s; var v = max;
   v = Math.floor(v*100 + 0.5);
	if(v>99) v=99; 
	var hsb = [0, 0, v];
//alert(delta + ',' + max + ' delta max rgb ' + r[0] + ',' + r[1] + ',' + r[2]);

   if (max < 0.003 || delta < 0.003) {	return hsb;
   } else { 
		s = delta / max; 
		if (r[0] == max) {		h = (r[1] - r[2]) / delta; 
		} else if (r[1] == max) {	h = 2 + (r[2] - r[0]) / delta; 
		} else {				h = 4 + (r[0] - r[1]) / delta; 
		}
		h *= 60;
		if(h < 0) h += 360;
	}
	h = Math.floor(h + 0.5); s = Math.floor(s*100 + 0.5);
	if(h>359) h=359; 
	if(s>99) s=99; 
//alert(' hsv ' + h + ',' + s + ',' + v);
return [h, s, v]; 
} 


function getPosInDiv(e, dObj, objAttr)	{	// 
	var posHash = { };
	if(!objAttr) objAttr = {};
	if(!e && $browser.msie) e = event;

	if(typeof(dObj) != 'object') dObj = document.getElementById(dObj);
	if(!dObj) return;

	var iObj = dObj;
	for(var i=0;i<$cnf.parentLev;i++) {
		var divHash = {
			'divLeft':	iObj.offsetLeft
			,'divTop':	iObj.offsetTop
			,'divWidth':	iObj.offsetWidth
			,'divHeight':	iObj.offsetHeight
			,'divEndX':	iObj.offsetLeft + iObj.offsetWidth
			,'divEndY':	iObj.offsetTop + iObj.offsetHeight
		}

		if(i==0) { posHash = divHash; posHash.parent =  []; }
		else posHash.parent.push(divHash);
		iObj = iObj.parentNode;
		if(!iObj) break;
	}


	if(e) {
		posHash.x = e.pageX || e.clientX;
		posHash.y = e.pageY || e.clientY;
		$cnf.mouse.x = posHash.x;
		$cnf.mouse.y = posHash.y;
	}

	var eObj = document.documentElement;
	var sw =  eObj.scrollLeft;
	var sh =  eObj.scrollTop;
	if($browser.opera) { sw =  window.pageXOffset; sh =  window.pageYOffset; }

	var ww =  eObj.clientWidth;
	var wh =  eObj.clientHeight;
	if($browser.opera) {
		ww =  document.body.clientWidth;
		wh =  document.body.clientHeight;
	}
	
	posHash.wWidth= ww;
	posHash.wHeight= wh;
	posHash.w_scrollLeft= sw;
	posHash.w_scrollTop= sh;

	if($browser.mozilla) sw = sh = 0;
	if($browser.opera) {
//		sw = 0;
		sh += 1;
	}

	posHash.x -= dObj.offsetLeft - sw + $cnf.gist.dx;
	posHash.y -= dObj.offsetTop - sh + $cnf.gist.dy;

	var wdObj = objAttr.width || posHash.divWidth;
	var hdObj = objAttr.height || posHash.divHeight;
	var top = (wh - hdObj) / 2;
	var left = (ww - wdObj) / 2;
	posHash.centr = {
		'left':	(left > 0 ? left : 0) + posHash.w_scrollLeft
		,'top':	(top > 0 ? top : 0) + posHash.w_scrollTop
	};
	
return posHash;
}

function getCentrWin(cssHash) {
	var eObj = document.documentElement;
	var sw =  eObj.scrollLeft;
	var sh =  eObj.scrollTop;
	var ww =  eObj.clientWidth;
	var wh =  eObj.clientHeight;
	if($browser.opera) {
		sw =  window.pageXOffset;
		sh =  window.pageYOffset;
		ww =  document.body.clientWidth;
		wh =  document.body.clientHeight;
	}
	var hCoef =  cssHash.height || 1;
	var wCoef =  cssHash.width || 1;
	cssHash.height = hCoef * wh;
	cssHash.width = wCoef * ww;
	cssHash.top = sh + wh*(1-hCoef)/2;
	cssHash.left = sw + ww*(1-wCoef)/2;
return cssHash;
}

function getFavLinks(fl) {	// Получить ссылки из Faves
	var tmp = [];
	var tmpHash = {};
	var nm = 0;
	var it = '';
	for(var prop in $cnf.favHash) {
		var fHash = $cnf.favHash[prop];
		if(!fHash) continue;
		var favItems = $gHash.favItems[fHash.mID];
		if(!favItems) continue;
		for(var i=0;i<favItems.iPage.length;i++) {
			var iPage = favItems.iPage[i];
			if(iPage) {
				tmpHash[iPage] = fHash.mID;
				break;
			}
		}
	}

	for(var prop in tmpHash) {
		nm++;
		if(fl) it += nm + '. <a target="_blank" href="'+prop+'">' + prop + '</a><br>';
		else it += nm + '. ' + escape(prop +"\n");
	}

return it;
}

function mailTo(aObj) {	// Послать
	var tmp = [];
	var tmpHash = {};
	var nm = 0;
	var it = getFavLinks();

if(it == '') return false;

//	it = unescape("\n" + it);
	var sHost = $gHash.env.sHost;
//	var body = escape(_('#EmailFavesTitle')) + "%20" +sHost + "%20:"+ escape("\n") + it;

	var tLoc = _('#EmailFavesTitle', $cnf.lang);
	if($browser.mozilla) tLoc = _('#EmailFavesTitle', 'eng');

	var body = tLoc + "%20" +sHost + "%20:"+ escape("\n") + it;
//alert(body);
	var subj = 'From%20site%20' + sHost;
	aObj.href = 'mailto:?subject=' + subj + '&body='+body;
//	aObj.href = 'mailto:?enctype='+escape('text/plain; charset=windows-1251')+'&subject=' + subj + '&body='+body;
//	aObj.href = 'mailto:?subject=' + unescape(subj) + '&body='+unescape(body);
return true;
//return false;
}

function ShowFav(pObj) {
	var it = getFavLinks(1);
if(it == '') return false;

	_html('showFavContent', it);
	var pos = getPosInDiv(null, 'showFavDiv', {height: 200, width: 400});
	_css('showFavDiv', { 'top':pos.centr.top, 'left':pos.centr.left });

	dHide('showFavDiv');
return false;
}

function evalScript(data) {	// Eval JS
var it = '';
var ok = true;
	try {
		eval(data);
	} catch(e){
		ok = false;
	}
return ok;
}

/*	#########	End: Утилиты	########	*/
