/*
*******************************************************************************************
 Copyright © 2009 Vasiltsov Vladimir
*******************************************************************************************
*/
document.write('<style type="text/css">');
document.write('#unlayout { top:-1000px; }');
document.write('#unlayout4 { top:-1000px; }');
if (navigator.appVersion.indexOf('nd') != -1 || navigator.appName.indexOf('ro') != -1) { 
	document.write('#cvlayout { top:0px; right:0px; } #unlayout { right:0px; }');
	document.write('#cvlayout4{ top:0px; left:0px; } #unlayout4{ left:0px; }'); 
} else { 
	document.write('#cvlayout { top:-1000px; right:0px; } #unlayout { right:0px; }');
	document.write('#cvlayout4{ top:-1000px; left:0px; } #unlayout4{ left:0px; }'); 
}
document.write('</style>');

var IPbizWindowWidth = 0;
var IPbizWindowScroll = 0;
var IPbizEtat = 'cv';

function setpos(param1, param2, param3, param4, param5) { 	
	if(param3 == '0px'){
		document.getElementById('cvlayout').style.top = '-1000px'; 
		document.getElementById('unlayout').style.top = IPbizWindowScroll + 'px';
		IPbizEtat = 'un';
	} else {
		document.getElementById('cvlayout').style.top = IPbizWindowScroll + 'px'; 
		document.getElementById('unlayout').style.top = '-1000px';
		IPbizEtat = 'cv';
	}
	if (navigator.appName.indexOf('ro')!= -1) { window.resizeBy(-1,-1); window.resizeBy(1,1); }
}

function pguncover(command, args) { 
	if (command == 'act_ppo') {
		document.getElementById('cvlayout').style.top = '-1000px'; 
		document.getElementById('unlayout').style.top = IPbizWindowScroll + 'px';
		IPbizEtat = 'un';
	}
}

function pgcover(command, args) { 
	if (command == 'act_ppc') {
		document.getElementById('cvlayout').style.top = IPbizWindowScroll + 'px'; 
		document.getElementById('unlayout').style.top = '-1000px';
		IPbizEtat = 'cv';
	}
}

document.write('<div id="cvlayout" style="position:absolute; width:75px; height:75px; z-index:20000;">');
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" id="cover" width="75" height="75">');
document.write('<param name="allowScriptAccess" value="always">');
document.write('<param name="movie" value="http://www.idealprazdnik.ru/images/75x75_tr.swf">');
document.write('<param name="wmode" value="transparent">');
document.write('<param name="FlashVars" value="&smallimg=http://www.idealprazdnik.ru/images/logo_for_kp.png&scrolltxtsmall=&txtsizesmall=20&textcolor=FFFFFF">');
document.write('<embed src="http://www.idealprazdnik.ru/images/75x75_tr.swf" id="cover" name="cover" wmode="transparent" width="75" height="75" allowscriptaccess="always" flashvars="&smallimg=http://www.idealprazdnik.ru/images/logo_for_kp.png&scrolltxtsmall=&txtsizesmall=20&textcolor=FFFFFF" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>');
document.write('</object>');
document.write('</div>');
document.write('<div id="unlayout" style="position:absolute; width:800px; height:600px; z-index:20000;">');
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" id="uncover" width="800" height="600">');
document.write('<param name="allowScriptAccess" value="always">');
document.write('<param name="movie" value="http://www.idealprazdnik.ru/images/800x600_tr.swf">');
document.write('<param name="wmode" value="transparent">');
document.write('<param name="FlashVars" value="&bigimg=http://www.idealprazdnik.ru/images/slepok.jpg&yaxis=0&scrolltxtbig=&textcolor=000000&txtsizebig=70&window=self&urlval=http%3A%2F%2Fwww.idealprazdnik.ru">');
document.write('<embed src="http://www.idealprazdnik.ru/images/800x600_tr.swf" id="uncover" name="uncover" wmode="transparent" width="800" height="600" allowscriptaccess="always" flashvars="&bigimg=http://www.idealprazdnik.ru/images/slepok.jpg&yaxis=0&scrolltxtbig=&textcolor=00FF00&txtsizebig=70&window=self&urlval=http%3A%2F%2Fwww.idealprazdnik.ru" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>');
document.write('</object>');
document.write('</div>');

if (navigator.appName && navigator.appName.indexOf('ro') != -1 && navigator.userAgent.indexOf('nd') != -1 && navigator.userAgent.indexOf('3.1') == -1)	{ 
	document.write('<script language="VBScript" type="text/vbscript">\n');
	document.write('On Error Resume Next\n');
	document.write('Sub cover_FSCommand(ByVal command, ByVal args)\n');
	document.write('Call pguncover(command, args)\n');
	document.write('End Sub\n');
	document.write('Sub uncover_FSCommand(ByVal command, ByVal args)\n');
	document.write('Call pgcover(command, args)\n');
	document.write('End Sub\n');
	document.write('</script>\n');
}

var IPbizWindowScroll = 0;
function IPbizGetScrollTop(){
	if (self.pageYOffset) {
		IPbizWindowScroll = self.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict
		IPbizWindowScroll = document.documentElement.scrollTop;
	} else if (document.body) { // all other Explorers
		IPbizWindowScroll = document.body.scrollTop;
	} else {
		IPbizWindowScroll = 0; 
	}
	return true;
}

function IPbiz_ReposTop_tr(){
	IPbizGetScrollTop();
	if (IPbizEtat = 'cv'){
		document.getElementById('cvlayout').style.top = IPbizWindowScroll + 'px';
		document.getElementById('unlayout').style.top = '-1000px';
	} else if (IPbizEtat = 'un'){
		document.getElementById('cvlayout').style.top = '-1000px'; 
		document.getElementById('unlayout').style.top = IPbizWindowScroll + 'px'; 
	}
}

function addLoadEvent(func) {
    var oldonload = window.onload;
    if (typeof window.onload != 'function') {
        window.onload = func;
    } else {
        window.onload = function() {
            if (oldonload) {
                oldonload();
            }
            func();
        }
    }
}

function addScrollEvent(func) {
    var oldonscroll = window.onscroll;
    if (typeof window.onscroll != 'function') {
        window.onscroll = func;
    } else {
        window.onscroll = function() {
            if (oldonscroll) {
                oldonscroll();
            }
            func();
        }
    }
}

addLoadEvent(IPbiz_ReposTop_tr);
addScrollEvent(IPbiz_ReposTop_tr);

function IPbizGetPageWidth(){
	if(document.body && document.body.clientWidth){
		IPbizWindowWidth = document.body.clientWidth;
	} else if(document.documentElement && document.documentElement.clientWidth){
		IPbizWindowWidth = document.documentElement.clientWidth;
	} else if(typeof(window.innerWidth) == 'number'){
		IPbizWindowWidth = window.innerWidth;
	} else {
		IPbizWindowWidth = 0;
	}
	return true;
}

function IPbiz_ReposLeft(){
	IPbizGetPageWidth();
	document.getElementById('cvlayout').style.left = (IPbizWindowWidth-75) + 'px'; 
	document.getElementById('unlayout').style.left = (IPbizWindowWidth-800) + 'px';
	IPbiz_ReposTop_tr();
}

function addResizeEvent(func) {
    var oldonresize = window.onresize;
    if (typeof window.onresize != 'function') {
        window.onresize = func;
    } else {
        window.onresize = function() {
            if (oldonresize) {
                oldonresize();
            }
            func();
        }
    }
}

if(parent.frames.length > 1){addResizeEvent(IPbiz_ReposLeft);}