function getXMLHttpRequest()
{if(window.XMLHttpRequest)
{return new XMLHttpRequest();}else if(window.ActiveXObject)
{try
{return new ActiveXObject("Msxml2.XMLHTTP");}catch(e)
{try
{return new ActiveXObject("Microsoft.XMLHTTP");}catch(e){}}}
return null;}
function getAjaxContent(url,callback)
{var ajax_req=getXMLHttpRequest();if(callback)
ajax_req.onreadystatechange=callback;ajax_req.open('POST',url,true);ajax_req.send(null);}
var img=null;function showPreview(url,clickID)
{if(clickID&&clickID>0);logPreview(clickID);if(img)return;img=new Image();img.src='http://www.shrinktheweb.com/xino.php?embed=1&STWAccessKeyId=b4f6f7e887f4104&Size=xlg&stwUrl='+escape(url);document.getElementById('preview').appendChild(img);document.getElementById('preview').style.display='block';}
function fbs_click(u,t){u=u||location.href;t=t=t||document.title;window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u),'sharer','toolbar=0,status=0,width=626,height=436');return false;}
function logPreview(clickID)
{getAjaxContent('/ajax/logPreview.php?ClickID='+clickID);}
function logFollow(clickID)
{getAjaxContent('/ajax/logFollow.php?ClickID='+clickID);}
function addRating(alias,rating)
{getAjaxContent('/ajax/addRating.php?alias='+alias+'&rating='+rating);var o=document.getElementById('rate-O');var g=document.getElementById('rate-G');var n=document.getElementById('rate-N');var x=document.getElementById('rate-X');o.onclick=function(){return false;}
g.onclick=function(){return false;}
n.onclick=function(){return false;}
x.onclick=function(){return false;}
o.className='inactive';g.className='inactive';n.className='inactive';x.className='inactive';var rated=document.getElementById('rate-'+rating);if(rated)
rated.className='rated rated-'+rating;}
function showComments(event,anchor,alias)
{hideAllFrames();var frame=document.getElementById('comments-frame');if(frame)return;frame=document.createElement('iframe');frame.src='/frames/comments.php?alias='+alias;frame.id='comments-frame';frame.frameBorder=0;frame.frameborder=0;frame.border=0;document.body.appendChild(frame);}
function hideComments()
{var frame=document.getElementById('comments-frame');if(frame)
document.body.removeChild(frame);}
function showRatings(event,anchor,alias)
{hideAllFrames();var frame=document.getElementById('ratings-frame');if(frame)return;frame=document.createElement('iframe');frame.src='/frames/ratings.php?alias='+alias;frame.id='ratings-frame';frame.frameBorder=0;frame.frameborder=0;frame.border=0;frame.scrolling='no';document.body.appendChild(frame);}
function hideRatings()
{var frame=document.getElementById('ratings-frame');if(frame)
document.body.removeChild(frame);}
function hideAllFrames()
{hideComments();hideRatings();}
window.size=function()
{var w=0;var h=0;if(!window.innerWidth)
{if(!(document.documentElement.clientWidth==0))
{w=document.documentElement.clientWidth;h=document.documentElement.clientHeight;}
else
{w=document.body.clientWidth;h=document.body.clientHeight;}}
else
{w=window.innerWidth;h=window.innerHeight;}
return{width:w,height:h};}
