0)
{
$.get('myadmin.php?list=adm&id='+id+'&ur='+ur,
function(data)
{
$('.ajax').remove();
$("#"+id).append(data);
setajax(id);
$.cookie("openid["+id+"]", "1");
}
);
}
else
{
$("#lim"+(-1)*id+'-'+lim).append('
<0){subid=$("#lim"+(-1)*id+'-'+lim+" div").remove();}="" else{subid="$("#"+id+"" div").remove()}="" $.cookie("openid["+id+"]",="" null);="" }="" }="" function="" addate()="" {="" var="" currenttime="new" date();="" $("#adcont="" [name="data]").val(currentTime.getFullYear()+'.'+(currentTime.getMonth()+1)+'.'+currentTime.getDate()" );="" }="" function="" imgoff(obj)="" {="" obj.classname="xx" ;="" }="" var="" resize="false;" function="" truesize()="" {="" wnead="831;" ww="$(window).width();" minw="parseInt($('#ct0').css('min-width'));" maxw="parseInt($('#ct0').css('max-width'));" maxw="maxw">0){subid=$("#lim"+(-1)*id+'-'+lim+">< 1="" 2000="" :="" maxw="" ;="" w="ww">< minw="" minw="" :="" ww="" ;="" $('title').text(minw);="" if="" (!adminpanel)="" {="" h="$(window).height();" pad="w/2" -="" math.floor(="" w/2="" )="" 1="" :="" 0="" ;="" alert(w);="" $("html").width(w-pad);="" $("body").width(w-pad);="" if="" (resize)="" {="" $('#inmod').css('max-height',="" (screenheight()-100)+'px'="" );="" if="" (="" $('#fancybox-content').php()="" )="" {="" $.fancybox.resize();="" $.fancybox.center();="" }="" }="" if="" (="" $('#ct1').attr('class')="='rezon'" )="" ����="" ������="" {="" www="maxw"> ww ? ww-pad : maxw;
www=minw < www="" www="" :="" minw;="" $('#ct0').width(="" www="" );="" lr="(" (="" ww=""> minw ? ww-pad : minw)-www )/2 ;
$('#header').css({'left': lr+'px', 'right': lr+'px' });
//alert(1);
if ( $('#cmenu .mincart').attr('class') ) // ���� ���� ������������
{
//$("html").height(h);
blocktov_w=$('#cmenu .mincart').width();
// lm=404; ����� ���!
num= Math.floor( $('#cmenu').width() / blocktov_w );
pad= Math.floor ( ( $('#cmenu').width() - (num * blocktov_w ) ) / (2 * num )) -1;
col=1;
mincart=$('#ct1.rezon #cmenu .mincart');
//mincart.css('margin-left',pad+'px').css('margin-right',pad+'px');
$('#newcss').remove();
$('body').append('');
if (oldcolnum!==num)
{
$('#ct1.rezon #cmenu .cll').remove();
oldcolnum=num;
mincart.each (function()
{
if (col==num)
{
$(this).after('
');
}
//pad=40;
//$(this).css('margin-left',pad+'px').css('margin-right',pad+'px');
col=col+1;
if (col>num)
{
col=1;
}
});
}
}
}
for(var i in resizefun)
{
resizefun[i]();
}
}
else
{
popr=30;
$('#outmenu').width(w-305);
$('.adm').height(screenHeight()-popr);
$('#maintab').height(screenHeight()-20-popr);
var nw=w-345;
if (nw<595) {nw="558;" }="" ttl(nw);="" $('#adcont="" .inadcont').height(screenheight()-51-popr).width(nw);="" $('#adcont="" .inadcont').height(screenheight()-32-popr).width(nw);="" var="" hf="screenHeight()-220;" if="" (="" $('#adcont="" input[name="mode]').val()==2" )="" {="" $('#elm1_ifr').height(hf);="" $('.mceiframecontainer="" ').height(hf);="" $('#elm1_tbl').height('auto');="" }="" }="" $(''="" alert(w);="" }="" function="" truesize_reg(fun)="" {="" resizefun[resizefun.length]="fun;" }="" function="" ttl(t)="" {="" $('title').text(t);="" return="" t;="" }="" function="" minmax(minval,val,maxval)="" {="" if="">595)>
maxval)
{
return maxval;
}
else
{
return val;
}
}
function colorpick()
{
$('.color input').ColorPicker({
onSubmit: function(hsb, hex, rgb, el) {
$(el).val(hex);
$(el).ColorPickerHide();
},
onBeforeShow: function () {
$(this).ColorPickerSetColor(this.value);
}
})
.bind('keyup', function(){
$(this).ColorPickerSetColor(this.value);
});
}
function parse1()
{
seleca=$('#parsform [name=seleca]').val();
basehr=$('#parsform [name=name]').val();
$('#parstable '+seleca).each( function()
{
href=basehr+$(this).attr('href')+$('#enter').text();
$('#parsform [name=conturl]').append(href);
});
}
function parse2()
{
enter=$('#parenter').text();
tab=$('#partab').text()
seleca=$('#parsform [name=seleca]').val();
basehr=$('#parsform [name=name]').val();
selecname=$('#parsform [name=selecname]').val();
seln=selecname.split(enter);
x=0;
var sl=[];
var dt=[];
seln.forEach( function(item)
{
sel=item.split('==');
//alert(sel[1] );
sl[x]=sel[0];
dt[x]=sel[1];
$('#parsform [name=outpars]').append(sl[x]+tab);
//$('#parsform [name=outpars]').append('dsd');
x++;
});
$('#parsform [name=outpars]').append(enter);
x=0;
$('#parstable .urls').each( function()
{
x++;
if (x<3) {="" href="http://anuschka.ru/cont/js/$(this).text();" $('#parsform="" [name="conturl]').append(href);" $.get(="" 'cont/'+href+'.php',="" function(data)="" {="">3)>'+data+'
');
dt.forEach( function(d)
{
dat=$('#parstable '+d);
$('#parsform [name=outpars]').append(dat+tab);
});
}
);
}
});
}
function datetime()
{
$('.datetime input').datetimepicker();
$('.timepicker input').timepicker({});
$('.datepicker input').datepicker({});
}
var fancyopen=false;
function scroller()
{
if (fancyopen) $.fancybox.resize();
}
function trim( str, charlist ) {
charlist = !charlist ? ' \s�' : charlist.replace(/([\[\]\(\)\.\?\/\*\{\}\+$\^\:])/g, '$1');
var re = new RegExp('^[' + charlist + ']+|[' + charlist + ']+$', 'g');
return str.replace(re, '');
}
function snif(text)
{
alert(text);
return text;
}
function implode( glue, pieces ) { // Join array elements with a string
//
// + original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
// + improved by: _argos
return ( ( pieces instanceof Array ) ? pieces.join ( glue ) : pieces );
}
function apply()
{
var val=[] ;
var i=0;
var inserter='';
$('#modaller .sorter input:checked' ).each(function()
{
val[i++]=$(this).attr('value');
inserter= inserter + '' + $(this).attr('value') + ' ' ;
});
variable=$('#fanvalue').attr('value');
$('#' + variable ).val(implode(' ',val));
$('#d-' + variable+ ' .spanins').php( inserter );
$.fancybox.close();
}
function myBrowser()
{
tinyMCE.execCommand('mceImages', true, arguments[3]);
//alert(12);
}
var jqtiny=false;
function edit_tn(selector,settings)
{
if ( $(selector).attr('name') )
{
if (!jqtiny)
{
$.getScript('/jscripts/tiny_mce/jquery.tinymce.js',function()
{
jqtiny=true;
edit_tiny(selector,settings);
});
}
else
{
edit_tiny(selector,settings);
}
}
}
function edit_tiny (selector,settings)
{
if (settings)
{
$(selector).tinymce(settings)
}
else
{
$(selector).tinymce({
// Location of TinyMCE script
script_url : '/jscripts/tiny_mce/tiny_mce.js',
// General options
theme : "advanced",//advanced
mode:'textareas',
plugins : "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,advlist,images",
// Theme options
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true,
// Example content CSS (should be your site CSS)
content_css : ( ( $('#reg5').val() || $('#reg9').val() ) ? "/jscripts/lib/remedit.css" : '' ) ,
file_browser_callback : "myBrowser",
// Drop lists for link/image/media/template dialogs
template_external_list_url : "lists/template_list.js",
external_link_list_url : "lists/link_list.js",
external_image_list_url : "lists/image_list.js",
media_external_list_url : "lists/media_list.js",
// Replace values for the template plugin
template_replace_values : {
username : "Some User",
staffid : "991234"
}
});
}
}
function rand( min, max )
{ // Generate a random integer
//
// + original by: Leslie Hoare
if( max ) {
return Math.floor(Math.random() * (max - min + 1)) + min;
} else {
return Math.floor(Math.random() * (min + 1));
}
}
function setpopup()
{
$('.help').each( function(e)
{
cont=decodeXml( $(this).find('.minihelp').php() );
//var query = url.substring(url.indexOf('?') + 1);
pref=cont.substr(0,2);
//alert(pref);
if ( pref=='l:' || pref=='�:' )
{
cont=cont.substr(2);
align={
target: 'topLeft',
tooltip: 'bottomRight'
};
tipal= 'bottomRight';
}
else
{
align={
target: 'topRight',
tooltip: 'bottomLeft'
};
tipal= 'bottomLeft';
}
biglink= $(this).find('.bighelp').php();
if (biglink)
{
biglink='���������
';
}
$(this).qtip(
{
content:cont+biglink,
show: 'mouseover',
hide: { delay: 200, fixed: true },
position: {
type: 'absolute',
corner: align
},
style: {
width:400,
padding: 5,
background: '#ffffff',
color: 'black',
textAlign: 'center',
border: {
width: 7,
radius: 5,
color: '#c0c0c0'
},
tip: tipal,
name: 'dark' // Inherit the rest of the attributes from the preset dark style
}
});
});
}
/*function resize(setup) {
02 // �������� �� ���������
03 var saveProportions = setup.saveProportions || true
04 var animate = setup.animate || true
05 var toHeight = setup.toHeight || ...
06 }
07 var setup = {toWidth: 100, animate: true}
08
09 resize(setup)
10 // ���
11 resize({toWidth: 100, animate: true})*/
function jquery_input_focus_unfocus_with_text( selectorinput , allalt)
{
selectorinput=selectorinput || 'form input.hinted, form textarea.hinted';
$(selectorinput).each(function()
{
jquery_input=$(this);
alt=allalt? allalt: jquery_input.attr('alt');
jquery_input.bind('focus', function() {
if ($(this).val()==$(this).attr('alt') ){
$(this).removeClass('hint');
$(this).val('');
}});
jquery_input.bind('focusout', function() {
if ( ! $(this).val().length>0){
$(this).val( $(this).attr('alt') );
$(this).addClass('hint');
}
});
if (jquery_input.val().length<=0 )="" {="" jquery_input.val(alt).addclass('hint');="" }="" });="" };="" function="" setpriceautochange()="" {="" $('#center="" .minimod="" input,="" #center="" .minimod="" select').change(="" );="" $('#center="" .minimod="" ').click(function="" ()="" {="" setprice();="" })="" }="" function="" setprice()="" {="" var="" summ="0;" var="" itogo="0;" $('#center="" .minimod="" input:visible').each(function()="" {="" if(="" $(this).attr('checked')="" )="" {="" summ+="$(this).attr('type')=='radio'" number($(this).attr('rel'))="" :="" number($('#p'+$(this).attr('id')).val());="" }="" });="" $('#center="" .minimod="" select').each(function()="" {="" summ="Number(summ)" +="" number(="" $(this).find('option[value="+$(this).val()+" ]').attr('rel')="" );="" });="" if="" (summ="">0)
{
mainprice=Number( str_replace(' ','', $('.mainprice').text()) );
itogo=Number(summ)+mainprice;
itogoname=mainprice>0 ? '�����' : '����';
itogo = Math.floor(itogo) < itogo="" itogo.tofixed(2)="" :="" itogo="" ;="">'+itogoname+': '+itogo +' '+mainval+' | ');
}
else
{
$('#itogo').php(' | | ');
}
}
function wheelmicrotov(event, delta)
{
//delt=delt+delta;
//ttl(delt);
if (delta<0) {="" delta="-delta;" ob2="$('#microtov" .viz:last');="" for="" (="" var="" i="0" ;="">0)>< scrol="" &&="" !ob.hasclass('afixed')="" )="" {="" ob.addclass("afixed").attr(="" {="" topold:="" topold,="" posit:="" ob.css('position')="" ,="" lco:="" leftcenterold="" ,="" oldstyle:="" ob.attr('style')="" }="" ).css(="" {="" position:="" 'fixed',="" top:0="" }="" )="" ;="" }="" else="" if="" (="" topold=""> scrol && ob.hasClass('afixed') )
{
ob.removeClass("afixed").css('position', ob.attr('posit') ).attr('style', ( ob.attr('oldstyle') ? ob.attr('oldstyle') : '' ) ) ;
}
}
else if( sel=='#inleft' || sel=='#inright' )
{
/*
���� ������ ����� ����, ��� ������ ������
������� �� ������� ����
���� ����
������� �� �������� ���� �����
*/
oh = ob.height();
if( oh < $('#incen').height()="" )="" if(="" oh="">< wh="" )="" {="" if="" (="" topold="">< scrol="" &&="" !ob.hasclass('afixed')="" )="" {="" ob.addclass("afixed").attr(="" {="" topold:="" topold,="" posit:="" ob.css('position')="" ,="" lco:="" leftcenterold="" ,="" oldstyle:="" ob.attr('style')="" }="" ).css(="" {="" position:="" 'fixed',="" top:0="" }="" )="" ;="" }="" else="" if="" (="" topold=""> scrol && ob.hasClass('afixed') )
{
ob.removeClass("afixed").css('position', ob.attr('posit') ).attr('style', ( ob.attr('oldstyle') ? ob.attr('oldstyle') : '' ) ) ;
}
}
else
{
if ( Number(topold) + oh < scrol="" +="" wh="" &&="" !ob.hasclass('afixed')="" )="" {="" ob.addclass("afixed").attr(="" {="" topold:="" topold,="" posit:="" ob.css('position')="" ,="" lco:="" leftcenterold="" ,="" oldstyle:="" ob.attr('style')="" }="" ).css(="" {="" position:="" 'fixed',="" bottom:0="" }="" )="" ;="" }="" else="" if="" (="" $(sel).hasclass('afixed')="" )="" {="" if(="" number(="" topold)="" +oh=""> scrol + wh )
{
ob.removeClass("afixed").css('position', ob.attr('posit') ).attr('style', ( ob.attr('oldstyle') ? ob.attr('oldstyle') : '' ) ) ;
}
else
{
if ( scrol+wh> $('#ct0').height() - $('#footer').height() )
{
ob.css('bottom', scrol+wh - ($('#ct0').height() - $('#footer').height()) );
}
else
{
ob.css('bottom', 0 );
}
}
}
}
}
else
{
if ( topold < scrol="" &&="" !ob.hasclass('afixed')="" )="" {="" ob.addclass("afixed").attr(="" {="" topold:="" topold,="" posit:="" ob.css('position')="" ,="" lco:="" leftcenterold="" ,="" oldstyle:="" ob.attr('style')="" }="" ).css(="" {="" position:="" 'fixed',="" left="" :="" w2+leftcenterold="" ,="" top:0="" }="" )="" ;="" }="" else="" if="" (="" topold=""> scrol && ob.hasClass('afixed') )
{
ob.removeClass("afixed").css('position', ob.attr('posit') ).attr('style', ( ob.attr('oldstyle') ? ob.attr('oldstyle') : '' ) ) ;
}
}
});
}
var fixobj=[];
function fix_set(sel)
{
fixobj[ fixobj.length ] = sel;
}
function cl(x)
{
console.log(x);
return x;
}
$(document).ready(function()
//if (false)
{
$(window).scroll(function()
{
fix_calc();
});
$(window).mousemove( function()
{
if( !$.cookie('ut') )
{
$.cookie('ut','1;1');
}
ut=$.cookie('ut').split(';');
num=(ut[0]>0 ? ut[0] : 1);
$.cookie('ut' , ( (Number(num) +1 ) + ';' + CryptoJS.SHA1( String(Number(num) +1) + "489747" ) ) ) ;
});
datetime();
$("a.group").fancybox(
{
'hideOnContentClick': false,
'imageScale': false,
'centerOnScroll': false
}
);
if (adminpanel )
{
colorpick();
setajax();
ajaxform();
setuploader();
setupdatecoord();
}
setpopup();
if ( $('#center').attr('class')=='tp-tov') {
setpriceautochange();
}
$(window).resize( function()
{
resize=true;
truesize();
fix_calc();
});
$("#center img.imgbox").each(function()
{
var largePath = $(this).attr("src");
largePath2=largePath.split("cont/img").join("cont/img/big");
$(this).wrap("");
});
$("#center").find("a.imgbig, a[href$='jpg'], a[href$='png'], a[href$='gif'] ").fancybox(
{
'autoScale': false,
'centerOnScroll': false
});
//$("div[title$='my']");
/*$("#center a.selectajax").fancybox(
{
'imageScale': false,
'centerOnScroll': false,
'onComplete': function ()
{
variable=$('#fanvalue').attr('value');
$('#d-'+variable+' .spanins span').each(function()
{
$('#f-'+$(this).text() ).attr('checked','checked');
});
resize=true;
fancyopen=true;
truesize();
setTimeout('truesize()',100);
},
'onClosed':function()
{
fancyopen=false;
},
'centerOnScroll':true,
'type':'ajax'
}
);*/
window.onscroll = function ()
{
setTimeout('scroller()',100);
}
//alert(1);
jquery_input_focus_unfocus_with_text(false,false);
truesize();
setcheckval();
setcheckident();
setprice();
setTimeout('truesize()',100);
if ( $('.sorter').attr('class') ) { $('.sorter').tablesorter(); }
edit_tn('.tiny textarea',false);
//var delt=0;
$("#microtov").mousewheel( function (event, delta)
{
wheelmicrotov(event, delta);
return false;
} );
});=0>