<?php
if (!defined('_VALID_MOS') && !defined('_JEXEC')) die('Direct Access to ' . basename(__FILE__) . ' is not allowed.');

//for Joomla 6
use Joomla\CMS\Factory;
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\Form\FormField;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\HTML\HTMLHelper;

if (version_compare(JVERSION, "6.0.0", "ge")) {
    if (!class_exists('JFactory')) class_alias('Joomla\CMS\Factory', 'JFactory');
    if (!class_exists('JURI')) class_alias('Joomla\CMS\Uri\Uri', 'JURI');
    if (!class_exists('JFormField')) class_alias('Joomla\CMS\Form\FormField', 'JFormField');
    if (!class_exists('JLayoutHelper')) class_alias('Joomla\CMS\Layout\LayoutHelper', 'JLayoutHelper');
    if (!class_exists('JHtml')) class_alias('Joomla\CMS\HTML\HTMLHelper', 'JHtml');
} 


if (!function_exists('checkJavaScriptIncludedOS')) {
	
  function checkJavaScriptIncludedOS($name) {

      $doc = JFactory::getDocument();

      foreach($doc->_scripts as $script_path=>$value){
        if(strpos( $script_path, $name ) !== false ) return true ;
      }
      return false;
  }
}
