use this inside joomla code:
$app =& JFactory::getApplication();$app->setTemplate("template2");
and by address:
index.php?template=template2