var opswin; var top_=10; var left_=10; function adm_opwin(a,w,h){ if (navigator.userAgent.toLowerCase().indexOf("opera")==-1 && opswin!=null && !opswin.closed)opswin.close(); //tops(w,h); opswin=window.open(a,'',"height="+h+",width="+w+",status=yes,toolbar=no,menubar=no,location=yes,top="+top_+",left="+left_+",scrollbars=yes,resizable=yes"); opswin.focus(); } function tops(w,h){ if(navigator.appName == "Netscape") { top_=window.innerHeight/2-h/2; left_=window.innerWidth/2-w/2; } else{ top_=document.body.clientHeight/2-h/2; left_=document.body.clientWidth/2-w/2; } if(top_<0)top=0; if(left_<0)top=0; } var ind=0; function iframe_href(a){ window.frames['iframe_index'+ind].location.href='iframe_index.php?'+a; if(++ind>4)ind=0; } function iframe_href_select(a,i){ window.frames['iframe_index'+i].location.href='/adm/iframe_index.php?'+a; } function popwin(nam,w,h){ var linkk='/popwin.html?link='+nam; //tops(w,h); var scrollbars='no'; if(w>1000 || h>800){ w=w+16; h=h+16; scrollbars='yes'; } param = 'top='+top_+',left='+left_+',width='+w+',height='+h; if(navigator.userAgent.toLowerCase().indexOf("opera")==-1 && opswin!=null && !opswin.closed)opswin.close(); opswin=window.open(linkk,'',param+',status=no,toolbar=no,menubar=no,scrollbars='+scrollbars+',resizable=yes'); opswin.focus(); return false; } var edit_layer_id_old='-'; function edit_layer_show(a){ edit_layer_cleartimeout(); if(edit_layer_id_old!='-' && document.getElementById('t'+edit_layer_id_old)){ document.getElementById('t'+edit_layer_id_old).style.display='none'; edit_layer_id_old='-'; } if(document.getElementById('t'+a)){ document.getElementById('t'+a).style.display='block'; edit_layer_id_old=a; } } function edit_layer_hide(a){ if(document.getElementById('t'+a))document.getElementById('t'+a).style.display='none'; } var edit_layer_timeout; function edit_layer_hide_timeout(a){ edit_layer_timeout=setTimeout("edit_layer_hide('"+a+"')",500); } function edit_layer_cleartimeout(){ clearTimeout(edit_layer_timeout); } var start_div='-'; function show_alt_mouse(nim,t){ if(document.getElementById("div_"+nim) ){ show_alt_cleartimeout(); var d=document.getElementById("div_"+nim).style; show_alt_hide(start_div); start_div=nim; d.display='block'; } } function show_alt_hide(a){ if(document.getElementById('div_'+a)){ document.getElementById('div_'+a).style.display='none'; } } var show_alt_timeout; function show_alt_hide_timeout(a){ show_alt_timeout=setTimeout("show_alt_hide('"+a+"')",500); } function show_alt_cleartimeout(){ clearTimeout(show_alt_timeout); } if(typeof($)!='undefined'){ $(function(){ if (typeof jQuery.fn.live == 'undefined' || !(jQuery.isFunction(jQuery.fn.live))) { jQuery.fn.extend({ live: function (event, callback) { if (this.selector) { jQuery(document).on(event, this.selector, callback); } } }); } //if (typeof jQuery == "function" && ('ui' in jQuery) && jQuery.ui && ('version' in jQuery.ui)){ /* $('.image-link').magnificPopup({ type: 'image', mainClass: 'mfp-with-zoom', // this class is for CSS animation below zoom: { enabled: true, // By default it's false, so don't forget to enable it duration: 300, // duration of the effect, in milliseconds easing: 'ease-in-out', // CSS transition easing function opener: function(openerElement) { return openerElement.is('img') ? openerElement : openerElement.find('img'); } }, gallery:{ enabled:true, arrowMarkup: '', tPrev: 'предыдущая', // title for left button tNext: 'следующая', // title for right button tCounter: '%curr% of %total%' } });*/ //beautiful otkritie $('a.img_middle_beauti').live("click",function () { //$(document).on("click", "a.img_middle_beauti",function(){ var w=$(this).attr('desc_w'); var h=$(this).attr('desc_h'); var a=$(this).attr('desc_a'); //alert(a); var temp=''; temp+='
'; $('#img_big_beauti').html(temp).fadeIn("slow"); $('#img_big_beauti').width(w*1+120); $('#img_big_beauti').height(h*1+120); set_position_beauti(w*1+120,h*1+120); }); $('#close_beauti').live("click",function () { //$(document).on("click", "#close_beauti",function(){ $('#img_big_beauti').fadeOut("slow"); return false; }); //close by ESC $(document).keydown(function(e) { var key = e.charCode ? e.charCode : e.keyCode ? e.keyCode : 0; //alert(key); switch(key) { case 27: $('#img_big_beauti').fadeOut("slow"); break;// esc } }); //end $(".spoiler").each(function(){ var obj=$(this); var first=obj.children(":first");//:not(ul,table).filter("a,b,i,div,span,strong,em,h1,h2,h3,h4"); //alert(first.html()); var head=$("").append(first).html(); first.remove(); var text=obj.html(); //obj.empty(); //alert(spoiler_header_text); if(typeof(spoiler_header_text)=='undefined')spoiler_header_text=''; head=''+head+' '+spoiler_header_text+''; text=''; obj.replaceWith(head+text); /* $('.image-link').magnificPopup({ type: 'image', mainClass: 'mfp-with-zoom', // this class is for CSS animation below zoom: { enabled: true, // By default it's false, so don't forget to enable it duration: 300, // duration of the effect, in milliseconds easing: 'ease-in-out', // CSS transition easing function opener: function(openerElement) { return openerElement.is('img') ? openerElement : openerElement.find('img'); } }, gallery:{ enabled:true, arrowMarkup: '', tPrev: 'предыдущая', // title for left button tNext: 'следующая', // title for right button tCounter: '%curr% of %total%' } });*/ }); //$(".spoiler_head").live("click",function(){ $(".spoiler_head").on("click",function(){ //$(document).on("click", ".spoiler_head",function(){ var obj=$(this); var text_obj=obj.next(".spoiler_text"); if(text_obj.css("display")=="none"){ text_obj.css("display","block"); } else{ text_obj.css("display","none"); } return false; }); //var id_elm=0; //var id_elm_open=0; $(".spoilerbutton").each(function(){ var obj=$(this); var first=obj.children(":first");//:not(ul,table).filter("a,b,i,div,span,strong,em,h1,h2,h3,h4"); //alert(first.html()); var head=$("").append(first).html(); first.remove(); first=obj.children("br:first-child"); first.remove(); var text=obj.html(); //obj.empty(); head=''+head+''; text=''; obj.replaceWith('
'+head+text+'
'); }); $(".spoilerbutton_head").live("click",function(){ //$(document).on("click", ".spoilerbutton_head",function(){ var obj=$(this); //var ob_id=obj.parent().get(0).id; $(".spoilerbutton_open").each(function(idn,ob){ //alert(ob.id+' = '+ob_id); //if(ob.id!=ob_id){ //alert($(ob).html()); $(ob).removeClass("spoilerbutton_open").addClass("spoilerbutton"); $(ob).children(".spoilerbutton_text").css("display","none"); $(ob).children(".spoilerbutton_head").css("display","block"); //} }); var text_obj=obj.next(".spoilerbutton_text"); if(text_obj.css("display")=="none"){ //var w=text_obj.parent().width(); text_obj.parent().removeClass("spoilerbutton").addClass("spoilerbutton_open"); //text_obj.parent().width(w); text_obj.css("display","block"); obj.css("display","none"); //id_elm_open=ob_id; } else{ text_obj.parent().removeClass("spoilerbutton_open").addClass("spoilerbutton"); text_obj.css("display","none"); obj.css("display","block"); //id_elm_open=0; } return false; }); $(".spoilerbutton_text").live("click",function(){ //$(document).on("click", ".spoilerbutton_text",function(){ //alert($(this).find('ul').is('.links-3g-ul')); if($(this).find('ul').is('.links-3g-ul'))return true; $(this).parent().removeClass("spoilerbutton_open").addClass("spoilerbutton"); $(this).css("display","none"); $(this).prev().css("display","block"); return true; }); }); } //beautiful otkritie function set_position_beauti(w,h){ var email_left=($(window).width()-w)/2; var email_top=($(window).height()-h)/2; if (email_left<0) email_left=0; if (email_top<0) email_top=0; email_top = $(window).scrollTop() + email_top; email_left = $(window).scrollLeft() + email_left; $("#img_big_beauti").offset({top:email_top, left:email_left}); }