﻿var domainnums;
var rands;
theDomain = new Array();

domainnums = 1;
theDomain[0] = "c.x007.org"
theDomain[1] = "c.x007.org"

if (domainnums > 1) {
    rands = Math.round(Math.random() * domainnums)
    while (rands > (domainnums - 1)) {
        rands = Math.round(Math.random() * domainnums)
    }
} else { rands = 0 }

if (rands == "") { rands = 0 }
var codedomain = theDomain[rands]


var star_location = window.location.href
var star_from_url;
try { star_from_url = window.top.document.referrer; }
catch (err)
{ star_from_url = document.referrer; };
if (star_userid != "0")
    if (self != top) {
    var xsukeshibody;
    xsukeshibody = document.documentElement;
    if (eval(xsukeshibody.clientWidth) <= 0) {
        document.writeln("<body></body>");
        xsukeshibody = document.body;
    }
    if ((xsukeshibody.clientWidth <= (parseInt(star_width) + 100)) || (xsukeshibody.clientHeight <= (parseInt(star_height) + 100)))
        top.location = self.location;
}

star_location = encodeURIComponent(star_location);
star_from_url = encodeURIComponent(star_from_url);

var star_encodes = star_encode;
var star_widths = '320';
var star_heights = '270';
var star_userids = star_userid;
var star_subids = star_subid;
var star_logos = star_logo;
var star_exids = star_exid;
var ImgUrl = "http://" + codedomain + "/m1.ashx?w=" + star_userids + "&sid=" + star_subids + "&logo=" + star_logos + "&e=" + star_encodes + "&furl=" + star_location + "&ffurl=" + star_from_url;



var star_fm_url = ImgUrl;
var star_fm_width = star_widths;
var star_fm_height = star_heights;
var star_fm_close_left = 15;
var star_fm_domain_left = 60; var star_fm_domain_top = 15;
if (typeof (__hasxsufmt) == 'undefined' && navigator.cookieEnabled) {
    ; (function() {
        var a = {};
        var d = navigator.userAgent;
        this.DebugMode = null;
        this.FloatDiv = null;
        this.Timer = null;
        this.TimerDiv = null;
        this.isfixed = false;
        a.ver = {
            ie: /MSIE/.test(d),
            ie6: !/MSIE 7\.0/.test(d) && (/MSIE 6\.0/.test(d) || /MSIE 5\.0/.test(d)) && !/MSIE 8\.0/.test(d) && !/MSIE 9\.0/.test(d),
            isie789: /MSIE 7\.0/.test(d) || /MSIE 8\.0/.test(d) || /MSIE 9\.0/.test(d),
            isfixed: /Firefox\/8/.test(d) || /Firefox\/7/.test(d) || /Firefox\/6/.test(d) || /Firefox\/5/.test(d) || /Firefox\/4/.test(d) || /Firefox\/3/.test(d) || /WebKit/.test(d)
        };
        a.init = function() {
            this.isfixed = false;
            if (a.ver.isfixed) this.isfixed = true;
            else if (a.ver.isie789 && document.compatMode != "BackCompat") this.isfixed = true;
            if (a.ver.ie6) img = '<img style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=http://js.star8.net/logo.png,sizingMethod=image);" src="http://js.star8.net/logo.png" width=60px height=16px border=0/>';
            else img = '<img src="http://js.star8.net/logo.png" width=60px height=16px border=0/>';
            if (this.isfixed) document.write('<div id="__star_fm_Div" style="position:fixed; z-index: 2147483647;width:' + star_fm_width + 'px;height:' + star_fm_height + 'px;bottom:0;right:0;">');
            else document.write('<div id="__star_fm_Div" style="position:absolute; z-index: 2147483647;width:' + star_fm_width + 'px;height:' + star_fm_height + 'px;">');
            document.write('<div id="__star_fm_Close" style="z-index:199999; top:3px;left:' + (star_fm_width - star_fm_close_left-3) + 'px; width:15px; height:15px; position:absolute; display:none;" onClick="javascript:_star_richmedia.close();"><img style="width:15px; height:15px;" src="http://js.star8.net/images/msg_close.gif"></div>');
            document.write('<div id="__star_fm_Logo" style="z-index:199998; top:' + (star_fm_height - star_fm_domain_top) + 'px;left:' + (star_fm_width - star_fm_domain_left) + 'px; width:60px; height:16px; position:absolute; display:;"><a href=http://www.star8.net target=_blank>' + img + '</a></div>');
            document.write('<iframe id="__star_fm_Frame" name="__star_fm_Frame" src="about:blank" marginwidth=0 marginheight=0  hspace=0 vspace=0 frameborder=0 scrolling=no width=' + star_fm_width + ' height=' + star_fm_height + ' allowTransparency="true"></iframe>');
            document.write('<div id="__star_fm_Count" style="z-index:199994; top:0px;left:0px; width:0px; height:0px; position:absolute; display:none;"></div>');
            document.write('</div>');
            this.FloatDiv = document.getElementById('__star_fm_Div').style;
            document.getElementById('__star_fm_Frame').src = star_fm_url;
            setTimeout(function() { document.getElementById('__star_fm_Close').style.display = ""; }, 2000);
        }
        a.open = function() {
            this.init();
            this.DebugMode = "status1";
            this.TimerDiv = setInterval("_star_RichMedia_CheckDivIsTop('__star_fm_Div')", 1000);
            if (!this.isfixed) try { window.onscroll = _star_RichMedia_ScrollFollow; } catch (e) { this.close(); }
            if (!this.isfixed) this.Timer = setInterval("_star_RichMedia_ScrollFollow()", 50);
            if (!this.isfixed) _star_RichMedia_ScrollFollow();
        }
        a.close = function() {
            document.getElementById('__star_fm_Frame').src = "about:blank";
            //clearInterval(this.Timer);
            //clearInterval(this.TimerDiv);
            //window.onscroll = null;
            this.FloatDiv.display = 'none';
            document.getElementById('__star_fm_Count').innerHTML='<img src="http://c.x007.org/tt.ashx?m=2" width=0 height=0 style="display:none;" border=0/>';
	    setTimeout(function(){document.getElementById('__star_fm_Div').style.display="inline";document.getElementById('__star_fm_Frame').src=star_fm_url;},120000)

        }
        a.scrollfllow = function(ev) {
            var obj = (document.compatMode.toLowerCase() == "css1compat") ? document.documentElement : document.body
            this.FloatDiv.top = obj.scrollTop + obj.clientHeight - star_fm_height - 3 + 'px';
            this.FloatDiv.left = obj.scrollLeft + obj.clientWidth - star_fm_width - 3 + 'px';
            this.debug(obj.scrollTop, obj.scrollLeft, obj.clientWidth, obj.clientHeight);
        }
        a.istop = function(ev) {
            var divs = document.getElementsByTagName("div");
            var len = divs.length;
            for (var i = 0; i < len; i++) {
                if (divs[i].id == ev) { divs[i].style.zIndex = 2147483647; }
                if (divs[i].style.zIndex == 2147483647 && divs[i].id != ev) { divs[i].style.zIndex--; }
            }
        }
        a.debug = function(argScrollTop, argScrollLeft, argclientWidth, argclientHeight) {
            arg = "#" + " clientWidth:" + argclientWidth + " clientHeight:" + argclientHeight + " ScrollTop:" + argScrollTop + " ScrollLeft:" + argScrollLeft + "      Time:" + new Date().toLocaleString();
            if (this.DebugMode == "alert") { alert(arg.toString()); }
            if (this.DebugMode == "status") { window.status = arg.toString(); document.title = arg.toString(); }
        }
        _star_RichMedia_ScrollFollow = function(ev) { _star_richmedia.scrollfllow(ev); }
        _star_RichMedia_CheckDivIsTop = function(ev) { _star_richmedia.istop(ev); }
        window._star_richmedia = a;
    })();
    _star_richmedia.open();
    var __hasxsufmt = 1;
}
