function getScrollingPosition()
{
var position = [0, 0];
if (typeof window.pageYOffset != 'undefined')
{
position = [
window.pageYOffset
];
}
else if (typeof document.documentElement.scrollTop
!= 'undefined' && document.documentElement.scrollTop > 0)
{
position = [
document.documentElement.scrollTop
];
}
else if (typeof document.body.scrollTop != 'undefined')
{
position = [
document.body.scrollTop
];
}
return position;
}

function check_url()
{
clearTimeout(scrolldelayy);
url =(location.href);
var SearchIndex = url.indexOf("?media");
var SearchIndex2 = url.indexOf("?comments");
var SearchIndex3 = url.indexOf("?video");
var SearchIndex4 = url.indexOf("?wallpaper");
var SearchIndex5 = url.indexOf("?photo");
var SearchIndex6 = url.indexOf("?cast");
var SearchIndex7 = url.indexOf("?crew");
if (SearchIndex != -1)
        {
			chkkk('ctl00_ContentPlaceHolder1_mediareview_main');
		}
if (SearchIndex2 != -1)
        {
			chkkk('ctl00_ContentPlaceHolder1_comments_main');
		}
if (SearchIndex3 != -1)
        {
			chkkk('ctl00_ContentPlaceHolder1_video');
		}
if (SearchIndex4 != -1)
        {
			chkkk('ctl00_ContentPlaceHolder1_CenterFold');
		}
if (SearchIndex5 != -1)
        {
			chkkk('ctl00_ContentPlaceHolder1_photos');
		}	
if (SearchIndex6 != -1)
        {
			chkkk('cast');
		}
if (SearchIndex7 != -1)
        {
			chkkk('crew');
		}	

}

function chkkk(a)
{
now_pos = getScrollingPosition();
var elem = document.getElementById(a);
var leftOffset = elem.offsetLeft;
var topOffset = elem.offsetTop;
var parent = elem.offsetParent;
        while(parent != document.body) 
 {
      leftOffset += parent.offsetLeft;
      topOffset += parent.offsetTop;
             parent = parent.offsetParent;
     }
         var Offsets = new Object();
     Offsets.top = topOffset;
     Offsets.left = leftOffset;
         
intY = Offsets.top - now_pos;
calculation(intY);
}
function calculation(j)
{
window.i = 0;
window.k = j % 50;
window.l = Math.floor(j/ 50);
pageScroll(window.i,window.k,window.l);
}
function pageScroll(i,k,l) {

		if( i < l)
		{
    	window.scrollBy(0,50); // horizontal and vertical scroll increments
		scrolldelay = setTimeout('pageScroll(window.i,window.k,window.l)',10); // scrolls every 100 milliseconds
		i++;
		window.i = i;
    	}
		else
		{
		final_scroll(k);
		}
		
}
function final_scroll(j)
{
window.scrollBy(0,j);
stopScroll();
}
function stopScroll() {
    	clearTimeout(scrolldelay);
}