/* dir_include=dir_http+"/moduls/shop/include"; function abuse_to_adv(num_abuse_adv) { //alert(num_abuse_adv+" dir_http="+dir_http); data_send="id_adv="+num_abuse_adv; url=dir_include+"/set_abuse_adv.php"; HTTPload.open("post",url,true); HTTPload.onreadystatechange=ob_save_abuse_adv; HTTPload.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); //obj_div_message_connect_start_edit.style.display="block"; HTTPload.send(data_send); } function ob_save_abuse_adv() { if (HTTPload.readyState!=4) return; //obj_div_message_connect_start_edit.style.display="none"; if (HTTPload.status != 200) { alert ("Произошла неизвестная ошибка!"); //alert (HTTPload.responseText); return; } answer=HTTPload.responseText; //alert (answer); answer=eval("("+answer+")"); if (answer.error.code==1) { alert (answer.error.text); return; } document.getElementById("link_abuse_to_adv").innerHTML=" Спасибо! Администрация сайта оповещена!"; } */ name_preload_foto_element=""; padding_img_element=5; permission_open_view_img_element=false; function on_view_big_foto_element(name_foto) { //alert(name_foto); name_preload_foto_element=name_foto; permission_open_view_img_element=true; if (!document.getElementById("block_preload_image_element")) { elem_div_preload_image_element=document.createElement("div"); elem_div_preload_image_element.setAttribute("id","block_preload_image_element"); elem_div_preload_image_element.style.position="absolute"; elem_div_preload_image_element.style.top="0px"; elem_div_preload_image_element.style.left="0px"; elem_div_preload_image_element.style.zIndex=-100; obj_div_preload_image_element=document.body.appendChild(elem_div_preload_image_element); } else { obj_div_preload_image_element=document.getElementById("block_preload_image_element"); } obj_div_preload_image_element.innerHTML=""; //отображаем полупрозрачный див if (!document.getElementById("block_black_pole_element")) { elem_black_pole_element=document.createElement("div"); elem_black_pole_element.setAttribute("id","block_black_pole_element"); elem_black_pole_element.onclick=close_view_image_element; elem_black_pole_element.style.position="absolute"; elem_black_pole_element.style.top="0px"; elem_black_pole_element.style.left="0px"; elem_black_pole_element.style.zIndex=99; elem_black_pole_element.style.background="#f4f1ea" obj_black_pole_element=document.body.appendChild(elem_black_pole_element); } else { obj_black_pole_element=document.getElementById("block_black_pole_element"); } razmers_page=getDocumentSize(document); page_width=razmers_page.width; page_height=razmers_page.height; obj_black_pole_element.style.width=page_width+"px"; obj_black_pole_element.style.height=page_height+"px"; obj_black_pole_element.style.display="block"; //выводим рисунок отображающий индикатор загрузки if (!document.getElementById("block_view_image_element")) { elem_div_view_image_element=document.createElement("div"); elem_div_view_image_element.setAttribute("id","block_view_image_element"); elem_div_view_image_element.style.position="absolute"; //elem_div_view_image_element.style.top="0px"; //elem_div_view_image_element.style.left="0px"; elem_div_view_image_element.style.zIndex=100; elem_div_view_image_element.style.background="#f4f1ea"; elem_div_view_image_element.style.border="solid 3px #bd4500"; elem_div_view_image_element.style.color="#f4f1ea"; elem_div_view_image_element.style.padding=padding_img_element+"px"; obj_div_view_image_element=document.body.appendChild(elem_div_view_image_element); } else { obj_div_view_image_element=document.getElementById("block_view_image_element"); } 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); page_y=document.body.scrollTop; page_x=document.body.scrollLeft; if (page_y==0 && page_x==0 && document.body.parentNode) { page_y=page_y+document.body.parentNode.scrollTop; page_x=page_x+document.body.parentNode.scrollLeft; } obj_div_view_image_element.style.display="block"; obj_div_view_image_element.innerHTML=""; foto_height=obj_div_view_image_element.offsetHeight; foto_width=obj_div_view_image_element.offsetWidth; y_block=page_y+(height_window-foto_height)/2; x_block=page_x+(width_window-foto_width)/2; obj_div_view_image_element.style.top=y_block-padding_img_element+"px"; obj_div_view_image_element.style.left=x_block-padding_img_element+"px"; //obj_div_veiw_image_element.style.width } function on_preload_image_element(obj_foto) { if (!permission_open_view_img_element) return; permission_open_view_img_element=false; if (!document.getElementById("block_view_image_element")) { elem_div_view_image_element=document.createElement("div"); elem_div_view_image_element.setAttribute("id","block_view_image_element"); elem_div_view_image_element.style.position="absolute"; //elem_div_view_image_element.style.top="0px"; //elem_div_view_image_element.style.left="0px"; elem_div_view_image_element.style.zIndex=100; elem_div_view_image_element.style.background="#fff"; elem_div_view_image_element.style.border="solid 3px #000"; elem_div_view_image_element.style.padding=padding_img_element+"px"; obj_div_view_image_element=document.body.appendChild(elem_div_view_image_element); } else { obj_div_view_image_element=document.getElementById("block_view_image_element"); } razmers_page=getDocumentSize(document); page_width=razmers_page.width; page_height=razmers_page.height; 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); page_y=document.body.scrollTop; page_x=document.body.scrollLeft; if (page_y==0 && page_x==0 && document.body.parentNode) { page_y=page_y+document.body.parentNode.scrollTop; page_x=page_x+document.body.parentNode.scrollLeft; } foto_height=obj_foto.offsetHeight; foto_width=obj_foto.offsetWidth; y_block=page_y+(height_window-foto_height)/2; x_block=page_x+(width_window-foto_width)/2; obj_div_view_image_element.style.top=y_block-padding_img_element+"px"; obj_div_view_image_element.style.left=x_block-padding_img_element+"px"; //obj_div_veiw_image_element.style.width obj_div_view_image_element.innerHTML="
"; obj_div_view_image_element.style.display="block"; } function close_view_image_element() { permission_open_view_img_element=false; obj_div_view_image_element.style.display="none"; obj_div_view_image_element.innerHTML=""; obj_black_pole_element.style.display="none"; obj_black_pole_element.innerHTML=""; } function getDocumentSize(doc) { // getting a real size document with scrolling etc. var r = { width: 0, height: 0 }; var width1=0, width2=0, width3=0, width4=0, maxWidth=0; var height1=0, height2=0, height3=0, height4=0, maxHeight=0; if (doc.width) maxWidth = doc.width; if (doc.body) { if (doc.body.scrollWidth) width1 = doc.body.scrollWidth; if (doc.body.offsetWidth) width2 = doc.body.offsetWidth; } if (doc.documentElement) { width3 = doc.documentElement.scrollWidth; width4 = doc.documentElement.clientWidth; } maxWidth = Math.max(Math.max(Math.max(width1, width2), Math.max(width3, width4)),maxWidth); if (doc.height) maxHeight = doc.height; if (doc.body) { if (doc.body.scrollHeight) height1 = doc.body.scrollHeight; if (doc.body.offsetHeight) height2 = doc.body.offsetHeight; } if (doc.documentElement) { height3 = doc.documentElement.scrollHeight; height4 = doc.documentElement.clientHeight; } maxHeight = Math.max(Math.max(Math.max(height1, height2), Math.max(height3, height4)),maxHeight); r.width = maxWidth; r.height = maxHeight; return r; }