﻿eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(5($){$.h.q=$.h.e=5(s){i($.r.t&&/6.0/.u(v.w)){s=$.x({7:\'3\',8:\'3\',9:\'3\',b:\'3\',j:y,f:\'A:k;\'},s||{});B a=5(n){g n&&n.C==D?n+\'4\':n},l=\'<m E="e"F="0"G="-1"f="\'+s.f+\'"\'+\'H="I:J;K:L;z-M:-1;\'+(s.j!==k?\'N:O(P=\\\'0\\\');\':\'\')+\'7:\'+(s.7==\'3\'?\'c(((o(2.d.p.Q)||0)*-1)+\\\'4\\\')\':a(s.7))+\';\'+\'8:\'+(s.8==\'3\'?\'c(((o(2.d.p.R)||0)*-1)+\\\'4\\\')\':a(s.8))+\';\'+\'9:\'+(s.9==\'3\'?\'c(2.d.S+\\\'4\\\')\':a(s.9))+\';\'+\'b:\'+(s.b==\'3\'?\'c(2.d.T+\\\'4\\\')\':a(s.b))+\';\'+\'"/>\';g 2.U(5(){i($(\'> m.e\',2).V==0)2.W(X.Y(l),2.Z)})}g 2}})(10);',62,63,'||this|auto|px|function||top|left|width||height|expression|parentNode|bgiframe|src|return|fn|if|opacity|false|html|iframe||parseInt|currentStyle|bgIframe|browser||msie|test|navigator|userAgent|extend|true||javascript|var|constructor|Number|class|frameborder|tabindex|style|display|block|position|absolute|index|filter|Alpha|Opacity|borderTopWidth|borderLeftWidth|offsetWidth|offsetHeight|each|length|insertBefore|document|createElement|firstChild|jQuery'.split('|'),0,{}));

eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(3($){$.E={F:\'@G\'};$.s([\'e\',\'t\'],3(i,d){$.l[\'H\'+d]=3(){m(!1[0])4;f a=d==\'e\'?\'n\':\'g\',7=d==\'e\'?\'v\':\'w\';4 1.x(\':y\')?1[0][\'I\'+d]:2(1,d.z())+2(1,\'o\'+a)+2(1,\'o\'+7)};$.l[\'J\'+d]=3(a){m(!1[0])4;f b=d==\'e\'?\'n\':\'g\',7=d==\'e\'?\'v\':\'w\';a=$.A({p:K},a||{});f c=1.x(\':y\')?1[0][\'5\'+d]:2(1,d.z())+2(1,\'B\'+b+\'t\')+2(1,\'B\'+7+\'t\')+2(1,\'o\'+b)+2(1,\'o\'+7);4 c+(a.p?(2(1,\'p\'+b)+2(1,\'p\'+7)):0)}});$.s([\'g\',\'n\'],3(i,b){$.l[\'h\'+b]=3(a){m(!1[0])4;4 a!=L?1.s(3(){1==j||1==q?j.M(b==\'g\'?a:$(j)[\'N\'](),b==\'n\'?a:$(j)[\'O\']()):1[\'h\'+b]=a}):1[0]==j||1[0]==q?P[(b==\'g\'?\'Q\':\'R\')]||$.S&&q.T[\'h\'+b]||q.C[\'h\'+b]:1[0][\'h\'+b]}});$.l.A({D:3(){f a=0,8=0,r=1[0],5,9,6,u;m(r){6=1.6();5=1.5();9=6.5();5.8-=2(r,\'U\');5.k-=2(r,\'V\');9.8+=2(6,\'W\');9.k+=2(6,\'X\');u={8:5.8-9.8,k:5.k-9.k}}4 u},6:3(){f a=1[0].6;Y(a&&(!/^C|Z$/i.10(a.11)&&$.12(a,\'D\')==\'13\'))a=a.6;4 $(a)}});3 2(a,b){4 14($.15(a.16?a[0]:a,b,17))||0}})(18);',62,71,'|this|num|function|return|offset|offsetParent|borr|top|parentOffset|||||Height|var|Left|scroll||window|left|fn|if|Top|padding|margin|document|elem|each|Width|results|Bottom|Right|is|visible|toLowerCase|extend|border|body|position|dimensions|version|VERSION|inner|client|outer|false|undefined|scrollTo|scrollLeft|scrollTop|self|pageXOffset|pageYOffset|boxModel|documentElement|marginTop|marginLeft|borderTopWidth|borderLeftWidth|while|html|test|tagName|css|static|parseInt|curCSS|jquery|true|jQuery'.split('|'),0,{}));


$.fn.modal = function(hash) {
/** 
 * @function $.modal(hash)
 * 
 * @param hash - Object, html, собственно передаваемая информация
 * 
 * @desc показ модального блока с информацией
 *
*/
	var html = $(this).html();

	var replacing = hash['replacing'];

	for (var obj in replacing)
	{
		html=html.replace("%"+obj+"%",replacing[obj]);
	}
	
	$("html").addClass("paranja");

	var h = "100%";

	if ($.browser.msie){
		h = $("body").outerHeight();
	}
	$(".b-modal").remove();
	$(window).scrollTop(0);
	var dialog_container = "#b-cms-dialog-add-content";

	$('body').append(
		'<div class="b-modal" style="position: absolute; z-index: 999; top: 0; left: 0;width: 100%; height: '+h+'; text-align: center;"><table width=100% height=100%><tr><td valign="center"><div style="width: 30em; margin: 15em auto 0;background: #fff; opacity: 1;">'+html+'</div></td></tr></table></div>'
	);

	$('body').append(
		'<iframe class="b-paranja" frameborder="0"></iframe><div class="b-paranja"></div>'
	);



	var options = hash['options'];
	for(var obj in options)
	{
		if (options[obj])
		{
			$(obj).unbind("click");
			$(obj).bind("click",options[obj]);
		}
	}
	
	if (hash.load)
	{
		hash.load();
	}

};





$.fn.modal2 = function(hash) {
/** 
 * @function $.modal(hash)
 * 
 * @param hash - Object, html, собственно передаваемая информация
 * 
 * @desc показ модального блока с информацией
 *
*/
	var html = $(this).html();

	var replacing = hash['replacing'];

	for (var obj in replacing)
	{
		html=html.replace("%"+obj+"%",replacing[obj]);
	}
	
	$("html").addClass("paranja");

	var h = "100%";

	if ($.browser.msie){
		h = $("body").outerHeight();
	}
	$(".b-modal").remove();
	$(window).scrollTop(0);
	var dialog_container = "#b-cms-dialog-add-content";

	$('body').append(html);



	var options = hash['options'];
	for(var obj in options)
	{
		if (options[obj])
		{
			$(obj).unbind("click");
			$(obj).bind("click",options[obj]);
		}
	}
	
	if (hash.load)
	{
		hash.load();
	}

};
/// 
