<?php

if (!defined('IS_ADMIN_FLAG')) {
  die('Illegal Access');
}

// INSERTS <SCRIPT> TAGS IN <HEAD> FOR WYZZ TO BE CALLED
if ($_SESSION['html_editor_preference_status']=="WYZZ") {

//<!-- load the main Wyzz files -->
  echo '<script type="text/javascript" src="' . DIR_WS_CATALOG . 'editors/wyzz/wyzz.js"></script>
		<script type="text/javascript">
		function atload() {
			var textareas = document.getElementsByTagName("textarea");
			for ( var i=0; i<textareas.length; i++ ){
				make_wyzz(textareas[i].name); 
			}
		}

		//GO1.1 :: Generic onload by brothercake - http://www.brothercake.com/
		//http://help.dottoro.com/ljeuqqoq.php
		//http://help.dottoro.com/larrqqck.php
		//ie8 and below use attachEvent with onload
		//ie9, ff, chrome, safari, opera use addEventListener with load
  
		//setup onload function
		if(typeof window.addEventListener != "undefined")
		{
			//.. gecko, safari, konqueror, ie9, and standard
			window.addEventListener("load", atload, false);
		}
		else if(typeof document.addEventListener != "undefined")
		{
			//.. opera 
			document.addEventListener("load", atload, false);
		}
		else if(typeof window.attachEvent != "undefined")
		{
			//.. win/ie
			window.attachEvent("onload", atload);
		}
		</script>';
}
?>