﻿function HS(item,action)      {if (action==1) {item.style.background='#E2EBFA'} else {item.style.background='transparent';}}
function MoveToPage(pageno)	  {if (pageno>=0) document.forms[0].PageNo.value=pageno;document.forms[0].submit();}

function openFile(openMethod,bid,fid,settings) {
	switch (openMethod) {
		case 'download','' : 
			PopupDiv2('execute','/_ACC/_Components/ATLANTIS-digistore/download/download.asp?basketID='+bid+'&fileID='+fid+'&settings='+settings+'&openmode=saveas');
			break;
		case 'browser' 	: 
			PopupDiv2('execute','/_ACC/_Components/ATLANTIS-digistore/download/download.asp?basketID='+bid+'&fileID='+fid+'&settings='+settings+'&openmode=open');
			break;
		case 'imagewnd'	: 
			openPopup('/_ACC/_Components/ATLANTIS-digistore/imageWnd.asp?basketID='+bid+'&fileID='+fid+'&settings='+settings,500,695);
			break;
		case 'filecard'	: 
			openPopup('/_ACC/_Components/ATLANTIS-digistore/preview/?basketID='+bid+'&fileID='+fid+'&settings='+settings,500,820);
			break;
	}
}

function SelectCard(fid,bid) {	
	parent.card_main.document.getElementById('ImgCard').src='/_ACC/_Components/ACC-DigiStore/_include/GetThumbnail.asp?mode=320&basketID='+bid+'&fileID='+fid;
	parent.card_main.document.forms[0].basketID.value=bid;
	parent.card_main.document.forms[0].fileID.value=fid;
}
 

function executeAction(action) {
	switch (action) {
		case 'preview' : {				
			document.forms[0].submit();
			break;			
		}		
		case 'send' : {				
			document.forms[0].Action.value='send';
			document.forms[0].submit();
			break;			
		}
		case 'edit' : {				
			document.forms[0].action='Create.asp';
			document.forms[0].submit();
			break;			
		}
		case 'cancel' : {				
			parent.document.location.href='/ACPages/etusivu.asp';
			break;			
		}		
	}	
}
