if( typeof(RealVu_once)=='undefined') {
RealVu_once = true; //
top2.RealVu_focus=true;
top2.RealVu_mouse=true; //
top2.RealVu_i=0;
top2.RealVu_o=1; //
top2.RealVu_ow=0; //
top2.RealVu_vnum=0;
top2.RealVu_test=false;
top2.RealVu_ff=navigator.userAgent.match(/Firefox/i);
top2.RealVu_ff_o=(top2.RealVu_ff && (navigator.userAgent.match(/Firefox\/2./i) || navigator.userAgent.match(/Firefox\/1./i)));
top2.RealVu_ff_n=(top2.RealVu_ff && !top2.RealVu_ff_o);
top2.RealVu_ie=navigator.appVersion.match(/MSIE/);
top2.RealVu_saf=(navigator.userAgent.match(/Safari/) && !navigator.userAgent.match(/Chrome/));
top2.RealVu_chrome=( navigator.userAgent.match(/Chrome/) );
top2.RealVu_ope=window.opera;
top2.RealVu_fowner=null;
top2.RealVu_insider = false;
top2.RealVu_area=99;
top2.RealVu_ie_old=false;
if(top2.RealVu_ie && !navigator.appVersion.match(/MSIE 8/)) top2.RealVu_ie_old=true;
top2.RealVu_getZ = function( ) //
{
var z=0, j = 0, e = Array();
e = top2.document.getElementsByTagName("*");
for( var i=0; i < e.length; i++){
if(e[i].currentStyle) {
j = parseInt(e[i].currentStyle["zIndex"]);
} else if(window.getComputedStyle) {
j = parseInt(document.defaultView.getComputedStyle(e[i],null).getPropertyValue("z-index"));
}
if(!isNaN(j) && j > z) z=j;
}
return ++z;
};
top2.RealVu_msover=function() {
if(top2.RealVu_mouse) {
top2.RealVu_focus=true;
top2.RealVu_mouse=false;
top2.RealVu_removeEvent(top2, "mousemove", top2.RealVu_msover);
top2.RealVu_fo();
}
};
top2.RealVu_addEvent = function(elem, evtType, func)
{
if(elem) {
if(elem.addEventListener) {
elem.addEventListener(evtType, func, true);
} else if(elem.attachEvent) {
elem.attachEvent("on" + evtType, func);
} else {
elem["on" + evtType] = func;
}
}
};
top2.RealVu_removeEvent = function(elem, evtType, func)
{
if(elem) {
if(elem.removeEventListener) {
elem.removeEventListener(evtType, func, false);
} else if(elem.detachEvent) {
elem.detachEvent("on" + evtType, func);
} else {
elem["on" + evtType] = func;
}
}
};
top2.RealVu_bl_insider= function() { //
top2.RealVu_removeEvent( top2.RealVu_fowner, "blur", top2.RealVu_bl_insider );
if( top2.RealVu_fowner == top2.document.activeElement )
{
top2.RealVu_insider = false;
top2.RealVu_bl();
}
else
{
try {
var ae = top2.document.activeElement;
if( typeof(ae) !='undefined' )
{
top2.RealVu_insider = true;
top2.RealVu_focus = true;
top2.RealVu_fowner = ae;
top2.RealVu_addEvent( top2.RealVu_fowner, "blur", top2.RealVu_bl_insider );
}
}
catch(ex1){}
}
};
top2.RealVu_bl= function() {
if( top2.RealVu_focus && (!top2.RealVu_ie || !top2.RealVu_insider) )
{
top2.RealVu_focus=false;
var tp=""; if(top2.RealVu_vnum>0) tp=" View Time counter paused.";
if(top2.RealVu_test) top2.RealVu_log.write( "Page out of focus."+tp+" RealVu idle");
}
};
top2.RealVu_fo=function() {
if( !top2.RealVu_focus ) {
top2.RealVu_focus=true;
var tp=""; if(top2.RealVu_vnum>0) tp=" View Time counter resumes.";
if(top2.RealVu_test) top2.RealVu_log.write( "Page in focus."+tp+" RealVu resume");
}
if(top2.RealVu_ie)
{
try {
var ae = top2.document.activeElement; //
if( typeof(ae) !='undefined' )
{
top2.RealVu_insider = true;
top2.RealVu_focus = true;
top2.RealVu_fowner = ae;
top2.RealVu_addEvent( top2.RealVu_fowner, "blur", top2.RealVu_bl_insider );
}
}
catch(ex1){}
}
};
top2.RealVu_df=function() {
top2.focus(); top2.RealVu_fo();
};
top2.RealVu_correlator_onload=function()
{
if(top2.RealVu_test) {
var now = new Date(), dur = (now.getTime() - top2.RealVu_log.start_time)/1000;
top2.RealVu_log.write( "Page loaded in "+dur+" sec." );
}
top2.RealVu_correlator_run();
};
top2.RealVu_addEvent(top2, "blur", top2.RealVu_bl );
top2.RealVu_addEvent(top2, "focus", top2.RealVu_fo );
top2.RealVu_addEvent(top2, "scroll", top2.RealVu_fo );
top2.RealVu_addEvent(top2, "load", top2.RealVu_correlator_onload );
//
if(!top2.RealVu_focus && !top2.RealVu_ie) top2.RealVu_addEvent(top2, "mousemove", top2.RealVu_msover);
//if( top2.location.search.indexOf('demo')<0) top2.RealVu_fo();
top2.RealVu_MouseDown = function (e) { //
var x = RealVu_viz_check.sl()+e.clientX;
var y = RealVu_viz_check.st()+e.clientY;
var ty = 0;
for (var i = 0; i < top2.RealVu_i; i++)
{
var adi = top2.RealVu_adi[i];
if(adi!=null && adi.cl==0 && adi.rend!="")
{
if(adi.tt == 1)
ty = 30;
else
ty=0;
var x1 = adi.x;
var y1 = adi.y;
var x2 = x1 + adi.width;
var y2 = y1 + adi.height + ty;
if( (x1< x)&&(x< x2)&&(y1< y)&&(y< y2))
{
adi.cl=1;
if(top2.RealVu_test) top2.RealVu_log.write("Count click at Ad #"+(i+1)+" x=" + x+" y="+ y );
var mv=top2.RealVu_tell(adi.wnd,"RealVuR"+i);
if(mv) {
try {mv.cl();}
catch(e1) {
if(top2.RealVu_test) top2.RealVu_log.write("Exception "+e1.message );
}
}
break;
}
}
}
};
top2.RealVu_addEvent( top2.document, "mousedown", top2.RealVu_MouseDown );
function RealVu_check_over( r )
{
var s_debug = "";
var ovr=false;
var divs = document.body.getElementsByTagName('div');
for(var i=0; i < divs.length; i++)
{
var dv = divs[i];
//if( dv.id.indexOf("submenu_")==-1 ) continue;
if( dv.id.indexOf("RealVu")>-1 ) continue; //
//if( !(dv.style.position == "absolute" || dv.style.position == "relative" || dv.style.position == "fixed")) continue;
var w = findPosG( dv );
var q = top2.findWH( dv );
if( w!=null && typeof(w) != 'undefined')
{
w.x2 = w.x+q.w; //
w.y2 = w.y+q.h;
w.display = dv.style.display;
if(dv.currentStyle) {
w.zIndex = parseInt(dv.currentStyle["zIndex"]);
} else if(window.getComputedStyle) {
w.zIndex = parseInt(document.defaultView.getComputedStyle(dv,null).getPropertyValue("z-index"));
}
if( (w.x2 >= r.x1) && (w.y2 >= r.y1) && (w.x <= r.x2) && (w.y <= r.y2) /*&& (w.display=='block')*/ )
{
//overlapped
if( (!isNaN( r.zIndex) && !isNaN(w.zIndex) && (w.zIndex>= r.zIndex) ) ||
( isNaN( r.zIndex) && !isNaN(w.zIndex) ) && (w.zIndex>0))
{
ovr = true; //overlapped
s_debug += "CHECK "+i+" "+dv.id+" x="+w.x+",y="+w.y+ " ";
s_debug += "width="+q.w+ " height="+q.h+ ";
";
s_debug += " zIndex="+w.zIndex;
s_debug += " display="+dv.style.display;
s_debug +=" ovr="+ovr+"
";
//dv.style.border = "dashed 2px limegreen";
top2.RealVu_log.reset();
top2.RealVu_log.write( s_debug );
break;
}
}
}
}
return ovr;
};
top2.move_decor=function(i) {
var adi = top2.RealVu_adi[i];
//
if(adi != null) {
adi.findPos();
adi.decor();
adi.deco.style.top = (adi.y-12)+"px";
adi.deco.style.left = adi.x+"px";
adi.deco.style.zIndex = top2.RealVu_getZ();
adi.deco2.style.top = (Number(adi.y)+Number(adi.height)-5)+"px";
adi.deco2.style.left = adi.x+"px";
adi.deco2.style.zIndex = top2.RealVu_getZ();
}
//
};
top2.call_decor=function() {
for (var i = 0; i < top2.RealVu_i; i++) top2.move_decor(i,null);
};
top2.move_easels = function()
{
for (var i = 0; i < top2.RealVu_i; i++)
{
var adi = top2.RealVu_adi[i];
if(adi != null )
{
if(top2.RealVu_log.run>0)top2.move_decor(i);
}
}
};
top2.init_decors = function() {
top2.RealVu_addEvent( top2, "resize", top2.call_decor );
for (var i = 0; i < top2.RealVu_i; i++)
{
var adi = top2.RealVu_adi[i];
if(adi != null)
{
adi.init_decor();
}
}
};
top2.RealVu_gbw = function (e) {
var w = new Object();
w.left = 0; w.top = 0; w.right = 0; w.bottom = 0;
if(window.getComputedStyle) {
s = window.getComputedStyle(e, null);
w.left = parseInt(s.borderLeftWidth.slice(0, -2));
w.top = parseInt(s.borderTopWidth.slice(0, -2));
w.right = parseInt(s.borderRightWidth.slice(0, -2));
w.bottom = parseInt(s.borderBottomWidth.slice(0, -2));
}
else {
w.left = top2.RealVu_pbw(e.style.borderLeftWidth);
w.top = top2.RealVu_pbw(e.style.borderTopWidth);
w.right = top2.RealVu_pbw(e.style.borderRightWidth);
w.bottom = top2.RealVu_pbw(e.style.borderBottomWidth);
}
return w;
};
top2.RealVu_pbw = function(w) {
var bw = 0;
if(typeof(w) == "string" && w != null && w != "" ) {
p = w.indexOf("px");
if(p >= 0) {
bw = parseInt(w.substring(0, p));
}
else {
bw = 1;
}
}
return bw;
};
top2.findWH = function( adi )
{
var ad = adi;
var q = new Object();
q.w = 0;
q.h = 0;
var wnd = window.self; //
try {
q.w = ad.offsetWidth;
q.h = ad.offsetHeight;
}
catch(e) {
//top2.RealVu_log.write("Exception 070A: "+e.message );
}
return q;
}
};
if( top2.RealVu_ope || top2.RealVu_saf ) top2.RealVu_fo();
//top2.RealVu_log.init();