
var Navigation = (function() 
{
	return {
		
		MenuLists: { 0 : {'name' : 'menulistnav',
						  'cache' : 0}
						  		
		},
		
		WindowPopUp: function (windowname, link, width, height)
		{
			this.WindowOpen(link, width, height, 'auto', 'auto', windowname, 'no', 'yes', 'yes', 'yes', 'no', 0);	
			
		},
		
		CountryChange: function()
		{
			var CountryCode = DOM.GetSelectedValue('CountryChange');
			
			switch(CountryCode)
			{
				case 'RO':
					this.Redirect('http://www.smslink.ro');
					break;
				case 'MD':
					this.Redirect('http://www.smslink.eu/md/');
					break;
				
			}
			
		},
		
		ChangeInputsForCSS: function ()
		{
			var i;
			var elements = document.getElementsByTagName('input');		
		
			for (i = 0; i < elements.length; i++)
			{
				if (elements[i].getAttribute('type'))
					elements[i].className = elements[i].getAttribute('type');
		
			}
			
		},
		
		Redirect: function(link)
		{
			location.href = link;
				
		},
		
		StartMenuLists: function () 
		{
			if (document.all && document.getElementById) 
			{
				var j;
						
				for (j in this.MenuLists)
				{			
					if (DOM.GetElement(this.MenuLists[j]['name']))
					{	
						if (this.MenuLists[j]['cache'] == 0)
						{				
							var elements = DOM.GetElement(this.MenuLists[j]['name']).getElementsByTagName("LI"); 
							
							for (var i = 0; i < elements.length; i++) 
							{         
								elements[i].onmouseover = function() 
								{             
									this.className += " over";         
								
								}         
								
								elements[i].onmouseout = function() 
								{             
									this.className = this.className.replace(new RegExp(" over\\b"), "");         
								
								}  
								
						    } 				
						    
						    this.MenuLists[j]['cache'] = 1;
						    
						}
					   
					}
					
				}
				
			}
		
		},	
		
		WindowOpen: function (link, width, height, top, left, windowsname, toolbar, status, scrollbars, resizable, location, getname)
		{
			var timestamp = new Date()
			
			if (top == 'auto') top = 100;
			if (left == 'auto') left = 170;
			
			if (toolbar == 'auto') toolbar = 'no';
			if (status == 'auto') status = 'yes';
			if (scrollbars == 'auto') scrollbars = 'yes';
			if (resizable == 'auto') resizable = 'yes';
			if (location == 'auto') location = 'no';
			
			if (windowsname == 'auto') 
				var windowsname = 'LiveBusiness' + timestamp.getTime();
			
			var windownew = window.open(link, windowsname, 'toolbar=' + toolbar + ',top=' + top + 'px,left=' + left + 'px,width=' + width + 'px,height=' + height + 'px,status=' + status + ',scrollbars=' + scrollbars + ',resizable=' + resizable + ',location=' + location); 
			
			windownew.focus(); 
			
			if (getname == 1)
			{
				return windownew;
				
			}
			
		},
		
		CreateBookmarkLink: function (url, title)
		{
			if (window.sidebar) 
			{
				// Mozilla Firefox Bookmark		
				window.sidebar.addPanel(title, url, "");	
			
			} 
			else if (window.external) 
			{ 
				// Internet Explorer Favorite		
				window.external.AddFavorite(url, title); 
				
			}	
			else if (window.opera && window.print) 
			{ 
				// Opera Hotlist		
				return true; 
			
			} 
			else if (navigator.appName == 'Netscape')
			{
				// Netscape Bookmark
				alert('');
				
			}
			
		},
		
		Confirmation: function(question, linkyes, linkno)
		{
			var status = confirm(question);
			
			if (status) 
			{ 
				if (linkyes.length > 0)
				{
					window.location = linkyes;
					
				}
				
			}
			else
			{
				if (linkno.length > 0)
				{
					window.location = linkno;
					
				}
				
			}
			
		}		
		
	};
	
})();

