/**
     *
     */
    function uploadMedia($uploadpage, $videotype, $checksecurity, $title, $description, $category_id, $tags, $public_private, $allow_comments, $allow_embedding, $allow_ratings, $md5password)
    {
		global $mainframe, $Itemid, $my, $params, $smartyvs;
		$c = hwd_vs_Config::get_instance();

		// load the menu name
		jimport( 'joomla.application.menu' );
		$menu   = &JMenu::getInstance('site');
		$mparams = &$menu->getParams($Itemid);
		$mparams_pt	= $mparams->get( 'page_title', '');

		jimport( 'joomla.document.document' );
		$doc = & JFactory::getDocument();
		$app = & JFactory::getApplication();

		$active = &$menu->getActive();

		if (!empty($mparams_pt)) {
			$metatitle = $mparams_pt;
		} else if (!empty($active->name)) {
			$metatitle = $active->name;
		} else {
			$metatitle = _HWDVIDS_META_DEFAULT;
		}

		// set the page/meta title
		$doc->setTitle( $metatitle." - "._HWDVIDS_META_UPLD );
		$doc->setMetaData( 'title' , $metatitle." - "._HWDVIDS_META_UPLD );
		hwd_vs_tools::generateActiveLink(4);
		hwd_vs_tools::generateBreadcrumbs();

		$supported_websites = hwd_vs_tools::generateSupportedWebsiteList();
		$smartyvs->assign("supported_websites", $supported_websites);

		if ($uploadpage == "2") {

			$allowedformats = hwd_vs_tools::generateAllowedFormats();
			$smartyvs->assign("allowed_formats", $allowedformats);
			$smartyvs->assign("maximum_upload", $c->maxupld);

			if ($c->locupldmeth == "3")
			{
				require_once(JPATH_SITE.DS.'components'.DS.'com_hwdvideoshare'.DS.'views'.DS.'upload_perl.php');
				$smartyvs->display('upload_local_perl.tpl');
				return;
			}
			else if ($c->locupldmeth == "2")
			{
				require_once(JPATH_SITE.DS.'components'.DS.'com_hwdvideoshare'.DS.'views'.DS.'upload_flash.php');
				$smartyvs->display('upload_local_flash.tpl');
				return;
			}
			else if ($c->locupldmeth == "0")
			{
				require_once(JPATH_SITE.DS.'components'.DS.'com_hwdvideoshare'.DS.'views'.DS.'upload_php.php');
				$smartyvs->display('upload_local_php.tpl');
				return;
			}
			else if ($c->locupldmeth == "4")
			{
				require_once(JPATH_SITE.DS.'components'.DS.'com_hwdvideoshare'.DS.'views'.DS.'upload_warp.php');
				$smartyvs->display('upload_local_warp.tpl');
				return;
			}
			else
			{
				require_once(JPATH_SITE.DS.'components'.DS.'com_hwdvideoshare'.DS.'views'.DS.'upload_php.php');
				$smartyvs->display('upload_local_php.tpl');
				return;
			}

		} else if ($uploadpage == "thirdparty") {

			$app->setUserState( "com_hwdvideoshare.upload_selection", "tp" );
			hwd_vs_javascript::checkaddform();
			$captcha = hwd_vs_tools::generateCaptcha();
			$smartyvs->assign("captcha", $captcha);
			$smartyvs->display('upload_thirdparty.tpl');
			return;

		} else if ($uploadpage == "1") {

			$app->setUserState( "com_hwdvideoshare.upload_selection", "local" );
			hwd_vs_javascript::checkuploadform();
			$captcha = hwd_vs_tools::generateCaptcha();
			$smartyvs->assign("captcha", $captcha);
			$smartyvs->display('upload_local.tpl');
			return;

		} else if ($uploadpage == "0") {

			hwd_vs_javascript::disablesubmit();
			$upload_selection = $app->getUserState( "com_hwdvideoshare.upload_selection", '' );
			if ($upload_selection == "tp") {
				$tpselect = 'selected="selected"';
			} else {
				$tpselect = '';
			}
			$smartyvs->assign("tpselect", $tpselect);
			$smartyvs->display('upload_choice.tpl');
			return;

		}
    }