<?php
/*======================================================================*\
|| #################################################################### ||
|| # Package - YJ Google Map									        ||
|| # Copyright (C) since 2007  Youjoomla.com . All Rights Reserved.     ||
|| # license - PHP files are licensed under  GNU/GPL V2                 ||
|| # license - CSS  - JS - IMAGE files  are Copyrighted material        ||
|| # bound by Proprietary License of Youjoomla.com                      ||
|| # for more information visit http://www.youjoomla.com/license.html   ||
|| # Redistribution and  modification of this software                  ||
|| # is bounded by its licenses                                         ||
|| # websites - http://www.youjoomla.com | http://www.yjsimplegrid.com  ||
|| #################################################################### ||
\*======================================================================*/

// no direct access
defined('_JEXEC') or die('Restricted access');

JHtml::_('behavior.framework',true);
$document = &JFactory::getDocument();


class modYJGooglemapHelper
{
	function getYJGmap(&$params,$yjgmapID,$yjgmapApiKey,$yjgmapName,$yjgmapLocation)
	{


			$yjgmapWidth					= 		$params->get('yjgmapWidth');
			$yjgmapHeight					= 		$params->get('yjgmapHeight');

			$document = &JFactory::getDocument();
			if(empty($yjgmapApiKey)){
				$document->addScript('http://maps.google.com/maps/api/js?sensor=false');
			}else{
				$document->addScript('http://maps.googleapis.com/maps/api/js?key='.$yjgmapApiKey.'&sensor=true');
			}
			$document->addStyleDeclaration(".yjGoogleMaps img{max-width:inherit!important;}#yjgooglemap".$yjgmapID."{width:".$yjgmapWidth.";height:".$yjgmapHeight.";margin:0 auto;}");

	}
}

?>