function advSlide(params) { vars = { objid : params.id, target : params.id+" .slidetrg", heigth : params.step*params.count+'px', limit : params.total-params.count, started : false, made : true }; if(!params.made) { of = 'overflow'; $(params.id).css("height",vars.heigth); $(params.id).css(of,"hidden"); params.started = true; params.made = true; params.margin = 0; params.realstep = false; } if($(vars.target).length) { if(!params.started) { params.started = true; } else { if(params.margin<=(vars.limit*params.step*-1)) { params.realstep = true; } else { if(params.margin>=0) { params.realstep = false; } } if(params.realstep) { params.margin = params.margin+params.step; } if(!params.realstep) { params.margin = params.margin-params.step; } $(vars.target).animate({"margin-top": params.margin}); } } setTimeout( function (){ advSlide(params);}, 1000*params.time); }
var www = document.domain || 'new-rutor.org';
if(www == "localhost") { www = ""; }
function set_cookie ( name, value, exp_y, exp_m, exp_d, path, domain, secure ) {
var cookie_string = name + "=" + escape ( value );
if ( exp_y > 2012) {
var expires = new Date ( exp_y, exp_m, exp_d );
cookie_string += "; expires=" + expires.toGMTString();
}
if ( exp_y < 2012) {
var date = new Date();
var expires = new Date(date.getTime() + 1000*60*60*24*exp_y);
cookie_string += "; expires=" + expires.toGMTString();
}
if ( path ) cookie_string += "; path=" + escape ( path );
if ( domain ) cookie_string += "; domain=" + escape ( domain );
if ( secure ) cookie_string += "; secure";
document.cookie = cookie_string;
}
function delete_cookie ( cookie_name ) {
var cookie_date = new Date (); // Текущая дата Р С‘ РІСЂРµРСРЎРЏ
cookie_date.setTime ( cookie_date.getTime() - 1 );
document.cookie = cookie_name += "=; expires=" + cookie_date.toGMTString();
}
function get_cookie ( cookie_name ) {
var results = document.cookie.match ( '(^|;) ?' + cookie_name + '=([^;]*)(;|$)' );
if ( results ) return ( unescape ( results[2] ) );
else return null;
}
function parseUrl(url) {
var r = /:\/\/(.[^/]+)(\/.*|$)/;
if(reg = url.match(r)) {
domain = reg[1];
params = reg[2];
if(params == '/') params = 'Главная';
if(params == '') params = 'Главная';
if(params == '/rutororg') params = '/rutororg_partner';
r = new Object;
r[domain]=params;
return r;
} else {
return url;
}
}
var MetrikaParams = '--';
if(get_cookie ('korjik_from')) {
MetrikaParams = parseUrl(get_cookie ('korjik_from'));
}
if(document.referrer && document.referrer.indexOf(www) == -1 ) {
if(!get_cookie ( 'korjik_from')) {
set_cookie ( 'korjik_from', document.referrer, 360, 0, 0, '/', www);
}
}