MyOtzivCl = function() {
    var siteAdr = 'http://reformal.ru/';
    
    this.mo_get_win_width = function() {
        var myWidth = 0;
        if( typeof( window.innerWidth ) == 'number' ) //Non-IE
            myWidth = window.innerWidth;
        else if( document.documentElement && document.documentElement.clientWidth ) //IE 6+ in 'standards compliant mode'
            myWidth = document.documentElement.clientWidth;
        else if( document.body && document.body.clientWidth) //IE 4 compatible
            myWidth = document.body.clientWidth;
        return myWidth;
    }
	
    this.mo_get_win_height = function() {
        var myHeight = 0;
        if( typeof( window.innerHeight ) == 'number' ) //Non-IE
            myHeight = window.innerHeight;
        else if( document.documentElement && document.documentElement.clientHeight ) //IE 6+ in 'standards compliant mode'
            myHeight = document.documentElement.clientHeight;
        else if( document.body && document.body.clientHeight) //IE 4 compatible
            myHeight = document.body.clientHeight;
        return myHeight;
    }

    this.getDocHeight = function() {
        var db = document.body;
        var dde = document.documentElement;
        return Math.max(
            $(document).height(),
            $(window).height(),
            /* For Opera: */
            document.documentElement.clientHeight,
            db.scrollHeight,
            dde.scrollHeight,
            db.offsetHeight,
            dde.offsetHeight,
            db.clientHeight,
            dde.clientHeight
        );
    };

    this.mo_get_scrol = function() {
        var yPos = 0;
        if (self.pageYOffset) {
            yPos = self.pageYOffset;
        } else if (document.documentElement && document.documentElement.scrollTop){
            yPos = document.documentElement.scrollTop;
        } else if (document.body) {
            yPos = document.body.scrollTop;
        }
        return yPos;
    }

    this.mo_show_box1 = function() {
        $( '#myotziv_box' ).fadeIn(500);
    }

    this.mo_show_box = function() {
	    if (document.getElementById("fthere").innerHTML == "") {
		    document.getElementById("fthere").innerHTML = "<iframe src=\"http://reformal.ru/wdg2.php?domain=highspec\" width=\"713\" height=\"385\" frameborder=\"0\" scrolling=\"no\">Frame error</iframe>";
		}
        var l = this.mo_get_win_width()/2 - 497;
        var t = this.mo_get_win_height()/2 - 300 + this.mo_get_scrol();
        document.getElementById('myotziv_box').style.top  = t+'px';
        document.getElementById('myotziv_box').style.left = l+'px';
        document.getElementById('myotziv_box').style.display='none';
        document.getElementById('fader').style.height=this.getDocHeight()+'px';
	   $( '#fader' ).fadeTo(500, 0.2, this.mo_show_box1);
    }

    this.mo_hide_box = function() {
        $( '#myotziv_box' ).fadeOut(300);
	   $( '#fader' ).fadeOut(300);
    }
    
    this.mo_showcss = function() {
        document.write("<style type=\"text/css\">");
        
        document.write(".tdsfh{background: url('/feedback_tab.png');}");
        document.write("* html .tdsfh{background-image: none; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/feedback_tab.png');}");
        document.write(".furjbqy {position:fixed; left:0; top:263px; z-index:5; width:22px; height:151px;}* html .furjbqy {position:absolute;}.furjbqy a {display:block; width:22px; height:151px; background:#456285;}.furjbqy a:hover {background:#456285;}.furjbqy img {border:0;}");
        document.write(".furrghtd {position:fixed; right:1px; top:263px; z-index:5; width:22px; height:163px;}* html .furrghtd {position:absolute;}.furrghtd a {display:block; width:22px; height:163px; background:#456285;}.furrghtd a:hover {background:#456285;}.furrghtd img {border:0;}");
        
        document.write(".tegdiw_tnoc {font-size:11px;font-family: Arial, Tahoma, sans-serif;color:#3F4543} .tegdiw_tnoc a img {border:0;} .tegdiw_tnoc a {color:#4F94D0; text-decoration:none;} .tegdiw_tnoc a:hover {text-decoration:underline;} .tegdiw_tnoc {width:713px;height:489px;position:absolute;margin: 55px 0 0 110px;z-index:10;}");
        document.write(".tegdiw {width:713px;height:489px;background: url("+siteAdr+"i/wd/widget_bg1.png) no-repeat;padding:15px 21px 0 21px;} .tegdiw_pot {height:52px;background:#516683;} .tegdiw_pot h2 {display:inline;float:left!important;margin:0;color:#FFF;font-size:18px;line-height:48px;vertical-align:middle;padding: 0 0 0 19px;}");
        document.write(".tegdiw_snottub {float:right !important;padding:10px 11px 0 0;} .tegdiw_snottub a {display:inline;float:right;margin-left:8px;}");
        document.write(".tegdiw_unem {background:#EFEFEF;height:25px;} .tegdiw_unem * {float:left;height:25px;line-height:25px;vertical-align:middle;text-align:center;padding: 0 17px;} .tegdiw_unem span {background:#FFF;} .tegdiw_unem a {color:#105895;} .tegdiw_unem .right {float:right;}");
        
        document.write(".derewop_yb {font-size:11px;color:#FFF;float:right;padding:8px 17px 0 0;} .tegdiw iframe {border:0;margin:0 0 -3px 0;padding:0;}");
        document.write("#tegdiw_dnapxe {background:url("+siteAdr+"i/wd/expand.png) left top no-repeat;width:17px;height:14px;}");
        document.write("#tegdiw_esloc {background:url("+siteAdr+"i/wd/close.png) left top no-repeat;width:16px;height:16px;}");
        
        document.write("</style><!--[if IE]><style type=\"text/css\">");
        document.write(".tegdiw {_background-image:none; _filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+siteAdr+"i/wd/widget_bg1.png');} .tegdiw * {position:relative;} .tegdiw iframe {margin:0;} .tegdiw_snottub {width:100px;}");
        document.write("#tegdiw_dnapxe {_background-image:none; _filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+siteAdr+"i/wd/expand.png');}");
        document.write("#tegdiw_esloc {_background-image:none; _filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+siteAdr+"i/wd/close.png');}");
        document.write("</style><![endif]-->");
    }

    this.mo_showframe = function() {
		this.mo_showcss();
        
		document.write("<div class=\"furrghtd\"><a style=\"border-bottom: 0px\" href=\"javascript:MyOtziv.mo_show_box();\"><img src=\""+siteAdr+"i/transp.gif\" width=\"22\" height=\"163\" alt=\"\" style=\"border: 0;\" class=\"tdsfh\" /></a></div>");
                            
		document.write("<div class=\"tegdiw_tnoc\" style=\"position:absolute; display: none; top: 0px; left: 0px;\" id=\"myotziv_box\">");
		document.write("<div class=\"tegdiw\"><div class=\"tegdiw_pot\"><div class=\"tegdiw_snottub\"><a style=\"border-bottom: 0px\" href=\"javascript:MyOtziv.mo_hide_box();\" id=\"tegdiw_esloc\"><img src=\""+siteAdr+"i/wd/sp.gif\" width=\"16\" height=\"16\" alt=\"Закрыть\" /></a><a style=\"border-bottom: 0px\" href=\"http://otziv.highspec.ru\" id=\"tegdiw_dnapxe\"><img src=\""+siteAdr+"i/wd/sp.gif\" width=\"17\" height=\"14\" alt=\"Развернуть\" /></a></div><h2 style=\"color:#ffffff\">Специализированное ПО</h2></div>");
		document.write("<div class=\"bvnmrte\" style=\"height: 385px;\" id=\"fthere\">");
		document.write("</div>");
		document.write("<div class=\"tegdiw_mottob\"><div class=\"derewop_yb\"><img src=\""+siteAdr+"i/wd/reformal.png\" width=\"64\" height=\"9\" alt=\"Reformal.ru\" /></div></div> </div></div>");
    }
}

var MyOtziv = new MyOtzivCl();	
MyOtziv.mo_showframe();