﻿function change_html(x,y){
document.getElementById(x).innerHTML=y;}
function show(x){
if (document.getElementById(x).style.display=='none'){
document.getElementById(x).style.display='';}}
function hide(x){
document.getElementById(x).style.display='none';}
function redirect(x){}
function ieopen(x){
window.open(x,null,'');}
function content_loader(x,y,z,w){
if (y!=='nouse'){
if (w!==-1){
change_html(y,'<table style="width: 100%"><tr><td style="text-align: center;height: 25px;"><img alt="" src="'+root+'/blog/images/ajax-loader2.gif" width="16" height="16" /></td></tr></table>');}}
var xmlHttp;
try{
xmlHttp=new XMLHttpRequest();}
catch (e){
try{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch (e){
try{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}
catch (e){
alert("Your browser does not support AJAX!");return false;}}}
xmlHttp.onreadystatechange=function(){
if(xmlHttp.readyState==4){
// Response
change_html(y,xmlHttp.responseText);show(y);
}}
if (z!==undefined){
if (isString(z)==true){
z = z.replace(/ /g, 'ŐŐ');
z = z.replace(/%/g, 'ẽẽ');
z = z.replace(/\n/g, "<br />");}}
myquery="x="+z+"&y="+w;
xmlHttp.open("POST","blog/"+x,true);
xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
xmlHttp.send(myquery);}

var loadedobjects=""
function loadobjs(){
if (!document.getElementById)
return
for (i=0; i<arguments.length; i++){
var file=arguments[i]
var fileref=""
if (loadedobjects.indexOf(file)==-1 && file.indexOf(".js")!=-1){ 
fileref=document.createElement('script')
fileref.setAttribute("type","text/javascript");
fileref.setAttribute("src", file);}
if (file.indexOf(".css")!=-1){
fileref=document.createElement("link")
fileref.setAttribute("rel", "stylesheet");
fileref.setAttribute("type", "text/css");
fileref.setAttribute("href", file);}
if (fileref!=""){
document.getElementsByTagName("head").item(0).appendChild(fileref)
loadedobjects+=file+" " }}}

function isString() {
if (typeof arguments[0] == 'string') return true;
if (typeof arguments[0] == 'object') {
var criterion = arguments[0].constructor.toString().match(/string/i); return (criterion != null);}return false;}

function comment_save(x){
var myvalue='';
myvalue+=document.getElementsByName('comment_name_'+x)[0].value+'||'+document.getElementsByName('comment_email_'+x)[0].value+'||'+document.getElementsByName('comment_site_'+x)[0].value+'||'+document.getElementsByName('comment_memo_'+x)[0].value+'||'+document.getElementsByName('article_id_'+x)[0].value
content_loader(root+'inc/commentsave.asp','nouse',myvalue);
var temp;
temp=parseInt(document.getElementById('commentcounter'+x).innerText)+1;
change_html('commentcounter'+x,temp);
hide('comment'+x)
}