var myVidSwap = [];
var myTxtSwap = [];
var orTxtSwap = [];
var orVidSwap = [];
/*
	//myVidSwap[3] = "<object width='370' height='228'><param name='movie' value='http://www.youtube.com/v/2eelyg_k5iw&hl=en&fs=1&rel=0'></param><param name='allowFullScreen' value='true'></param><param name='allowscriptaccess' value='always'></param><embed src='http://www.youtube.com/v/2eelyg_k5iw&hl=en&fs=1&rel=0' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' width='370' height='228'></embed></object>";
	//myVidSwap[2] = QT_GenerateobjectText_XHTML('./videos/plantsgrow.mov', '370', '228', '','autoplay', 'false','emb#bgcolor', '000000','align', 'middle', 'scale', 'aspect', 'controller', 'true');	
	//myVidSwap[2] = "<object classid='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B' width='370' height='228' codebase='http://www.apple.com/qtactivex/qtplugin.cab'><param name='src' value='./videos/plantsgrow.mov'><param name='autoplay' value='false'><param name='controller' value='true'><embed src='./videos/plantsgrow.mov' width='370' height='228' scale='aspect' bgcolor='000000' autohref='false' autoplay='false' controller='true' pluginspage='http://www.apple.com/quicktime/download/'></embed></object>";
	//myVidSwap[2] = "<object id='myVideo' classid='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B' width='370' height='228' codebase='http://www.apple.com/qtactivex/qtplugin.cab'><param name='src' value='http://www.teachersdomain.org/assets/wgbh/tdc02/tdc02_vid_plantsgrow/tdc02_vid_plantsgrow_56.mov'><param name='autoplay' value='false'><param name='controller' value='true'><embed src='http://www.teachersdomain.org/assets/wgbh/tdc02/tdc02_vid_plantsgrow/tdc02_vid_plantsgrow_56.mov' width='370' height='228' scale='aspect' bgcolor='000000' autohref='false' autoplay='false' controller='true' pluginspage='http://www.apple.com/quicktime/download/'></embed></object>";
	//myVidSwap[1] = "<object id='myVideo' classid='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B' width='370' height='228' codebase='http://www.apple.com/qtactivex/qtplugin.cab'><param name='src' value='./videos/plantsgrow.mov'><param name='autoplay' value='false'><param name='controller' value='true'><embed src='./videos/plantsgrow.mov' width='370' height='228' scale='aspect' bgcolor='000000' autohref='false' autoplay='false' controller='true' pluginspage='http://www.apple.com/quicktime/download/'></embed></object>";
	//myVidSwap[1] = "<object classid='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B' width='370' height='228' codebase='http://www.apple.com/qtactivex/qtplugin.cab'><param name='src' value='./videos/elemduck.mov'><param name='autoplay' value='false'><param name='controller' value='true'><param name='scale' value='aspect'><param name='bgcolor' value='000000'><param name='autohref' value='false'><embed href='./videos/elemduck.mov' target='myself' src='./images/duck.jpg' width='370' height='228' scale='aspect' bgcolor='000000' autohref='false' autoplay='false' controller='true' pluginspage='http://www.apple.com/quicktime/download/'></embed></object>";
	//myVidSwap[1] = QT_GenerateobjectText_XHTML('./images/duck.jpg', '370', '228', '', 'target', 'myself', 'href', './videos/elemduck.mov', 'autoplay', 'false','emb#bgcolor', '000000','align', 'middle', 'scale', 'aspect', 'controller', 'true');	
	//myVidSwap[1] = "<object id='vidObj' width='369' height='228' classid='CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95' codebase='http://activex.microsoft.com/activex/controls/ mplayer/en/nsmp2inf.cab#Version=5,1,52,701' standby= 'Loading Media Player' type='application/x-oleobject'><param name='fileName' value='./videos/elemduck.mov'><param name='autoStart' value='false'><param name='showControls' value='true'><param name ='ShowAudioControls' value='true'><param name='ShowStatusBar' value='true'><param name='loop' value='false'><embed type='application/x-mplayer2' pluginspage='http://microsoft.com/windows/mediaplayer/en/download/' id='vidObj1' name='vidObj1' bcolor='black' src='./videos/elemduck.mov' width='369' height='228' autostart='false' ShowStatusBar='true' ShowControls='true' showdisplay='0'></embed></object>";
*/


	myVidSwap[1] = "<script language='javascript'>AC_FL_RunContent('codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0', 'width', '370', 'height', '228', 'src', ((!DetectFlashVer(9, 0, 0) && DetectFlashVer(8, 0, 0)) ? 'OSplayer' : 'OSplayer'), 'pluginspage', 'http://www.macromedia.com/go/getflashplayer', 'id', 'flvPlayer', 'allowFullScreen', 'true', 'movie', ((!DetectFlashVer(9, 0, 0) && DetectFlashVer(8, 0, 0)) ? 'OSplayer' : 'OSplayer'), 'FlashVars', 'movie=./videos/elemduck.flv&btncolor=0x333333&accentcolor=0x20b3f7&txtcolor=0xffffff&volume=50&previewimage=./images/ducks.jpg&autoload=on');</script><noscript><object width='370' height='228' id='flvPlayer'><param name='allowFullScreen' value='true'><param name='movie' value='OSplayer.swf?movie=./videos/elemduck.flv&btncolor=0x333333&accentcolor=0x20b3f7&txtcolor=0xffffff&volume=50&previewimage=./images/ducks.jpg&autoload=on'><embed src='OSplayer.swf?movie=./videos/elemduck.flv&btncolor=0x333333&accentcolor=0x20b3f7&txtcolor=0xffffff&volume=50&previewimage=./images/ducks.jpg&autoload=on' width='370' height='228' allowFullScreen='true' type='application/x-shockwave-flash'></object></noscript>";
	myVidSwap[2] = "<script language='javascript'>AC_FL_RunContent('codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0', 'width', '370', 'height', '228', 'src', ((!DetectFlashVer(9, 0, 0) && DetectFlashVer(8, 0, 0)) ? 'OSplayer' : 'OSplayer'), 'pluginspage', 'http://www.macromedia.com/go/getflashplayer', 'id', 'flvPlayer', 'allowFullScreen', 'true', 'movie', ((!DetectFlashVer(9, 0, 0) && DetectFlashVer(8, 0, 0)) ? 'OSplayer' : 'OSplayer'), 'FlashVars', 'movie=./videos/plantsgrow.flv&btncolor=0x333333&accentcolor=0x20b3f7&txtcolor=0xffffff&volume=50&previewimage=./images/flowers.jpg&autoload=on');</script><noscript><object width='370' height='228' id='flvPlayer'><param name='allowFullScreen' value='true'><param name='movie' value='OSplayer.swf?movie=./videos/plantsgrow.flv&btncolor=0x333333&accentcolor=0x20b3f7&txtcolor=0xffffff&volume=50&previewimage=./images/flowers.jpg&autoload=on'><embed src='OSplayer.swf?movie=./videos/plantsgrow.flv&btncolor=0x333333&accentcolor=0x20b3f7&txtcolor=0xffffff&volume=50&previewimage=./images/flowers.jpg&autoload=on' width='370' height='228' allowFullScreen='true' type='application/x-shockwave-flash'></object></noscript>";
	myVidSwap[3] = "<object width='369' height='228'><embed src='http://www.dnatube.com/nvplayer.swf?config=http://www.dnatube.com/nuevo/econfig.php?key=b7f1006d605e9161946b' width='370' height='228' wmode='transparent' allowscriptaccess='always' allowfullscreen='true' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' /></embed></object>";

	myTxtSwap[1] = [];
	myTxtSwap[1][0] = "This video is called &quot;Embryo To Duckling.&quot;<br /><br />Cannot see the player? Click <a href='#' onclick='insertText(1,1)'><u>here</u></a>.<br /><br />Click <a href='./magnificence.html'><u>here</u></a> to Exit.<br />";
	myTxtSwap[1][1] = "This video is called &quot;Embryo To Duckling.&quot;<br /><br />Cannot see the video? Click <a href='#' onclick='insertText(1,2)'><u>here</u></a>.<br /><br />Click <a href='./magnificence.html'><u>here</u></a> to Exit.<br />";
	myTxtSwap[1][2] = "If you still cannot see the video, click <a href='./mail_FP.html'><u>here</u></a> to let us know of your difficulties.<br /><br />Click <a href='./magnificence.html'><u>here</u></a> to Exit.<br />";

	myTxtSwap[2] = [];
	myTxtSwap[2][0] = "This video is called &quot;How Do Plants Grow.&quot;<br /><br />Cannot see the player? Click <a href='#' onclick='insertText(2,1)'><u>here</u></a>.<br /><br />Click <a href='./magnificence.html'><u>here</u></a> to Exit.<br />";
	myTxtSwap[2][1] = "This video is called &quot;How Do Plants Grow.&quot;<br /><br />Cannot see the video? Click <a href='#' onclick='insertText(2,2)'><u>here</u></a>.<br /><br />Click <a href='./magnificence.html'><u>here</u></a> to Exit.<br />";
	myTxtSwap[2][2] = "If you still cannot see the video, click <a href='./mail_FP.html'><u>here</u></a> to let us know of your difficulties.<br /><br />Click <a href='./magnificence.html'><u>here</u></a> to Exit.<br />";

	myTxtSwap[3] = [];
	myTxtSwap[3][0] = "This video is called &quot;Human Reproduction: Fertilization and Fetal Development.&quot;<br /><br />Please be patient as the video might take a while to load.<br /><br />Click <a href='./magnificence.html'><u>here</u></a> to Exit.<br />";
	myTxtSwap[3][1] = "This video is called &quot;Human Reproduction: Fertilization and Fetal Development.&quot;<br /><br />Please be patient as the video might take a while to load.<br /><br />Click <a href='./magnificence.html'><u>here</u></a> to Exit.<br />";
	myTxtSwap[3][2] = "This video is called &quot;Human Reproduction: Fertilization and Fetal Development.&quot;<br /><br />Please be patient as the video might take a while to load.<br /><br />Click <a href='./magnificence.html'><u>here</u></a> to Exit.<br />";

	orTxtSwap[1] = "Consider the growth of a duck embryo, from a single fertilized egg cell to a complex, hatching duckling.<br /><br />Click on the duck to load sample video.<br />";
	orTxtSwap[2] = "Consider the growth of beautiful flowers from seeds.<br /><br />Click on the flower to load sample video.<br />";
	orTxtSwap[3] = "Consider a fetus developing from sperm and egg, being made into a person.<br /><br />Click on the fetus to load sample video.<br /><br />The player may take a while to load. Please be patient.<br />";

var myCounter = "<img src='nfcounter?id=92CCBD-BB39B0-234&amp;font=bc&amp;num_digits=04' id='counter' alt='hit counter' />";


function myVideo(whichVid, pos) {
	var myVid = (whichVid == undefined) ?  3 : whichVid;
	var myPos = (pos == undefined) ?  0 : pos;

	if ((whichVid < 1) || (whichVid >myVidSwap.length) || (whichVid >myTxtSwap.length)) {
		return null;
	} else {
		return {myVid: myVidSwap[whichVid], myTxt: myTxtSwap[whichVid][myPos], orTxt: orTxtSwap[whichVid], orVid: orVidSwap[whichVid]};
	}
}

function myVideoCount() {
	//alert('myTxtSwap.length: ' + myTxtSwap.length);
	return myTxtSwap.length;
}

function setOrigText(whatText, whatIndex) {
	orTxtSwap[whatIndex] = whatText;
}

function setOrigVid(whatContent, whatIndex) {
	orVidSwap[whatIndex] = whatContent;
}

function insertMovie(wMovie) {
	myCode = myVideo(wMovie).myVid;
	document.write(myCode);
}

function insertText(wMovie, w) {
	var myCode = (w == 0 ) ? myVideo(wMovie).orTxt : myVideo(wMovie,w).myTxt ;
	if (w == 1) {
		myTxtId  = "vid" + wMovie * 1 + "txt";
		$('#' + myTxtId).html(myCode);
		
		myVideId = "qt" + wMovie * 1;
		myOldVid = "video" + wMovie * 1;
		$('#' + myVideId).css('display','block');
		$('#' + myOldVid).css('display','none');
	} else if (w == 2) {
		myTxtId  = "vid" + wMovie * 1 + "txt";
		$('#' + myTxtId).html(myCode);

		myVideId = "qt" + wMovie * 1;
		$('#' + myVideId).css('display','none');
		$('#elemSwap').css('display','block');
		if (wMovie == 1) openWin('http://www.teachersdomain.org/assets/wgbh/tdc02/tdc02_vid_elemduck/tdc02_vid_elemduck_56.mov','popup','width=320,height=320,location=centre,directories=no,status=no,menubar=no,toolbar=no,scrollbars=no,resizable=yes');
		if (wMovie == 2) openWin('http://www.teachersdomain.org/assets/wgbh/tdc02/tdc02_vid_plantsgrow/tdc02_vid_plantsgrow_56.mov','popup','width=320,height=320,location=centre,directories=no,status=no,menubar=no,toolbar=no,scrollbars=no,resizable=yes');
	} else {
		document.write(myCode);
	}
}

function insertCounter() {
	document.write(myCounter);
}

//Subscribe
var newSubCode 	= "<div align='center'><table border='0' cellspacing='0' cellpadding='3' bgcolor='#FFFFFF'><tr><td><p>&nbsp;<br /><br /></p></td></tr><tr><td align='center' valign='middle' style='font-family:Verdana, Geneva, Arial, Helvetica, sans-serif; font-size:12px; color:#0A317A;'>Be Our Newsletter Recipient</td></tr><tr><td align='center'><form name='ccoptin' action='http://visitor.constantcontact.com/d.jsp' target='_blank' method='post' style='margin-bottom:2;'><input type='hidden' name='m' value='1102591620193'><input type='hidden' name='p' value='oi'><font style='font-weight: normal; font-family:Arial; font-size:10px; color:#0000CC;'></font><input type='text' name='ea' size='20' value='' style='font-size:10pt; border:1px solid #999999;'><input type='submit' name='go' value='Go' class='submit' onBlur='javascript:goToDomain(); return true;' style='font-family:Verdana,Geneva,Arial,Helvetica,sans-serif; font-size:10pt;'></form></td></tr></table></div><div align='center' style='padding-top:5px;'><a href='http://www.constantcontact.com/safesubscribe.jsp' target='_blank'><img src='http://img.constantcontact.com/ui/images1/safe_subscribe_logo.gif' border='0' width='168' height='14' alt=''/></a><br /><br /><br /><br />Click <a href='#' onClick='javascript:goToDomain()'><u>here</u></a> to Exit.</div>";
var newSubTxt	= "<img src='./images/shared/img_r1_c7_f2.png' id='img_r1_c7' alt='Subscribe' />";
var oldSubCode	= "<div class='elemSwap' id='elemSwap'><img src='./images/shared/img_r3_c5.png' alt='da Vinci' /></div>";
var oldSubTxt	= "<span class='subscription' id='subscription'><a href='#'><img src='./images/shared/img_r1_c7.png' id='img_r1_c7' alt='Subscribe' /></a></span>";

function meSubscribe() {
	return {sCode: newSubCode, sTxt:newSubTxt, oCode:oldSubCode, oTxt:oldSubTxt};
}


//Support
var newSupCode 	= "<div align='center'><table border='0' style='margin: 5px;' cellspacing='0' cellpadding='3' bgcolor='#FFFFFF'><tr><td align='center' valign='middle' style='font-family:Verdana, Geneva, Arial, Helvetica, sans-serif; font-size:12px; color:#0A317A;'><br /><b>Support<br /><br />The Goodybye Evolution Project</b><br /><br /><br />Lifetime Reference Guides would like your support.<br /><br />If you think you can aid our project, please <a href='./contact_us.html'><u>contact us</u></a>. If you would like to help us financially, please support us by purchasing multiple items in the <a href='.//eStore//index.php'><u>store</u></a>.</td></tr></table></div><div align='center' style='padding-top:5px;'><br />Click <a href='#' onClick='javascript:goToDomain()'><u>here</u></a> to Exit.</div>";
var newSupTxt	= "<img src='./images/shared/img_r1_c9_f2.png' id='img_r1_c9' alt='Support' />";
var oldSupCode	= "<div class='elemSwap' id='elemSwap'><img src='./images/shared/img_r3_c5.png' alt='da Vinci' /></div>";
var oldSupTxt	= "<span class='support' id='support'><a href='#'><img src='./images/shared/img_r1_c9.png' id='img_r1_c9' alt='Support' /></a></span>";

function meSupport() {
	return {sCode: newSupCode, sTxt:newSupTxt, oCode:oldSupCode, oTxt:oldSupTxt};
}


