var bannDuxy = '<div id="rich_media" style="position:absolute;ledt:0px;top:-1000px;height:400;width:420px;margin:0px;padding:0px;z-index:10;" border="1">';
bannDuxy += '<table cellpadding="0" cellspacing="0" width="400" height="420" border="0">';
bannDuxy += '<tr>';
bannDuxy += '<td valign="top">';
bannDuxy += '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="400" height="420" id="dvdbanner">';
bannDuxy += '<param name="movie" value="/images/banners/dyxi.swf" />';
bannDuxy += '<param name="loop" value="false" />';
bannDuxy += '<param name="menu" value="false" />';
bannDuxy += '<param name="quality" value="high" />';
bannDuxy += '<param name="wmode" value="transparent" />';
bannDuxy += '<embed src="/images/banners/dyxi.swf" loop="false" menu="false" quality="high" wmode="transparent" width="400" height="420" name="dvdbanner" type="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" />';
bannDuxy += '</object>';
bannDuxy += '</td>';
bannDuxy += '</tr>';
bannDuxy += '</table>';
bannDuxy += '</div>';
var bannDuxyHeight = 420;
var bannDuxyLink = 'http://www.dyxi.ru/?partner=5karich';

var bannPenn = '<div id="rich_media" style="position:absolute;ledt:0px;top:-1000px;height:400;width:410px;margin:0px;padding:0px;z-index:10;" border="1">';
bannPenn += '<table cellpadding="0" cellspacing="0" width="400" height="410" border="0">';
bannPenn += '<tr>';
bannPenn += '<td valign="top">';
bannPenn += '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="400" height="410" id="dvdbanner">';
bannPenn += '<param name="movie" value="/images/banners/pen007.swf" />';
bannPenn += '<param name="loop" value="false" />';
bannPenn += '<param name="menu" value="false" />';
bannPenn += '<param name="quality" value="high" />';
bannPenn += '<param name="wmode" value="transparent" />';
bannPenn += '<embed src="/images/banners/pen007.swf" loop="false" menu="false" quality="high" wmode="transparent" width="400" height="410" name="dvdbanner" type="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" />';
bannPenn += '</object>';
bannPenn += '</td>';
bannPenn += '</tr>';
bannPenn += '</table>';
bannPenn += '</div>';
var bannPennHeight = 410;
var bannPennLink = 'http://www.pen007.ru/?partner=5karich';

function getCookie(name) {
	var cookie = " " + document.cookie;
	var search = " " + name + "=";
	var setStr = null;
	var offset = 0;
	var end = 0;
	if (cookie.length > 0) {
		offset = cookie.indexOf(search);
		if (offset != -1) {
			offset += search.length;
			end = cookie.indexOf(";", offset)
			if (end == -1) {
				end = cookie.length;
			}
			setStr = unescape(cookie.substring(offset, end));
		}
	}
	return(setStr);
}

function setCookieBN (name, value, expires, path, domain) {
	var exp = new Date(); 
	exp.setTime(exp.getTime());
	document.cookie = name + "=" + escape(value) + ((path) ? "; path=" + path : "");
}
	
function PromoLoad(heightBann){
	var element = document.getElementById('rich_media');
	element.style.left =  Math.round((screen.availWidth - 400) / 2) + 'px'
	var height = Math.round((screen.availHeight - heightBann) / 2);
	if(height > 100 ){
		element.style.top =  height + 'px';
	}
	else{
		element.style.top =  '200px';
	}
}
function PromoLink() {
	if(getCookie('dyxi')=='1') {
		location.href='http://www.pen007.ru/?partner=5karich';
	}
	else {
		location.href='http://www.dyxi.ru/?partner=5karich';
	}
}
function PromoClose(){
	var element = document.getElementById('rich_media');
	element.style.top = -10000;
	FlashElement = document.getElementById('dvdbanner');
	try{
		FlashElement.style.display = 'none';
	}
	catch(e){
	}
}

/*if(getCookie('dyxi')=='1') {
	if(getCookie('pen007')=='1') {
	}
	else {
		document.write(bannPenn);
		PromoLoad(bannPennHeight);
		setCookieBN('pen007', '1', '0', '/', 'referatik.com.ua');
	} 
}
else {
	document.write(bannDuxy);
	PromoLoad(bannDuxyHeight);
	setCookieBN('dyxi', '1', '0', '/', 'referatik.com.ua');
} 
*/