var xmlHttp;function ajaxcall(ajid,type,html){window.ajid=ajid;window.html=html;var anum=/(^\d+$)|(^\d+\.\d+$)/if(anum.test(ajid)){xmlHttp=GetXmlHttpObject();if(xmlHttp==null)
{alert("Browser does not support HTTP Request");return;}
var url="layout/header.php";url=url+"?ajid="+ajid;url=url+"&type="+type;url=url+"&sid="+Math.random();xmlHttp.onreadystatechange=stateChanged;xmlHttp.open("GET",url,true);xmlHttp.send(null);}else{return;}}
function stateChanged()
{if(xmlHttp.readyState==4||xmlHttp.readyState=="complete")
{document.getElementById(html+ajid).innerHTML=xmlHttp.responseText;document.getElementById(html+ajid).style.display='block';}}
function GetXmlHttpObject()
{var xmlHttp=null;try
{xmlHttp=new XMLHttpRequest();}
catch(e)
{try
{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e)
{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}}
return xmlHttp;}
function opacity(id,opacStart,opacEnd,millisec){var speed=Math.round(millisec/100);var timer=0;if(opacStart>opacEnd){for(i=opacStart;i>=opacEnd;i--){setTimeout("changeOpac("+ i+",'"+ id+"','down')",(timer*speed));timer++;}}else if(opacStart<opacEnd){for(i=opacStart;i<=opacEnd;i++)
{setTimeout("changeOpac("+ i+",'"+ id+"','up')",(timer*speed));timer++;}}}
function changeOpac(opacity,id,type){var object=document.getElementById(id).style;object.opacity=(opacity/100);object.MozOpacity=(opacity/100);object.KhtmlOpacity=(opacity/100);object.filter="alpha(opacity="+ opacity+")";if(opacity=="0"&&type=="down"){document.getElementById(id).style.display="none";}}
var sliderIntervalId=0;var sliding=false;var slideSpeed=3;function Slide(id,type)
{window.sliderHeight=document.getElementById(id).clientHeight;window.offset=20;window.sliderHeight=Number(sliderHeight)-Number(offset);window.increaseby=80;window.maxslide=Number(increaseby)+Number(sliderHeight);window.sliderorigHeight=Number(maxslide)-Number(increaseby)-Number(offset)-Number(20);window.id=id;window.resid=id.replace(/result/,"");window.plusbox=document.getElementById("sharelinks"+resid);if(sliding)
return;sliding=true;if(type=="up")
sliderIntervalId=setInterval('SlideUpRun()',30);if(type=="down")
sliderIntervalId=setInterval('SlideDownRun()',30);}
function SlideUpRun()
{slider=document.getElementById(id);sliderwrap=document.getElementById("addslider"+resid);if(sliderHeight<=sliderorigHeight)
{sliding=false;sliderHeight=sliderorigHeight;slider.style.height=sliderorigHeight+'px';clearInterval(sliderIntervalId);}
else
{sliderHeight-=slideSpeed;if(sliderHeight<sliderorigHeight)
sliderHeight=sliderorigHeight;slider.style.height=sliderHeight+'px';sliderwrap.innerHTML="<a href='javascript:;' onclick=\"Slide('result"+resid+"','down');\" class='addslide'>Share Story [+]</a>";plusbox.style.display="none";}}
function SlideDownRun()
{slider=document.getElementById(id);sliderwrap=document.getElementById("addslider"+resid);setTimeout('plusbox.style.display="block"',500);if(sliderHeight>=maxslide)
{sliding=false;sliderHeight=maxslide;slider.style.height=maxslide+'px';clearInterval(sliderIntervalId);opacity("sharelinks"+resid,0,100,800);}
else
{sliderHeight+=slideSpeed;if(sliderHeight>maxslide)
sliderHeight=maxslide;slider.style.height=sliderHeight+'px';sliderwrap.innerHTML="<a href='javascript:;' onclick=\"Slide('result"+resid+"','up');\" class='addslide'>[--]</a>";}}
