/************************************************************
**     JavaScript for BACIT ( http://www.naccq.ac.nz/bacit )
**     By Michael Verhaart (c) 2009 http://www.virtualmv.com
**     Version : 2009-11-2
*************************************************************/

/* Set up month array */
var monthName = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
/* create zero formatted numbers */
	if (strVol < 10 ) { strVol0 = '0'+strVol;} else { strVol0 = strVol;}
	if (strIssue < 10) {strIssue0 = '0' +strIssue;} else {strIssue0 = strIssue;}
/* Create page metadata -------------------- */

    var strURL = window.location;    
    document.write ("<title>")
    document.write ("BACIT | Vol "+strVol+", Iss "+strIssue+" |" +strAuthors+" ("+strIssueDate+"), "+ strTitle);
    document.write ("</title>");
    document.write('<meta name="description" content = "BACIT | Vol '+strVol+', Iss '+strIssue+' |' +strAuthors+' ('+strIssueDate+'), '+ strTitle+'">');
    if (strKeywords.length > 0 ){ document.write('<meta name="keywords" content = "'+strKeywords+'">');}
	
	if (strFinalised == "N" ){ 
		document.write('<link rel="stylesheet" type="text/css" href="../sitePrePub.css" >');
	}
function fnUpdatePage(){
	fnAPA();
	fnPaperTypeNo();
	fnTitles();
	fnAuthors();
	fnCOinS();
}	
function fnPaperTypeNo(){
  var strPaperTypeNo1 = '<p style="text-align: left;"><b>'+strPaperTypeNo+'</b></p>';
	document.getElementById('PaperTypeNo').innerHTML = strPaperTypeNo1;
}

function fnTitles(){
  var strTitles = '<h1>'+strTitle+'</h1>'
	if (strTitleSub.length > 0) { strTitles += '<h2>'+strTitleSub+'</h2>';} 
	document.getElementById('Titles').innerHTML = strTitles;
}

function fnAPA(){
	var now=new Date();
	var strAPARef =strAuthors+ " ("+strIssueDate+" ). "+strTitle
	if (strTitleSub.length > 0) { strAPARef += " " + strTitleSub;}
	strAPARef += ". <i>Bulletin of Applied Computing and Information Technology</i> Vol. "+strVol+", Issue "+strIssue+". ISSN 1176-4120.";
	strAPARef += " Retrieved "+ monthName[now.getMonth()] + " " + now.getDate() +", " + now.getFullYear();
	strAPARef += " from " + strURL;
	document.getElementById('ApaRef').innerHTML = strAPARef;      
}

function fnAuthors(){
	var strAu = '';
	for (i=0;i < arrAuthor.length; i++){
	  arrAu =  arrAuthor[i].split(",");
	  if (i > 0) { strAu += ' ,';} 
	  strAu += arrAu[1] + ' '+arrAu[0];
	}
	document.getElementById('Authors').innerHTML = strIssueYear +' ' + strAu;
}

function fnCOinS(){
	var arrAu =  arrAuthor[0].split(","); strAuLast = arrAu[0]; strAuFirst = arrAu[1];
	var strCOinS = '<span class="Z3988" ';
	strCOinS += 'title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;';
	strCOinS += 'rfr_id=info%3Asid%2Focoins.info%3Agenerator&amp;rft.genre=article&amp;';
	strCOinS += 'rft.atitle='+escape(strTitle+ " " + strTitleSub)+'&amp;';
	strCOinS += 'rft.title=Bulletin+of+Applied+Computing+and+Information+Technology&amp;';
	strCOinS += 'rft.stitle=BACIT&amp;rft.issn=1176-4120&amp;';
	strCOinS += 'rft.date='+strIssueDate+'&amp;rft.volume='+strVol+'&amp;rft.issue='+strIssue+'&amp;';
	strCOinS += 'rft.aulast='+strAuLast+'&amp;rft.aufirst='+strAuFirst+'&amp;';
	for (i=0;i < arrAuthor.length; i++){
	  strCOinS += 'rft.au='+escape(arrAuthor[i])+'&amp;';
	}
	strCOinS += 'rft_id='+escape(strURL)+'">';
    strCOinS += '(\u2713<span style ="color: #FF0000;">z</span>otero)</span>';
	document.getElementById('COinS').innerHTML = strCOinS;      
}
function fnAbstract(){
  winMsg=window.open("","DisplayAbstract","scrollbars=yes, resizable=yes");
  winMsg.document.write("<html><head><title>Abstract</title>");
  winMsg.document.write('<link rel="stylesheet" type="text/css" href="../siteAbs.css">');
  winMsg.document.write('<link rel="stylesheet" type="text/css" href="../sitePrnAbs.css" media="print">');
  winMsg.document.write("</head>");
  winMsg.document.write('<body>');
  winMsg.document.write('<h3>Bulletin of Applied Computing and Information Technology</h3>');
  winMsg.document.write('<table style="width: 100%"><tr><td>');
  winMsg.document.write('<p style="text-align: left;"><b>'+strPaperTypeNo+'</b></p>');
  winMsg.document.write('<h1>'+strTitle+'</h1>');
  if (strTitleSub.length > 0) { winMsg.document.write('<h2>'+strTitleSub+'</h2>');} 
  winMsg.document.write('</td><td style="text-align: right; vertical-align: top">');
  winMsg.document.write("<h2 style='text-align:right'>"+strVol0 + ':'+strIssue0+"</h2>");
  winMsg.document.write("<p style='text-align:right'>"+strIssueDate+"</p>")
  winMsg.document.write("</td></tr></table>");
  winMsg.document.write(document.getElementById('Abstract').innerHTML );
  winMsg.document.write("</body></html>");
}
