addLoadListener(function()
{
	var flashvars = {
      file: "video/Jill.mp4",
      autostart: "false",
      controlbar: "over",
      image: "media/video/Jill_hm.jpg"
    };
    var params = {
      wmode: "opaque",
      allowfullscreen: "true",
      allowscriptaccess: "always"
    };
    var attributes = {
      id: "video_flv",  
      name: "video_flv"
    };

//    swfobject.embedSWF("media/player.swf", "video_flv", "233", "175", "9", "media/expressInstall.swf", flashvars, params, attributes);
	swfobject.embedSWF("media/player.swf", "video_flv", "318", "179", "9", "media/expressInstall.swf", flashvars, params, attributes);

	bObj = document.getElementsByTagName('body')[0];

/*	responseDiv = document.createElement('div');
	responseDiv.setAttribute('id','response_wrap');
	document.getElementById('join_us').insertBefore(responseDiv, document.getElementById('join_us').firstChild);
	 
	html = '<div id="response_inner">';
	html += '<div id="response_top"></div>';
	html += '<div id="response_middle">';
	html += '<div id="response_middle_text"></div>';
	html += '</div>';
	html += '<div id="response_bottom"></div>';
	html += '</div>';
	
	document.getElementById('response_wrap').innerHTML = html;*/
	
	vObj = document.getElementById('video_flv');
	adDiv = document.createElement('div');
	adDiv.setAttribute('id','video_ad');
	vObj.parentNode.insertBefore(adDiv, vObj.nextSibling);
	vaObj = document.getElementById('video_ad');
	vaObj.innerHTML = 'Click here for info and registration.';
	vaObj.onclick = function() {location.href='current-for-women.php';};
	
	oVMLinks = document.getElementById('video_menu').getElementsByTagName('a');
	for (i=1; i<4; i++) {
		oVMLinks[i].onmouseover = new Function("toolTip('show',this,'"+oVMLinks[i].getElementsByTagName('img')[0].alt.replace(/'/,"\\'")+"')");
		oVMLinks[i].onmouseout = new Function("toolTip('hide')");
	}
	
	newDiv = document.createElement('div');
	newDiv.setAttribute('id','photo_balloon');
	bObj.insertBefore(newDiv, bObj.nextSibling);
	document.getElementById('photo_balloon').innerHTML = '<div id="balloon_top"></div><div id="balloon_middle"><div id="balloon_middle_text"></div></div><div id="balloon_bottom"></div>'
		
	preloading(
	"yellow25per_bg_slammed.png",
	"blue60per_bg_slammed.png",
	"red35per_bg_slammed.png",
	"input_white_bg.gif",
	"input_blue_bg.gif",
	"input_red_bg.gif",
	"response_slot_slammed.png",
	"response_top_slammed.png",
	"response_middle_solid_slammed.png",
	"response_middle_grad.gif",
	"response_bottom_slammed.png",
	"world_missions/photo_balloon_top_bg_slammed.png",
	"world_missions/photo_balloon_middle_bg_slammed.png",
	"world_missions/photo_balloon_bottom_left_bg.png"
	);
	
	if (document.getElementById('video_flv').innerHTML == '') {
	 document.getElementById('video_flv').innerHTML = '<div id="no_flash">You do not have the latest version of Adobe Flash Player installed. Please install by clicking below. You will then be able to view this video.<br /><a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" target="_blank"><img src="images/get_adobe_flash_player.gif" alt="Get Adobe Flash Player" width="158" height="39" /></a></div>';
	}
});

function showTip(imgAlt) {
alert(imgAlt);
}

var flag = false;

function toolTip(option,linkObj,text) {
obj = document.getElementById('photo_balloon');

//document.getElementById('balloon_middle_text').innerHTML = text;

if (option == 'hide') {
	obj.style.visibility = 'hidden';
	obj.style.display = 'none';
	document.getElementById('balloon_middle_text').innerHTML = '';
	flag = false;
} else {
	if (!flag) {
		document.getElementById('balloon_middle_text').innerHTML = text;
		obj.style.display = 'block';
		balloonHeight = obj.offsetHeight;
		startY = findPosY(linkObj);
		startX = findPosX(linkObj);
		obj.style.left = startX + 'px';
		obj.style.top = startY - balloonHeight + 'px';
		obj.style.visibility = 'visible';
		flag = true;
	}
}
}

var player = null;
function playerReady(thePlayer) {
	oVMbg = document.getElementById('video_menu_background');
	oVM = document.getElementById('video_menu');
	t1 = new Tween(oVMbg.style,'right',Tween.strongEaseOut,76,0,.5,'px');
	t1.onMotionFinished = function() {
		opacityTween = new OpacityTween(document.getElementById('more_video'),Tween.strongEaseOut, 0, 100, 3);
		opacityTween.start();
	
		thmLinks = oVM.getElementsByTagName('a');
		v1 = new Tween(thmLinks[1].style,'right',Tween.strongEaseOut,70,0,.5,'px');
		v1.start();
		
		setTimeout(function() {
			v2 = new Tween(thmLinks[2].style,'right',Tween.strongEaseOut,70,0,.5,'px');
			v2.start();
		},100);
		
		setTimeout(function() {
			v3 = new Tween(thmLinks[3].style,'right',Tween.strongEaseOut,70,0,.5,'px');
			v3.start();
		},200);
	};
	t1.start();
	
	player = document.getElementById(thePlayer.id);
	addListeners();
}


function addListeners() {
	if (player) {
		player.addModelListener("STATE", "stateListener");
		player.addModelListener("TIME", "positionListener");
	} else {
		setTimeout("addListeners()",100);
	}
}

function stateListener(obj) { //IDLE, BUFFERING, PLAYING, PAUSED, COMPLETED
currentState = obj.newstate;
previousState = obj.oldstate;

if (currentState == "IDLE" && (previousState == "PLAYING" || previousState == "PAUSED")) {
 	document.getElementById('video_ad').style.display = 'none';
}
}

function positionListener(obj) { 
currentPosition = obj.position;
fileDuration = obj.duration;
//if (currentPosition == 1) {
//	document.getElementById('video_ad').style.display = 'block';
//}
}

var myimages = [];
function preloading() {
for (x=0; x<preloading.arguments.length; x++){
myimages[x] = new Image();
myimages[x].src = "images/"+preloading.arguments[x];
}
}

var ajax_error = [];
ajax_error[0] = "Your email address is not in the correct format. Please check your entries and try again.";
ajax_error[1] = "Your friend's email address is not in the correct format. Please check your entries and try again.";
ajax_error[2] = "Your email address contains illegal characters. Please check your entries and try again.";
ajax_error[3] = "Your friend's email contains illegal characters. Please check your entries and try again.";
ajax_error[4] = "There are illegal characters in one of the fields you just entered. Please check your entries and try again.";
ajax_error[10] = "There was a problem signing you up. An email has been sent to our tech team and we will do everything we can to get you signed up for our newsletter.";

function buildSuccess(oldList,newList) {
html = '<div class="response_header ph_blue">Success!</div>';
 
if (oldList) {
 html += '<strong>It looks like you are already signed up for Full Sail\'s newsletter. You will continue to receive it until you unsubscribe. So now you can sleep at night. No more worries.</strong>';
}
 
if (newList) {
 html += '<strong>Thank you for signing up for Full Sail\'s newsletter. You are almost done. You will receive a confirmation email for signing up. We look forward to sharing with you what God is doing through us.</strong>';
}

html += '<div style="text-align: center"><a class="close_window" href="javascript:;" onclick="responseClose()">Close Window</a><span class="chevron">&gt;&gt;</span></div>';
return html;
}

function buildError(errorNum,field) {
html = '<div class="response_header ph_red">Error</div>';
html += 'I\'m sorry, an error has occured.<div class="error_div">'+ajax_error[errorNum]+'</div>Please <a class="error_link" href="javascript:ajax_goback(\''+field+'\',true);\">click here</a> and try again.';
return html;
}

function emailCheck() {
obj = document.emailForm;
document.emailForm.sender_name.className = 'text';
document.emailForm.sender_email.className = 'text';

if (obj.sender_name.value.length < 1) {
 alert("Please enter your name.\n\nThank you.");
 obj.sender_name.focus();
 return false;
} else if (obj.sender_email.value.length < 1) {
 alert("Please enter your email address.\n\nThank you.");
 obj.sender_email.focus();
 return false;
}

req = createXMLHttpRequest();

if (!req) {
 obj.submit();
} else {
 formSenderName = obj.sender_name.value;
 formSenderEmail = obj.sender_email.value;
 
 document.getElementById('subscribe_loading').style.visibility = 'visible';
 document.getElementById('subscribe_loading').src = 'images/loader_red_green_home_trans.gif';
 
 url = 'email-signup-process.php?action=signup&ajax=true&list=fs&sender_name='+formSenderName+'&sender_email='+formSenderEmail;

// alert(url);
 req.open('GET', url, true);
 req.onreadystatechange = handleResponseSignup;
 req.send(null);
 return false;
}
}

function handleResponseSignup() {
  if(req.readyState == 4){
    if (req.status == 200) {
      var response = req.responseText;
      update = response.split(':');
      
      document.getElementById('response_slot').style.display = 'block';
      
      if (update[0] == 'error') {
       document.getElementById('response_middle_text').innerHTML = buildError(update[1],update[2]);
       responseInnerHeight = document.getElementById('response_inner').offsetHeight;
	   document.getElementById('response_inner').style.top = (responseInnerHeight * -1) + 'px';
	   document.getElementById('response_wrap').style.height = responseInnerHeight + 'px';
       slideTop(responseInnerHeight * -1,0);
      } else if (update[0] == 'success') {
       document.getElementById('response_middle_text').innerHTML = buildSuccess(update[1],update[2]);
       responseInnerHeight = document.getElementById('response_inner').offsetHeight;
	   document.getElementById('response_inner').style.top = (responseInnerHeight * -1) + 'px';
	   document.getElementById('response_wrap').style.height = responseInnerHeight + 'px';
       slideTop(responseInnerHeight * -1,0);
      }
      document.getElementById('subscribe_loading').style.visibility = 'hidden';
    }
  }
}

function ajax_goback(elm,error) {
if (error) {
 slideTop(0,document.getElementById('response_inner').offsetHeight * -1,elm);
 return;
}

document.emailForm.elements[elm].className = 'text_error';
document.emailForm.elements[elm].focus();
}

function responseClose() {
document.emailForm.sender_name.value = '';
document.emailForm.sender_email.value = '';
slideTop(0,document.getElementById('response_inner').offsetHeight * -1,'responseClose');
}

var slideTimer = '';
var inc = 4;

function slideTop(initY, finalY, elm) {
window.clearTimeout(slideTimer);

obj = document.getElementById('response_inner');

if (initY != finalY) {
 if (initY > finalY) {
  rate = Math.floor((finalY - initY) / inc);
 } else {
  rate = Math.ceil((finalY - initY) / inc);
 }
 
 newTop = obj.offsetTop + parseInt(rate);
 obj.style.top = newTop + 'px';
 
 slideTimer = window.setTimeout("slideTop(" + newTop + ", " + finalY + ", '"+elm+"');", 2);
} else {
 if (elm != 'undefined') {
  document.getElementById('response_slot').style.display = 'none';
  document.getElementById('response_wrap').style.height = '0';
  
  if (elm != 'responseClose' && elm != '-1') {
   ajax_goback(elm);
  }
 }
}
}

function findPosX(obj)
  {
    var curleft = 0;
    if(obj.offsetParent)
        while(1) 
        {
          curleft += obj.offsetLeft;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.x)
        curleft += obj.x;
    return curleft;
  }

function findPosY(obj)
  {
    var curtop = 0;
    if(obj.offsetParent)
        while(1)
        {
          curtop += obj.offsetTop;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.y)
        curtop += obj.y;
    return curtop;
  }
