<!--
var moo = 0;

function closeWebPart()
{
	MSOTlPn_ShowToolPane(0);
}

function setResult(control, value)
{
  	var ctlElement;
	ctlElement = document.getElementById(control);
	ctlElement.value = value;
}



function populateTxtBox(item)
{
	for(var i=0;i<item.form.elements.length;i++)
	{
		if(item==item.form.elements[i])
		{
			var rtnVal = item.options[item.selectedIndex].value;
			if (rtnVal.indexOf(":") > -1)
			{
				item.form.elements[i+1].value=rtnVal.substring(rtnVal.indexOf(":",(rtnVal.indexOf(":")+1))+1,rtnVal.lastIndexOf(":"));
				//item.form.elements[i+2].value=rtnVal.substring(0,rtnVal.indexOf(":"));
			} else {
				item.form.elements[i+1].value=rtnVal;
				//item.form.elements[i+2].value=rtnVal;
			}
		}
	}
}

function init() {
	
}

function handleModalboxClose(me) {
	if (me){
		if (me.href!="#" && me.href!=""){
			window.location.href=me.href;
		}
	} else {
		Modalbox.close();
	}

	return false;
}

function resizeModalbox(h,w,cap) {
	Modalbox.nextPage(h,w,cap);
	return false;
}// Begin: Previously KraftCanada.js -------------------------------------------------------------------------------------------

	//BUSTS the page out of a frameset.
	// ??? should this be back in?
	//if (self.location != top.location) {
	//	top.location = self.location;
	//}

function openCustomWin(urly,wid,ht,topz,leftz,namaroni,scrl) {
	pd = "";
	tf = pd + urly;
	nw = window.open(tf,namaroni,"width=" + wid + ",height=" + ht + ",top=" + topz + ",left=" + leftz + ",scrollbars=" + scrl);
}
	
function openNewWin(wurl)
{
	newWindow=window.open(wurl);
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; 
  
  
  document.MM_sr=new Array; 
  for(i=0;i<(a.length-2);i+=3)
	if ((x=MM_findObj(a[i]))!=null)
	{
		document.MM_sr[j++]=x; 
		if(!x.oSrc) x.oSrc=x.src; 
		x.src=a[i+2];
	}
}

// This should no longer be applicable
//MM_preloadImages('/assets/images/nav/nav_chinese_on.gif');


function clearSearchText(txt)
{
	if ((txt.value == "search") || (txt.value == "recherche"))
		txt.value = "";
}

// 
var hasClickedSubmit = false;
var msg = "Did you make any changes to your profile?  Click 'OK' to save your profile changes.";
	
function unLoadVerify()
{
	
	if (!hasClickedSubmit) {
		if (window.confirm(msg)) {
			var btnSubmit = document.getElementById('EditProfile1_cmdUpdate');
			btnSubmit.click();
			
		}
	}
}

function killDoubleClick()
{
	if (!hasClickedSubmit) {
		hasClickedSubmit = true;
		return true;
	}
	return false;
}

// End: Previously KraftCanada.js -------------------------------------------------------------------------------------------


function winopen(wurl,wname,wfeatures)
{
   newWindow=window.open(wurl,wname,wfeatures);
}

function select_url(x)
{
    parent.location.href = x;
}

function open_window_sm(url, h, w, name){
	if (!(name)) {
		name = "popupbrowserWindow1";
	}
	var xPos = (screen.width - w) / 2;
	var yPos = (screen.height - h) / 2;
	popupbrowser=window.open(url,name,"toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,height=" + h + ",width=" + w + ",left=" + xPos + ",top=" + yPos +"");
	popupbrowser.focus();

}

function open_window_scroll(url, h, w, name){
	if (!(name)) {
		name = "popupbrowserWindow1";
	}
	var xPos = (screen.width - w) / 2;
	var yPos = (screen.height - h) / 2;
	popupbrowser=window.open(url,name,"toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,height=" + h + ",width=" + w + ",left=" + xPos + ",top=" + yPos +"");
	popupbrowser.focus();
}

function open_window_sm(url, h, w, name){
	if (!(name)) {
		name = "popupbrowserWindow1";
	}
	var xPos = (screen.width - w) / 2;
	var yPos = (screen.height - h) / 2;
	popupbrowser=window.open(url,name,"toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,height=" + h + ",width=" + w + ",left=" + xPos + ",top=" + yPos +"");
	popupbrowser.focus();

}

function open_window_scroll(url, h, w, name){
	if (!(name)) {
		name = "popupbrowserWindow1";
	}
	var xPos = (screen.width - w) / 2;
	var yPos = (screen.height - h) / 2;
	popupbrowser=window.open(url,name,"toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,height=" + h + ",width=" + w + ",left=" + xPos + ",top=" + yPos +"");
	popupbrowser.focus();
}

function getMilliseconds() {

dot = new Date(0);
now = new Date();
t = (now - dot);
return(t);

}

function getHyperloadDcr(dcr){
dcr = dcr +"?" +getMilliseconds();
return dcr;

}

function PrintGameTag(dcr, width, height, bgcolor, sw1, sw2, sw3, sw4, sw5, sw6, sw7, sw8, sw9, swlist, version, menu) {
	if (!(sw1)) { sw1 = ""; }
	if (!(sw2)) { sw2 = ""; }
	if (!(sw3)) { sw3 = ""; }
	if (!(sw4)) { sw4 = ""; }
	if (!(sw5)) { sw5 = ""; }
	if (!(sw6)) { sw6 = ""; }
	if (!(sw7)) { sw7 = ""; }
	if (!(sw8)) { sw8 = ""; }
	if (!(sw9)) { sw9 = ""; }
	if (!(swlist)) { swlist = ""; }

	document.write('   <OBJECT CLASSID="clsid:166B1BCA-3F9C-11CF-8075-444553540000" CODEBASE="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=' + version + '" WIDTH="' + width + '" HEIGHT="' + height + '">	');
	document.write('   <PARAM NAME="SRC" VALUE="' + dcr + '">	');
	document.write('   <PARAM NAME="BGCOLOR" VALUE="' + bgcolor + '">	');
	document.write('   <PARAM NAME="SW1" VALUE="' + sw1 + '">	');
	document.write('   <PARAM NAME="SW2" VALUE="' + sw2 + '">	');
	document.write('   <PARAM NAME="SW3" VALUE="' + sw3 + '">	');
	document.write('   <PARAM NAME="SW4" VALUE="' + sw4 + '">	');
	document.write('   <PARAM NAME="SW5" VALUE="' + sw5 + '">	');
	document.write('   <PARAM NAME="SW6" VALUE="' + sw6 + '">	');
	document.write('   <PARAM NAME="SW7" VALUE="' + sw7 + '">	');
	document.write('   <PARAM NAME="SW8" VALUE="' + sw8 + '">	');
	document.write('   <PARAM NAME="SW9" VALUE="' + sw9 + '">	');
	document.write('   <PARAM NAME="SWLIST" VALUE="' + swlist + '">	');
	if (menu == 0) {
		document.write('   <PARAM NAME="SWREMOTE" VALUE="swSaveEnabled=\'false\' swVolume=\'false\' swRestart=\'false\' swPausePlay=\'false\' swFastForward=\'false\' swContextMenu=\'false\'">	');
		document.write('   <EMBED SRC="' + dcr + '" WIDTH="' + width + '" HEIGHT="' + height + '"  BGCOLOR="' + bgcolor + '" SW1="' + sw1 + '" SW2="' + sw2 + '" SW3="' + sw3 + '" SW4="' + sw4 + '" SW5="' + sw5 + '" SW6="' + sw6 + '" SW7="' + sw7 + '" SW8="' + sw8 + '" SW9="' + sw9 + '" SWLIST="' + swlist + '" SWREMOTE="swSaveEnabled=\'false\' swVolume=\'false\' swRestart=\'false\' swPausePlay=\'false\' swFastForward=\'false\' swContextMenu=\'false\'" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/" PALETTE="background"></EMBED>	');
	} else {
		document.write('   <PARAM NAME="SWREMOTE" VALUE="swSaveEnabled=\'false\' swVolume=\'false\' swRestart=\'false\' swPausePlay=\'false\' swFastForward=\'false\' swContextMenu=\'true\'">	');
		document.write('   <EMBED SRC="' + dcr + '" WIDTH="' + width + '" HEIGHT="' + height + '"  BGCOLOR="' + bgcolor + '" SW1="' + sw1 + '" SW2="' + sw2 + '" SW3="' + sw3 + '" SW4="' + sw4 + '" SW5="' + sw5 + '" SW6="' + sw6 + '" SW7="' + sw7 + '" SW8="' + sw8 + '" SW9="' + sw9 + '" SWLIST="' + swlist + '" SWREMOTE="swSaveEnabled=\'false\' swVolume=\'false\' swRestart=\'false\' swPausePlay=\'false\' swFastForward=\'false\' swContextMenu=\'true\'" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/" PALETTE="background"></EMBED>	');
	}
	document.write('   </OBJECT>	');
}

function writeFlashTag(movie, width, height, bgcolor, paramstring) {
	document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" WIDTH="' + width + '" HEIGHT="' + height + '">');
	source = movie
	if ((paramstring != null) && (paramstring != "")) {
		source = source + "?" + paramstring;
	}
	document.write('  <PARAM NAME=movie VALUE="' + source + '">');
	document.write('  <PARAM NAME=quality VALUE=high>'); 
	document.write('  <PARAM NAME=menu VALUE=false>'); 
	document.write('  <PARAM NAME=bgcolor VALUE="#' + bgcolor + '">');
	document.write('  <EMBED src="' + source + '" quality=high menu=false bgcolor=#' + bgcolor + ' WIDTH="' + width + '" HEIGHT="' + height + '" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>');
	document.write('</OBJECT>');
}

var buttonCounter = 0;
function OneButtonClick() {
	if (buttonCounter == 0) {
		buttonCounter = 1;
		return true;
	} else {
		return false;
	}
}

function containsNoBad( instring ) {
    badChars = "<>";
    for (var i=0; i< instring.length; i++) {
       if (badChars.indexOf(instring.charAt(i)) != -1) {
          return false;
       }
    }
    return true;
}
	
function navChange(imgName,imgSrc){
	document.images[imgName].src = imgSrc;
}

function navChangeAlt(inputName,imgSrc){
	document.getElementById(inputName).src = imgSrc;
}

function colorOver(id,type){
	if(type == "featured"){
		document.getElementById(id).style.backgroundColor='#d7e7f4';
	}
	else{
		document.getElementById(id).style.backgroundColor='#ffffff';
	}
}

function colorOff(id,type){
	if(type == "featured"){
		document.getElementById(id).style.backgroundColor='#ffffff';
	}
	else{
		document.getElementById(id).style.backgroundColor='#d7e7f4';
	}
}

function inArray(thearray, searchfor) {
	var found = false;

	if (thearray.length > 0) {
		var arraystring = '@' + thearray.join('@');
		found = (arraystring.indexOf('@' + searchfor) > -1)
	}
	return found
}

function doSubmit(event,btn)
{
	
	if ((event.which && event.which == 13) || (event.keyCode && event.keyCode == 13))
	{ 
	
		if (navigator.appName == "Netscape")
		{
			btn = btn.replace(/:/g, "_");
		}

		document.getElementById(btn).click();
		return false;
	} 
	return true; 
}

function makeDefaultTextBox(txt)
{
	document.getElementById(txt).focus();
}

function getfile(filename,divname,layername) 
{
   var nn4 = (document.layers);
   var nn6 = (document.getElementById && !document.all);
   var ie4 = (document.all && !document.getElementById);
   var ie5 = (document.all && document.getElementById);

   if (nn4){
      eval('parent.document.' + divname + '.layers.' + layername + '.load(filename, parent.document.' + divname + '.layers.' + layername + '.clip.width)');
   }
   else if (ie4) eval('parent.document.all.' + divname + '.document.frames[layername].location = filename');
   else if (ie5 || nn6) parent.document.getElementById(layername).src = filename;
}

function trimright(s) {
	while (s.charAt(s.length -1) == ' ') {
		s = s.substring(0, s.length-1);		
	}
	return s;
}

function loadNewPage(ddl) {
	window.location = ddl[ddl.selectedIndex].value;
}

//ADDITIONAL ROUTINES FOR PRIMARY NAVIGATION - from ffm.js

window.onload = function()
{
	startList();
	freeFloatingArr = document.getElementById("ffm") ? document.getElementById("ffm").getElementsByTagName("DIV") : [];
	freeFloatingMenu();
}

function freeFloatingMenu()
{
	for (i = 0; i < freeFloatingArr.length; i++)
	{
		if (freeFloatingArr[i].className == "ffm_drop_wrapper")
		{
			// render dropshadow(s) and menu offset
			
			freeFloatingArr[i].getElementsByTagName("div")[0].style.width = freeFloatingArr[i].getElementsByTagName("li")[0].offsetWidth + 2 + "px";
			freeFloatingArr[i].getElementsByTagName("div")[0].style.height = freeFloatingArr[i].getElementsByTagName("li")[0].offsetHeight + 2 + "px";
			freeFloatingArr[i].getElementsByTagName("div")[1].style.width = freeFloatingArr[i].getElementsByTagName("div")[0].offsetWidth + 2 + "px";
			freeFloatingArr[i].getElementsByTagName("div")[1].style.height = freeFloatingArr[i].getElementsByTagName("div")[0].offsetHeight + 1 + "px";
			freeFloatingArr[i].getElementsByTagName("div")[1].style.left = "-1px";
			
			if (freeFloatingArr[i].getElementsByTagName("li")[0].className.indexOf("right") != -1)
			{
				freeFloatingArr[i].getElementsByTagName("li")[0].style.left = freeFloatingArr[i].getElementsByTagName("img")[0].offsetWidth - freeFloatingArr[i].getElementsByTagName("li")[0].offsetWidth + "px";
			}
			
			// attach mouseover events
			
			freeFloatingArr[i].onmouseover = function()
			{
				if (typeof hideMenuTimeout != "undefined")
				{
					window.clearTimeout(hideMenuTimeout);
					menuHide.objRef = prevMenu;
					if (prevMenu != this.getElementsByTagName("li")[0])
					{
						menuHide();
					}
				}
				menuShow.objRef = this.getElementsByTagName("li")[0];
				showMenuTimeout = window.setTimeout("menuShow()",500);
			}
			freeFloatingArr[i].onmouseout = function()
			{
				
				if (typeof showMenuTimeout != "undefined")
				{
					window.clearTimeout(showMenuTimeout);
				}
				
				menuHide.objRef = this.getElementsByTagName("li")[0];
				hideMenuTimeout = window.setTimeout("menuHide()",1000);
				prevMenu = this.getElementsByTagName("li")[0];
			}
		}
	}
}

var menuShow = function()
{
	menuShow.objRef.style.visibility = "visible";
}

var menuHide = function()
{
	menuHide.objRef.style.visibility = "hidden";
}



//ADDITIONAL ROUTINES FOR SECONDARY NAVIGATION - from list_rollovers.js

	startList = function() {

if (document.all&&document.getElementById) {
	navRoot = document.getElementById("nav");
	if (navRoot) {
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
 }
 
if (document.all&&document.getElementById) {
	navRoot = document.getElementById("nav2");
	if (navRoot) {
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
 }
 
 
if (document.all&&document.getElementById) {
	navRoot = document.getElementById("nav3");
	if (navRoot) {
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
 }
 
}
//window.onload=startList;


function RotateBack(divCurrent, divPrevious)                    
{
	var objDivCurrent = document.getElementById(divCurrent);
	var objDivPrevious = document.getElementById(divPrevious);

    objDivCurrent.style.display = 'none';
    objDivPrevious.style.display = 'block';
}

function RotateForward(divCurrent, divNext)
{
	var objDivCurrent = document.getElementById(divCurrent);
	var objDivNext = document.getElementById(divNext);

    objDivCurrent.style.display = 'none';
    objDivNext.style.display = 'block';
}


function hideDivById(divCurrent)
{
	var objDiv = document.getElementById(divCurrent);
	if (objDiv != null) {
		if (objDiv.style.display == 'none')
			objDiv.style.display = 'block';
		else
			objDiv.style.display = 'none';
	}
}

// assign one href to another - to handle image icons outside of the anchor
function assignHrefToNewAnchor(hrefId, newHrefId)
{
	var objAnchor= document.getElementById(hrefId);
	var objNewAnchor= document.getElementById(newHrefId);	
	if (objAnchor != null && objNewAnchor !=null) 
	{
		objNewAnchor.href = objAnchor.href;
	}	
}

    function RotateBack(divCurrent, divPrevious)                    
{
	var objDivCurrent = document.getElementById(divCurrent);
	var objDivPrevious = document.getElementById(divPrevious);

    objDivCurrent.style.display = 'none';
    objDivPrevious.style.display = 'block';
}

function RotateForward(divCurrent, divNext)
{
	var objDivCurrent = document.getElementById(divCurrent);
	var objDivNext = document.getElementById(divNext);

    objDivCurrent.style.display = 'none';
    objDivNext.style.display = 'block';
}

// ******* AD SERV ***********
function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return '';
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}

var rndNumber = '';

function generateRandomNumber() {

	if (rndNumber.length == '')
	{
		rndNumber = Math.ceil(Math.random() * 10000000000);
	}
	
	return rndNumber;

}

function buildAdServParameters()
{
	var strParams = '';

	strParams = strParams + 'age=' + readCookie('age') + (';');
	strParams = strParams + 'gen=' + readCookie('gen') + (';');
	strParams = strParams + 'zip=' + readCookie('zip') + (';');
	strParams = strParams + 'kids1=' + readCookie('u12') + (';');
	strParams = strParams + 'kids2=' + readCookie('13+') + (';');
	strParams = strParams + 'mag=' + readCookie('mag') + (';');
	strParams = strParams + 'rbe=' + readCookie('rbe') + (';');
	strParams = strParams + 'hl=' + readCookie('hl') + (';');

	return strParams;
}

function replaceAdServTags()
{
	var imgImage;

	if (document.images) 
	{
		//Loop for all images
		for (var loopCounter = 0; loopCounter < document.images.length; loopCounter++) 
		{
			imgImage = document.images[loopCounter];
			imgImage.src = imgImage.src.replace('%7BPARAMETERS%7D', buildAdServParameters())
			imgImage.src = imgImage.src.replace('%7RANDOM%7D', generateRandomNumber())
		}
	}
}
// ******* AD SERV ***********


function alertEmail() {
		alert('1');
	var myForm=$('aspnetForm');
	var txt=$('control_AlertEmail');
	var msg=$('errMsg');
	emailRe = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*\.(\w{2}|(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum))$/;
		alert('2');
	if (!emailRe.test(txt.value)){
		alert('3');
			msg.setStyle('display','block');
	} else {
			alert('4');

		var objRemove = $('__VIEWSTATE');
		objRemove.value='';
		for(i=0; i<myForm.elements.length; i++)
		{
			if((myForm.elements[i].name=="ErrorLanguage") || (myForm.elements[i].name=="basepage") || (myForm.elements[i].name=="control_AlertEmail")){
				
			} else {
				if(myForm.elements[i].name){
					myForm.elements[i].parentNode.removeChild(myForm.elements[i]);
				}
			}
		}
		__doPostBack=false;
		__CMS_PostbackFormBeenReset=true;
		//DEVELOPMENT
		//myForm.action="http://phx.corporate-ir.net/preview/phoenix.zhtml?c=129070&p=irol-alertslong";
		//PRODUCTION
		myForm.action="http://phx.corporate-ir.net/phoenix.zhtml?c=129070&p=irol-alertslong";
		
		alert('5');
		//myForm.submit();
	}
}

function setLocationPF()
{
// set the location path specified in the textbox.
	var iQuestionLoc = window.location.href.indexOf("?");
	if (iQuestionLoc >= 0) {
		window.open(window.location.href + "&pf=true");
	} else {
		window.open(window.location.href + "?pf=true");
	}
}

// -->


