
// JavaScript Document

function linkclick ( obj, id )
{
	for ( var i = 1; i < 11; i++ )
	{
		objLink  = document.getElementById ( obj + i.toString () );
		objTable = document.getElementById ( obj + "_" + i.toString () );

		if ( objLink && objTable )
		{
			if ( id == i )
			{
				objLink.className = obj + "_click";
				objTable.style.display = "";
			}
			else
			{
				objLink.className = obj + "_normal";
				objTable.style.display = "none";
			}
		}
		else
			break;
	}
}

function linkclick2 ( obj, id )
{
	for ( var i = 1; i < 11; i++ )
	{
		objTable = document.getElementById ( obj + "_" + i.toString () );

		if ( objTable )
		{
			if ( id == i )
				objTable.style.display = "";
			else
				objTable.style.display = "none";
		}
		else
			break;
	}
}

function pressGo ( obj, page, ext )
{
	var code = event.keyCode;

	if ( code == 13 )
	{
		var url = page;
		var index = obj.value * 1;

		if ( index > 1 )
			url += "_" + ( index - 1 );

		url += "." + ext;
        url = url+"?page="+obj.value;
		window.location = url;
	}
	else if ( code >= 48 && code <= 57 )
		return true;

	return false;
}

function pressGo1 ( obj, page, ext,totalPage )
{
	var code = event.keyCode;
	var curPage = obj.value;
	if(curPage>totalPage){
		curPage = totalPage;
	}
    
	if ( code == 13 )
	{
		var url = page;

		url += "." + ext;
        url = url+"?page="+curPage;
		window.location = url;
	}
	else if ( code >= 48 && code <= 57 )
		return true;

	return false;
}
