var search_cnt = 0;var thisval=0;function login_site_user_js() {    JsHttpRequest.query(        '/ru/calendar/login.html?rand='+Math.random(10000),        {            'login_sp': document.getElementById('login_sp').value,            'pass_sp': document.getElementById('pass_sp').value        },        function(result, errors) {            if(!result["result_var"]){                alert('Неправильный логин или пароль!');            } else document.location = '/ru/calendar';        }        );}function login_site_user_js2() {    JsHttpRequest.query(        '/ru/calendar/login.html?rand='+Math.random(10000),        {            'login_sp': document.getElementById('email_login2').value,            'pass_sp': document.getElementById('pass_login2').value        },        function(result, errors) {            if(!result["result_var"]){                alert('Неправильный логин или пароль!');            } else                document.location = '/ru/calendar';        }        );}var godays = 7;var bgtmp=0;function change_opacity(id, opacity){    document.getElementById(id).style.opacity=opacity;    document.getElementById(id).style.filter = 'alpha(opacity='+(opacity*400)+')';    opacity = opacity + 0.03;    if(opacity<1){        setTimeout('change_opacity(\''+id+'\','+opacity+')', 30);    }}function show_calendar_aj(data, wday){    var sel_proc = document.getElementById('cal_procedure');    if(sel_proc.value==0) alert('Вы не выбрали название процедуры!');    else {        document.getElementById("pleasewait2").style.display = "block";        var xScroll, yScroll;        if (window.innerHeight && window.scrollMaxY) {            xScroll = document.body.scrollWidth;            yScroll = window.innerHeight + window.scrollMaxY;        } else if (document.body.scrollHeight > document.body.offsetHeight){            xScroll = document.body.scrollWidth;            yScroll = document.body.scrollHeight;        } else {            xScroll = document.body.offsetWidth;            yScroll = document.body.offsetHeight;        }        var windowWidth, windowHeight;        if (self.innerHeight) {            windowWidth = self.innerWidth;            windowHeight = self.innerHeight;        } else if (document.documentElement && document.documentElement.clientHeight) {            windowWidth = document.documentElement.clientWidth;            windowHeight = document.documentElement.clientHeight;        } else if (document.body) {            windowWidth = document.body.clientWidth;            windowHeight = document.body.clientHeight;        }        if(yScroll < windowHeight){            pageHeight = windowHeight;        } else {            pageHeight = yScroll;        }        if(xScroll < windowWidth){            pageWidth = windowWidth;        } else {            pageWidth = xScroll;        }        document.getElementById("pleasewait2").style.height = pageHeight + "px";        document.location='#';        document.getElementById('calenderdiv').style.display='block';        change_opacity('calenderdiv', 0);        document.getElementById('calenderdiv_html').innerHTML = '<img src="/res/loading.gif" border=0 alt="" hspace=430 vspace=90>';        document.getElementById('calenderdiv').style.left=((((window.innerWidth?window.innerWidth:document.body.offsetWidth)-910)/2)*1)+'px';        for(var f=0; f<sel_proc.options.length; f++){            if(sel_proc.options[f].selected==true) {                document.getElementById('title_proc_id').innerHTML = sel_proc.options[f].text + " - ";            }        }        JsHttpRequest.query(            '/ru/calendar/calendar_form.html?rand='+Math.random(10000),            {                'data': data,                'wday': wday,                'id_procedure': document.getElementById('cal_procedure').value            },            function(result, errors) {                if(result["result_var"]){                    document.getElementById('calenderdiv_html').innerHTML=result["result_var"];                    document.getElementById('title_proc_id').innerHTML = result["title"] + " - ";                    document.getElementById('about_link').href=result["link2"];                    document.getElementById('prodol').innerHTML=result["time"];                } else {                    alert(result["error_var"]);                }            }            );    }}var sess_sid = '';/*function save_time_table(){        var obj_form = document.getElementById('timetablesform');        var times_data = '';        for(var j=0; j<obj_form.elements.length; j++){            if(obj_form.elements[j].name=='day_times[]' && obj_form.elements[j].value!=''){                times_data += (';'+obj_form.elements[j].value);            }        }        var unblock_data = '';        for(var j=0; j<obj_form.elements.length; j++){            if(obj_form.elements[j].name=='day_unblock[]' && obj_form.elements[j].value!=''){                unblock_data += (';'+obj_form.elements[j].value);            }        }        if(document.getElementById('email_login2')){            if(document.getElementById('email_login2').value){                JsHttpRequest.query(                '/ru/calendar/login.html?rand='+Math.random(10000),                {                    'login_sp': document.getElementById('email_login2').value,                    'pass_sp': document.getElementById('pass_login2').value                },                function(result, errors) {                    if(!result["result_var"]){                        alert('Неправильный логин или пароль!');                    } else {                        JsHttpRequest.query(                        '/ru/calendar/calendar_save.html?rand='+Math.random(10000),                        {                            'times_data': times_data,                            'unblock_data': unblock_data,                            'id_procedure': document.getElementById('id_procedure_hid').value                        },                        function(result, errors) {                            if(result["result_var"]){                                //show_calendar_aj(document.getElementById('date_classic').value, godays);                                document.location='/ru/calendar';                            } else {                                alert(result["result_var"]);                            }                        }                    );                    }                }            );            } else {                if(document.getElementById('reg_email_reg2') && document.getElementById('reg_email_reg2').value){                    JsHttpRequest.query(                    '/ru/calendar/register_data.html?rand='+Math.random(10000),                    {                        'pass':  document.getElementById('reg_pass_reg2').value,                        'pass2': document.getElementById('reg_pass_reg2').value,                        'email': document.getElementById('reg_email_reg2').value,                        'phone': document.getElementById('reg_phone_reg2').value,                        'code':  document.getElementById('reg_code_reg2').value,                        'fio':  document.getElementById('last_name_reg2').value                    },                    function(result, errors) {                        if(result["error_var"]=='OK'){                            JsHttpRequest.query(                            '/ru/calendar/calendar_save.html?rand='+Math.random(10000),                            {                                'times_data': times_data,                                'unblock_data': unblock_data,                                'id_procedure': document.getElementById('id_procedure_hid').value                            },                            function(result, errors) {                                if(result["result_var"]){                                    document.location = '/ru/calendar';                                } else {                                    alert(result["result_var"]);                                }                            }                        );                        } else {                            alert(result["error_var"]);                        }                    }                );                } else alert('Вы не авторизировались!');            }        } else {            JsHttpRequest.query(            '/ru/calendar/calendar_save.html?rand='+Math.random(10000),            {                'times_data': times_data,                'unblock_data': unblock_data,                'id_procedure': document.getElementById('id_procedure_hid').value            },            function(result, errors) {                if(result["result_var"]){                    //show_calendar_aj(document.getElementById('date_classic').value, godays);                    document.location='/ru/calendar';                } else {                    alert(result["result_var"]);                }            }        );        }    }*/function save_time_table(){    var obj_form = document.getElementById('timetablesform');    var times_data = '';    for(var j=0; j<obj_form.elements.length; j++){        if(obj_form.elements[j].name=='day_times[]' && obj_form.elements[j].value!=''){            times_data += (';'+obj_form.elements[j].value);        }    }    var unblock_data = '';    for(var j=0; j<obj_form.elements.length; j++){        if(obj_form.elements[j].name=='day_unblock[]' && obj_form.elements[j].value!=''){            unblock_data += (';'+obj_form.elements[j].value);        }    }    JsHttpRequest.query(        '/ru/calendar/calendar_save.html?rand='+Math.random(10000),        {            'email': document.getElementById('reg_email_reg2').value,            'phone': document.getElementById('reg_phone_reg2').value,            'code':  document.getElementById('reg_code_reg2').value,            'fio':  document.getElementById('last_name_reg2').value,            'times_data': times_data,            'unblock_data': unblock_data,            'id_procedure': document.getElementById('id_procedure_hid').value        },        function(result, errors) {            if(result["result_var"]){                document.getElementById('calenderdiv').style.left=((((window.innerWidth?window.innerWidth:document.body.offsetWidth)-650)/2)*1)+'px';                document.getElementById('calenderdiv').innerHTML=result["result_var"];                return false;            } else {                alert(result["error_var"]);            }        }        );}function register_js() {    JsHttpRequest.query(        '/ru/calendar/register_data.html?rand='+Math.random(10000),        {            'pass':  document.getElementById('reg_pass_reg').value,            'pass2': document.getElementById('reg_pass2_reg').value,            'email': document.getElementById('reg_email_reg').value,            'phone': document.getElementById('reg_phone_reg').value,            'code':  document.getElementById('reg_code_reg').value,            'fio':  document.getElementById('last_name_reg').value        },        function(result, errors) {            if(result["error_var"]=='OK'){                document.location = '/ru/calendar/';            } else {                alert(result["error_var"]);            }        }        );}function printdiv(id){    MiniWin=window.open ('MiniWin', 'MiniWin', '980, 590 , scrollbars=yes, resizable=yes');    MiniWin.document.open();    Today = new Date();    MiniWin.document.writeln('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><HTML><HEAD><TITLE>Print</TITLE></HEAD><style type="text/css">body{font-family:arial,tahoma,verdana,sans-serif;font-size:11px;color:#000;padding:0px;margin:0px} form{margin:0px} a{text-decoration:none;color:#000} a:hover{text-decoration:underline} img{border:none} .yel{color:#fde6c5} a.yel{text-decoration:underline;font-family:Times New Roman,arial,tahoma,verdana} .inpbdr{border:1px solid #efc282;width:105px;height:14px} .y10{font-size:10px} .caltitle{padding-left:27px} .right_menu{color:#9d6c41;font-family:times new roman;font-size:14px;}</style><BODY leftmargin=0 topmargin=0><div id="contents" align=center></div></BODY></HTML>');    MiniWin.document.close();    MiniWin.focus();    MiniWin.document.getElementById('contents').innerHTML=document.getElementById(id).innerHTML;    MiniWin.print();}Date.prototype.addDays = function(d) {    this.setDate( this.getDate() - d );    return this;};function populate(objForm,selectIndex) {    timeA = new Date(objForm.year.options[objForm.year.selectedIndex].text, objForm.month.options[objForm.month.selectedIndex].value,1);    timeDifference = timeA - 86400000;    timeB = new Date(timeDifference);    var daysInMonth = timeB.getDate();    for (var i = 0; i < objForm.day.length; i++) {        objForm.day.options[0] = null;    }    for (var i = 0; i < daysInMonth; i++) {        objForm.day.options[i] = new Option((i+1<10)?('0'+(i+1)):(i+1));    }    document.f1.day.options[0].selected = true;}function getYears() {    var years = new Array(2009,2010,2011,2012,2013,2014,2015)    for (var i = 0; i < document.f1.year.length; i++) {        document.f1.year.options[0] = null;    }    timeC = new Date();    currYear = timeC.getFullYear();    for (var i = 0; i < years.length; i++){        document.f1.year.options[i] = new Option(years[i]);    }    document.f1.year.options[0].selected=true;}function re_days(fday, obj){    for (var i = 0; i < obj.length; i++){        if(obj.options[i].value == fday || obj.options[i].value == '0' + fday) obj.options[i].selected = true;    }}function re_month(fday, obj){    for (var i = 0; i < obj.length; i++){        if(obj.options[i].value == fday || obj.options[i].value == '0' + fday) obj.options[i].selected = true;    }}function re_year(fday, obj){    for (var i = 0; i < obj.length; i++) {        if(obj.options[i].value == fday) obj.options[i].selected = true;    }}var date = new Date();function change_select(){    getYears();    var date = new Date();    if(!selec){        re_days(date.getDate(), document.f1.day);        re_month(date.getMonth()+1, document.f1.month);        re_year(date.getFullYear(), document.f1.year);        var d = date.addDays(7);        re_days(d.getDate(), document.f1.day2);        re_month(d.getMonth()+1, document.f1.month2);        re_year(d.getFullYear(), document.f1.year2);    } else {        re_days(date.getDate(), document.f1.day2);        re_month(date.getMonth()+1, document.f1.month2);        re_year(date.getFullYear(), document.f1.year2);        var d = date.addDays(7);        re_days(d.getDate(), document.f1.day);        re_month(d.getMonth()+1, document.f1.month);        re_year(d.getFullYear(), document.f1.year);    }}function overlays(id){    var xScroll, yScroll;    if (window.innerHeight && window.scrollMaxY) {        xScroll = document.body.scrollWidth;        yScroll = window.innerHeight + window.scrollMaxY;    } else if (document.body.scrollHeight > document.body.offsetHeight){        xScroll = document.body.scrollWidth;        yScroll = document.body.scrollHeight;    } else {        xScroll = document.body.offsetWidth;        yScroll = document.body.offsetHeight;    }    var windowWidth, windowHeight;    if (self.innerHeight) {        windowWidth = self.innerWidth;        windowHeight = self.innerHeight;    } else if (document.documentElement && document.documentElement.clientHeight) {        windowWidth = document.documentElement.clientWidth;        windowHeight = document.documentElement.clientHeight;    } else if (document.body) {        windowWidth = document.body.clientWidth;        windowHeight = document.body.clientHeight;    }    if(yScroll < windowHeight){        pageHeight = windowHeight;    } else {        pageHeight = yScroll;    }    if(xScroll < windowWidth){        pageWidth = windowWidth;    } else {        pageWidth = xScroll;    }    document.getElementById(id).style.height = pageHeight + "px";}var message="";function clickIE() {    if (document.all) {        (message);        return false;    }}function clickNS(e) {    if    (document.layers||(document.getElementById&&!document.all)) {        if (e.which==2) {            (message);            return false;        }    }}if (document.layers) {    document.captureEvents(Event.MOUSEDOWN);    document.onmousedown=clickNS;}else{    document.onmouseup=clickNS;    document.oncontextmenu=clickIE;}document.oncontextmenu=new Function("return false")
