//Script for opening of rotatomatics at Nebula Station website
//Written by Walter

function openRotatomaticWindow(theURL,winName,features,picture,title) {
	var picWindow = window.open(theURL,winName,features);
	var picsource = picture
	var pictitle = title
	picWindow.document.open();
	picWindow.focus();
	picWindow.document.write("<!-- Generated by script. -->");
	picWindow.document.write("<html><head>");
	picWindow.document.write("<meta http-equiv='Content-Type'  content='text/html; charset=windows-1250'>");
	picWindow.document.write("<style type='text/css'> table { font-family: Arial; font-size: 10pt; color: #E0F0FF; font-weight: bold; } </style>");
	picWindow.document.write("<title>NEBULA STATION</title>");
        picWindow.document.write("<script language='JavaScript'>rotatomaticPosition = 0; function moveLeft() { if(movingLeft == 'yes') { rotatomaticPosition = rotatomaticPosition + 480; if(rotatomaticPosition == 11520) { rotatomaticPosition = 0; } document.getElementById('rotatomatic').style.backgroundPosition = '0 ' + rotatomaticPosition; setTimeout('moveLeft()', 166); } } function moveRight() { if(movingRight == 'yes') { rotatomaticPosition = rotatomaticPosition - 480; if(rotatomaticPosition == -11520) { rotatomaticPosition = 0; } document.getElementById('rotatomatic').style.backgroundPosition = '0 ' + rotatomaticPosition; setTimeout('moveRight()', 166); } } function startLeft() { movingLeft = 'yes'; moveLeft(); } function startRight() { movingRight = 'yes';  moveRight(); } function stopMove() { movingLeft = 'false'; movingRight = 'false' } </script>");
	picWindow.document.write("</head><body bgcolor=#000000 text=#E0F0FF topmargin=16 leftmargin=16>")
	picWindow.document.write("<table border='0' cellspacing='0' cellpadding='0' width='672' height='560'><tr><td colspan='3' height='32' bgcolor='#002040' align='center' valign='middle' background='img/top.gif'>" + pictitle + "</td></tr>");
	picWindow.document.write("<tr><td width='16' height='480' bgcolor='#002040'><img src='img/left.gif' width='16' height='480'></td><td id='rotatomatic' background=" + picsource + " bgcolor='#80A0C0'><img src='img/mask.gif' width='640' height='480'></td><td width='16' height='480' bgcolor='#002040'><img src='img/right.gif' width='16' height='480'></td></tr>");
	picWindow.document.write("<tr><td colspan='3' height='48' background='img/bottom.gif' align='center' bgcolor='#002040'><img src='img/rotate_left.gif' width='56' height='24' border='0' onMouseOver='startLeft()' onMouseOut='stopMove()'><img src='img/rotate_label.gif' width='74' height='24'><img src='img/rotate_right.gif' width='56' height='24' border='0' onMouseOver='startRight()' onMouseOut='stopMove()'></td></tr></table>");
	picWindow.document.write("</body></html>");
	picWindow.document.close();
}