/* определим тип браузера */ var bIE=0;bOp=0;bFF=0; var verBr=navigator.userAgent; if (verBr.indexOf("Opera")!=-1) bOp=1; else { if (verBr.indexOf("MSIE")!=-1) bIE=1; else { //if (verBr.indexOf("Firefox")!=-1) bFF=1; } } obj_pg_table_photo=document.getElementById("pg_table_from_photos"); obj_block_from_photos=document.getElementById("pg_block_from_photos"); obj_black_block=document.getElementById("pg_black_block"); obj_content_page=document.getElementById("content_page"); obj_block_load=document.getElementById("pg_block_for_load_image"); obj_block_print_image=document.getElementById("pg_block_print_image"); pg_on_top=false; pg_on_bottom=true; pg_num_bottom=0; pg_first_bottom=0; pg_on_first_bottom=false; pg_num_row_on_load=-1; image_load_src=""; on_view_big_image=true; end_y_table=0; step_y_table=1; on_slaid_table_photo=false; /* slaid_photo delta_y kolvo_for_load kolvo_hidden data_images data_load_images dir_http */ function pg_on_bottom_table() { if (!slaid_photo) return; //alert(delta_y); if (!pg_on_bottom) return; if (on_slaid_table_photo) return; if (!pg_on_first_bottom) { pg_on_first_bottom=true; pg_first_bottom=obj_pg_table_photo.offsetTop;; } //y_table=obj_pg_table_photo.offsetTop; //y_table=y_table-delta_y; pg_on_top=true; pg_num_bottom++; if (pg_num_bottom >= kolvo_for_load+kolvo_hidden) pg_on_bottom=false; on_view_big_image=false; //obj_pg_table_photo.style.top=pg_first_bottom-delta_y*pg_num_bottom+"px"; end_y_table=pg_first_bottom-delta_y*pg_num_bottom; step_y_table=-3; on_slaid_table_photo=true; slaid_table_photo(); pg_load_images(); } function slaid_table_photo() { t_y_table=obj_pg_table_photo.offsetTop; prod_slaid=true; if (step_y_table>0) { if (end_y_table>t_y_table+step_y_table) new_y_table=t_y_table+step_y_table; else { new_y_table=end_y_table; prod_slaid=false; } } else { if (end_y_table0) { obj_pg_table_photo.style.top=t_y_table+step_y_table+"px"; } else { obj_pg_table_photo.style.top=t_y_table+step_y_table+"px"; } setTimeout("slaid_table_photo();",10); } else { on_view_big_image=true; on_slaid_table_photo=false; } */ } function pg_on_top_table() { if (!slaid_photo) return; //alert(delta_y); if (!pg_on_top) return; if (on_slaid_table_photo) return; pg_num_bottom--; if (pg_num_bottom <=0 ) pg_on_top=false; pg_on_bottom=true; //obj_pg_table_photo.style.top=pg_first_bottom-delta_y*pg_num_bottom+"px"; on_view_big_image=false; //obj_pg_table_photo.style.top=pg_first_bottom-delta_y*pg_num_bottom+"px"; end_y_table=pg_first_bottom-delta_y*pg_num_bottom; step_y_table=3; on_slaid_table_photo=true; slaid_table_photo(); } function pg_load_images() { if ((pg_num_bottom-1) > pg_num_row_on_load && pg_num_row_on_load < (kolvo_for_load-1)) { pg_num_row_on_load++; var mas=data_load_images[pg_num_row_on_load]; for (k=0;k"; } //else //obj_one_image.src=dir_small+data_one_image["small_photo_url"]; //obj_one_image.style.width="auto"; //obj_one_image.style.height="auto"; } } } } function pg_view_photo(num_photo) { if (!on_view_big_image) return; obj_foto=document.getElementById("pg_image_num"+num_photo); if (obj_foto) { pg_step=0; width_window=0; height_window=0; if (window.outerWidth) width_window=window.innerWidth; else width_window=document.body.offsetWidth; if (window.outerHeight) height_window=window.innerHeight; else height_window=(document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.offsetHeight); num_open_photo=num_photo; page_width=obj_content_page.offsetWidth; page_height=obj_content_page.offsetHeight; if (page_height"; preview_height=obj_foto.offsetHeight; preview_width=obj_foto.offsetWidth; obj_td=obj_foto.parentNode; delta_b=1; if (bOp) delta_b=0; preview_y=obj_foto.offsetTop+obj_td.offsetTop+delta_b; preview_x=obj_foto.offsetLeft+obj_td.offsetLeft+delta_b; //alert(preview_y+" "+preview_x); okno_y=obj_block_from_photos.offsetTop; okno_x=obj_block_from_photos.offsetLeft; first_y=okno_y+preview_y-1+obj_pg_table_photo.offsetTop; first_x=okno_x+preview_x-1-cellspacing; end_height=data_images[num_photo]["big_photo_height"]; end_width=data_images[num_photo]["big_photo_width"]; //alert(height_window); end_y=(height_window-end_height)/2+page_y; end_x=(width_window-end_width)/2+page_x; obj_block_print_image.style.display="block"; obj_block_print_image.style.top=first_y+"px"; obj_block_print_image.style.left=first_x+"px"; obj_block_print_image.style.width=preview_width+"px"; obj_block_print_image.style.height=preview_height+"px"; obj_block_print_image.style.border="solid 1px #000"; //obj_block_print_image.style.background="#222"; on_open_okno=false; obj_block_print_image.innerHTML=""; //pg_step=1; //t_slaid=setInterval("slide_write()",time_slaid); } } pg_step=0; num_step=10; time_slaid=10; t_slaid=0; on_slaid_okno=false; on_load_big_foto=false; on_open_okno=false; obj_big_photo_pg=null; num_open_photo=0; on_permission_slaid=true; function slide_write() { if (pg_step <= num_step) { x=(end_x-first_x)*pg_step/num_step+first_x; y=(end_y-first_y)*pg_step/num_step+first_y; w=(end_width-preview_width)*pg_step/num_step+preview_width; h=(end_height-preview_height)*pg_step/num_step+preview_height; obj_block_print_image.style.top=y+"px"; obj_block_print_image.style.left=x+"px"; obj_block_print_image.style.width=w+"px"; obj_block_print_image.style.height=h+"px"; obj_big_photo_pg.style.width=w+"px"; obj_big_photo_pg.style.height=h+"px"; //obj_block_print_image.innerHTML=""; pg_step++; } else { clearInterval(t_slaid); t_slaid=0; text="
"; text+="
"; text+=""; text+="
"; text+="
"; text+=decodeURIComponent(data_images[num_open_photo]["name_photo"]); text+="
"; text+=""; text+="
"; text+="
"; obj_block_print_image.style.border="none"; obj_block_print_image.style.top=end_y-15+"px"; obj_block_print_image.style.left=end_x-15+"px"; w=end_width-0+30; h=end_height-0+35; //alert(w+" "+h); obj_block_print_image.style.width=w+"px"; obj_block_print_image.style.height=h+"px"; obj_block_print_image.innerHTML=text; //obj_big_photo_pg.style.width=end_width+"px"; //obj_big_photo_pg.style.height=end_height+"px"; on_slaid_okno=false; on_open_okno=true; } } function pg_onload_image() { /* //image_load_src //obj_block_print_image.style.display="block"; if (!on_slaid_okno) obj_block_print_image.innerHTML=""; on_load_big_foto=true;*/ if (!on_permission_slaid) return; on_permission_slaid=false; on_slaid_okno=true; on_open_okno=false; pg_step=1; obj_block_print_image.innerHTML=""; obj_big_photo_pg=document.getElementById("pg_image_big_photo"); t_slaid=setInterval("slide_write()",time_slaid); } function close_lightbox() { if (obj_block_load) { obj_block_load.style.display="none"; obj_block_load.innerHTML=""; } if (t_slaid!=0) { clearInterval(t_slaid); t_slaid=0; } if (!on_slaid_okno && !on_open_okno) { if (obj_black_block) obj_black_block.style.display="none"; if (obj_block_print_image) { obj_block_print_image.style.display="none"; obj_block_print_image.innerHTML=""; } on_permission_slaid=true; } else { on_slaid_okno=true; obj_block_print_image.style.border="none"; obj_block_print_image.style.top=end_y+"px"; obj_block_print_image.style.left=end_x+"px"; w=end_width; h=end_height; obj_block_print_image.style.width=w+"px"; obj_block_print_image.style.height=h+"px"; obj_block_print_image.innerHTML=""; obj_big_photo_pg=document.getElementById("pg_image_big_photo"); t_slaid=setInterval("close_slaid_lightbox();",time_slaid); } } function close_slaid_lightbox() { if (pg_step > 0) { x=(end_x-first_x)*pg_step/num_step+first_x; y=(end_y-first_y)*pg_step/num_step+first_y; w=(end_width-preview_width)*pg_step/num_step+preview_width; h=(end_height-preview_height)*pg_step/num_step+preview_height; obj_block_print_image.style.top=y+"px"; obj_block_print_image.style.left=x+"px"; obj_block_print_image.style.width=w+"px"; obj_block_print_image.style.height=h+"px"; obj_big_photo_pg.style.width=w+"px"; obj_big_photo_pg.style.height=h+"px"; //obj_block_print_image.innerHTML=""; pg_step--; } else { clearInterval(t_slaid); t_slaid=0; pg_step=0; obj_block_print_image.innerHTML="";//"; on_slaid_okno=false; on_open_okno=false; close_lightbox(); } }