function GetWidth()
{
        var x = 0;
        if (self.innerHeight)
        {
                x = self.innerWidth;
        }
        else if (document.documentElement && document.documentElement.clientHeight)
        {
                x = document.documentElement.clientWidth;
        }
        else if (document.body)
        {
                x = document.body.clientWidth;
        }
        return x;
}


function twinkle(){
	var show=Math.floor(Math.random()*101);
	var xpos=Math.floor(Math.random()*(GetWidth()-45));
	var ypos=Math.floor(Math.random()*421);
	//alert(xpos+', '+ypos);
	if(show > 40){
		document.getElementById('replaceStar').innerHTML = '<img id="JS" style="z-index: 0; left: '+xpos+'px; position: absolute; top: '+ypos+'px" height=40 width=40 align=baseline border=0 hspace=0 src="/assets/templates/moonpie/images/aniStar.gif">';
	}else{
		document.getElementById('replaceStar').innerHTML = '<img id="JS" style="z-index: 0; left: 0px; position: absolute; top: 0px" height=0 width=0 align=baseline border=0 hspace=0 src="/assets/templates/moonpie/images/aniStar.gif">';
	}
}
var myInterval = window.setInterval(function () {
  twinkle();
},425);
window.setTimeout(function () {
  clearInterval(myInterval);
  document.getElementById('replaceStar').innerHTML = '<img id="JS" style="z-index: 0; left: 0px; position: absolute; top: 0px" height=0 width=0 align=baseline border=0 hspace=0 src="/assets/templates/moonpie/images/aniStar.gif">';
},100000);

function swapImage(targetX,imageX){
	p=document.getElementById(targetX);
	p.src=imageX;
}