//Code to create rich text field-------------------------------------------------------------------
tinyMCE.init({
// General options
mode : "textareas",
theme : "advanced",
plugins : "safari,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,imagemanager,filemanager", 


// Theme options
theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,cut,copy,paste,undo,redo,|link",
theme_advanced_buttons2: "",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true,

//Full Theme options

// Theme options
/*
plugins : "safari,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,imagemanager,filemanager",
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true,
*/


// Example content CSS (should be your site CSS)
content_css : "css/example.css",


// Drop lists for link/image/media/template dialogs
template_external_list_url : "js/template_list.js",
external_link_list_url : "js/link_list.js",
external_image_list_url : "js/image_list.js",
media_external_list_url : "js/media_list.js",


// Replace values for the template plugin
template_replace_values : {
username : "Some User",
staffid : "991234"
}
});
//End rich text field --------------------------------------------------------------------------

//Functions to hide and show divs and create tabs
function hide (hidden) {
  document.getElementById(hidden).style.display = "none";
}
function showMe (box) {
  document.getElementById(box).style.display = "block";
}
function tabChange(element1,element2,element3) {
  //Element click on
  document.getElementById(element1).style.backgroundColor= '#000000';
  document.getElementById(element1).style.color= '#D7A550';
  
  //Elements not being looked at
  document.getElementById(element2).style.color= '#666666';
  document.getElementById(element2).style.backgroundColor= '#F4F1EB';
  document.getElementById(element3).style.color= '#666666';
  document.getElementById(element3).style.backgroundColor= '#F4F1EB';
}

//Code for popup Calendar
var cal = new CalendarPopup(); 
//cal.showNavigationDropdowns();
//cal.showYearNavigation();
cal.showMonthNavigation();

/*function validateRanking (min, max, count) {

						
					var STD_ERROR_PREFIX = "There were one or more problems with the rankings you entered.\nPlease check that all rankings are different and try submitting the form again:\n\n";
						var f = document.getElementById('rankingForm');
						//alert("Min: " + min);
						//alert("Max: " + max);
						var errors	= [];

						for (i= 1; i <=count; i++) {
							alert(id[i]);
						}
						//var i = min;
						//var x;
						
						for (i = min; i <= max; i++) {
							for (x = min; x <=max; x++) {
								if (x == i && f.i.value == f.x.value) {
									errors.push("Please make sure more than 1 announcement does not have the same ranking!");
									alert(STD_ERROR_PREFIX + errors.join("\n"))
									return false;
								}
							}
						}
						
						
						//return true;

						if (f.csvolnme.value == "") {
							errors.push("You did not enter the Volunteer/Coach Name.");
						}

						if (f.csphone.value == "") {
							errors.push("You did not enter a Phone Number.");
						}

						if (f.csemail.value == "") {
							errors.push("You did not enter an Email Address.");
						}

						if (f.cslgenme.value == "") {
							errors.push("You did not enter League(s) you're involved with.");
						}

						if (f.csvolyrs.value == "") {
							errors.push("You did not enter the number of years you have been volunteering.");
						}

						if (f.csenjmst.value == "") {
							errors.push("You did not enter what you enjoy most.");
						}
						
						if (f.csgoodvc.value == "") {
							errors.push("You did not enter what makes a good youth sports volunteer/coach.");
						}
						
						if (f.csimptnc.value == "") {
							errors.push("You did not enter why youth sports are important for kids.");
						}

						if (f.csvolpic.value == "") {
							errors.push("You did not select a Volunteer/Coach Picture to upload.");
						}

						if (errors.length > 0) {
							alert(STD_ERROR_PREFIX + errors.join("\n"))
							return false;
						}

						return true;
					
}*/