// JavaScript Document
var docData = [];
var docPastData = [];
var docFavoriteData = [];
var largeSummary = false;
var largeFavorite = false;
var largeContact = false;


$(document).ready(function(){
	window.name = "W180";
	
	$('.linkDocument').click(function(){
		$(this).css('color','#800080');
		var folder_no = $(this).attr('data-folder_no');
		getSearch(folder_no);
		return false;
	});
});

function getSearch(folder_no){
	var setParam = {
		'appname':'NAIS3WEB',
		'prgname':'W183',
		'ssid': $('#ssid').val(),
		'folder_no': folder_no,
		'arguments':'ssid,folder_no'
	};
	getSearchCore(setParam);
}

function getSearchCore(searchParam){
	$.ajax({
		async : false,
		url: ajaxURL,
		data : searchParam,
		dataType:'html',
		scriptCharset: 'utf-8',
		success : function(html){			
			var getHtml = $($.parseHTML(html));
			var sessionError = getHtml.filter('#sessionError').val();
			if(sessionError === '0'){
				$('#divContents').empty();
				$('#divContents').append(getHtml.filter('#divSearchRes')[0].innerHTML);
				
			}else {
				cm_sessionError();
			}
		},
		error : function(XMLHttpRequest, textStatus, errorThrown){
				cmAjaxError(XMLHttpRequest, textStatus, errorThrown);
		}
	});
}	

//ドキュメントオープン
function DocOpen(filename)
        {
		var str = filename.toUpperCase();
		if( (str.substr(str.length -3,3)) === "PDF" )
        	{window.open( filename ,"",'toolbar=0,directories=0,status=1,resizable=1,scrollbars=0,menubar=0,left=100,top=60,width=800,height=550,');}
		else
        	{window.open( filename ,"",'toolbar=1,directories=0,status=1,resizable=1,scrollbars=0,menubar=1,left=100,top=60,width=800,height=550,');}
        }

function NPHelp(){
	var hdnWebDocAlias = $('#hdnWebDocAlias').val();
	window.open(hdnWebDocAlias+"help/nphelp_lib001.htm");
}