function gE(e){return document.getElementById(e);}
function wH(e,h){e.innerHTML=h;}
function makeRequest(url,loadingFunc,doneFunc){http_request=false;if(window.XMLHttpRequest){http_request=new XMLHttpRequest();if(http_request.overrideMimeType){http_request.overrideMimeType('text/xml');}}
else if(window.ActiveXObject){try{http_request=new ActiveXObject('Msxml2.XMLHTTP');}catch(e){try{http_request=new ActiveXObject('Microsoft.XMLHTTP');}catch(e){}}}
if(!http_request){alert('FATAL ERROR: Cannot create an XMLHTTP instance.');return false;}
http_request.onreadystatechange=function(){if(http_request.readyState==4){if(http_request.status==200){eval(doneFunc+'(http_request.responseText)');}else{alert('Error while connecting to the server. Please try again leter.');}}else{if(this.isOpera||!document.all||!navigator.userAgent.match(/msie/gi)){eval(loadingFunc+'(http_request.responseText)');}}}
try{http_request.open('POST','http://shinonoi-ghp.jp/wp-content/plugins/ajaxified-expand-post-now.php',true);http_request.setRequestHeader('Content-Type','application/x-www-form-urlencoded');http_request.send('p='+url);}catch(e){alert('I have encountered an problem while fetching data due to the cross-domain restriction of the XMLHTTPRequest object.');}}
function getData(id){postID='p'+id;makeRequest(id,'fetchLoading','fetchDone');gE('viewBox-'+postID).style.display='block';gE('open-'+postID).style.display='none';gE('close-'+postID).style.display='inline';}
function fetchLoading(){wH(gE('viewBox-'+postID),'Fetching Data...');}
function fetchDone(outcome){wH(gE('viewBox-'+postID),outcome);}
function closeView(id){gE('viewBox-'+id).style.display='none';gE('open-'+id).style.display='inline';gE('close-'+id).style.display='none';}
