// init addEvent(window,'load', function(){ ticmsView(1,''); }); // fix W3C compliance addEvent(window,'resize', function() { ticmsOnResize(); }); function createXMLHttpRequest() { var xmlhttp; if(window.XMLHttpRequest) { try { xmlhttp = new XMLHttpRequest(); } catch(e) { xmlhttp = false; } } else if(window.ActiveXObject) { try { xmlhttp = new ActiveXObject("MSXML2.XMLHTTP.3.0"); } catch(e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { xmlhttp = false; } } } return xmlhttp; } var ticmsAjax = createXMLHttpRequest(); function handleResponse(){ if(ticmsAjax.readyState == 4){ var response = ticmsAjax.responseText; var parser_div = new Array(); var parser_subdiv = new Array(); var delimiter_begin = '*#@|'; var delimiter_end = '*#@EOL|*'; if(response.indexOf('||') != -1) { var content = ''; var div = ''; parser_div = response.substr(2).split('||'); for(i=0;i<(parser_div.length);i++){ content = ''; if(i%2==0){ div = parser_div[i]; if(parser_div[i+1].indexOf('*#@|') != -1){ parser_subdiv = parser_div[i+1].substr(parser_div[i+1].indexOf('*#@|')+delimiter_begin.length).split('*#@|'); if(parser_div[i+1].indexOf('*#@|')!=0){ content += parser_div[i+1].substr(0,parser_div[i+1].indexOf('*#@|')); } for(y=0;y<(parser_subdiv.length);y++){ if(y%2==0){ if(parser_subdiv[y].substr(0,2) == '**'){ eval("ticmsGetElementById('"+parser_subdiv[y].substring(2,parser_subdiv[y].indexOf('/'))+"')."+(parser_subdiv[y].substring(parser_subdiv[y].indexOf('/')+1))+" = "+(parser_subdiv[y+1].substring(0,String(parser_subdiv[y+1]).indexOf(delimiter_end)))+";"); } else if(parser_subdiv[y].substr(0,2) == '##'){ eval(parser_subdiv[y].substring(2)+"="+parser_subdiv[y+1].substring(0,parser_subdiv[y+1].indexOf(delimiter_end))+";"); } else if(parser_subdiv[y].substr(0,2) == '@@'){ eval(parser_subdiv[y].substring(2)); } if(parser_subdiv[y+1].length!=(parser_subdiv[y+1].substring(0,parser_subdiv[y+1].indexOf(delimiter_end)).length+delimiter_end.length)){ content += parser_subdiv[y+1].substring(parser_subdiv[y+1].indexOf(delimiter_end)+delimiter_end.length); } } } if(content.length>0){ ticmsGetElementById(div).innerHTML = content; } } else { ticmsGetElementById(parser_div[i]).innerHTML = parser_div[i+1]; } } } } } } function ticmsView(hash0,hash1,hash2,hash3,hash4,hash5,hash6,hash7,hash8,hash9,hash10){ ticms_asynchronous = false; if(document.getElementById('ticms-dialog-status')) ticms_status = document.getElementById('ticms-dialog-status').innerHTML; else ticms_status = 0; ticmsAjax.open('get', '/ajax_request.php?request=ticms_view&ticms_hash0=' + encodeURIComponent(hash0+'-'+ticms_status+'-'+f_scrollTop()) + '&ticms_hash1=' + encodeURIComponent(hash1) + '&ticms_hash2=' + encodeURIComponent(hash2)+ '&ticms_hash3=' + encodeURIComponent(hash3)+ '&ticms_hash4=' + encodeURIComponent(hash4)+ '&ticms_hash5=' + encodeURIComponent(hash5)+ '&ticms_hash6=' + encodeURIComponent(hash6)+ '&ticms_hash7=' + encodeURIComponent(hash7)+ '&ticms_hash8=' + encodeURIComponent(hash8)+ '&ticms_hash9=' + encodeURIComponent(hash9)+ '&ticms_hash10=' + encodeURIComponent(hash10),ticms_asynchronous); try { ticmsAjax.onreadystatechange = handleResponse(); // FIX FF } catch(e) { ticmsAjax.onreadystatechange = handleResponse; } // ticmsAjax.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); ticmsAjax.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); ticmsAjax.send(null); try { if (ticmsAjax.onreadystatechange == null) handleResponse(); // FIX FF } catch(e) {} if(hash2==''){ if(ticmsGetElementById('ticms-data-box-container')){ ticmsContentControl(); } } } function ticmsContentControl(){ if(ticmsGetElementById('page-container').offsetHeight-ticmsGetElementById('ticms-data-box').style.marginTop.substr(0,ticmsGetElementById('ticms-data-box').style.marginTop.indexOf('px'))-ticmsGetElementById('ticms-data-box').offsetHeight<0){ ticmsGetElementById('page-container').style.position = 'fixed'; ticmsCenterBox('page-container','page-container',false); } } function ticmsExecute(option){ switch(option){ case true: case false: document.getElementById('ticms-dialog-status').innerHTML = 1; eval(document.getElementById('ticms-dialog-'+option).innerHTML); break; } } function ticmsGetElementById(div,object){ if(!object) object = 'document'; var ticmsElement; var tmp; eval("ticmsElement = "+object+".getElementById('"+div+"');"); if(!ticmsElement){ ticmsElement = document.createElement('div'); tmp = document.createAttribute('id'); tmp.value = div; ticmsElement.setAttributeNode(tmp); document.body.appendChild(ticmsElement); if(div!='ticms-execute') alert(div+' DIV non presente, generato!'); } return ticmsElement; } function ticmsFixNiftyIE(div){ var tmp = document.getElementById(div); tmp2 = tmp.getElementsByTagName('b'); // FIX NIFTY WIDTH for(i=0;i document.body.offsetHeight) return document.body.scrollHeight; else if (document.documentElement && document.documentElement.scrollHeight > document.documentElement.offsetHeight) return document.documentElement.scrollHeight; else return document.body.offsetHeight; } function f_clientWidth() { return f_filterResults ( window.innerWidth ? window.innerWidth : 0, document.documentElement ? document.documentElement.clientWidth : 0, document.body ? document.body.clientWidth : 0 ); } function f_clientHeight() { return f_filterResults ( window.innerHeight ? window.innerHeight : 0, document.documentElement ? document.documentElement.clientHeight : 0, document.body ? document.body.clientHeight : 0 ); } function f_scrollLeft() { return f_filterResults ( window.pageXOffset ? window.pageXOffset : 0, document.documentElement ? document.documentElement.scrollLeft : 0, document.body ? document.body.scrollLeft : 0 ); } function f_scrollTop() { return f_filterResults ( window.pageYOffset ? window.pageYOffset : 0, document.documentElement ? document.documentElement.scrollTop : 0, document.body ? document.body.scrollTop : 0 ); } function f_filterResults(n_win, n_docel, n_body) { var n_result = n_win ? n_win : 0; if (n_docel && (!n_result || (n_result > n_docel))) n_result = n_docel; return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result; }