if (navigator.userAgent.indexOf("Opera") != -1){
	var clix_isOpera=true;
}
else
	var clix_isOpera=false;

var clix_widget='clix';
var location2='http://clix.ru/';
var location1='http://www.interstar.ua/ico/';
clix_but=0;
clix_div=0;
clix_img_bolvanka=clix_img_div=new Object();
if (typeof(clix_pub)=="undefined") clix_pub="";
if (typeof(clix_style)=="undefined") clix_style="def";
function clix_ge(elem){
	return document.getElementById(elem);
}
function clix_closewinwait(img_div){
	clix_but=0;
	setTimeout('clix_close()',10);
}
function clix_closediv(){
	setTimeout('clix_close()',10);
}
function clix_close(){
	if ((clix_but+clix_div)==0){
		setTimeout('clix_on_out()',500);
	}
}
function clix_preloadImage() {
	var image = new Image();
	image.src = location1+"bookmarks.gif";
	return image;
}
function clix_on_out(){
	if ((clix_but+clix_div)==0){
		el=document.getElementById('dropdown');
		el.style.display='none';

       	clix_img_div.childNodes[0].style.backgroundColor="";
	}
}
function clix_linecolor(st){
	if ((st==1)||(st==2)||(st==4)||(st==5)) return "#FE4F00";
	if ((st==3)||(st==6)) return "#43A8D3";
	return "#E0E0E0";
}
function clix_bgcolor(st){	if ((clix_down==1) && (clix_style!=='def')){
		clix_img_div.childNodes[0].style.backgroundColor=clix_linecolor(clix_style);
	}
}
function clix_divwidth(st){
	if ((st==1)||(st==2)||(st==3)) return "149";
	if ((st==6)||(st==4)||(st==5)) return "122";
	return "149";
}


function clix_onmouseover(img_div){	if (clix_img_div!=img_div && clix_img_bolvanka!=clix_img_div) {		clix_img_div.childNodes[0].style.backgroundColor="";
	}
    clix_but=1;
    clix_img_div=img_div;
	kartinka=img_div.childNodes[0];
	kartinka.style.borderStyle="none";
	img_div.style.borderStyle="none";
	kartinka.style.padding="0px";
	var vipadajushij=document.getElementById('dropdown');
	var hren=clix_off_tl(kartinka);
	if (clix_isOpera) {		off_ll=hren[0];
	}
	else{		off_ll=hren[0]+0;
	}
	element_position=hren[1];
	var window=clix_widthheight();
	var scrolling=clix_offsset();
	var inwidp=img_div.childNodes[0];
	if (off_ll-scrolling[0]+vipadajushij.clientWidth>window[0]){		vipadajushij.style.left=(off_ll-(vipadajushij.clientWidth-kartinka.clientWidth))+'px';
	}else{
		vipadajushij.style.left=off_ll+'px';
	}
	vipadajushij.style.display='block';
	if (element_position-scrolling[1]+vipadajushij.clientHeight+kartinka.clientHeight>window[1]){
		vipadajushij.style.top=(element_position-vipadajushij.clientHeight)+'px';
    	document.getElementById('clix_top_pops').style.display="none";
		document.getElementById('clix_bottom_pops').style.display="block";
		clix_down=0;
	}
	else{
		if (clix_isOpera) {
			vipadajushij.style.top=(element_position+kartinka.clientHeight-1)+'px';
		}
		else{
			vipadajushij.style.top=(element_position+kartinka.clientHeight)+'px';
		}
		document.getElementById('clix_top_pops').style.display="block";
		document.getElementById('clix_bottom_pops').style.display="none";
		if (clix_style!=='def')
   			kartinka.style.backgroundColor=clix_linecolor(clix_style);
		clix_down=1;
	}
	vipadajushij.style.display='block';
}

function clix_off_tl(element){
	var of_t=0,of_l=0;
	do{
		of_t+=element.offsetTop || 0;
		of_l+=element.offsetLeft || 0;
		element=element.offsetParent;
	}
	while (element);
	return [of_l,of_t];
}
function clix_td_set_color(elem){
	elem.style.backgroundColor="#E0E0E0";
	clix_show=1;
}
function clix_td_ret_color(elem){
	elem.style.backgroundColor="#FFFFFF";
}

function clix_widthheight( ){
	var inwid=0;
	var inheig=0;
	if (typeof(window.innerWidth)=='number'){
		inwid=window.innerWidth;
		inheig=window.innerHeight;
	}
	else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)){
		inwid=document.documentElement.clientWidth;
		inheig=document.documentElement.clientHeight;
	}
	else if (document.body && (document.body.clientWidth || document.body.clientHeight)){
		inwid=document.body.clientWidth;
		inheig=document.body.clientHeight;
	}
	return [inwid,inheig];
}
function clix_offsset( ){
	var xoff=0;
	var yoff=0;
	if (typeof(window.pageYOffset)=='number'){
		yoff=window.pageYOffset;
		xoff=window.pageXOffset;
	}
	else if (document.body && (document.body.scrollLeft || document.body.scrollTop)){
		yoff=document.body.scrollTop;
		xoff=document.body.scrollLeft;
	}
	else if (document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)){
		yoff=document.documentElement.scrollTop;
		xoff=document.documentElement.scrollLeft;
	}
	return [xoff,yoff];
}
function clix_to (serv){		window.open(location2+'/bookmark/?serv='+serv+'&publ_id='+clix_pub+'&url='+encodeURIComponent(clix_url)+'&title='+encodeURIComponent(clix_title)+'&ref='+encodeURIComponent(clix_referer),'clix','scrollbars=yes,menubar=no,width=620,height=400,resizable=yes,toolbar=no,location=no,status=no');
		return false;
}

function clix_get_inner(dir){	if (typeof dir =="undefined") dir="top";
	line_col=clix_linecolor(clix_style);
	div_width=clix_divwidth(clix_style);
	var dvichik="<div onmouseover=\"clix_div=1;clix_bgcolor();this.style.display='block';return false;\" onmouseout=\"clix_div=0;clix_closediv();\" id=\"dropdown\" style=\"z-index: 1000; position: absolute;display:none;width:"+div_width+"px;background:#FFFFFF none repeat scroll 0%;border:0px solid #CCCCCC;overflow:hidden;padding:0px 0px 0px 0px;\">";
	dvichik+='<div style="width:100%;height:4px;background-color: '+line_col+';overflow:hidden;display:none" id="clix_top_pops"></div>';
	dvichik+='<div style="border:1px solid #CCCCCC;overflow:hidden;padding:0px 0px 0px 0px;">';

	dvichik+='<table id="clix_services" width="100%" cellpadding="1" style="font-family: Verdana, Arial; font-size: 11px;">';
	dvichik+='<tr><td style="background-color:#FFF4C0;height:20px;" align="center"><span style="color:#586673">&nbsp;&nbsp;&#1047&#1072&#1082&#1083&#1072&#1076&#1082&#1080 </span></td></tr>';
dvichik+='<tr>';dvichik+='<td align="left" id=clix_td_bobr onmouseover="clix_td_set_color(this)" onmouseout="clix_td_ret_color(this)"><div style="width:16px; height:16px; padding:0px; border:0px; margin-left:10px;margin-right:5px; float:left; cursor:pointer; background-image:url(\''+location1+'bookmarks.gif\'); background-position:0px 0px; " title="Сохранить страницу в &#1041&#1086&#1073&#1088&#1076&#1086&#1073&#1088" onclick="return clix_to(\'bobr\')"></div><span style="vertical-align:3px;"> <a href="/#" onclick="return clix_to(\'bobr\')" style="color:#0970D9;text-decoration:none;font-weight:normal;">&#1041&#1086&#1073&#1088&#1076&#1086&#1073&#1088 </a></span></td>';dvichik+='</tr>';dvichik+='<tr>';dvichik+='<td align="left" id=clix_td_memori onmouseover="clix_td_set_color(this)" onmouseout="clix_td_ret_color(this)"><div style="width:16px; height:16px; padding:0px; border:0px; margin-left:10px;margin-right:5px; float:left; cursor:pointer; background-image:url(\''+location1+'bookmarks.gif\'); background-position:0px -16px; " title="Сохранить страницу в &#1052&#1077&#1084&#1086&#1088&#1080" onclick="return clix_to(\'memori\')"></div><span style="vertical-align:3px;"> <a href="/#" onclick="return clix_to(\'memori\')" style="color:#0970D9;text-decoration:none;font-weight:normal;">&#1052&#1077&#1084&#1086&#1088&#1080 </a></span></td>';dvichik+='</tr>';dvichik+='<tr>';dvichik+='<td align="left" id=clix_td_google onmouseover="clix_td_set_color(this)" onmouseout="clix_td_ret_color(this)"><div style="width:16px; height:16px; padding:0px; border:0px; margin-left:10px;margin-right:5px; float:left; cursor:pointer; background-image:url(\''+location1+'bookmarks.gif\'); background-position:0px -32px; " title="Сохранить страницу в Google" onclick="return clix_to(\'google\')"></div><span style="vertical-align:3px;"> <a href="/#" onclick="return clix_to(\'google\')" style="color:#0970D9;text-decoration:none;font-weight:normal;">Google </a></span></td>';dvichik+='</tr>';dvichik+='<tr>';dvichik+='<td align="left" id=clix_td_wong onmouseover="clix_td_set_color(this)" onmouseout="clix_td_ret_color(this)"><div style="width:16px; height:16px; padding:0px; border:0px; margin-left:10px;margin-right:5px; float:left; cursor:pointer; background-image:url(\''+location1+'bookmarks.gif\'); background-position:0px -48px; " title="Сохранить страницу в &#1052&#1080&#1089&#1090&#1077&#1088&nbsp;&#1042&#1086&#1085&#1075" onclick="return clix_to(\'wong\')"></div><span style="vertical-align:3px;"> <a href="/#" onclick="return clix_to(\'wong\')" style="color:#0970D9;text-decoration:none;font-weight:normal;">&#1052&#1080&#1089&#1090&#1077&#1088&nbsp;&#1042&#1086&#1085&#1075 </a></span></td>';dvichik+='</tr>';dvichik+='<tr>';dvichik+='<td align="left" id=clix_td_yandex onmouseover="clix_td_set_color(this)" onmouseout="clix_td_ret_color(this)"><div style="width:16px; height:16px; padding:0px; border:0px; margin-left:10px;margin-right:5px; float:left; cursor:pointer; background-image:url(\''+location1+'bookmarks.gif\'); background-position:0px -64px; " title="Сохранить страницу в &#1071&#1085&#1076&#1077&#1082&#1089" onclick="return clix_to(\'yandex\')"></div><span style="vertical-align:3px;"> <a href="/#" onclick="return clix_to(\'yandex\')" style="color:#0970D9;text-decoration:none;font-weight:normal;">&#1071&#1085&#1076&#1077&#1082&#1089 </a></span></td>';dvichik+='</tr>';dvichik+='<tr>';dvichik+='<td align="left" id=clix_td_mesto onmouseover="clix_td_set_color(this)" onmouseout="clix_td_ret_color(this)"><div style="width:16px; height:16px; padding:0px; border:0px; margin-left:10px;margin-right:5px; float:left; cursor:pointer; background-image:url(\''+location1+'bookmarks.gif\'); background-position:0px -80px; " title="Сохранить страницу в &#1052&#1086&#1077&nbsp;&#1084&#1077&#1089&#1090&#1086" onclick="return clix_to(\'mesto\')"></div><span style="vertical-align:3px;"> <a href="/#" onclick="return clix_to(\'mesto\')" style="color:#0970D9;text-decoration:none;font-weight:normal;">&#1052&#1086&#1077&nbsp;&#1084&#1077&#1089&#1090&#1086 </a></span></td>';dvichik+='</tr>';dvichik+='<tr>';dvichik+='<td align="left" id=clix_td_lstore onmouseover="clix_td_set_color(this)" onmouseout="clix_td_ret_color(this)"><div style="width:16px; height:16px; padding:0px; border:0px; margin-left:10px;margin-right:5px; float:left; cursor:pointer; background-image:url(\''+location1+'bookmarks.gif\'); background-position:0px -96px; " title="Сохранить страницу в LinkStore" onclick="return clix_to(\'lstore\')"></div><span style="vertical-align:3px;"> <a href="/#" onclick="return clix_to(\'lstore\')" style="color:#0970D9;text-decoration:none;font-weight:normal;">LinkStore </a></span></td>';dvichik+='</tr>';dvichik+='<tr><td align="center" style="background-color:#EAF1C3;height:20px;"><span style="color:#586673;font-weight:normal;">&nbsp;&nbsp;&#1053&#1086&#1074&#1086&#1089&#1090&#1080</span></td></tr>';dvichik+='<tr>';dvichik+='<td align="left" id=clix_td_smi2 onmouseover="clix_td_set_color(this)" onmouseout="clix_td_ret_color(this)"><div style="width:16px; height:16px; padding:0px; border:0px; margin-left:10px;margin-right:5px; float:left; cursor:pointer; background-image:url(\''+location1+'bookmarks.gif\'); background-position:0px -112px; " title="Сохранить страницу в &#1057&#1052&#1048&nbsp;2" onclick="return clix_to(\'smi2\')"></div><span style="vertical-align:3px;"> <a href="/#" onclick="return clix_to(\'smi2\')" style="color:#0970D9;text-decoration:none;font-weight:normal;">&#1057&#1052&#1048&nbsp;2 </a></span></td>';dvichik+='</tr>';dvichik+='<tr>';dvichik+='<td align="left" id=clix_td_news2 onmouseover="clix_td_set_color(this)" onmouseout="clix_td_ret_color(this)"><div style="width:16px; height:16px; padding:0px; border:0px; margin-left:10px;margin-right:5px; float:left; cursor:pointer; background-image:url(\''+location1+'bookmarks.gif\'); background-position:0px -128px; " title="Сохранить страницу в News2" onclick="return clix_to(\'news2\')"></div><span style="vertical-align:3px;"> <a href="/#" onclick="return clix_to(\'news2\')" style="color:#0970D9;text-decoration:none;font-weight:normal;">News2 </a></span></td>';dvichik+='</tr>';
	dvichik+='</table>';
	dvichik+='<table width="100%" cellpadding="0" cellspacing="0" style="background-color: #EEEEEE; height: 6px; font-size: 8px; color: #777777">';
	dvichik+='<tr><td align="right" style="font-size: 10px; color: #666666">&copy;&nbsp;Clix.ru</td></tr>';
	dvichik+='</table>';
	dvichik+='</div>';
	dvichik+='<div style="width:100%;height:4px;background-color:'+line_col+';border:0px;display:none;overflow:hidden;" id="clix_bottom_pops"></div>';
	dvichik+='</div>';
	return dvichik;
}
function clix_sho_2( ){
    dvichik=clix_get_inner();
	divka_2=document.createElement('div');
	divka_2.innerHTML=dvichik;
	divka_2.id="dr";
	document.body.insertBefore(divka_2,document.body.firstChild);
}

clix_sho_2( );
clix_preloadImage();

