if (Portal == null) var Portal = {};
if (Portal.Web == null) {
	Portal.Web =	{
						getURLPortal: function () 
						{
							var loc = document.location;
							var urlPortal = loc.protocol.concat("//", loc.hostname, (loc.port != "" ? ":" : ""), loc.port);
							return urlPortal;
						},
						UI: {			
								Care:	{
											openSelectBox: function()
											{
												$('#selectBoxSetores').fadeIn(200);
											},
											
											selectedItem: function(departamento, setor, telefoneHorario, email, info)
											{
												$('#selectBoxSetores').fadeOut(150);
												$('#informacoesSetor').fadeIn(100);
												$('#departamento').html(departamento);
												$('#setor').html(setor);
												$('#telefoneHorario').html(telefoneHorario);
												$('#email').html(email);
												$('#email').attr('href', 'mailto:' + email);
												
												$('#info').css('display', 'none');
												if (info != "")
												{
													$('#info').css('display', 'block');
													$('#info').html(info);
												}
											}
										},
						
								openCloseElement: function(id)
								{
									var masterElement = "div";
									var masterElementLI = "li";
									var changeCSS = false;
									var masterElementCSS = "titulo";
									var cssOpener = "title_open";
									var cssClosed = "title_closed";
									
									var Element = Portal.Web.Common.getElement(masterElement + id);
									var ElementLI = Portal.Web.Common.getElement(masterElementLI + id);
									
									if (Element.style.display == 'none')
									{
										ElementLI.className = "on";
										Element.style.display = "block";
										if (changeCSS)
										{
											var ElementCSS = Portal.Web.Common.getElement(masterElementCSS + id);
											ElementCSS.className = cssClosed;  //title_closed
										}
									}
									else
									{
										ElementLI.className = "";
										Element.style.display = "none";
										if (changeCSS)
										{
											var ElementCSS = TopBroker.Web.Common.getElement(masterElementCSS + id);
											ElementCSS.className = cssOpener; //title_open
										}
									}								
								},
								
								openSubMenu: function(menu)
								{
									$("div.segundonivel").fadeOut(150, function() {
									});
									$(menu).fadeIn(150);
								}
							},
						Common:	{
									getElement: function(id)
									{
										return document.getElementById(id);
									},
									
									isObject: function(what)
									{
										if ((typeof what == 'object') && (what != null))
										{
											return true;
										}
										else
										{
											return false;
										}
									},
									
									getElement: function(id)
									{
										return document.getElementById(id);
									}
								}									
					} // final da declaração
};
