function visit(newURL)
{
	if (newURL != "")
	{
		location.href=newURL
	}
}
			


function showsearchwin()
{
	window.open ("http://restructuring.vantisplc.com/search.aspx","_blank","height=600,width=800,status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes")
}

//client side js
function clickButton(e, buttonid){ 
     var bt = document.getElementById(buttonid); 
     if (typeof bt == 'object'){ 
           if(navigator.appName.indexOf("Netscape")>(-1)){ 
                 if (e.keyCode == 13){ 
                       bt.click(); 
                       return false; 
                 } 
           } 
           if (navigator.appName.indexOf("Microsoft Internet Explorer")>(-1)){ 
                 if (event.keyCode == 13){ 
                       bt.click(); 
                       return false; 
                 } 
           } 
     }
}

//search page javascript
//This page contains inline styles and script to reduce the number of files in the example
function getKey(e)
	{
		if (window.event)
		{
			return window.event.keyCode;
		}
		else if (e)
		{
			return e.which;
		
		}
		else
		{
			return null;
		}
	}
	
	function onSearchKeyPress(e, searchTextBox)
	{
		if (getKey(e) == 13)
		{
			StopBubbling(e);
			if((searchTextBox.value != ""))
			{
				var button = document.getElementById("btnSearch");
				if (button)
				{
					button.click();
				}
				return false;
			}
			else 
			{
				//alert("not searching");
				return false;
			}
		}
		else
		{
			return true;
		}
	}
	
	function StopBubbling(e)
	{
		if(window.event && window.event.cancelBubble != null)
		{
			window.event.cancelBubble = true;
		}
		else if(e && e.stopPropogation)
		{
			e.stopPropogation();
		}
	}	
	
//add to favourites
function addToFavorites()
{
	var urlAddress = "http://restructuring.vantisplc.com/search.aspx";
	var pageName = "Vantis Numerica - Interim Management - Search";
 
	if (window.external)
	{
		window.external.AddFavorite(urlAddress,pageName)
	}
	else
	{ 
		alert("Sorry! Your browser doesn't support this function.");
	}
}

//Valid target="_blank" code
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") == "nofollow") 
     anchor.target = "_blank"; 
 } 
} 
window.onload = externalLinks;


