function JsHttpRequest(){var t=this;t.onreadystatechange=null;t.readyState=0;t.responseText=null;t.responseXML=null;t.status=200;t.statusText="OK";t.responseJS=null;t.caching=false;t.loader=null;t.session_name="PHPSESSID";t._ldObj=null;t._reqHeaders=[];t._openArgs=null;t._errors={inv_form_el:"Invalid FORM element detected: name=%, tag=%",must_be_single_el:"If used, <form> must be a single HTML element in the list.",js_invalid:"JavaScript code generated by backend is invalid!\n%",url_too_long:"Cannot use so long query with GET request (URL is larger than % bytes)",unk_loader:"Unknown loader: %",no_loaders:"No loaders registered at all, please check JsHttpRequest.LOADERS array",no_loader_matched:"Cannot find a loader which may process the request. Notices are:\n%"};t.abort=function(){with(this){if(_ldObj&&_ldObj.abort){_ldObj.abort();}
_cleanup();if(readyState==0){return;}
if(readyState==1&&!_ldObj){readyState=0;return;}
_changeReadyState(4,true);}};t.open=function(_2,_3,_4,_5,_6){with(this){if(_3.match(/^((\w+)\.)?(GET|POST)\s+(.*)/i)){this.loader=RegExp.$2?RegExp.$2:null;_2=RegExp.$3;_3=RegExp.$4;}
try{if(document.location.search.match(new RegExp("[&?]"+session_name+"=([^&?]*)"))||document.cookie.match(new RegExp("(?:;|^)\\s*"+session_name+"=([^;]*)"))){_3+=(_3.indexOf("?")>=0?"&":"?")+session_name+"="+this.escape(RegExp.$1);}}
catch(e){}
_openArgs={method:(_2||"").toUpperCase(),url:_3,asyncFlag:_4,username:_5!=null?_5:"",password:_6!=null?_6:""};_ldObj=null;_changeReadyState(1,true);return true;}};t.send=function(_7){if(!this.readyState){return;}
this._changeReadyState(1,true);this._ldObj=null;var _8=[];var _9=[];if(!this._hash2query(_7,null,_8,_9)){return;}
var _a=null;if(this.caching&&!_9.length){_a=this._openArgs.username+":"+this._openArgs.password+"@"+this._openArgs.url+"|"+_8+"#"+this._openArgs.method;var _b=JsHttpRequest.CACHE[_a];if(_b){this._dataReady(_b[0],_b[1]);return false;}}
var _c=(this.loader||"").toLowerCase();if(_c&&!JsHttpRequest.LOADERS[_c]){return this._error("unk_loader",_c);}
var _d=[];var _e=JsHttpRequest.LOADERS;for(var _f in _e){var ldr=_e[_f].loader;if(!ldr){continue;}
if(_c&&_f!=_c){continue;}
var _11=new ldr(this);JsHttpRequest.extend(_11,this._openArgs);JsHttpRequest.extend(_11,{queryText:_8.join("&"),queryElem:_9,id:(new Date().getTime())+""+JsHttpRequest.COUNT++,hash:_a,span:null});var _12=_11.load();if(!_12){this._ldObj=_11;JsHttpRequest.PENDING[_11.id]=this;return true;}
if(!_c){_d[_d.length]="- "+_f.toUpperCase()+": "+this._l(_12);}else{return this._error(_12);}}
return _f?this._error("no_loader_matched",_d.join("\n")):this._error("no_loaders");};t.getAllResponseHeaders=function(){with(this){return _ldObj&&_ldObj.getAllResponseHeaders?_ldObj.getAllResponseHeaders():[];}};t.getResponseHeader=function(_13){with(this){return _ldObj&&_ldObj.getResponseHeader?_ldObj.getResponseHeader(_13):null;}};t.setRequestHeader=function(_14,_15){with(this){_reqHeaders[_reqHeaders.length]=[_14,_15];}};t._dataReady=function(_16,js){with(this){if(caching&&_ldObj){JsHttpRequest.CACHE[_ldObj.hash]=[_16,js];}
responseText=responseXML=_16;responseJS=js;if(js!==null){status=200;statusText="OK";}else{status=500;statusText="Internal Server Error";}
_changeReadyState(2);_changeReadyState(3);_changeReadyState(4);_cleanup();}};t._l=function(_18){var i=0,p=0,msg=this._errors[_18[0]];while((p=msg.indexOf("%",p))>=0){var a=_18[++i]+"";msg=msg.substring(0,p)+a+msg.substring(p+1,msg.length);p+=1+a.length;}
return msg;};t._error=function(msg){msg=this._l(typeof(msg)=="string"?arguments:msg);msg="JsHttpRequest: "+msg;if(!window.Error){throw msg;}else{if((new Error(1,"test")).description=="test"){throw new Error(1,msg);}else{throw new Error(msg);}}};t._hash2query=function(_1e,_1f,_20,_21){if(_1f==null){_1f="";}
if((""+typeof(_1e)).toLowerCase()=="object"){var _22=false;if(_1e&&_1e.parentNode&&_1e.parentNode.appendChild&&_1e.tagName&&_1e.tagName.toUpperCase()=="FORM"){_1e={form:_1e};}
for(var k in _1e){var v=_1e[k];if(v instanceof Function){continue;}
var _25=_1f?_1f+"["+this.escape(k)+"]":this.escape(k);var _26=v&&v.parentNode&&v.parentNode.appendChild&&v.tagName;if(_26){var tn=v.tagName.toUpperCase();if(tn=="FORM"){_22=true;}else{if(tn=="INPUT"||tn=="TEXTAREA"||tn=="SELECT"){}else{return this._error("inv_form_el",(v.name||""),v.tagName);}}
_21[_21.length]={name:_25,e:v};}else{if(v instanceof Object){this._hash2query(v,_25,_20,_21);}else{if(v===null){continue;}
if(v===true){v=1;}
if(v===false){v="";}
_20[_20.length]=_25+"="+this.escape(""+v);}}
if(_22&&_21.length>1){return this._error("must_be_single_el");}}}else{_20[_20.length]=_1e;}
return true;};t._cleanup=function(){var _28=this._ldObj;if(!_28){return;}
JsHttpRequest.PENDING[_28.id]=false;var _29=_28.span;if(!_29){return;}
_28.span=null;var _2a=function(){_29.parentNode.removeChild(_29);};JsHttpRequest.setTimeout(_2a,50);};t._changeReadyState=function(s,_2c){with(this){if(_2c){status=statusText=responseJS=null;responseText="";}
readyState=s;if(onreadystatechange){onreadystatechange();}}};t.escape=function(s){return escape(s).replace(new RegExp("\\+","g"),"%2B");};}
JsHttpRequest.COUNT=0;JsHttpRequest.MAX_URL_LEN=2000;JsHttpRequest.CACHE={};JsHttpRequest.PENDING={};JsHttpRequest.LOADERS={};JsHttpRequest._dummy=function(){};JsHttpRequest.TIMEOUTS={s:window.setTimeout,c:window.clearTimeout};JsHttpRequest.setTimeout=function(_2e,dt){window.JsHttpRequest_tmp=JsHttpRequest.TIMEOUTS.s;if(typeof(_2e)=="string"){id=window.JsHttpRequest_tmp(_2e,dt);}else{var id=null;var _31=function(){_2e();delete JsHttpRequest.TIMEOUTS[id];};id=window.JsHttpRequest_tmp(_31,dt);JsHttpRequest.TIMEOUTS[id]=_31;}
window.JsHttpRequest_tmp=null;return id;};JsHttpRequest.clearTimeout=function(id){window.JsHttpRequest_tmp=JsHttpRequest.TIMEOUTS.c;delete JsHttpRequest.TIMEOUTS[id];var r=window.JsHttpRequest_tmp(id);window.JsHttpRequest_tmp=null;return r;};JsHttpRequest.query=function(url,_35,_36,_37){var req=new this();req.caching=!_37;req.onreadystatechange=function(){if(req.readyState==4){_36(req.responseJS,req.responseText);}};req.open(null,url,true);req.send(_35);};JsHttpRequest.dataReady=function(d){var th=this.PENDING[d.id];delete this.PENDING[d.id];if(th){th._dataReady(d.text,d.js);}else{if(th!==false){throw"dataReady(): unknown pending id: "+d.id;}}};JsHttpRequest.extend=function(_3b,src){for(var k in src){_3b[k]=src[k];}};JsHttpRequest.LOADERS.xml={loader:function(req){JsHttpRequest.extend(req._errors,{xml_no:"Cannot use XMLHttpRequest or ActiveX loader: not supported",xml_no_diffdom:"Cannot use XMLHttpRequest to load data from different domain %",xml_no_headers:"Cannot use XMLHttpRequest loader or ActiveX loader, POST method: headers setting is not supported, needed to work with encodings correctly",xml_no_form_upl:"Cannot use XMLHttpRequest loader: direct form elements using and uploading are not implemented"});this.load=function(){if(this.queryElem.length){return["xml_no_form_upl"];}
if(this.url.match(new RegExp("^([a-z]+://[^\\/]+)(.*)","i"))){if(RegExp.$1.toLowerCase()!=document.location.protocol+"//"+document.location.hostname.toLowerCase()){return["xml_no_diffdom",RegExp.$1];}}
var xr=null;if(window.XMLHttpRequest){try{xr=new XMLHttpRequest();}
catch(e){}}else{if(window.ActiveXObject){try{xr=new ActiveXObject("Microsoft.XMLHTTP");}
catch(e){}
if(!xr){try{xr=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e){}}}}
if(!xr){return["xml_no"];}
var _40=window.ActiveXObject||xr.setRequestHeader;if(!this.method){this.method=_40&&this.queryText.length?"POST":"GET";}
if(this.method=="GET"){if(this.queryText){this.url+=(this.url.indexOf("?")>=0?"&":"?")+this.queryText;}
this.queryText="";if(this.url.length>JsHttpRequest.MAX_URL_LEN){return["url_too_long",JsHttpRequest.MAX_URL_LEN];}}else{if(this.method=="POST"&&!_40){return["xml_no_headers"];}}
this.url+=(this.url.indexOf("?")>=0?"&":"?")+"JsHttpRequest="+(req.caching?"0":this.id)+"-xml";var id=this.id;xr.onreadystatechange=function(){if(xr.readyState!=4){return;}
xr.onreadystatechange=JsHttpRequest._dummy;req.status=null;try{req.status=xr.status;req.responseText=xr.responseText;}
catch(e){}
if(!req.status){return;}
try{eval("JsHttpRequest._tmp = function(id) { var d = "+req.responseText+"; d.id = id; JsHttpRequest.dataReady(d); }");}
catch(e){return req._error("js_invalid",req.responseText);}
JsHttpRequest._tmp(id);JsHttpRequest._tmp=null;};xr.open(this.method,this.url,true,this.username,this.password);if(_40){for(var i=0;i<req._reqHeaders.length;i++){xr.setRequestHeader(req._reqHeaders[i][0],req._reqHeaders[i][1]);}
xr.setRequestHeader("Content-Type","application/octet-stream");}
xr.send(this.queryText);this.span=null;this.xr=xr;return null;};this.getAllResponseHeaders=function(){return this.xr.getAllResponseHeaders();};this.getResponseHeader=function(_43){return this.xr.getResponseHeader(_43);};this.abort=function(){this.xr.abort();this.xr=null;};}};JsHttpRequest.LOADERS.script={loader:function(req){JsHttpRequest.extend(req._errors,{script_only_get:"Cannot use SCRIPT loader: it supports only GET method",script_no_form:"Cannot use SCRIPT loader: direct form elements using and uploading are not implemented"});this.load=function(){if(this.queryText){this.url+=(this.url.indexOf("?")>=0?"&":"?")+this.queryText;}
this.url+=(this.url.indexOf("?")>=0?"&":"?")+"JsHttpRequest="+this.id+"-"+"script";this.queryText="";if(!this.method){this.method="GET";}
if(this.method!=="GET"){return["script_only_get"];}
if(this.queryElem.length){return["script_no_form"];}
if(this.url.length>JsHttpRequest.MAX_URL_LEN){return["url_too_long",JsHttpRequest.MAX_URL_LEN];}
var th=this,d=document,s=null,b=d.body;if(!window.opera){this.span=s=d.createElement("SCRIPT");var _49=function(){s.language="JavaScript";if(s.setAttribute){s.setAttribute("src",th.url);}else{s.src=th.url;}
b.insertBefore(s,b.lastChild);};}else{this.span=s=d.createElement("SPAN");s.style.display="none";b.insertBefore(s,b.lastChild);s.innerHTML="Workaround for IE.<s"+"cript></"+"script>";var _49=function(){s=s.getElementsByTagName("SCRIPT")[0];s.language="JavaScript";if(s.setAttribute){s.setAttribute("src",th.url);}else{s.src=th.url;}};}
JsHttpRequest.setTimeout(_49,10);return null;};}};JsHttpRequest.LOADERS.form={loader:function(req){JsHttpRequest.extend(req._errors,{form_el_not_belong:"Element \"%\" does not belong to any form!",form_el_belong_diff:"Element \"%\" belongs to a different form. All elements must belong to the same form!",form_el_inv_enctype:"Attribute \"enctype\" of the form must be \"%\" (for IE), \"%\" given."});this.load=function(){var th=this;if(!th.method){th.method="POST";}
th.url+=(th.url.indexOf("?")>=0?"&":"?")+"JsHttpRequest="+th.id+"-"+"form";if(th.method=="GET"){if(th.queryText){th.url+=(th.url.indexOf("?")>=0?"&":"?")+th.queryText;}
if(th.url.length>JsHttpRequest.MAX_URL_LEN){return["url_too_long",JsHttpRequest.MAX_URL_LEN];}
var p=th.url.split("?",2);th.url=p[0];th.queryText=p[1]||"";}
var _4d=null;var _4e=false;if(th.queryElem.length){if(th.queryElem[0].e.tagName.toUpperCase()=="FORM"){_4d=th.queryElem[0].e;_4e=true;th.queryElem=[];}else{_4d=th.queryElem[0].e.form;for(var i=0;i<th.queryElem.length;i++){var e=th.queryElem[i].e;if(!e.form){return["form_el_not_belong",e.name];}
if(e.form!=_4d){return["form_el_belong_diff",e.name];}}}
if(th.method=="POST"){var _51="multipart/form-data";var _52=(_4d.attributes.encType&&_4d.attributes.encType.nodeValue)||(_4d.attributes.enctype&&_4d.attributes.enctype.value)||_4d.enctype;if(_52!=_51){return["form_el_inv_enctype",_51,_52];}}}
var d=_4d&&(_4d.ownerDocument||_4d.document)||document;var _54="jshr_i_"+th.id;var s=th.span=d.createElement("DIV");s.style.position="absolute";s.style.display="none";s.style.visibility="hidden";s.innerHTML=(_4d?"":"<form"+(th.method=="POST"?" enctype=\"multipart/form-data\" method=\"post\"":"")+"></form>")+"<iframe name=\""+_54+"\" id=\""+_54+"\" style=\"width:0px; height:0px; overflow:hidden; border:none\"></iframe>";if(!_4d){_4d=th.span.firstChild;}
d.body.insertBefore(s,d.body.lastChild);var _56=function(e,_58){var sv=[];var _5a=e;if(e.mergeAttributes){var _5a=d.createElement("form");_5a.mergeAttributes(e,false);}
for(var i=0;i<_58.length;i++){var k=_58[i][0],v=_58[i][1];sv[sv.length]=[k,_5a.getAttribute(k)];_5a.setAttribute(k,v);}
if(e.mergeAttributes){e.mergeAttributes(_5a,false);}
return sv;};var _5e=function(){top.JsHttpRequestGlobal=JsHttpRequest;var _5f=[];if(!_4e){for(var i=0,n=_4d.elements.length;i<n;i++){_5f[i]=_4d.elements[i].name;_4d.elements[i].name="";}}
var qt=th.queryText.split("&");for(var i=qt.length-1;i>=0;i--){var _63=qt[i].split("=",2);var e=d.createElement("INPUT");e.type="hidden";e.name=unescape(_63[0]);e.value=_63[1]!=null?unescape(_63[1]):"";_4d.appendChild(e);}
for(var i=0;i<th.queryElem.length;i++){th.queryElem[i].e.name=th.queryElem[i].name;}
var sv=_56(_4d,[["action",th.url],["method",th.method],["onsubmit",null],["target",_54]]);_4d.submit();_56(_4d,sv);for(var i=0;i<qt.length;i++){_4d.lastChild.parentNode.removeChild(_4d.lastChild);}
if(!_4e){for(var i=0,n=_4d.elements.length;i<n;i++){_4d.elements[i].name=_5f[i];}}};JsHttpRequest.setTimeout(_5e,100);return null;};}};jQuery.cookie=function(name,value,options){if(typeof value!='undefined'){options=options||{};if(value===null){value='';options.expires=-1;}
var expires='';if(options.expires&&(typeof options.expires=='number'||options.expires.toUTCString)){var date;if(typeof options.expires=='number'){date=new Date();date.setTime(date.getTime()+(options.expires*24*60*60*1000));}else{date=options.expires;}
expires='; expires='+date.toUTCString();}
var path=options.path?'; path='+(options.path):'';var domain=options.domain?'; domain='+(options.domain):'';var secure=options.secure?'; secure':'';document.cookie=[name,'=',encodeURIComponent(value),expires,path,domain,secure].join('');}else{var cookieValue=null;if(document.cookie&&document.cookie!=''){var cookies=document.cookie.split(';');for(var i=0;i<cookies.length;i++){var cookie=jQuery.trim(cookies[i]);if(cookie.substring(0,name.length+1)==(name+'=')){cookieValue=decodeURIComponent(cookie.substring(name.length+1));break;}}}
return cookieValue;}};jQuery.fn.extend({everyTime:function(interval,label,fn,times,belay){return this.each(function(){jQuery.timer.add(this,interval,label,fn,times,belay);});},oneTime:function(interval,label,fn){return this.each(function(){jQuery.timer.add(this,interval,label,fn,1);});},stopTime:function(label,fn){return this.each(function(){jQuery.timer.remove(this,label,fn);});}});jQuery.extend({timer:{global:[],guid:1,dataKey:"jQuery.timer",regex:/^([0-9]+(?:\.[0-9]*)?)\s*(.*s)?$/,powers:{'ms':1,'cs':10,'ds':100,'s':1000,'das':10000,'hs':100000,'ks':1000000},timeParse:function(value){if(value==undefined||value==null)
return null;var result=this.regex.exec(jQuery.trim(value.toString()));if(result[2]){var num=parseFloat(result[1]);var mult=this.powers[result[2]]||1;return num*mult;}else{return value;}},add:function(element,interval,label,fn,times,belay){var counter=0;if(jQuery.isFunction(label)){if(!times)
times=fn;fn=label;label=interval;}
interval=jQuery.timer.timeParse(interval);if(typeof interval!='number'||isNaN(interval)||interval<=0)
return;if(times&&times.constructor!=Number){belay=!!times;times=0;}
times=times||0;belay=belay||false;var timers=jQuery.data(element,this.dataKey)||jQuery.data(element,this.dataKey,{});if(!timers[label])
timers[label]={};fn.timerID=fn.timerID||this.guid++;var handler=function(){if(belay&&this.inProgress)
return;this.inProgress=true;if((++counter>times&&times!==0)||fn.call(element,counter)===false)
jQuery.timer.remove(element,label,fn);this.inProgress=false;};handler.timerID=fn.timerID;if(!timers[label][fn.timerID])
timers[label][fn.timerID]=window.setInterval(handler,interval);this.global.push(element);},remove:function(element,label,fn){var timers=jQuery.data(element,this.dataKey),ret;if(timers){if(!label){for(label in timers)
this.remove(element,label,fn);}else if(timers[label]){if(fn){if(fn.timerID){window.clearInterval(timers[label][fn.timerID]);delete timers[label][fn.timerID];}}else{for(var fn in timers[label]){window.clearInterval(timers[label][fn]);delete timers[label][fn];}}
for(ret in timers[label])break;if(!ret){ret=null;delete timers[label];}}
for(ret in timers)break;if(!ret)
jQuery.removeData(element,this.dataKey);}}}});jQuery(window).bind("unload",function(){jQuery.each(jQuery.timer.global,function(index,item){jQuery.timer.remove(item);});});;(function($){var moz=$.browser.mozilla&&/gecko/i.test(navigator.userAgent);var webkit=$.browser.safari&&$.browser.version>=3;var expr=$.browser.msie&&(function(){var div=document.createElement('div');try{div.style.setExpression('width','0+0');}
catch(e){return false;}
return true;})();function sz(el,p){return parseInt($.css(el,p))||0;};function hex2(s){var s=parseInt(s).toString(16);return(s.length<2)?'0'+s:s;};function gpc(node){for(;node&&node.nodeName.toLowerCase()!='html';node=node.parentNode){var v=$.css(node,'backgroundColor');if(v=='rgba(0, 0, 0, 0)')
continue;if(v.indexOf('rgb')>=0){var rgb=v.match(/\d+/g);return'#'+hex2(rgb[0])+hex2(rgb[1])+hex2(rgb[2]);}
if(v&&v!='transparent')
return v;}
return'#ffffff';};function getWidth(fx,i,width){switch(fx){case'round':return Math.round(width*(1-Math.cos(Math.asin(i/width))));case'cool':return Math.round(width*(1+Math.cos(Math.asin(i/width))));case'sharp':return Math.round(width*(1-Math.cos(Math.acos(i/width))));case'bite':return Math.round(width*(Math.cos(Math.asin((width-i-1)/width))));case'slide':return Math.round(width*(Math.atan2(i,width/i)));case'jut':return Math.round(width*(Math.atan2(width,(width-i-1))));case'curl':return Math.round(width*(Math.atan(i)));case'tear':return Math.round(width*(Math.cos(i)));case'wicked':return Math.round(width*(Math.tan(i)));case'long':return Math.round(width*(Math.sqrt(i)));case'sculpt':return Math.round(width*(Math.log((width-i-1),width)));case'dog':return(i&1)?(i+1):width;case'dog2':return(i&2)?(i+1):width;case'dog3':return(i&3)?(i+1):width;case'fray':return(i%2)*width;case'notch':return width;case'bevel':return i+1;}};$.fn.corner=function(options){if(this.length==0){if(!$.isReady&&this.selector){var s=this.selector,c=this.context;$(function(){$(s,c).corner(options);});}
return this;}
return this.each(function(index){var $this=$(this);var o=(options||$this.attr($.fn.corner.defaults.metaAttr)||'').toLowerCase();var keep=/keep/.test(o);var cc=((o.match(/cc:(#[0-9a-f]+)/)||[])[1]);var sc=((o.match(/sc:(#[0-9a-f]+)/)||[])[1]);var width=parseInt((o.match(/(\d+)px/)||[])[1])||10;var re=/round|bevel|notch|bite|cool|sharp|slide|jut|curl|tear|fray|wicked|sculpt|long|dog3|dog2|dog/;var fx=((o.match(re)||['round'])[0]);var edges={T:0,B:1};var opts={TL:/top|tl|left/.test(o),TR:/top|tr|right/.test(o),BL:/bottom|bl|left/.test(o),BR:/bottom|br|right/.test(o)};if(!opts.TL&&!opts.TR&&!opts.BL&&!opts.BR)
opts={TL:1,TR:1,BL:1,BR:1};if($.fn.corner.defaults.useNative&&fx=='round'&&(moz||webkit)&&!cc&&!sc){if(opts.TL)
$this.css(moz?'-moz-border-radius-topleft':'-webkit-border-top-left-radius',width+'px');if(opts.TR)
$this.css(moz?'-moz-border-radius-topright':'-webkit-border-top-right-radius',width+'px');if(opts.BL)
$this.css(moz?'-moz-border-radius-bottomleft':'-webkit-border-bottom-left-radius',width+'px');if(opts.BR)
$this.css(moz?'-moz-border-radius-bottomright':'-webkit-border-bottom-right-radius',width+'px');return;}
var strip=document.createElement('div');strip.style.overflow='hidden';strip.style.height='1px';strip.style.backgroundColor=sc||'transparent';strip.style.borderStyle='solid';var pad={T:parseInt($.css(this,'paddingTop'))||0,R:parseInt($.css(this,'paddingRight'))||0,B:parseInt($.css(this,'paddingBottom'))||0,L:parseInt($.css(this,'paddingLeft'))||0};if(typeof this.style.zoom!=undefined)this.style.zoom=1;if(!keep)this.style.border='none';strip.style.borderColor=cc||gpc(this.parentNode);var cssHeight=$.curCSS(this,'height');for(var j in edges){var bot=edges[j];if((bot&&(opts.BL||opts.BR))||(!bot&&(opts.TL||opts.TR))){strip.style.borderStyle='none '+(opts[j+'R']?'solid':'none')+' none '+(opts[j+'L']?'solid':'none');var d=document.createElement('div');$(d).addClass('jquery-corner');var ds=d.style;bot?this.appendChild(d):this.insertBefore(d,this.firstChild);if(bot&&cssHeight!='auto'){if($.css(this,'position')=='static')
this.style.position='relative';ds.position='absolute';ds.bottom=ds.left=ds.padding=ds.margin='0';if(expr)
ds.setExpression('width','this.parentNode.offsetWidth');else
ds.width='100%';}
else if(!bot&&$.browser.msie){if($.css(this,'position')=='static')
this.style.position='relative';ds.position='absolute';ds.top=ds.left=ds.right=ds.padding=ds.margin='0';if(expr){var bw=sz(this,'borderLeftWidth')+sz(this,'borderRightWidth');ds.setExpression('width','this.parentNode.offsetWidth - '+bw+'+ "px"');}
else
ds.width='100%';}
else{ds.position='relative';ds.margin=!bot?'-'+pad.T+'px -'+pad.R+'px '+(pad.T-width)+'px -'+pad.L+'px':(pad.B-width)+'px -'+pad.R+'px -'+pad.B+'px -'+pad.L+'px';}
for(var i=0;i<width;i++){var w=Math.max(0,getWidth(fx,i,width));var e=strip.cloneNode(false);e.style.borderWidth='0 '+(opts[j+'R']?w:0)+'px 0 '+(opts[j+'L']?w:0)+'px';bot?d.appendChild(e):d.insertBefore(e,d.firstChild);}}}});};$.fn.uncorner=function(){if(moz||webkit)
this.css(moz?'-moz-border-radius':'-webkit-border-radius',0);$('div.jquery-corner',this).remove();return this;};$.fn.corner.defaults={useNative:true,metaAttr:'data-corner'};})(jQuery);function setElementOpacity(oElem,nOpacity)
{var p=getOpacityProperty();(setElementOpacity=p=="filter"?new Function('oElem','nOpacity','nOpacity *= 100; var oAlpha = oElem.filters["DXImageTransform.Microsoft.alpha"] || oElem.filters.alpha; if (oAlpha) oAlpha.opacity = nOpacity; else oElem.style.filter += "progid:DXImageTransform.Microsoft.Alpha(opacity="+nOpacity+")";'):p?new Function('oElem','nOpacity','oElem.style.'+p+' = nOpacity;'):new Function)(oElem,nOpacity);}
function getOpacityProperty()
{var p;if(typeof document.body.style.opacity=='string')p='opacity';else if(typeof document.body.style.MozOpacity=='string')p='MozOpacity';else if(typeof document.body.style.KhtmlOpacity=='string')p='KhtmlOpacity';else if(document.body.filters&&navigator.appVersion.match(/MSIE ([\d.]+);/)[1]>=5.5)p='filter';return(getOpacityProperty=new Function("return '"+p+"';"))();}
function fadeOpacity(sElemId,sRuleName,bBackward)
{var elem=document.getElementById(sElemId);if(!elem||!getOpacityProperty()||!fadeOpacity.aRules[sRuleName])return;var rule=fadeOpacity.aRules[sRuleName];var nOpacity=rule.nStartOpacity;if(fadeOpacity.aProc[sElemId]){clearInterval(fadeOpacity.aProc[sElemId].tId);nOpacity=fadeOpacity.aProc[sElemId].nOpacity;}
if((nOpacity==rule.nStartOpacity&&bBackward)||(nOpacity==rule.nFinishOpacity&&!bBackward))return;fadeOpacity.aProc[sElemId]={'nOpacity':nOpacity,'tId':setInterval('fadeOpacity.run("'+sElemId+'")',fadeOpacity.aRules[sRuleName].nDalay),'sRuleName':sRuleName,'bBackward':Boolean(bBackward)};}
fadeOpacity.addRule=function(sRuleName,nStartOpacity,nFinishOpacity,nDalay){fadeOpacity.aRules[sRuleName]={'nStartOpacity':nStartOpacity,'nFinishOpacity':nFinishOpacity,'nDalay':(nDalay||30),'nDSign':(nFinishOpacity-nStartOpacity>0?1:-1)};};fadeOpacity.back=function(sElemId){fadeOpacity(sElemId,fadeOpacity.aProc[sElemId].sRuleName,true);};fadeOpacity.run=function(sElemId)
{var proc=fadeOpacity.aProc[sElemId];var rule=fadeOpacity.aRules[proc.sRuleName];proc.nOpacity=Math.round((proc.nOpacity+.1*rule.nDSign*(proc.bBackward?-1:1))*10)/10;setElementOpacity(document.getElementById(sElemId),proc.nOpacity);if(proc.nOpacity==rule.nStartOpacity||proc.nOpacity==rule.nFinishOpacity)clearInterval(fadeOpacity.aProc[sElemId].tId);}
fadeOpacity.aProc={};fadeOpacity.aRules={};$(document).ready(function(){$("#rm_new_users").click(function(){var disp=($("#new_users_rm").css("display"));$("#new_users_rm").slideToggle("fast");$.cookie("rm_new_users",disp);});$("#rm_new_comments").click(function(){var disp=($(".new_comments").css("display"));$(".new_comments").slideToggle("fast");$.cookie("rm_new_comments",disp);});$("#rm_new_happybirtday").click(function(){var disp=($("#new_happybirtday_rm").css("display"));$("#new_happybirtday_rm").slideToggle("fast");$.cookie("rm_new_happybirtday",disp);});$("#rm_new_fotos").click(function(){var disp=($(".new_fotos").css("display"));$(".new_fotos").slideToggle("fast");$.cookie("rm_new_fotos",disp);});$("#rm_photo_albums").click(function(){var disp=($(".right_photo_albums").css("display"));$(".right_photo_albums").slideToggle("fast");$.cookie("rm_photo_albums",disp);});$("#sex").change(function(){if($(this).val()!=2){$("#marital_1").css({"display":"block","name":"marital"});$("#marital_2").css({"display":"none","name":""});}else{$("#marital_1").css({"display":"none","name":""});$("#marital_2").css({"display":"block","name":"marital"});}});$("#us_sex").change(function(){$("#marital_box").css("display","none");if($(this).val()!=2){$("#marital_1").css({"display":"block","name":"us_marital"});$("#marital_2").css({"display":"none","name":"us_marital_none"});}else{$("#marital_1").css({"display":"none","name":"us_marital_none"});$("#marital_2").css({"display":"block","name":"us_marital"});}});$("#marital_1, #marital_2").change(function(){if($(this).val()>1&&$(this).val()<7){$("#marital_box").css("display","block");$("#info_marital").css("display","block");if($("#marital_1").css("display")!='none'){$("#marital_1 option:selected").each(function(){$("#marital_of").text($(this).text());if($(this).val()==2){g("marital_of").innerHTML+=' в...';}else if($(this).val()==4){g("marital_of").innerHTML+=' на...';}else if($(this).val()==5){g("marital_of").innerHTML+=' на...';}else if($(this).val()==6){g("marital_of").innerHTML+=' с...';}});}else{$("#marital_2 option:selected").each(function(){$("#marital_of").text($(this).text());if($(this).val()==2){g("marital_of").innerHTML+=' в...';}else if($(this).val()==4){g("marital_of").innerHTML+=' на...';}else if($(this).val()==5){g("marital_of").innerHTML+=' за...';}else if($(this).val()==6){g("marital_of").innerHTML+=' с...';}});}}else{$("#marital_box").css("display","none");$("#marital_of").text("");$("#info_marital").css("display","none");}});$("h2").click(function(){var h2id=$(this).attr('id');if(h2id!=''){var div_block=$(this).next();div_block.slideToggle("fast",function(){if(div_block.is(":hidden")){$(this).prev().attr("class","hide");$.cookie(h2id,1);}else{$(this).prev().attr("class","");$.cookie(h2id,0);}});}});hover_com=0;$(".new_comments").hover(function(){hover_com=1;},function(){hover_com=0;});$("#new_com1").everyTime(10000,function(){if(hover_com==0){$("#new_com1, #new_com5").slideToggle("slow");}});$(".forma_blog .knopka").click(function(){var theme_length=$(".forma_blog input:name=[name]").attr('value').length;var text_length=$(".forma_blog textarea").attr('value').length;if(theme_length<5){alert('Введите тему (не менее 5 символов, сейчас '+theme_length+')');return false;}
else if(text_length<5){alert('Введите текст (не менее 5 символов, сейчас '+text_length+')');return false;}});wait=0;$("#mes_send").click(function(){messages_send();});$("#history").everyTime(5000,function(){if(wait==0){messages();}});if(g('history')!=null){g('history').scrollTop=g('history').scrollHeight;}
$("#add_mp3 .knopka").click(function(){if($("#add_mp3_singer").attr('value')==''){alert('Введите название исполнителя');return false;}
else if($("#add_mp3_song").attr('value')==''){alert('Введите название песни');return false;}
else if($("#add_mp3_url").attr('value').length<17){alert('Укажите ссылку на mp3');return false;}
addmp3($("#add_mp3_singer").attr('value'),$("#add_mp3_song").attr('value'),$("#add_mp3_url").attr('value'));});$("#favorite_user_stars a").hover(function(){$("a[id='"+this.id+"'] p[class='fv_height2']").animate({height:"42px",marginTop:"48px"},500);$("a[id='"+this.id+"'] p[class='fv_height']").animate({height:"28px",marginTop:"62px"},200);},function(){$("a[id='"+this.id+"'] p").animate({height:"15px",marginTop:"75px"},200);});$(".main_popular_stars a").hover(function(){$(this).find("div").css("overflow","visible");$(this).find("div").css("height","auto");$(this).children("div").animate({marginTop:"85px"},200);},function(){$(this).find("div").css("overflow","hidden");$(this).find("div").animate({marginTop:"73px",height:"13px"},200);});$(".corner").corner();$("h2").corner("5px");$("h1").corner();$("#main_otvet").corner("5px");$("div.btm").find("a").corner("5px");$("#line_search").keyup(function(e){if(e.which==13||e.which==27||e.which==37||e.which==38||e.which==39||e.which==40||e.which==40){}
else{var val=$('#line_search').attr('value');if(val.length<2){$(".ajax_search").hide();return false;}
if(cache_se[val]!=undefined){$(".ajax_search").show();$(".ajax_search").children("p").html(cache_se[val]+'<hr />');$(".ajax_search").animate({height:$(".ajax_search").children("p").css('height')},500);$("#ajax_search_load").hide();return false;}
$("#line_search").stopTime('se_ajax');$("#line_search").oneTime(1000,'se_ajax',function(){ajax_search();});}});$(document).click(function(){$(".ajax_search").oneTime(200,function(){$(".ajax_search").hide();});});see_prev=0;last_img='';$("#star_img").hover(function(){see_prev=1;},function(){see_prev=0;});starIMG=1;$("#star_img").everyTime(6000,function(){if(see_prev==0){see_prev=1;$("#star_img"+starIMG).find("div").show();$("#star_img"+starIMG).find("div").fadeTo('slow',0.60);$(this).find("img").fadeTo('slow',0.25,function(){starIMG=parseInt(starIMG)+1;if($("#star_img"+starIMG).attr("href")==undefined){starIMG=1;}
$(this).attr('src',sefon_pic+'/wh300/'+$("#star_img"+starIMG).find("img").attr('id'));$("#star_img").attr('href',$("#star_img"+starIMG).attr('href'));$(this).fadeTo('slow',1);$("#star_img"+starIMG).find("div").fadeTo('slow',0);if($("#star_img").find("img").css('marginLeft')=='-1px'){var mrg_left=-90;}else{var mrg_left=-1;}
$("#star_img").find("img").animate({marginLeft:mrg_left},4500,function(){see_prev=0;});});}});if($("#us_country").attr('value')!=undefined){$("#us_country").autocomplete(country,{autoFill:true,max:999,mustMatch:true,minChars:0});}
$(".corner_left").corner("left");$(".corner_right").corner("right");$(".panel_top_page a").corner("top 7px");$(".album_edit_fotos textarea").focus(function(){if($(this).next('input').attr('value')==0){$(this).attr('value','');$(this).css('color','#000');$(this).next('input').attr('value',1);}});$(".album_edit_fotos textarea").blur(function(){if($(this).attr('value')==''){$(this).next('input').attr('value',0);$(this).attr('value','введите описание к фотографии');$(this).css('color','#999');}});var css_label={'background-color':'','color':''}
var css_label_on={'background-color':'#66CC66','color':'#fff'}
$(".album_edit_fotos label").hover(function(){if($(this).attr('title')==''){$(this).css('backgroundColor','#FF977D');}else{$(this).css('backgroundColor','#66CC66');}
$(this).css('color','#FFF');},function(){if($(this).find("input").attr('checked')==false){$(this).css(css_label);}});$(".album_edit_fotos label[title!='']").click(function(){$(".album_edit_fotos label[title!=''] input[checked=false]").parent().css(css_label);$(this).css(css_label_on);});$(".album_edit_fotos label").find("input:checked").parent().css(css_label_on);$(".album_edit_fotos textarea").keyup(function(){if($(this).attr('value').length>=250){$(this).attr('value',$(this).attr('value').substr(0,250));}});$(".album_edit_fotos label").corner("left");$("#del_album").click(function(){if($(this).attr('checked')==true){$(this).parent().css("backgroundColor","#FF977D");$('#del_album_btm').text('УДАЛИТЬ АЛЬБОМ');}else{$(this).parent().css("backgroundColor","#fff");$('#del_album_btm').text('Редактировать альбом');}});$("#add_user_foto").click(function(){$('.add_album').fadeOut('fast',function(){$('#process_add').fadeIn('fast',function(){$('.add_album').submit();});});});});var reg_mp3_stop=function(){$(".clickmp3").click(function(){if(auth==0){if(autolang!='ru'&&autolang!='ua'&&autolang!='uk'&&autolang!='be'&&autolang!='kz'){alert('You need registration!');document.location='http://vk.com/reg7053589';}else{alert('Необходимо зарегистрироваться либо войти в свой аккаунт!');document.location=sefon+'/signup';}
return false;}});}
var stepcarousel={ajaxloadingmsg:'<div style="margin: 1em; font-weight: bold"><img src="ajaxloadr.gif" style="vertical-align: middle" /> Fetching Content. Please wait...</div>',defaultbuttonsfade:0.4,configholder:{},getCSSValue:function(val){return(val=="auto")?0:parseInt(val)},getremotepanels:function($,config){config.$belt.html(this.ajaxloadingmsg)
$.ajax({url:config.contenttype[1],async:true,error:function(ajaxrequest){config.$belt.html('Error fetching content.<br />Server Response: '+ajaxrequest.responseText)},success:function(content){config.$belt.html(content)
config.$panels=config.$gallery.find('.'+config.panelclass)
stepcarousel.alignpanels($,config)}})},getoffset:function(what,offsettype){return(what.offsetParent)?what[offsettype]+this.getoffset(what.offsetParent,offsettype):what[offsettype]},getCookie:function(Name){var re=new RegExp(Name+"=[^;]+","i");if(document.cookie.match(re))
return document.cookie.match(re)[0].split("=")[1]
return null},setCookie:function(name,value){document.cookie=name+"="+value},fadebuttons:function(config,currentpanel){config.$leftnavbutton.fadeTo('fast',currentpanel==0?this.defaultbuttonsfade:1)
config.$rightnavbutton.fadeTo('fast',currentpanel==config.lastvisiblepanel?this.defaultbuttonsfade:1)},addnavbuttons:function(config,currentpanel){config.$leftnavbutton=$('<img alt="влево" onmouseover="this.src=\'http://www.sefon.ru/img/left.png\';" onmouseout="this.src=\''+config.defaultbuttons.leftnav[0]+'\';" src="'+config.defaultbuttons.leftnav[0]+'">').css({zIndex:50,position:'absolute',left:config.offsets.left+config.defaultbuttons.leftnav[1]+'px',top:config.offsets.top+config.defaultbuttons.leftnav[2]+'px',cursor:'hand',cursor:'pointer'}).attr({title:'Предыдущие '+config.defaultbuttons.moveby+' фотографий'}).appendTo('body')
config.$rightnavbutton=$('<img alt="вправо" onmouseover="this.src=\'http://www.sefon.ru/img/right.png\';" onmouseout="this.src=\''+config.defaultbuttons.rightnav[0]+'\';" src="'+config.defaultbuttons.rightnav[0]+'">').css({zIndex:50,position:'absolute',left:config.offsets.left+config.$gallery.get(0).offsetWidth+config.defaultbuttons.rightnav[1]+'px',top:config.offsets.top+config.defaultbuttons.rightnav[2]+'px',cursor:'hand',cursor:'pointer'}).attr({title:'Следующие '+config.defaultbuttons.moveby+' фотографий'}).appendTo('body')
config.$leftnavbutton.bind('click',function(){stepcarousel.stepBy(config.galleryid,-config.defaultbuttons.moveby)})
config.$rightnavbutton.bind('click',function(){stepcarousel.stepBy(config.galleryid,config.defaultbuttons.moveby)})
if(config.panelbehavior.wraparound==false){this.fadebuttons(config,currentpanel)}
return config.$leftnavbutton.add(config.$rightnavbutton)},stopautostep:function(config){clearTimeout(config.steptimer)
clearTimeout(config.resumeautostep)},alignpanels:function($,config){var paneloffset=0
config.paneloffsets=[paneloffset]
config.panelwidths=[]
config.$panels.each(function(index){var $currentpanel=$(this)
$currentpanel.css({float:'none',position:'absolute',left:paneloffset+'px'})
$currentpanel.bind('click',function(e){return config.onpanelclick(e.target)})
paneloffset+=stepcarousel.getCSSValue($currentpanel.css('marginRight'))+parseInt($currentpanel.get(0).offsetWidth||$currentpanel.css('width'))
config.paneloffsets.push(paneloffset)
config.panelwidths.push(paneloffset-config.paneloffsets[config.paneloffsets.length-2])})
config.paneloffsets.pop()
var addpanelwidths=0
var lastpanelindex=config.$panels.length-1
config.lastvisiblepanel=lastpanelindex
for(var i=config.$panels.length-1;i>=0;i--){addpanelwidths+=(i==lastpanelindex?config.panelwidths[lastpanelindex]:config.paneloffsets[i+1]-config.paneloffsets[i])
if(config.gallerywidth>addpanelwidths){config.lastvisiblepanel=i}}
config.$belt.css({width:paneloffset+'px'})
config.currentpanel=(config.panelbehavior.persist)?parseInt(this.getCookie(window[config.galleryid+"persist"])):0
config.currentpanel=(typeof config.currentpanel=="number"&&config.currentpanel<config.$panels.length)?config.currentpanel:0
if(config.currentpanel!=0){var endpoint=config.paneloffsets[config.currentpanel]+(config.currentpanel==0?0:config.beltoffset)
config.$belt.css({left:-endpoint+'px'})}
if(config.defaultbuttons.enable==true){var $navbuttons=this.addnavbuttons(config,config.currentpanel)
$(window).bind("load resize",function(){config.offsets={left:stepcarousel.getoffset(config.$gallery.get(0),"offsetLeft"),top:stepcarousel.getoffset(config.$gallery.get(0),"offsetTop")}
config.$leftnavbutton.css({left:config.offsets.left+config.defaultbuttons.leftnav[1]+'px',top:config.offsets.top+config.defaultbuttons.leftnav[2]+'px'})
config.$rightnavbutton.css({left:config.offsets.left+config.$gallery.get(0).offsetWidth+config.defaultbuttons.rightnav[1]+'px',top:config.offsets.top+config.defaultbuttons.rightnav[2]+'px'})})}
if(config.autostep&&config.autostep.enable){var $carouselparts=config.$gallery.add(typeof $navbuttons!="undefined"?$navbuttons:null)
$carouselparts.bind('click',function(){stepcarousel.stopautostep(config)
config.autostep.status="stopped"})
$carouselparts.hover(function(){stepcarousel.stopautostep(config)
config.autostep.hoverstate="over"},function(){if(config.steptimer&&config.autostep.hoverstate=="over"&&config.autostep.status!="stopped"){config.resumeautostep=setTimeout(function(){stepcarousel.autorotate(config.galleryid)
config.autostep.hoverstate="out"},500)}})
config.steptimer=setTimeout(function(){stepcarousel.autorotate(config.galleryid)},config.autostep.pause)}
this.statusreport(config.galleryid)
config.oninit()
config.onslideaction(this)},stepTo:function(galleryid,pindex){var config=stepcarousel.configholder[galleryid]
if(typeof config=="undefined"){alert("There's an error with your set up of Carousel Viewer \""+galleryid+"\"!")
return}
stepcarousel.stopautostep(config)
var pindex=Math.min(pindex-1,config.paneloffsets.length-1)
var endpoint=config.paneloffsets[pindex]+(pindex==0?0:config.beltoffset)
if(config.panelbehavior.wraparound==false&&config.defaultbuttons.enable==true){this.fadebuttons(config,pindex)}
config.$belt.animate({left:-endpoint+'px'},config.panelbehavior.speed,function(){config.onslideaction(this)})
config.currentpanel=pindex
this.statusreport(galleryid)},stepBy:function(galleryid,steps){var config=stepcarousel.configholder[galleryid]
if(typeof config=="undefined"){alert("There's an error with your set up of Carousel Viewer \""+galleryid+"\"!")
return}
stepcarousel.stopautostep(config)
var direction=(steps>0)?'forward':'back'
var pindex=config.currentpanel+steps
if(config.panelbehavior.wraparound==false){pindex=(direction=="back"&&pindex<=0)?0:(direction=="forward")?Math.min(pindex,config.lastvisiblepanel):pindex
if(config.defaultbuttons.enable==true){stepcarousel.fadebuttons(config,pindex)}}
else{if(pindex>config.lastvisiblepanel&&direction=="forward"){pindex=(config.currentpanel<config.lastvisiblepanel)?config.lastvisiblepanel:0}
else if(pindex<0&&direction=="back"){pindex=(config.currentpanel>0)?0:config.lastvisiblepanel}}
if(galleryid=='prev_foto'){var left_otstup=0;var right_otstup=0;}else{var left_otstup=-30;var right_otstup=100;}
var endpoint=config.paneloffsets[pindex]+(pindex==0?0:config.beltoffset)
if(pindex==0&&direction=='forward'||config.currentpanel==0&&direction=='back'&&config.panelbehavior.wraparound==true){config.$belt.animate({left:-config.paneloffsets[config.currentpanel]-(direction=='forward'?right_otstup:left_otstup)+'px'},'normal',function(){config.$belt.animate({left:-endpoint+'px'},config.panelbehavior.speed,function(){config.onslideaction(this)})})}
else
config.$belt.animate({left:-endpoint+'px'},config.panelbehavior.speed,function(){config.onslideaction(this)})
config.currentpanel=pindex
this.statusreport(galleryid)},autorotate:function(galleryid){var config=stepcarousel.configholder[galleryid]
if(config.$gallery.attr('_ismouseover')!="yes"){this.stepBy(galleryid,config.autostep.moveby)}
config.steptimer=setTimeout(function(){stepcarousel.autorotate(galleryid)},config.autostep.pause)},statusreport:function(galleryid){var config=stepcarousel.configholder[galleryid]
var startpoint=config.currentpanel
var visiblewidth=0
for(var endpoint=startpoint;endpoint<config.paneloffsets.length;endpoint++){visiblewidth+=config.panelwidths[endpoint]
if(visiblewidth>config.gallerywidth){break}}
startpoint+=1
endpoint=(endpoint+1==startpoint)?startpoint:endpoint
var valuearray=[startpoint,endpoint,config.panelwidths.length]
for(var i=0;i<config.statusvars.length;i++){window[config.statusvars[i]]=valuearray[i]
config.$statusobjs[i].text(valuearray[i]+" ")}},setup:function(config){document.write('<style type="text/css">\n#'+config.galleryid+'{overflow: hidden;}\n</style>')
jQuery(document).ready(function($){config.$gallery=$('#'+config.galleryid)
config.gallerywidth=config.$gallery.width()
config.offsets={left:stepcarousel.getoffset(config.$gallery.get(0),"offsetLeft"),top:stepcarousel.getoffset(config.$gallery.get(0),"offsetTop")}
config.$belt=config.$gallery.find('.'+config.beltclass)
config.$panels=config.$gallery.find('.'+config.panelclass)
config.panelbehavior.wraparound=(config.autostep&&config.autostep.enable)?true:config.panelbehavior.wraparound
config.onpanelclick=(typeof config.onpanelclick=="undefined")?function(target){}:config.onpanelclick
config.onslideaction=(typeof config.onslide=="undefined")?function(){}:function(beltobj){$(beltobj).stop();config.onslide()}
config.oninit=(typeof config.oninit=="undefined")?function(){}:config.oninit
config.beltoffset=stepcarousel.getCSSValue(config.$belt.css('marginLeft'))
config.statusvars=config.statusvars||[]
config.$statusobjs=[$('#'+config.statusvars[0]),$('#'+config.statusvars[1]),$('#'+config.statusvars[2])]
config.currentpanel=0
stepcarousel.configholder[config.galleryid]=config
if(config.contenttype[0]=="ajax"&&typeof config.contenttype[1]!="undefined")
stepcarousel.getremotepanels($,config)
else
stepcarousel.alignpanels($,config)})
jQuery(window).bind('unload',function(){if(config.panelbehavior.persist){stepcarousel.setCookie(window[config.galleryid+"persist"],config.currentpanel)}
jQuery.each(config,function(ai,oi){oi=null})
config=null})}}
function g(id){if(document.getElementById){return document.getElementById(id);}else if(document.all){return document.all[id];}else if(document.layers){return document.layers[id];}
return null;}
load_img='<img src="http://www.sefon.ru/img/load1.gif" width="150" height="20" />';function getBodyScrollTop(){return self.pageYOffset||(document.documentElement&&document.documentElement.scrollTop)||(document.body&&document.body.scrollTop);}
function getBodyScrollLeft(){return self.pageXOffset||(document.documentElement&&document.documentElement.scrollLeft)||(document.body&&document.body.scrollLeft);}
function getClientCenterX()
{return parseInt(getClientWidth()/2)+getBodyScrollLeft();}
function getClientCenterY()
{return parseInt(getClientHeight()/2)+getBodyScrollTop();}
function getDocumentHeight()
{return(document.body.scrollHeight>document.body.offsetHeight)?document.body.scrollHeight:document.body.offsetHeight;}
function getElementComputedStyle(elem,prop)
{if(typeof elem!="object")elem=document.getElementById(elem);if(document.defaultView&&document.defaultView.getComputedStyle)
{if(prop.match(/[A-Z]/))prop=prop.replace(/([A-Z])/g,"-$1").toLowerCase();return document.defaultView.getComputedStyle(elem,"").getPropertyValue(prop);}
if(elem.currentStyle)
{var i;while((i=prop.indexOf("-"))!=-1)prop=prop.substr(0,i)+prop.substr(i+1,1).toUpperCase()+prop.substr(i+2);return elem.currentStyle[prop];}
return"";}
function mousePageXY(e)
{var x=0,y=0;if(!e)e=window.event;if(e.pageX||e.pageY)
{x=e.pageX;y=e.pageY;}
else if(e.clientX||e.clientY)
{x=e.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)-document.documentElement.clientLeft;y=e.clientY+(document.documentElement.scrollTop||document.body.scrollTop)-document.documentElement.clientTop;}
return{"x":x,"y":y};}
function mouseLayerXY(e)
{if(!e){e=window.event;e.target=e.srcElement}
var x=0;var y=0;if(e.layerX)
{x=e.layerX-parseInt(getElementComputedStyle(e.target,"border-left-width"));y=e.layerY-parseInt(getElementComputedStyle(e.target,"border-top-width"));}
else if(e.offsetX)
{x=e.offsetX;y=e.offsetY;}
return{"x":x,"y":y};}
function brouser(){var ua=navigator.userAgent.toLowerCase();if(ua.indexOf("msie")!=-1&&ua.indexOf("opera")==-1&&ua.indexOf("webtv")==-1){return"msie"}
if(ua.indexOf("opera")!=-1){return"opera"}
if(ua.indexOf("gecko")!=-1){return"gecko";}
if(ua.indexOf("safari")!=-1){return"safari";}
if(ua.indexOf("konqueror")!=-1){return"konqueror";}
return"unknown";}
function anch(){if(event.srcElement.tagName=='A'&&!event.srcElement.href.indexOf(document.location+'#')){var id=event.srcElement.href;id=id.substr(id.indexOf('#')+1);document.all[id].scrollIntoView(true);return false;}
return true;}
function anchor_go(id){document.all[id].scrollIntoView(true);}
function sefonit(){g('gruzim').style.display='block';}
function nowork(id){g('mp3_nowork_'+id).innerHTML='спасибо!';var req=new JsHttpRequest();req.onreadystatechange=function(){if(req.readyState==4){g('mp3_nowork_'+id).innerHTML=req.responseJS.q;}}
req.open(null,sefon+'/ajax/nowork.php',true);req.send({id:id});}
function bg(element,color){element.style.backgroundColor=color;}
function messages_send(){if($('#text_mes').attr('value')==''){alert('Пустое сообщение!');return false;}
var str=$('#text_mes').attr('value');$('#mes_send').attr('disabled',true);$('#text_mes').attr('disabled',true);messages(2);$('#sending').html(' '+load_img);}
mes_last_time='';function messages(spec){wait=1;if(spec==2){wait=2;var str=$('#text_mes').attr('value');}else{var str='';$('#panel_messages').text('.');}
var req=new JsHttpRequest();req.onreadystatechange=function(){if(req.readyState==4){if(spec==1){g('history').innerHTML=req.responseJS.q;}else if(mes_last_time!=req.responseJS.last){if(req.responseJS.q!=''){g('history').innerHTML+=req.responseJS.q;if(spec!=2){if(brouser()=="msie"){$('#sound').html('<bgsound src="'+sefon+'/mes.wav" loop="1">');}else if(brouser()=="opera"){$('#sound').html('<embed mastersound="mastersound" controls="smallconsole" autostart="true" loop="false" play_loop="1" hidden="false" width="1px" height="1px" src="'+sefon+'/mes.wav"></embed>');}}}}
if(spec==2){$('#mes_send').attr('disabled',false);$('#text_mes').attr('disabled',false);$('#sending').text('');$('#text_mes').attr('value','');}
$('#panel_messages').text('');wait=0;if(req.responseJS.q!=''){g('history').scrollTop=g('history').scrollHeight;}
if(req.responseJS.last!=''){mes_last_time=req.responseJS.last;}}}
req.open(null,sefon+'/ajax/messages.php',true);req.send({last_time:mes_last_time,user2_nick:mes_user2_nick,user2:mes_user2,text:str,spec:spec});}
function key_message(){if(g('text_mes').value.length>1000){g('sending').style.color='red';}else{g('sending').style.color='black';}
g('sending').innerHTML='('+g('text_mes').value.length+'/1000)';}
function smiles(smile){insert_in_text('text_mes',smile);}
function insert_in_text(f,v){f=g(f);if(document.selection){f.focus();sel=document.selection.createRange();sel.text=v;}
else if(f.selectionStart||f.selectionStart=='0'){var startPos=f.selectionStart;var endPos=f.selectionEnd;var sel_text=f.value.substring(startPos,endPos);f.value=f.value.substring(0,startPos)+v+f.value.substring(endPos,f.value.length);}
else{f.value+=v;}}
function bbcode(f,txt,v1,v2){f=g(f);if(document.selection){f.focus();sel=document.selection.createRange();var septext=sel.text;if(septext==''){var septext=txt;}
sel.text=v1+septext+v2;}
else if(f.selectionStart||f.selectionStart=='0'){var startPos=f.selectionStart;var endPos=f.selectionEnd;var septext=f.value.substring(startPos,endPos);if(septext==''){var septext=txt;}
f.value=f.value.substring(0,startPos)+v1+sel_text+v2+f.value.substring(endPos,f.value.length);}
else{f.value+=v;}
return false;}
function onlines_check(){var elements=document.getElementsByTagName('div');for(var i=0;i<elements.length;i++){var el_id=elements[i].id;if(el_id.indexOf('online_')==0){var id=el_id.substring(7,el_id.length);if(onlines[id]!=undefined){if(a_id==id){elements[i].style.backgroundColor='#CC00CC';elements[i].innerHTML='это вы';}else{elements[i].style.backgroundColor='#009900';elements[i].innerHTML='онлайн';}}else{elements[i].innerHTML='оффлайн';}}}}
function otvet(kuda,otvet){var replyForm=g('forma_otveta');$('#forma_otveta').css('marginLeft',$('#'+kuda).css('marginLeft'));$('#forma_otveta').css('width',$('#'+kuda).css('width'));if(otvet!=g('otvety').value){var currentComment=g(kuda);g('otvety').value=otvet;}else{var currentComment=g('main_otvet');g('otvety').value=0;g('forma_otveta').style.marginLeft=0;$('#forma_otveta').css('width','595px');}
currentComment.parentNode.insertBefore(replyForm,currentComment.nextSibling);}
function redact(id,w,text,ch){g('comment_'+id).innerHTML='Подождите... '+load_img;var req=new JsHttpRequest();req.onreadystatechange=function(){if(req.readyState==4){g('comment_'+id).innerHTML=req.responseJS.q;if(w==5){opened('fich_comment'+id,'inline');closed('rebuild'+id);}
if(w==4){closed('fich_comment'+id);opened('rebuild'+id,'inline');}}}
req.open(null,sefon+'/ajax/comment_edit.php',true);req.send({id:id,w:w,text:text,ch:ch});}
function clear_area(chto){g(chto).value='';g(chto).onclick='';}
function friends(id,w){if(w==5){opened('friend_not_accept_'+id);opened('friend_del_'+id);closed('friend_delete_'+id);return false;}
if(w==1||w==2){g('friend_accept_'+id).innerHTML='Подождите...';}
if(w==3){closed('friend_not_accept_'+id);closed('friend_del_'+id);opened('friend_delete_'+id);return false;}
if(w==4){g('friend_delete_'+id).innerHTML='Подождите...';}
var req=new JsHttpRequest();req.onreadystatechange=function(){if(req.readyState==4){if(req.responseJS.ok==1){if(w==4||w==2){closed('friend'+id);}
if(w==1){g('friend'+id).style.backgroundColor='#FFFFFF';closed('friend_accept_'+id);opened('friend_del_'+id);}}else{if(w==1){g('friend_accept_'+id).innerHTML='Ошибка: '+req.responseJS.ok;}else{g('friend_delete_'+id).innerHTML='Ошибка: '+req.responseJS.ok;}}}}
req.open(null,sefon+'/ajax/friends.php',true);req.send({id:id,w:w});}
function poisk(s){closed('change_search');g('ishem').innerHTML=g('poisk'+s).innerHTML;g('se').value=s;opened('poisk1');opened('poisk2');opened('poisk3');opened('poisk4');opened('poisk5');closed('poisk'+s);poisk2();return false;}
function poisk2(){if(g('up_down').innerHTML=='▼'){g('up_down').innerHTML='▲';}else{g('up_down').innerHTML='▼';}}
function poisk_letters(){if(g('my_letters').value.length<20){window.location.href=sefon+'/letters/'+g('my_letters').value;}else{g('my_letters').style.border='1px red solid';}
setTimeout("g('my_letters').style.border = '1px gray solid';",2000);}
function add_favorite_star(star){if(star=='noauth'){g('add_favorite_star').innerHTML='Зарегистрируйтесь или авторизуйтесь';}else{g('add_favorite_star').style.padding='5px';g('add_favorite_star').innerHTML='Подождите... добавляем...';g('add_favorite_star').onclick='return false;';g('add_favorite_star').style.cursor='default';var req=new JsHttpRequest();req.onreadystatechange=function(){if(req.readyState==4){g('add_favorite_star').innerHTML=req.responseJS.q;}}
req.open(null,sefon+'/ajax/fast_add_favorite_star.php',true);req.send({star:star});}}
function add_fast(ff,value){g('fasting_write').innerHTML='Подождите... Обрабатывается информация!';g('fasting_write').style.display='block';var req=new JsHttpRequest();req.onreadystatechange=function(){if(req.readyState==4){g('fasting_write').innerHTML=req.responseJS.q;g('fasting_form').reset();}}
req.open(null,sefon+'/ajax/fast_add_'+ff+'.php',true);req.send({value:value});}
function scrolling(id,no){var heightTop=getBodyScrollTop();g(id).style.top=heightTop+260+'px';if(no!=1){interval_scroll=setInterval("scrolling('"+id+"', 1);",1);}}
fadeOpacity.addRule('cntr_opt',1,0,20);fadeOpacity.addRule('cntr_opt2',0,1,20);function centr(id){opened(id,'block');var heightTop=getBodyScrollTop();g(id).style.top=heightTop+260+'px';g('opacity').style.height=getDocumentHeight()+'px';g('opacity').style.display='block';scrolling(id);}
function centr_close(id){fadeOpacity(id,'cntr_opt');setTimeout("closed('fast_wind'); fadeOpacity('fast_wind', 'cntr_opt2');",600);g('opacity').style.display='none';clearInterval(interval_scroll);}
function open_add_forms(func,star,track){centr('fast_wind');g('fast_wind_past').innerHTML='Подождите... Идёт загрузка!';g('fast_wind_status').innerHTML='';g('fast_wind').className=func+'_form';var req=new JsHttpRequest();req.onreadystatechange=function(){if(req.readyState==4){g('fast_wind_past').innerHTML=req.responseText;g('fast_wind_status').innerHTML=req.responseJS.q;}}
req.open(null,sefon+'/ajax/fast_'+func+'.php',true);req.send({star:star,track:track});}
function toggle(id,dsp){if(dsp==undefined){dsp='block';}
if(g(id).style.display=='none'||g(id).style.display==''){opened(id,dsp);}else{closed(id);}}
function opened(id,dsp){if(g(id)!=undefined){if(dsp==undefined){dsp='block';}
g(id).style.display=dsp;}}
function closed(id){if(g(id)!=undefined){g(id).style.display='none';}}
last_row=0;hidden_row=1;setTimeout("hidden_roza();",2000);function hidden_roza(){if(g('roza')!=undefined){if(hidden_row==1){g('roza').style.display='none';g('mus'+last_row).style.backgroundColor='#FFFFFF';}
setTimeout("hidden_roza();",2000);hidden_row=1;}}
function add_info(id,star){hidden_row=0;if(star==undefined){star=0;}
var replyForm=g('roza');var currentComment=g('roza'+id);currentComment.parentNode.insertBefore(replyForm,currentComment.nextSibling);g('roza').style.display='block';g('roza').name=star;if(g('roza_info').className!=id){g('roza_info').style.display='none';g('roza_info').className='';if(last_row>0){g('mus'+last_row).style.backgroundColor='#FFFFFF';}
g('mus'+id).style.backgroundColor='#E8F7FF';last_row=id;}
g('roza_info').className=id;}
function open_roza(id,e){g('roza_info').style.display='block';g('roza_info').style.top=mousePageXY(e)['y']-2;g('roza_info').style.left=mousePageXY(e)['x']-130;}
function upload_userpic(str){g('upload_status').innerHTML='Подождите... идёт загрузка';var req=new JsHttpRequest();req.onreadystatechange=function(){if(req.readyState==4){g('upload_status').innerHTML=req.responseJS.q;if(req.responseJS.ok==1){var rand=Math.round(Math.random()*100000);g('avatara').src=req.responseJS.pic;g('avatara').height=req.responseJS.h;g('topava').src=req.responseJS.pic2;g('rightava').src=req.responseJS.pic4;}}}
req.open(null,sefon+'/ajax/upload_userpic.php',true);req.send({str:str});}
function upload_images(str){g('upload_status').style.color='black';g('upload_status').innerHTML='Подождите... идёт загрузка '+load_img;var req=new JsHttpRequest();req.onreadystatechange=function(){if(req.readyState==4){g('upload_status').innerHTML=req.responseJS.q;if(req.responseJS.ok==1){if(g('netu')!=null){closed('netu');}
g('upload_status').style.color='green';g('all_images').innerHTML=req.responseJS.img+' '+g('all_images').innerHTML;}else{g('upload_status').style.color='red';}}}
req.open(null,sefon+'/ajax/upload_images.php',true);req.send({str:str});}
function link_my_info(id){if(id==1){opened('us_info1');closed('us_info2');closed('us_info3');g('link_my_info1').className='link';g('link_my_info2').className='';g('link_my_info3').className='';}
if(id==2){opened('us_info2');closed('us_info1');closed('us_info3');g('link_my_info1').className='';g('link_my_info2').className='link';g('link_my_info3').className='';}
if(id==3){opened('us_info3');closed('us_info1');closed('us_info2');g('link_my_info1').className='';g('link_my_info2').className='';g('link_my_info3').className='link';}}
function us_update(str){g('us_div_submit').style.display='none';g('us_alert').innerHTML='Подождите...';g('us_error').innerHTML=load_img;var req=new JsHttpRequest();req.onreadystatechange=function(){if(req.readyState==4){if(req.responseJS.ok==1){window.location.reload(false);}else{g('us_alert').innerHTML='<span style="color:red">Ошибка →</span>';g('us_error').innerHTML=req.responseJS.q;g('us_div_submit').style.display='block';}}}
req.open(null,sefon+'/ajax/user_update.php',true);req.send({str:str});}
function us_settings(value){g('us_div_submit2').style.display='none';g('us_alert2').innerHTML='Подождите...';g('us_error2').innerHTML=load_img;var req=new JsHttpRequest();req.onreadystatechange=function(){if(req.readyState==4){g('us_alert2').innerHTML='';g('us_error2').innerHTML=req.responseJS.q;g('us_div_submit2').style.display='block';}}
req.open(null,sefon+'/ajax/user_settings.php',true);req.send({value:value});}
function vote_mouse(n,r){var url_star=sefon+'/img';if(n==0){for(var i=1;i<=5;i++){if(i<=r){g('vote'+i).src=url_star+'/star.png';}else{g('vote'+i).src=url_star+'/star2.png';}}}else{for(var i=1;i<=n;i++){g('vote'+i).src=url_star+'/star3.png';}
for(var i=i;i<=5;i++){g('vote'+i).src=url_star+'/star2.png';}}}
function vote(v,id){g('votes_status').innerHTML='секунду...';var req=new JsHttpRequest();req.onreadystatechange=function(){if(req.readyState==4){g('votes_status').innerHTML=req.responseJS.q;if(req.responseJS.rate>0){g('fotos_rate').innerHTML=req.responseJS.rate;vote_mouse(0,req.responseJS.rate2);g('fotos_vote').innerHTML=req.responseJS.votes;}
for(var i=1;i<=5;i++){g('vote'+i).onmouseover='';g('vote'+i).onclick='';}
g('votes').onmouseout='';}}
req.open(null,sefon+'/ajax/vote_foto.php',true);req.send({v:v,id:id});}
function vote_user_foto(v,id){g('votes_status').innerHTML='секунду...';var req=new JsHttpRequest();req.onreadystatechange=function(){if(req.readyState==4){g('votes_status').innerHTML=req.responseJS.q;if(req.responseJS.rate>0){g('fotos_rate').innerHTML=req.responseJS.rate;vote_mouse(0,req.responseJS.rate2);g('fotos_vote').innerHTML=req.responseJS.votes;}
for(var i=1;i<=5;i++){g('vote'+i).onmouseover='';g('vote'+i).onclick='';}
g('votes').onmouseout='';}}
req.open(null,sefon+'/ajax/vote_user_foto.php',true);req.send({v:v,id:id});}
function delstar(star,w){if(a_id==com_id){if(w==1){opened('delstar'+star);}else{closed('delstar'+star);}}}
fadeOpacity.addRule('fv',1,0.2,30);fadeOpacity.addRule('fv2',0.2,1,10);fadeOpacity.addRule('fv3',0.2,0,10);function delete_star(star){if(confirm("Вы действительно хотите удалить этого исполнителя из библиотеки?")){fadeOpacity('fv_star_'+star,'fv');g('fv_star_'+star).onmouseover='';g('fv_star_'+star).onmouseout='';closed('delstar'+star);var req=new JsHttpRequest();req.onreadystatechange=function(){if(req.readyState==4){if(req.responseJS.q==1){fadeOpacity('fv_star_'+star,'fv3');g('fv_star_'+star).onclick='alert("Вы удалили этого исполнителя!"); return false;';}else{fadeOpacity('fv_star_'+star,'fv2');g('fv_star_'+star).onmouseover='delstar('+star+',1);';g('fv_star_'+star).onmouseout='delstar('+star+',0);';g('fv_star_'+star).onclick='';}}}
req.open(null,sefon+'/ajax/delete_favorite.php',true);req.send({star:star});}else{}}
function moder_foto(id,w){if(w==1){element=g('foto_del');}else if(w==2){element=g('foto_blacklist');}
element.innerHTML='подождите...';var req=new JsHttpRequest();req.onreadystatechange=function(){if(req.readyState==4){if(req.responseJS.q==1){if(w==1){element.innerHTML='удалено';}else if(w==2){element.innerHTML='удалено и занесено в blacklist';}
$('.fotoshow').html('<div style="text-align:center; background-color:gray; font-size:24px; margin:2px; color:white; height:'+$('.foto_next').css('height')+'"><br /><br /><br />Фотография удалена</div>');}else if(req.responseJS.q==2){element.innerHTML='удалено, а в blacklist`e уже есть';}else{element.innerHTML='ошибка';}}}
req.open(null,sefon+'/ajax/moder_foto.php',true);req.send({id:id,w:w});}
function delete_account(){if(confirm('Вы уверены, что хотите удалить свою учетную запись на этом сайте?')){$(".delete_account_div").text('Подождите... готовим письмо!');var req=new JsHttpRequest();req.onreadystatechange=function(){if(req.readyState==4){$(".delete_account_div").text('Мы выслали Вам письмо в котором есть ссылка на удаление аккаунта!');}}
req.open(null,sefon+'/ajax/delete_account.php',true);req.send({});}else{}}
function addmp3(singer,song,url){$(".add_mp3_status").text('Пожалуйста, подождите...');var req=new JsHttpRequest();req.onreadystatechange=function(){if(req.readyState==4){$(".add_mp3_status").html(req.responseJS.q);}}
req.open(null,sefon+'/ajax/add_mp3.php',true);req.send({singer:singer,song:song,url:url});}
cache_se=new Array();function ajax_search(){var val=$('#line_search').attr('value');$("#ajax_search_load").show();$.post(sefon+'/ajax/search.php',{q:$('#line_search').attr('value')},function(data){$(".ajax_search").children("p").html(data);cache_se[val]=data;if(brouser()=='msie'){$(".ajax_search").show();}else{if($(".ajax_search").is(":hidden")){$(".ajax_search").css('height','1px');$(".ajax_search").show();$(".ajax_search").animate({height:$(".ajax_search").children("p").css('height')},500);}else{$(".ajax_search").animate({height:$(".ajax_search").children("p").css('height')},500);}}
$("#ajax_search_load").hide();});}