//price_show ########################################################################################################    function price_show (price, func_result) {                //set const ------------------------------------------------------            var space_period = 3;            var spacer_value = " ";        // / set const ---------------------------------------------------        //prepare price --------------------------------------------------            price = Number(price);            price = price.toFixed(2);        // / prepare price -----------------------------------------------                //explode price for 2 part ---------------------------------------            var temp_v = [''];            temp_v = price.split('.');        // / explode price for 2 part ------------------------------------        //price_result2 --------------------------------------------------            var price_result2 = '.';            if (temp_v[1]) {                price_result2 = price_result2 + temp_v[1];            } else {                price_result2 = price_result2 + '00';            }                   // / price_result2 -----------------------------------------------            //price_result1 --------------------------------------------------            var price_result1 = temp_v[0];            var length1 = price_result1.length;                    if (length1 > space_period) {                var pos = length1;                var new_str = '';                var sub;                var spacer_counter = 1;                while (pos != 0) {                    pos = pos - 1;                     sub = price_result1.substr(pos, 1);                    new_str = sub + new_str;                    if (spacer_counter == space_period) {                        new_str = spacer_value + new_str;                        spacer_counter = 0;                    }                    spacer_counter = spacer_counter + 1;                }                            if (new_str) {                    price_result1 = new_str;                }            }         // / price_result1 -----------------------------------------------            //price_result ---------------------------------------------------            var price_result;            if (func_result) {                price_result = price_result1 + price_result2;            } else {                price_result = price_result1;            }        // / price_result ------------------------------------------------                        return price_result;    }// / price_show #####################################################################################################$(document).ready(function(){//BOF FANCYBOX ########################################################################################################################## 			$("a[rel=inner_goods_img]").fancybox({				'transitionIn'		: 'none', /* animations: fade, elastic, none */				'transitionOut'		: 'none', /* animations: fade, elastic, none */				'titlePosition' 	: 'over', /* outside, inside, over  */				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {					return '<span id="fancybox-title-over">Фото ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';				}			});			$("a[rel=inner_folio_img]").fancybox();						$("a[rel=inner_folio_img1]").fancybox();			$("a[rel=inner_folio_img2]").fancybox();			$("a[rel=inner_folio_img3]").fancybox();			$("a[rel=inner_folio_img4]").fancybox();			$("a[rel=inner_folio_img5]").fancybox();			$("a[rel=inner_folio_img6]").fancybox();			$("a[rel=inner_folio_img7]").fancybox();			$("a[rel=inner_folio_img8]").fancybox();			$("a[rel=inner_folio_img9]").fancybox();			$("a[rel=inner_folio_img10]").fancybox();//EOF FANCYBOX ##########################################################################################################################         $("#wed_num").keyup(function(){            var total_sum_text;            var temp_value = 0;                        //Проверка ввода ----------------------                                obj = document.getElementById("wed_num");                 if (obj) {                    temp_value = obj.value;                }                            if (temp_value == 'Среднее количество свадеб в год') {                    temp_value = 0;                } else {                          temp_value = Number(temp_value);                                if (isNaN(temp_value)) {                        temp_value = 0;                    }                }                                        if (!temp_value) temp_value = 0;            // / Проверка ввода ----------------------            //$("#text_sum").html('t=' + temp_value);                                           if (temp_value > 0) {                //Вычисляем ------------------------                    total_sum_text = ((4480*temp_value)*20)/100;                // / Вычисляем ------------------------                        //Выводим значение ------------------------                    obj.value = temp_value;                // / Выводим значение ------------------------                        //Выводим текст ------------------------                    var temp_text = '<nobr>';                    temp_text = temp_text + 'Вы сможете зарабатывать до <span id="sbig">' + price_show(total_sum_text, 0) + '</span> руб. в год';                    temp_text = temp_text + '</nobr>';                                            $("#text_sum").html(temp_text);                                        //$("#text_sum).show();                // / Выводим текст ---------------------                            } else {                $("#text_sum").html('&nbsp;');                obj.value = '';            }                                  return false;	              });        });
