(function(){
	
	function C()
	{
		var a = window;
		if(typeof a.weathermn_banner_format == 'undefined') return false;
		if(typeof a.weathermn_banner_townid == 'undefined') return false;
		if(typeof a.weathermn_banner_bannerset == 'undefined') a.weathermn_banner_bannerset = "01";
		if(typeof a.weathermn_banner_iconset == 'undefined') a.weathermn_banner_iconset = "02";
		if(typeof a.weathermn_banner_color == 'undefined') a.weathermn_banner_color = "FFFFFF";
		if(typeof a.weathermn_banner_bgcolor == 'undefined') a.weathermn_banner_bannerset = "FF7F00";
		return true;
	}
	
	function A()
	{
		if(!C()) 
		{ 
			document.write("<p>Banner not properly configured. Refer to help.</p>"); return; 
		}
		else
		{
		 	var a = window, url = "http://www.weather-montenegro.com/show_banner.php", width, height;
			var dims = a.weathermn_banner_format.split("x");
			width = dims[0]; height = dims[1];
			 	
			url += "?format=" + a.weathermn_banner_format;
		 	url += "&width=" + width;
			url += "&height=" + height;
			url += "&townid=" + a.weathermn_banner_townid;
		 	url += "&bannerset=" + a.weathermn_banner_bannerset;
		 	url += "&iconset=" + a.weathermn_banner_iconset;
		 	url += "&color=" + a.weathermn_banner_color;
		 	url += "&bgcolor=" + a.weathermn_banner_bgcolor;

			if(a.weathermn_banner_format == "Map")
			{
            width = "300";
            height = "300";
            }

			if(!a.weathermn_page_logged)
			{
				url += "&domain=" + document.domain;
				url += "&url=" + escape(document.location);
				url += "&title=" + escape(document.title);
				a.weathermn_page_logged = true;
			}
		
		 	document.write('<iframe src="'+url+'" width="'+width+'" height="'+height+'" marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="false" frameborder="0" scrolling="no"></iframe>');
		
		}
	}
	A();	
})()
