var drag_x,drag_y;var active_div=null;var cloack_div=null;var div_lock=false;var div_modal=false;var div_center=false;var i_count=28;var ifr_height_step;var ifr_width_step;var def_ifr_height=330;var def_ifr_width=330;var ifr_res_interval=1;var img_path="/video/img/";var pp_bgcolor='#EEEEEE';var header_color='#ffffff';var modal_color='#F1F1F1';var modal_opacity=0.8;var modal_class=false;var header_size='12px';var header_weight='bold';var hide_iframe=true;function win_show(sender,evt,sx,sy,disable_scroll,modal,center){var src;sy++;if(sx){ifr_width=sx;}else{ifr_width=def_ifr_width;}if(sy){ifr_height=sy;}else{ifr_height=def_ifr_height;}ifr_height_step=Math.round((ifr_height+25)/i_count);ifr_width_step=Math.round(ifr_width/i_count);disable_iframe_scroll=disable_scroll;div_modal=modal;div_center=center;if(sender){if(sender.href){src=sender.href;}else{src=sender;}}create_div(src,ifr_width,ifr_height,disable_iframe_scroll);div_lock=true;if(active_div.style.display=='none'){var w=parseInt(active_div.style.width);var h=parseInt(active_div.style.height);if(document.all){evt=event;}var x1,y1;xx=getBodyScrollLeft();yy=getBodyScrollTop();x1=evt.clientX+xx;y1=evt.clientY+yy;if(center){var doc_width;if(document.compatMode&&document.compatMode!="BackCompat"){doc_width=document.documentElement.clientWidth;}else{doc_width=document.body.clientWidth;}x1=xx+(doc_width-ifr_width)/2;var doc_height;if(document.compatMode&&document.compatMode!="BackCompat"){doc_height=document.documentElement.clientHeight;}else{doc_height=document.body.clientHeight;}if(doc_height>(window.innerHeight)){doc_height=window.innerHeight;}y1=yy+(doc_height-ifr_height)/2;}x1=check_x(x1,ifr_width);y1=check_y(y1,ifr_height+25);active_div.style.top=y1+'px';active_div.style.left=x1+'px';active_div.style.display='';win_resize(ifr_width,ifr_height+25,ifr_width_step,ifr_height_step);}else{win_resize(0,0,ifr_width_step,ifr_height_step);}}function win_hide(){div_lock=true;win_resize(0,0,ifr_width_step,ifr_height_step);}function win_resize(t_width,t_height,w_step,h_step){window.status=div_lock;if(active_div){var w=parseInt(active_div.style.width);var h=parseInt(active_div.style.height);if(active_div.childNodes[1].style.display!='none'&&hide_iframe){active_div.childNodes[1].style.display='none';}if(t_width>=w&&t_height>=h&&(t_width>0&&t_height>0)){direction=1;}else{direction=-1;}if(((w>t_width||h>t_height)&&(direction<0))||((w<t_width||h<t_height)&&(direction>0))){w=w+w_step*direction;h=h+h_step*direction;if(direction>0){if(w>t_width){w=t_width;}if(h>t_height){h=t_height;}}else{bug_fix_frame=active_div.childNodes[2];if(bug_fix_frame.style)if(bug_fix_frame.style.display)if(bug_fix_frame.style.display='block'){bug_fix_frame.style.display='none';}if(w<t_width){w=t_width;}if(h<t_height){h=t_height;}}active_div.style.width=w+'px';active_div.style.height=h+'px';if(direction==-1&&w>=w_step){active_div.style.left=(parseInt(active_div.style.left)+w_step)+'px';}setTimeout("win_resize("+t_width+", "+t_height+", "+w_step+", "+h_step+")",ifr_res_interval);}if((direction<0&&(w<=0&&h<=0))||(direction>0&&(w>=t_width||h>=t_height))){div_lock=false;if(active_div.childNodes[1].style.display=='none'&&hide_iframe){active_div.childNodes[1].style.display='';}bug_fix_frame=active_div.childNodes[2];if(bug_fix_frame.style)if(bug_fix_frame.style.display)if(bug_fix_frame.style.display='none'){bug_fix_frame.style.display='block';}}if(direction<0&&(w<=0&&h<=0)){delete_div();}}}function cut_header(ev){var ifr;h1=null;if(ev.target){ifr=ev.target;}if(ev.currentTarget){ifr=ev.currentTarget;}if(ev.srcElement){ifr=ev.srcElement;}ifr=active_div.childNodes[1];if(ifr.contentDocument){h1=ifr.contentDocument.getElementsByTagName('h1')[0];}if(ifr.document){h1=ifr.document.getElementsByTagName('h1')[0];}if(ifr.contentWindow){h1=ifr.contentWindow.document.getElementsByTagName('h1')[0];}if(h1){active_div.firstChild.innerHTML=h1.innerHTML;h1.style.display='none';}else{active_div.firstChild.innerHTML='...';}}function create_div(src,i_width,i_height,disable_iframe_scroll){active_div=document.createElement('div');active_div.style.zIndex="100";if(div_modal){active_div.style.zIndex="200";cloack_div=document.createElement('div');cloack_div.style.zIndex="199";cloack_div.style.display="";cloack_div.style.position="fixed";if(navigator.appName=='Microsoft Internet Explorer'){cloack_div.style.position="absolute";}cloack_div.style.width="100%";cloack_div.style.height="100%";cloack_div.style.left="0px";cloack_div.style.top="0px";if(modal_class){cloack_div.classname=modal_class;}else{cloack_div.style.backgroundColor=modal_color;cloack_div.style.filter='progid:DXImageTransform.Microsoft.Alpha(Opacity='+(modal_opacity*100)+')';cloack_div.style.opacity=modal_opacity;}cloack_div.onClick='return false';cloack_div.style.overflow="hidden";cloack_div.innerHTML='<!--[if lte IE 6.5]><iframe style="display:block; position:absolute; top:0; left:0; z-index:-1; filter:mask(); width:3000px; height:3000px;"></iframe><![endif]-->';document.body.appendChild(cloack_div);wscroll();}active_div.style.display="";active_div.style.position="absolute";active_div.style.padding="0!important";active_div.style.margin="0!important";active_div.style.width="0px";active_div.style.height="0px";active_div.style.left="0px";active_div.style.top="0px";active_div.style.border="solid 1px #000000";active_div.style.overflow="hidden";active_div.style.display="none";active_div.style.backgroundColor=pp_bgcolor;if(!div_modal){active_div.onmouseover=function iframe_mover(){if(!div_lock){active_div=this;}this.style.zIndex=110;};active_div.onmouseout=function iframe_mout(){this.style.zIndex=100;};}document.body.appendChild(active_div);cd=document;if(disable_iframe_scroll){iframe='scrolling="no"';}else{iframe='';}var iframe=cd.createElement("IFRAME");var header=cd.createElement("DIV");var c_button=cd.createElement("DIV");header.style.height='25px';header.style.padding='0px 35px 0px 4px';header.style.lineHeight='24px';header.style.zIndex=101;header.style.overflow='hidden';header.style.backgroundImage="url('"+img_path+"player-shap.jpg')";header.style.border="none";header.style.fontSize=header_size;header.style.fontWeight=header_weight;header.style.color=header_color;header.style.cursor='pointer';header.innerHTML='Подождите! Идет загрузка...';addEvent(header,'mousedown',hmd,false);addEvent(header,'mouseup',hmu,false);iframe.style.margin="0px 0px 0px 0px";iframe.style.width=i_width+"px";iframe.style.height=i_height+"px";if(navigator.appName=='Microsoft Internet Explorer'){header.style.position="relative";iframe.style.width=i_width+2+"px";iframe.style.height=i_height+2+"px";iframe.style.position="relative";iframe.style.top="-2px";iframe.style.left="-2px";}iframe.style.padding="0!important";iframe.style.border="none";iframe.src=src;addEvent(iframe,'load',cut_header,false);c_button.style.position="absolute";c_button.style.backgroundImage="url('"+img_path+"close-0.gif')";c_button.style.backgroundRepeat="repeat-x";c_button.style.right='0px';c_button.style.top='0px';c_button.style.height='25px';c_button.style.width='21px';c_button.style.padding='0px 0px 0px 0px';c_button.style.fontSize='12px';c_button.style.zIndex='103';c_button.innerHTML='<a href="javascript:'+"win_hide();"+'" onmouseover=><img style="border:none; margin:0px; width:21px; height:24px;" src="'+img_path+'dot.gif" width=""></a>';c_button.onmouseout=function mout(){this.style.background='url('+img_path+'close-0.gif)';};c_button.onmouseover=function mover(){this.style.background='url('+img_path+'close-1.gif)';};c_button.onclick=function mclick(){ative_div=this.parentNode;this.onmouseover=null;this.onmouseout=null;this.style.background='url('+img_path+'close-2.gif)';};active_div.appendChild(iframe);active_div.insertBefore(header,iframe);active_div.appendChild(c_button);}function delete_div(){document.body.removeChild(active_div);active_div=null;if(cloack_div){document.body.removeChild(cloack_div);cloack_div=null;}}function getBodyScrollTop(){return self.pageYOffset||(document.documentElement&&document.documentElement.scrollTop)||(document.body&&document.body.scrollTop);}function getBodyScrollLeft(){return self.pageXOffset||(document.documentElement&&document.documentElement.scrollLeft)||(document.body&&document.body.scrollLeft);}function check_x(x1,tmp_ifr_width){var xx=getBodyScrollLeft();var doc_width;if(document.compatMode&&document.compatMode!="BackCompat"){doc_width=document.documentElement.clientWidth;}else{doc_width=document.body.clientWidth;}if(x1+tmp_ifr_width>doc_width+xx-10){x1=doc_width+xx-tmp_ifr_width-10;}if(x1<5+xx){x1=5+xx;}return x1;}function check_y(y1,tmp_ifr_height){var doc_height;var yy=getBodyScrollTop();if(document.compatMode&&document.compatMode!="BackCompat"){doc_height=document.documentElement.clientHeight;}else{doc_height=document.body.clientHeight;}if(doc_height>(window.innerHeight)){doc_height=window.innerHeight;}if(y1+tmp_ifr_height>doc_height+yy-10){y1=doc_height+yy-tmp_ifr_height-10;}if(y1<5+yy){y1=5+yy;}return y1;}function hmd_pd(ev){if(ev.preventDefault){ev.preventDefault();}}function hmd(ev){var ifr;if(ev.target){header=ev.target;}else{header=ev.srcElement;}header.style.cursor='move';active_div=header.parentNode;ifr_s=active_div.style;drag_x=ev.clientX-parseInt(ifr_s.left);drag_y=ev.clientY-parseInt(ifr_s.top);addEvent(document.body,'mousemove',hmm,false);div_lock=true;if(ev.preventDefault){ev.preventDefault();}if(document.selection)if(document.selection.empty){document.selection.empty();}}function hmm(ev){if(active_div){if(document.selection)if(document.selection.empty){document.selection.empty();}var ifr_s;ifr_s=active_div.style;x1=check_x((ev.clientX-drag_x),parseInt(ifr_s.width));y1=check_y((ev.clientY-drag_y),parseInt(ifr_s.height));ifr_s.left=x1+'px';ifr_s.top=y1+'px';}}function hmu(ev){if(document.selection)if(document.selection.empty){document.selection.empty();}if(ev.target){header=ev.target;}else{header=ev.srcElement;}header.style.cursor='pointer';removeEvent(document.body,'mousemove',hmm,false);div_lock=false;}function wscroll(){if(cloack_div.style.position=="absolute"){if(document.body.scrollHeight){cloack_div.style.height=document.body.scrollHeight;if(document.body.offsetHeight)if(document.body.offsetHeight>document.body.scrollHeight){cloack_div.style.height=document.body.offsetHeight;}}if(document.body.scrollWidth){cloack_div.style.width=document.body.scrollWidth;}}}function addEvent(elm,evType,fn,useCapture){if(elm.addEventListener){elm.addEventListener(evType,fn,useCapture);return true;}else if(elm.attachEvent){var r=elm.attachEvent('on'+evType,fn);return r;}else{elm['on'+evType]=fn;}}function removeEvent(elm,evType,fn,useCapture){if(elm.removeEventListener){elm.removeEventListener(evType,fn,useCapture);return true;}else if(elm.attachEvent){var r=elm.detachEvent('on'+evType,fn);return r;}else{elm['on'+evType]=null;}}