window.onload=function()
	{
		// Calculate the height of the listings page
		
			side_bar_left = "#main #sidebarleft";
			side_bar_right = "#main #sidebarright";
			main_content = "#main #listing";
			
			s_b_l = $(side_bar_left).height();
			s_b_r = $(side_bar_right).height();
			m_c = $(main_content).height();
			
			if(s_b_l > s_b_r)
				{
					if(s_b_l > m_c)
						{
							content_height = s_b_l;	
						}
					else
						{
							content_height = m_c;
						}
				}
			else
				{
		
					if(s_b_r > m_c)
						{
							content_height = s_b_r;	
						}
					else
						{
							content_height = m_c;
						}
				}
				
			if(content_height < '400')
				{
					content_height = '410';
				}
			
			content_height1 = content_height + 'px';
			$(side_bar_left).css("height", content_height1);
			$(side_bar_right).css("height", content_height1);
			$(main_content).css("height", content_height1);
			
			function externalLinks() 
				{
					if (!document.getElementsByTagName) return;
			 
					var anchors = document.getElementsByTagName("a");
			 
					for (var i=0; i<anchors.length; i++) 
						{
							var anchor = anchors[i];
							if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external")
								{
									anchor.target = "_blank";
								}
						}
						
					var forms = document.getElementsByTagName("form"); 
					
					for(var i = 0; i < forms.length; i++) 
						{ 
							var form = forms[i]; 
							if(form.getAttribute("action").substring(0, 4) == "http") 
								{ 
									form.target = "_blank"; 
								} 
						} 
				}
			externalLinks()
	}
