// Redirects user to redirect page 'searches.aspx'
// Opens the new URL in a new window.
function OpenWndURL(IID)
{
	var URL = "http%3a%2f%2fcgi.ebay.com%2fws%2feBayISAPI.dll%3fViewItem%26item%3d" + IID;	
	var NW;	
	NW = open("searches.aspx?iid=" + IID + "&rurl=" + URL, "", "");
	return false;
}

function OpenWndURLex(IID, type)
{
	var URL = "http%3a%2f%2fcgi.ebay.com%2fws%2feBayISAPI.dll%3fViewItem%26item%3d" + IID;	
	var NW;	
	NW = open("searches.aspx?iid=" + IID + "&rurl=" + URL + "&type=" + type, "", "");
	return false;
}

// Redirects user to redirect page 'searches.aspx'
// Opens the new URL in the same window.
function OpenURL(IID)
{
	var URL = "http%3a%2f%2fcgi.ebay.com%2fws%2feBayISAPI.dll%3fViewItem%26item%3d" + IID;
	window.location.href = "searches.aspx?iid=" + IID + "&rurl=" + URL;
	return false;
}

function OpenURLex(IID, type)
{
	var URL = "http%3a%2f%2fcgi.ebay.com%2fws%2feBayISAPI.dll%3fViewItem%26item%3d" + IID;
	window.location.href = "searches.aspx?iid=" + IID + "&rurl=" + URL + "&type=" + type;
	return false;
}

// Redirects user to category.
// Opens the new URL in the same window.
function OpenCatURL(Cat)
{
	var URL = Cat;
	if (URL.indexOf (".html") <= 0)
	{
	  URL = URL + ".html";
	}
	window.location.href = URL;
	return false;
}

// Displays category URL in the status bar.
function StatusCatURL(Cat)
{
	var URL = Cat;
    if (URL.indexOf (".html") <= 0)
	{
	  URL = URL + ".html";
	}
	window.status = URL;
	return true;
}

// Displays URL for item in the status bar.
function StatusURL(IID)
{
	var URL = "http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=" + IID;
	window.status = URL;
	return true;
}

// Replaces fake images' URLs to real URLs
function idimages()
{
	var i=0;
	for (i=0; i < document.images.length; i++)
	{
	    if (document.images[i].id.length > 0)
   		{
    	    if ((document.images[i].id.indexOf("ttp:") > 0) || (document.images[i].id == "img.jpg"))
	            document.images[i].src = document.images[i].id;
        }
	}
	return false;
}
