
//Interact with Flash:
function getFlashMovie(movieName) {
  var isIE = navigator.appName.indexOf("Microsoft") != -1;
  return (isIE) ? window[movieName] : document[movieName];
}// function getFlashMovie

function callToActionscript(str, looping, vidTitle) {
	
     getFlashMovie("test_videos6").sendToActionscript(str, looping, vidTitle);
	 window.status = " ";
	
}// function callToActionscript


function moveStart(maximum, minimum, divName, marginAmt, mode, increment, timeout) {
	div = document.getElementById(divName); //the div to move
	mode = mode; //vertical or horizontal
	incr = increment; //number of pixels to move per iteration
	time = timeout; //amount of time between moves in milliseconds
	
	var move; //direction to move: up, down, right, left
	switch(mode) {
		case 'horizontal':
	if(parseInt(div.style.left) >= maximum) {
		move = 'left';
		}
	else {
		move = 'right';
		}
	moveDivHoriz(divName, marginAmt, move, maximum, minimum, incr, time);
	break;
		case 'vertical':
		if(parseInt(div.style.top) >= maximum) {
		move = 'up';
		}
	else {
		move = 'down';
		}
	moveDivVert(divName, marginAmt, move, maximum, minimum, incr, time);
	break;
	}//switch
}//function

function moveDivHoriz(divName, marginAmt, direction, right, left, increment, timeout) {
margin = marginAmt; //the initial move amount to make it "jump"
div = document.getElementById(divName); //the div to move
divID = divName; //just the name of the div
incr = increment; //number of pixels to move per iteration
time = timeout; //amount of time between moves in milliseconds

dir = direction; //right or left
rt = right;
lt = left;

if(dir == 'right') { 
	setTimeout("textDiv('left')", 225);
	div.style.left = (lt + (margin+incr)) +'px';
	margin = margin+incr;
	end = right;
	if(margin<end-left) {
		setTimeout("moveDivHoriz(divID, margin, dir, rt, lt, incr, time)", time);
	}//if

}//if
else {
	setTimeout("textDiv('right')", 225);
	div.style.left = (rt - (margin+incr)) +'px';
	margin = margin+incr;
	end = left;
	if(parseInt(div.style.left)>end) {
		setTimeout("moveDivHoriz(divID, margin, dir, rt, lt, incr, time)", time);
	}//if
}//else

}//function

function moveDivVert(divName, marginAmt, direction, bottom, top, increment, timeout) {
margin = marginAmt; //the initial move amount to make it "jump"
div = document.getElementById(divName); //the div to move
divID = divName; //just the name of the div
incr = increment; //number of pixels to move per iteration
time = timeout; //amount of time between moves in milliseconds

dir = direction; //up or down
thetop = top;
thebottom = bottom;

if(dir == 'down') {
	div.style.top = (thetop + (margin+incr)) +'px';
	margin = margin+incr;
	end = thebottom;
	if(margin<end-thetop) {
		setTimeout("moveDivVert(divID, margin, dir, thebottom, thetop, incr, time)", time);
	}//if

}//if
else {
	div.style.top = (thebottom - (margin+incr)) +'px';
	margin = margin+incr;
	end = thetop;
	if(parseInt(div.style.top)>end) {
		setTimeout("moveDivVert(divID, margin, dir, thebottom, thetop, incr, time)", time);
	}//if
}//else

}//function


function textDiv(position) {
pos = position;

switch(pos) {
	case 'left':
	document.getElementById('text_div').style.left = '50px';
	break;
	case 'right':
	document.getElementById('text_div').style.left = '635px';
	break;
	}//switch
}//function

function setContent(contentId) {

theContentId = contentId;
theDiv = document.getElementById('inner_text');
theContent = '';

$("#inner_text").animate({"height": "toggle", "opacity": "toggle"}, 225);

switch(theContentId) {
	case 'content1':
	theContent = '<p>Marx Creative is a full-service production company with years of experience producing original content for television. That includes all aspects of writing, direction, scouting, shooting, set design, talent, and editing, plus marketing, promotion, and even product placement.</p><p>Marx produced Walgreens Health Corner TV show for six seasons from 2005 through 2010. Airing on the Lifetime cable channel, Health Corner was a weekly 30-minute "health infotainment" show focused on issues important to women. It ran for 173 episodes, each with five to eight segments, and was hosted by veteran TV personalities including Joan Lunden and Leeza Gibbons.</p>';
	break;
	case 'content2':
	theContent = '<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus euismod nulla eget enim ultricies convallis. Maecenas scelerisque diam nec nibh dictum id lacinia metus accumsan. Pellentesque in lorem non nibh faucibus tempus id eget ipsum. Vestibulum tempus, leo sagittis venenatis cursus, ligula orci ultrices eros, et iaculis quam dolor sed massa. Cras suscipit viverra velit id posuere. Vivamus in porta velit. Aenean tincidunt tristique elit, a fermentum tellus viverra id. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Duis malesuada lobortis enim vel scelerisque. Phasellus in arcu sed mauris mattis venenatis.</p>';
	break;
	case 'content3':
	theContent = 'This is content #3.';
	break;
	default:
	theContent = 'This is the default content.';
	}//switch



$("#inner_text").animate({"height": "toggle", "opacity": "toggle"}, 500);
setTimeout("theDiv.innerHTML = theContent", 400);

}//function

