﻿var pu = "http://adsense.scupio.com/adpinline/picadfile/";

function onFlash() { na = 1; }

function mouseout(id) {
    var itm = document.getElementById(id);
    itm.style.zIndex=0;
    itm.style.visibility='hidden';
    itm.style.top='0px';
    itm.style.left='-1000px';
}


function now() { return +new Date(); }

function flashclick(adNo) {
    var ades = cu + ad[adNo] + up + '&clickrange=pic&redirect=0&rand=' + now();
    includejs(ades);
}

function createjs(jssrc) {
    var s = document.createElement('script');
    s.setAttribute('type', 'text/javascript');
    s.setAttribute('src', jssrc);
    return s;
}

function includejs(jssrc) {
    var head = document.getElementsByTagName('head')[0];
    if (head) head.appendChild(createjs(jssrc));
    else document.body.appendChild(createjs(jssrc));
}

function scsetimage2(scspanid, isFlash, adNo, th, tw, ph, pw, adC) {
    var maximgt = th - (ph + 10);
    var estrt = (th - 12) / adC;
    var imgl = tw - pw - 14;
    var scspitm = document.getElementById(scspanid);
    scspitm.style.zIndex = 50;
    scspitm.style.visibility = 'visible';
    var esimgt = 0; if (maximgt > 0) { esimgt = estrt * adNo; esimgt = esimgt > maximgt ? maximgt : esimgt; }
    scspitm.style.top = esimgt + 'px';
    scspitm.style.left = imgl + 'px';
    if (IsSetSrc[adNo] == 0) {
        IsSetSrc[adNo] = 1;
        var isrc = pu+src[adNo];
        var ades = ad[adNo] + up;
        if (isFlash == 0)
            scspitm.firstChild.src = isrc;
        else {
            ades = cu + encodeURIComponent(ades + '&clickrange=pic');
            scspitm.innerHTML = '<object type="application/x-shockwave-flash" data="' + isrc + '" width="' + pw + '" height="' + ph + '">'
            + '<param name="movie" value="' + isrc + '" />'
            + '<param name="SCALE" value="exactfit" />'
            + '<param name="wmode" value="transparent" />'
            + '<param name="FlashVars" value="clickTAG2=javascript:flashclick(' + adNo + ')&clickTAG=' + ades + '" />'
            + '<param name="width" value="' + pw + '" />'
            + '<param name="height" value="' + ph + '" />'
            + '</object>';
        }
    }
}
