<?php
	require_once( $GLOBALS["site_root"]."/includes/widgets/Widget.inc.php" );

	class Openads extends Widget {
		protected $iZoneId;

		public function __construct( $id = "OpenAds" , $parent = null , $zoneid = 0 ) {
			parent::__construct( $id , $parent );
			$this->setZoneId( $zoneid );
		}
		
		public function setZoneId( $id ) { $this->iZoneId = $id; }

		public function render() {
			if (FNTHPage::isDebugPage()) return "";
			$this->setParam( "zone_id" , $this->iZoneId );
			switch ($GLOBALS["language"]) {
			case "hu":$code=3;$b=false;break;
			case "en":$code=8;$b=false;break;
			case "de":$code=22;$b=false;break;
			}
			FNTHPage::setPageHead( "openads_js_script" , FNTH_embed_js_file( sprintf( "http://ads.easy-media.hu/delivery/spcjs.php?id=%d%s",$code,($b) ? "&block=1" : "" ) ) );
			return parent::render();
		}
	}

?>
