/* Copyright (c) 2008 Astronim* (astronim.com) */ $(document).ready(function(){ if ($("#grafMenu").length){ var dwidth = $(document).width(); $("#grafMenu").width(dwidth-29-75); $("#grafMenu").css('display', 'block'); $("#grafMenu").css('left', dwidth+29); $("#grafMenu").animate({left: dwidth}, 'slow'); initGrafMenuClick(); } }); $(window).resize(function(){ if ($("#grafMenu").length){ var dwidth = $(document).width(); $("#grafMenu").width(dwidth-29-40);; if( !$("#grafMenu").is('.opened') ){ $("#grafMenu").css('left', dwidth); } else { $("#grafMenu").css('left', 29); }; initGrafMenuClick(); } }); function initGrafMenuClick(){ var dwidth = $(document).width(); $("#grafMenu .label").unbind(); $("#grafMenu .label").click(function(){ if( !$("#grafMenu").is('.opened') ){ $("#grafMenu").animate({left: 29}, 'slow'); $("#grafMenu").addClass('opened'); } else { $("#grafMenu").removeClass('opened'); $("#grafMenu").animate({left: dwidth}, 'middle'); } }) } var Root; var LinkDivActive=0; var onDiv; var timeOnDiv; var layerRef; var styleRef; var showVar; var hideVar; var ua=navigator.userAgent.toLowerCase(); var dom=(document.getElementById) ? 1 : 0; var nn4=(document.layers) ? 1 : 0; var ie=(((ua.indexOf('msie')!=-1) && (ua.indexOf('opera')==-1))) ? 1 : 0; var opera=(ua.indexOf('opera')!=-1) ? 1 : 0; var offsetX=92; var offsetY=3; if (dom) { layerRef="document.getElementById(divId)"; styleRef=".style"; showVar="'visible'"; hideVar="'hidden'"; } else if (ie) { layerRef="document.all[divId]"; styleRef=".style"; showVar="'visible'"; hideVar="'hidden'"; } else if (nn4) { layerRef="document.layers[divId]"; styleRef=""; showVar="'show'"; hideVar="'hide'"; } function hideDiv(divId) { if (eval(layerRef)) eval(layerRef+styleRef+'.visibility='+hideVar); } function showDiv(divId) { if (eval(layerRef)) eval(layerRef+styleRef+'.visibility='+showVar); } function moveDiv(divId,xoff,yoff) { if (eval(layerRef)) { eval(layerRef+styleRef+'.left='+xoff); eval(layerRef+styleRef+'.top='+yoff); } } function show(divId) { if (eval(layerRef)) { if (timeOnDiv != null) { clearTimeout(timeOnDiv); hideDiv(onDiv); } moveDiv(divId,relPosX('p'+divId)+offsetX,relPosY('p'+divId)+offsetY); showDiv(divId); onDiv=divId; } } function timer() { timeOnDiv=setTimeout("divOut()",1000) } function divOut() { if (LinkDivActive==0) { hideDiv(onDiv); } } function over() { LinkDivActive=1; clearTimeout(timeOnDiv); } function out() { LinkDivActive=0; timeOnDiv=setTimeout("divOut()",800) } function relPosX(divId) { if (eval(layerRef)) { if (nn4) return eval(layerRef+styleRef+'.pageX'); else { var elem=eval(layerRef); var pos=elem.offsetLeft; while (elem.offsetParent!=null) { elem=elem.offsetParent; pos+=elem.offsetLeft; if (elem.tagName=='BODY') break; } return pos; } } } function relPosY(divId) { if (eval(layerRef)) { if (nn4) return eval(layerRef+styleRef+'.pageY'); else { var elem=eval(layerRef); var pos=elem.offsetTop; while (elem.offsetParent!=null) { elem=elem.offsetParent; pos+=elem.offsetTop; if (elem.tagName=='BODY') break; } return pos; } } } // ----------------------- function newi(arg) { if (document.images) { rslt=new Image(); rslt.src=arg; return rslt; } } function chgi() { if (document.images && (preload==true)) for (var i=0;i6){ alert('Значения паролей не совпадают'); document.reg_form.elements[6].focus(); return false; } } function check1(last){ var first=0; //var last=8; var error=false; for (i=first;i<=last;i++){ if(document.form1.elements[i].value==''){ if(!error)flag=i; error=true; } } if(error){ document.form1.elements[flag].focus(); alert('Пожалуйста, заполните все обязательные поля!'); return false; } } function fcheck(obj){ mask=0; if(obj.author.value=='') {mask=1; obj.author.focus();} //if(obj.title.value==''&&mask!=1){mask=1; obj.title.focus();} if(obj.post.value==''&&mask!=1){mask=1; obj.post.focus();} if(mask==1){ alert('Пожалуйста, заполните все обязательные поля!'); return false; } } function wo(link,ww,hh,title) { w=window.open(link,'',(ww ? 'width='+ww+',' : '')+(hh ? 'height='+hh+',' : '')+'toolbar=0,scrollbars=0,resizable'); if (link.indexOf('.html')==-1) { if (document.layers) title=''; w.document.open(); w.document.write(''+title+''); w.document.write('
'); w.document.close(); } w.focus(); } // --> var showImage = function(object) { var __this = object; var _this = $(object).parents('a'); var smallImgHeight = $(object).height(); var smallImgWidth = $(object).width(); $(_this).prepend(''); $('.big-image', _this).load(function () { var param = ($(__this).attr('align') != 'left') ? -1 : 1; if ($(__this).attr('align') == 'right') { $(this).remove(); } $(this) .css('margin-left', -$(this).width() / 2 - smallImgWidth / 2 * param) .css('margin-top', -$(this).height() / 2 + smallImgHeight / 2) .fadeIn() .mouseout(hideImage); }) } var hideImage = function() { $('.big-image').fadeOut(500, function () { $(this).remove(); }); } $(function () { $('.popup a').each(function () { if (this.toString().match('-big.')) { var timer = null; $('img', this).hover( function () { _this = this; if (timer) clearTimeout(timer); timer = setTimeout(function () {showImage(_this)}, 1000); $(this).addClass('relative-position'); }, function () { clearTimeout(timer); } ); } }); });