// shortcut
d = document;

// window dressing
d.status = d.title;

// generic popwin function
function pop_win( url, name, width, height )
{
	var t = ( ( screen.height - height ) / 2 );
	var l = ( ( screen.width - width ) / 2 );
	
	window.open( url, name, 'width='+width+',height='+height+',top='+t+',left='+l+',location=0,status=0,scrollbars=0,toolbar=0,resizeable=no,noresize' );
	
} // pop_win

// popscroll function - adds a scrollbar
function pop_scroll( url, name, width, height )
{
	var t = (( screen.height - height ) / 2 );
	var l = (( screen.width - width ) / 2 );
	window.open( url, name, 'width='+width+',height='+height+',top='+t+',left='+l+',location=0,status=0,scrollbars=1,toolbar=0,resizeable=no,noresize' );

} // pop_scroll


// opens aimicon popup
function pop_aim( iconurl )
{
	pop_win('pop_aim.php?iconurl='+iconurl,'pop_aim',450,150);
	
}

function changestate(playStatus)
{
	if (document.hs_pix_es){
		RN = Math.floor(Math.random()*10000);   
		if( playStatus.indexOf("111~") != -1 ) {
			var trailerPath = "/movies/click/site/";
			ES = "random=" + RN + "&event=28~" + affiliate + "~5~" + trailerPath + "~17~~" + playStatus;
		}
		else if(playStatus.indexOf("255~") != -1 ) {
			ES = "random=" + RN + "&event=20~~28~" + affiliate + "~53~"  + escape (endString) + "~221~" + site + "~232~" + division + "~" + playStatus;
		}
		else {
			ES = "random=" + RN + "&event=20~~28~" + affiliate + "~" + playStatus;
		}
		document.hs_pix_es.src = "http://wvw.sonypictures.com/spacer.gif?" + ES;
	}
}
