if (!adminpanel) { truesize(); } var clearident=false; var x=0; var oldcolnum; var resizefun=[]; //browser.display.focus_ring_width = 0 ; function setupdatecoord() { $( "#response .butresize" ).draggable( { containment: "parent", stop:function() { updatecoord() ; } }); updatecoord(); } function updatecoord() { var position = $("#response .butresize").position(); if (position) { var relativeX = position.left; var relativeY = position.top; $("#imgcoord").val([relativeX, relativeY]); } } $.ajaxSetup({ type: "POST", cache:false, dataType:'text', error: function (XMLHttpRequest, textStatus, errorThrown) { ////console.log('error:', XMLHttpRequest,'stat:', textStatus, errorThrown ); // typically only one of textStatus or errorThrown // will have info //this; // the options for this ajax request } }); $('#footer').append('
'); //, $("#nav li, #hmenu li, #left .m2-L,#left .m3-L,#left .m4-L,#left .m5-L,#right .m2-L,#right .m3-L,#right .m4-L,#right .m5-L, #cmenu .cmenu-L, #cmenu .dalee-L, #left ul.MenuBarVertical li").hover( function () { $(this).addClass("ov"); }, function () { $(this).removeClass("ov"); } ); function price_line(pattern,num) { patter=pattern.split( '?' ); //if ( sizeof(patter)==1 ) return ; if ( patter.length==1 ) return ; x=0; var n2,p2,out,stop; patter.forEach( function(patte) { x++; patt= patte.split( '-' ); n1=n2; p1=p2; n2=trim(patt[1]); p2=trim(patt[0]); //v(get_defined_vars()); //exit(); if (!stop) { if ( x==1 ) { n1=1; p1=p2; //console.log(n1,p1,n2,p2,x); if( n2 > num ) { out= p2; stop=1; } } else if ( (x == patter.length) && (n2<= num)="" )="" {="" out="(p2);" stop="1;" }="" else="" if="" (="" num="">< n2="" )="" {="" v(get_defined_vars());="" out="Number(p1)" +="" number((num-n1)*(="" p2="" -="" p1="" )="" (="" n2="" -="" n1="" ));="" stop="1;" }="" }="" });="" return="" out;="" }="" $(window).click(function="" ()="" {="" $('#maintab="" .admenu="" .incontext').fadeout('fast');="" });="" $('body').mousemove(function="" (e)="" {="" curx="e.pageX;" cury="e.pageY;" $("#coord").text("(="" e.pagex,="" e.pagey="" )="" -="" "="" +="" pagecoords);="">
X: " + e.pageX + "
Y: " + e.pageY + "
H: " + (e.pageY-usY)+ "
W: " + (e.pageX-usX) ); $("#coord").css('top',e.pageY+3).css('left',e.pageX+3); }); var prekey,usX,usY,curX,curY; $(document).keyup(function(event) { $("#coord").php(''); //alert(); prekey=0; }); $(document).keydown(function(event) { $("#coord").php("
"+(event.keyCode)); if (event.keyCode==17 ) { //alert('rere'); usX=curX; usY=curY; //alert(usX); } /*else { prekey=event.keyCode; }*/ //alert(); }); function subscriber(form) { if ( checkmyform(form) ) { email=$('.emailsubscribe'); $.fancybox(''); $.get( hrpref+'--?&subscriber='+email.val(), function(data) { setTimeout("$.fancybox('������� �� ��������!')",1000); email.val(''); }); return false; } return false; } function deltovcart(id) { $('#incen .fullcart').css('opacity',0.2) ; ////console.log(id); $.ajax({dataType:'text', type:'GET',url:hrpref+'cart--?' , cache:false, data:({deltovcart: id }), success: function(data) { dat=data.split('[fc]'); $('#incen .fullcart').css('opacity',1) ; if ( dat[1] ) { $('#outfullcart').php( (dat[1])); } else { cartclear_jq(); } cartminiup(dat[2]); }, error: function (XMLHttpRequest, textStatus, errorThrown) { //console.log(XMLHttpRequest, textStatus, errorThrown) ; // typically only one of textStatus or errorThrown // will have info this; // the options for this ajax request } }); } function cartminiup(data) { //alert(data); if ( $('#cartmini').attr('id') ) { $('#cartmini').php(data); //console.log(1); } else if ( $('.blockcart').attr('class') ) { $('.blockcart').replaceWith(data); //console.log(2,data); } else if ( data ) { $('#inleft').prepend(data); } else { $('.blockcart').remove(); cartclear_jq(); } } function prigl() { $.fancybox('
����� ������ ���� ���������������:

���� �� ��� �� ���������������� - �����������������
'); jquery_input_focus_unfocus_with_text(false,false); } function cartrenum() { $('#incen .fullcart').css('opacity',0.2) ; post=$('#center .num_tov').serializeArray(); post[post.length]={ name:'renum',value: '1' } ////console.log(post); $.get(hrpref+'cart--?', post ,function(data){ dat=data.split('[fc]'); $('#incen .fullcart').css('opacity',1) ; ////console.log( dat[1] ); if ( dat[1] ) { $('#outfullcart').php( (dat[1])); } else { cartclear_jq(); } cartminiup(dat[2]); }); } function cartclear() { $('#incen .fullcart').css('opacity',0.2) ; $.get(hrpref+'cart--?',{ cartclear:1 } ,function(data){ dat=data.split('[fc]'); $('#incen .fullcart').css('opacity',1) ; ////console.log( dat[1] ); if ( dat[1] ) { $('#outfullcart').php( '' ); cartclear_jq(); } else { } cartminiup(dat[2]); }); } function adcartbut(tovid) { adcart( $('#tov'+tovid) ); } function adcart(ob){ $(ob).css('opacity',0.2) ; //ob.css('opacity',0.2) ; art= $(ob).find('input[name=art]').val(); num_tov= $(ob).find('input[name=num_tov]').val(); //console.log('startpost','/'+hrpref+'cart',{adcart:'1',art:art, num_tov: num_tov },'endpost'); post=$(ob).serializeArray(); post[post.length]={ name:'adcart',value: '1' }; post[post.length]={ name:'art',value: art }; post[post.length]={ name:'num_tov',value: num_tov }; post[post.length]={ name:'ajaxcart',value: '1' }; $.get('/'+hrpref+'cart--?', post ,function(data){ dat=data.split('[fc]'); $(ob).css('opacity',1) ; ////console.log( dat[1] ); if ( dat[1]=='ok' ) { noimg=false; ob_anim=$(ob).find('.tovimg') if (!ob_anim.offset()) ob_anim=$(ob).find('img'); if (!ob_anim.offset()) { ob_anim=$(ob).find('.tovname a'); if (!ob_anim.offset()) { ob_anim=$(ob).find('h1'); } noimg=true; } //ob_anim.remove(); c=ob_anim.offset(); console.log(c); t=$('.cartmini').offset(); if (!t) t=$('#cartmini').offset(); if (!t) t=$('#left').offset(); //console.log(c,t); $(ob_anim).clone() .css({'position' : 'absolute', 'z-index' : '9999', left:c.left, top:c.top }). prependTo('body') .animate({opacity: 0.5, left:t.left, top:t.top,width:10,height:10 }, 2000,'easeInOutQuart' , function() { $(this).remove(); cartminiup(dat[2]); $.fancybox('
   

����� �������� � �������!

   



'); }); } else if (dat[1]=='added') { $.fancybox('
������ ����� ��� �������� � �������

'); } }); return false; } function cartclear_jq() { $('#gozakazform,#center .clearcart,#center .renum,#outfullcart').remove() } // �������� � ��������� �������� � ��������� function add_favorite(a) { title=document.title; url=document.location; try { // Internet Explorer window.external.AddFavorite(url, title); } catch (e) { try { // Mozilla window.sidebar.addPanel(title, url, ""); } catch (e) { // Opera if (typeof(opera)=="object") { a.rel="sidebar"; a.title=title; a.url=url; return true; } else { // Unknown alert('������� Ctrl-D ����� �������� �������� � ��������'); } } } return false; } function checkmyform(ob) { var fal; ////console.log( $(ob).attr('name') ); th=func_get_arg(0) ; ea=$(th).find(' .need input:visible, .need textarea:visible, .need select:visible'); ea.each(function() { if ($(this).val()=='' || ( $(this).attr('alt') && $(this).attr('alt')==$(this).val() ) ) { fal=1; } }); if (fal) { $.fancybox('


���������� ��������� ��� ����, ���������� ���������


'); return false; } else { if ( !adminpanel ) { $("form .hidden:hidden[rel!=opt]").remove(); } //alert('��'); $(".hint").val(''); // c����� ������� ���� var oldname; var formnames; $(ob).find(' .i_t input:visible[type=text], .i_t input:visible[type=password], .i_t textarea:visible, input:visible[type=checkbox], input:visible[type=radio], select:visible ').each( function(k,inp) { n=$(inp).attr('name'); //console.log(n); if (n!==oldname) { formnames=formnames? formnames+','+n : n ; } oldname=n; }); $(ob).append(''); return true; } } function searchadm() { sa=$('#ssad').val(); if( sa ) { $("#adcont").css('opacity',0.2); $.post('/myadmin.php', { searchadm:sa }, function(data) { //$('#th'+id).slideDown( 200 ); $("#adcont").php('
'+data+'
').css('opacity',1); //setTimeout( 'location.replace(window.location.href);',1000); truesize(); }); } return false; } function cache_img_flush() { $('*').each(function(){ im=$(this).css('background-image'); ; $(this).css('background-image',str_replace('.png','.png?'+rand(1000,100000),str_replace('.png','.png?'+rand(1000,100000 ) , im ) )); }); } function setcheckval() { var objdep; var dps=''; var old={}; $('form div[group]').each(function(){ eval ('bool='+$(this).attr('group') + ';') ; dps=dps+dp; }); // form input[type=checkbox],form input[type=radio], form select ////console.log(dps); arr=dps.split(';'); ////console.log(arr); for(var k in arr) { if(arr[k] && arr[k]!==' ' && old[arr[k]]!==1 ){ old[arr[k]]=1; $('#'+arr[k]).change(function() { //console.log( 'cn', $(this).attr('id') ); checkval(); //checkval(); }); } }; checkval(); } function ini_set (varname, newvalue) { // Set a configuration option, returns false on error and the old value of the configuration option on success // // version: 1109.2015 // discuss at: http://phpjs.org/functions/ini_set // + original by: Brett Zamir (http://brett-zamir.me) // % note 1: This will not set a global_value or access level for the ini item // * example 1: ini_set('date.timezone', 'America/Chicago'); // * returns 1: 'Asia/Hong_Kong' var oldval = '', that = this; this.php_js = this.php_js || {}; this.php_js.ini = this.php_js.ini || {}; this.php_js.ini[varname] = this.php_js.ini[varname] || {}; oldval = this.php_js.ini[varname].local_value; var _setArr = function (oldval) { // Although these are set individually, they are all accumulated if (typeof oldval === 'undefined') { that.php_js.ini[varname].local_value = []; } that.php_js.ini[varname].local_value.push(newvalue); }; switch (varname) { case 'extension': if (typeof this.dl === 'function') { this.dl(newvalue); // This function is only experimental in php.js } _setArr(oldval, newvalue); break; default: this.php_js.ini[varname].local_value = newvalue; break; } return oldval; } function krsort (inputArr, sort_flags) { // Sort an array by key value in reverse order // // version: 1109.2015 // discuss at: http://phpjs.org/functions/krsort // + original by: GeekFG (http://geekfg.blogspot.com) // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // + improved by: Brett Zamir (http://brett-zamir.me) // % note 1: The examples are correct, this is a new way // % note 2: This function deviates from PHP in returning a copy of the array instead // % note 2: of acting by reference and returning true; this was necessary because // % note 2: IE does not allow deleting and re-adding of properties without caching // % note 2: of property position; you can set the ini of "phpjs.strictForIn" to true to // % note 2: get the PHP behavior, but use this only if you are in an environment // % note 2: such as Firefox extensions where for-in iteration order is fixed and true // % note 2: property deletion is supported. Note that we intend to implement the PHP // % note 2: behavior by default if IE ever does allow it; only gives shallow copy since // % note 2: is by reference in PHP anyways // % note 3: Since JS objects' keys are always strings, and (the // % note 3: default) SORT_REGULAR flag distinguishes by key type, // % note 3: if the content is a numeric string, we treat the // % note 3: "original type" as numeric. // - depends on: i18n_loc_get_default // * example 1: data = {d: 'lemon', a: 'orange', b: 'banana', c: 'apple'}; // * example 1: data = krsort(data); // * results 1: {d: 'lemon', c: 'apple', b: 'banana', a: 'orange'} // * example 2: ini_set('phpjs.strictForIn', true); // * example 2: data = {2: 'van', 3: 'Zonneveld', 1: 'Kevin'}; // * example 2: krsort(data); // * results 2: data == {3: 'Kevin', 2: 'van', 1: 'Zonneveld'} // * returns 2: true var tmp_arr = {}, keys = [], sorter, i, k, that = this, strictForIn = false, populateArr = {}; switch (sort_flags) { case 'SORT_STRING': // compare items as strings sorter = function (a, b) { return that.strnatcmp(b, a); }; break; case 'SORT_LOCALE_STRING': // compare items as strings, based on the current locale (set with i18n_loc_set_default() as of PHP6) var loc = this.i18n_loc_get_default(); sorter = this.php_js.i18nLocales[loc].sorting; break; case 'SORT_NUMERIC': // compare items numerically sorter = function (a, b) { return (b - a); }; break; case 'SORT_REGULAR': // compare items normally (don't change types) default: sorter = function (b, a) { var aFloat = parseFloat(a), bFloat = parseFloat(b), aNumeric = aFloat + '' === a, bNumeric = bFloat + '' === b; if (aNumeric && bNumeric) { return aFloat > bFloat ? 1 : aFloat < bfloat="" -1="" :="" 0;="" }="" else="" if="" (anumeric="" &&="" !bnumeric)="" {="" return="" 1;="" }="" else="" if="" (!anumeric="" &&="" bnumeric)="" {="" return="" -1;="" }="" return="" a=""> b ? 1 : a < b="" -1="" :="" 0;="" };="" break;="" }="" make="" a="" list="" of="" key="" names="" for="" (k="" in="" inputarr)="" {="" if="" (inputarr.hasownproperty(k))="" {="" keys.push(k);="" }="" }="" keys.sort(sorter);="" begin="" redundant="" this.php_js="this.php_js" ||="" {};="" this.php_js.ini="this.php_js.ini" ||="" {};="" end="" redundant="" strictforin="this.php_js.ini['phpjs.strictForIn']" &&="" this.php_js.ini['phpjs.strictforin'].local_value="" &&="" this.php_js.ini['phpjs.strictforin'].local_value="" !="=" 'off';="" populatearr="strictForIn" inputarr="" :="" populatearr;="" rebuild="" array="" with="" sorted="" key="" names="" for="" (i="0;" i="">< keys.length;="" i++)="" {="" k="keys[i];" tmp_arr[k]="inputArr[k];" if="" (strictforin)="" {="" delete="" inputarr[k];="" }="" }="" for="" (i="" in="" tmp_arr)="" {="" if="" (tmp_arr.hasownproperty(i))="" {="" populatearr[i]="tmp_arr[i];" }="" }="" return="" strictforin="" ||="" populatearr;="" }="" function="" strtr="" (str,="" from,="" to)="" {="" translates="" characters="" in="" str="" using="" given="" translation="" tables="" version:="" 1109.2015="" discuss="" at:="" http://phpjs.org/functions/strtr="" +="" original="" by:="" brett="" zamir="" (http://brett-zamir.me)="" +="" input="" by:="" uestla="" +="" bugfixed="" by:="" kevin="" van="" zonneveld="" (http://kevin.vanzonneveld.net)="" +="" input="" by:="" alan="" c="" +="" bugfixed="" by:="" kevin="" van="" zonneveld="" (http://kevin.vanzonneveld.net)="" +="" input="" by:="" taras="" bogach="" +="" bugfixed="" by:="" brett="" zamir="" (http://brett-zamir.me)="" +="" input="" by:="" jpfle="" +="" bugfixed="" by:="" brett="" zamir="" (http://brett-zamir.me)="" -="" depends="" on:="" krsort="" -="" depends="" on:="" ini_set="" *="" example="" 1:="{'hello'" :="" 'hi',="" 'hi'="" :="" 'hello'};="" *="" example="" 1:="" strtr('hi="" all,="" i="" said="" hello',="" )="" *="" returns="" 1:="" 'hello="" all,="" i="" said="" hi'="" *="" example="" 2:="" strtr('aaabaaccasdeooo',="" 'aao','aao');="" *="" returns="" 2:="" 'aaabaaccasdeooo'="" *="" example="" 3:="" strtr('aaaaaaaa',="" 'a',="" 'a');="" *="" returns="" 3:="" 'aaaaaaaa'="" *="" example="" 4:="" strtr('http',="" 'pthxyz','xyzpth');="" *="" returns="" 4:="" 'zyyx'="" *="" example="" 5:="" strtr('zyyx',="" 'pthxyz','xyzpth');="" *="" returns="" 5:="" 'http'="" *="" example="" 6:="" strtr('aa',="" {'a':1,'aa':2});="" *="" returns="" 6:="" '2'="" var="" fr="" ,="" i="0," j="0," lenstr="0," lenfrom="0," tmpstrictforin="false," fromtypestr="" ,="" totypestr="" ,="" istr="" ;="" var="" tmpfrom="[];" var="" tmpto="[];" var="" ret="" ;="" var="" match="false;" received="" replace_pairs?="" convert="" to="" normal="" from-="">to chars if (typeof from === 'object') { tmpStrictForIn = this.ini_set('phpjs.strictForIn', false); // Not thread-safe; temporarily set to true from = this.krsort(from); this.ini_set('phpjs.strictForIn', tmpStrictForIn); for (fr in from) { if (from.hasOwnProperty(fr)) { tmpFrom.push(fr); tmpTo.push(from[fr]); } } from = tmpFrom; to = tmpTo; } // Walk through subject and replace chars when needed lenStr = str.length; lenFrom = from.length; fromTypeStr = typeof from === 'string'; toTypeStr = typeof to === 'string'; for (i = 0; i < lenstr;="" i++)="" {="" match="false;" if="" (fromtypestr)="" {="" istr="str.charAt(i);" for="" (j="0;" j="">< lenfrom;="" j++)="" {="" if="" (istr="=" from.charat(j))="" {="" match="true;" break;="" }="" }="" }="" else="" {="" for="" (j="0;" j="">< lenfrom;="" j++)="" {="" if="" (str.substr(i,="" from[j].length)="=" from[j])="" {="" match="true;" fast="" forward="" i="(i" +="" from[j].length)="" -="" 1;="" break;="" }="" }="" }="" if="" (match)="" {="" ret="" +="toTypeStr" to.charat(j)="" :="" to[j];="" }="" else="" {="" ret="" +="str.charAt(i);" }="" }="" return="" ret;="" }="" function="" checkval="" ()="" {="" $('form="" .hidden').each(function()="" {="" eval="" (('bool="+$(this).attr(" group')="" +="" ';'))="" ;="" alert(0.5);="" if="" (bool="" )="" {="" alert(1);="" if(="" $(this).css('display')="='none')" {="" $(this).slidedown('fast',="" function(){="" }="" );="" $('#ihi'+$(this).attr('id')).val('')="" ;="" }="" if="" (="" $(this).attr('rel')="='spanopt'" )="" {="" rep="