function import_JS(src){ var scriptElem = document.createElement("script"); scriptElem.setAttribute("src",src); scriptElem.setAttribute("type","text/javascript"); document.getElementsByTagName("head")[0].appendChild(scriptElem); } function import_JSNoCache(src){ var ms = new Date().getTime().toString(); var seed = "&d=" + ms; import_JS(src + seed); } var name_search_form = "listObjectsForm"; function tableOrdering2( order, dir, task ) { var name_search_form = document.getElementById('name_search_form').value; var form = document.getElementById(name_search_form); form.filter_order.value = order; form.filter_order_Dir.value = dir; form.task.value = task; document.getElementById(name_search_form).submit(); } if("undefined"===typeof Joomla)var Joomla={}; Joomla.tableOrdering=function( order, dir, task ) { var name_search_form = document.getElementById('name_search_form').value; var form = document.getElementById(name_search_form); form.filter_order.value = order; form.filter_order_Dir.value = dir; form.task.value = task; document.getElementById(name_search_form).submit(); } function get_values_elements(form1, name1) { var elem = eval("form1."+name1); var value = 0; var a = []; var k = 0; if(elem.disabled == true){ return a;} if(elem!=null) { if(elem.length > 0 && elem.type!='select-multiple' && elem.type != "select-one") { k = 0; for (i=0; i 0 && elem.type!='select-multiple') { k = 0; for (i=0; i < elem.length; i++) { if(elem[i].checked) { a[k]= elem[i].value ; k++;} } return a; } } else { var elem = document.getElementsByName(name1+'[]'); if(elem.length>0 ) { k = 0; for (i=0; i < elem.length; i++) { if(elem[i].checked) { a[k]= elem[i].value ; k++;} } return a; }; } return a; } function in_array(value, array) { for(var i = 0; i < array.length; i++) { if(array[i] == value) return true; } return false; } function disabledChilds(doc, value) { for (var j = 0; j < doc.childNodes.length; j++) { elem = doc.childNodes[j]; if(elem.name!=null) elem.disabled = value; disabledChilds(elem, value); } } function get_notepad(object_id) { var req=new JsHttpRequest(); req.onreadystatechange=function() { if(req.readyState==4) { if(req.responseJS.notepad=='1')document.getElementById("notepad_object"+object_id).className = "npselect"; if(req.responseJS.notepad=='0')document.getElementById("notepad_object"+object_id).className = "npnoselect"; } } req.open(null,"http://krasdoma24.ru/index.php?option=com_ncatalogues&controller=ajax&task=getNotepad&object_type=26&object_id="+object_id,false); req.send({'object_id':object_id, 'object_type':'26','controller':'ajax', 'option':'com_ncatalogues', 'task':'getNotepad' }); } function add_to_notepad(object_id) { var req=new JsHttpRequest(); if(document.getElementById("notepad_object"+object_id).className == "npselect") document.getElementById("notepad_object"+object_id).className = "npnoselect"; if(document.getElementById("notepad_object"+object_id).className == "npnoselect") document.getElementById("notepad_object"+object_id).className = "npselect"; req.onreadystatechange=function() { if(req.readyState==4) { if(req.responseJS.notepad=='1')document.getElementById("notepad_object"+object_id).className = "npselect"; if(req.responseJS.notepad=='0')document.getElementById("notepad_object"+object_id).className = "npnoselect"; } } req.open(null,"http://krasdoma24.ru/index.php?option=com_ncatalogues&controller=ajax&task=addToNotepad&object_type=26&object_id="+object_id,false); req.send({'object_id':object_id, 'object_type':'26','controller':'ajax', 'option':'com_ncatalogues', 'task':'addToNotepad' }); } function notepadMOut(object_id) { if(njQuery("#notepad_object"+object_id).hasClass("npnoselectfocus") ) njQuery("#notepad_object"+object_id).removeClass("npnoselectfocus") ; } function notepadMOver(object_id) { njQuery("#notepad_object"+object_id).addClass("npnoselectfocus") ; } function listUserObjects(limitstart, limit, type, id, Itemid, alias) { var req=new JsHttpRequest(); req.onreadystatechange=function(){ if(req.readyState==4) { document.getElementById('list_objects').innerHTML = sbEvalJS(req.responseText); } } req.open(null,"http://krasdoma24.ru/index.php?option=com_ncatalogues&controller=ajax&task=listUserObjects",true); req.send({'limitstart':limitstart, 'Itemid':Itemid, 'alias':alias, 'type':type, 'limit':limit,'id':id, 'object_user_type_id':'26'}); }