/*
	www.davidsherman.ca JavaScript
	Copyright 2006 Daryl Beattie.
*/

// Used to obfuscate e-mail address from web scouring programs.
var dsEmailAddr = "ds" + "@";
dsEmailAddr += "davidsherman" + ".ca";
var dbEmailAddr = "daryl" + "@";
dbEmailAddr += "darylbeattie" + ".com";

var MAGIC_CASE_HISTORIES_SELECT_BOX_SIZE = 15;

var GLOBAL_LAST_MODIFIED_INFO = 'Last modified September 2008 by Daryl Beattie.';

var order = new Array(
	new Array("01", "GST  air travel commissions"),
	new Array("02", "GST  builder built home for personal use"),
	new Array("46", "GST  builder of new home was not who CRA thought it was"),
	new Array("03", "GST  cleaning up years of failure to charge GST on management fees"),
	new Array("23", "GST  director's liability (construction contractor)"),
	new Array("04", "GST  director's liability (corporate lawyer)"),
	new Array("05", "GST  director's liability (restaurant owner)"),
	new Array("56", "GST  directors liability assessment  individual was never a director"),
	new Array("51", "GST  full input tax credits allowed"),
	new Array("65", "GST  getting CRA to honour a retroactive registration"),
	new Array("06", "GST  golf club memberships"),
	new Array("63", "GST  home renovation was not substantial renovation"),
	new Array("24", "GST  input tax credits allowed without documentation"),
	new Array("25", "GST  input tax credits justified"),
	new Array("49", "GST  liability of charitable institution for unremitted GST"),
	new Array("36", "GST  miscellaneous adjustments"),
	new Array("62", "GST  partnership assessment was out of time"),
	new Array("07", "GST  purchase of real estate"),
	new Array("08", "GST  rebate for ship towed out of the country"),
	new Array("66", "GST  recognizing when a second objection had to be filed"),
	new Array("57", "GST  reducing assessment by almost 90%"),
	new Array("37", "GST  registrants were not associated"),
	new Array("09", "GST  reopening audit after expiry of appeal period"),
	new Array("55", "GST  retroactively deeming a business to be GST-registered"),
	new Array("10", "GST  sales of condominiums"),
	new Array("53", "GST  school board's liability eliminated"),
	new Array("11", "GST  stopping a client from being driven out of business"),
	new Array("38", "GST  tire installer neglecting to bill GST"),
	new Array("12", "GST  townhouse renovations"),
	new Array("58", "GST  voluntary disclosure  negotiating interest relief and income tax offset"),
	new Array("52", "GST  voluntary disclosure accepted"),
	new Array("43", "GST  voluntary disclosure of GST collected on commercial rents"),
	new Array("45", "GST  voluntary disclosure of management fees"),
	new Array("13", "GST  waiver of interest"),
	new Array("14", "GST  waiver of interest and penalty"),
	new Array("32", "GST  waiver of penalty"),
	new Array("15", "GST  were courses educational or recreational?"),
	new Array("33", "PST  director's liability"),
	new Array("34", "PST  eliminating assessment for tax collected by franchisor"),
	new Array("16", "PST  invoices written up incorrectly"),
	new Array("39", "PST  reducing tax on sale of book with CD-ROM"),
	new Array("35", "PST  refund of tax on supermarket construction"),
	new Array("47", "Income tax  another refund where return filed late"),
	new Array("17", "Income tax  assessment for transfer by tax debtor"),
	new Array("18", "Income tax  builder built home as personal residence"),
	new Array("26", "Income tax  cancelling source deductions assessment"),
	new Array("27", "Income tax  capital gains vs. income"),
	new Array("54", "Income tax  charitable donation of kidney beans"),
	new Array("60", "Income tax  child support deduction"),
	new Array("28", "Income tax  claiming business losses from past years"),
	new Array("48", "Income tax  companies were not carrying on Personal Services Business"),
	new Array("19", "Income tax  corporation was bare trustee"),
	new Array("44", "Income tax  donations to suspect charity allowed"),
	new Array("59", "Income tax  expenses of setting up a film shelter"),
	new Array("20", "Income tax  general anti-avoidance rule"),
	new Array("61", "Income tax  getting the $500,000 capital gains exemption"),
	new Array("64", "Income tax  getting Third Level Fairness review"),
	new Array("40", "Income tax  intercompany charges deductible"),
	new Array("50", "Income tax  no tax on litigation settlement"),
	new Array("21", "Income tax  over-intrusive audit"),
	new Array("31", "Income tax  refunds where returns filed late"),
	new Array("42", "Income tax  \"reserve\" was not a reserve"),
	new Array("22", "Income tax  trust for disabled child"),
	new Array("41", "Income tax  wages of family members were deductible"),
	new Array("29", "Collections  execution preventing sale of property"),
	new Array("30", "Your problem goes here")
);

function writeMenuAndTitle(sel) {
	document.open();
	document.write('<TABLE cellpadding="0" cellspacing="0" border="0"><tr><td rowspan="2">');
	document.write('<SELECT NAME="opt_view" style="font: 10pt Arial;" onChange="document.location.href = this.options[this.selectedIndex].value" SIZE="' + MAGIC_CASE_HISTORIES_SELECT_BOX_SIZE + '" language="JavaScript">');
	var index = 0;
	for (var i = 0; i < order.length; i++) {
		if (sel == order[i][0]) {
			index = i;
		}
		document.write('<OPTION ' + (sel == order[i][0] ? 'SELECTED ' : '') + 'VALUE="magic_' + order[i][0] + '.html">' + order[i][1]);
	}
	document.write('</SELECT>');
	document.write('</td><td valign="top">');
	if (index != 0) {
		document.write('&nbsp;&nbsp;<a href="javascript:document.location.href = \'magic_' + order[index - 1][0] + '.html\';">Previous Case</a>');
	}
	document.write('</td></tr><tr><td valign="bottom">');
	if (index != (order.length - 1)) {
		document.write('&nbsp;&nbsp;<a href="javascript:document.location.href = \'magic_' + order[index + 1][0] + '.html\';">Next Case</a>');
	}
	document.write('</td></tr></TABLE>');
	document.write('<BR><CENTER><B>' + order[index][1] + '</B></CENTER><BR>');
	document.close();
}

function writeFooter(modifiedInfo) {
	document.open();
	document.write('<HR ALIGN=center NOSHADE WIDTH="75%">');
	document.write('<CENTER><FONT COLOR="000000" FACE="Arial">');
	document.write('David M. Sherman<BR>');
	document.write('Toronto, Ontario - Fax: 416-781-4633<BR>');
	document.write('E-mail: <A HREF="javascript:doEmail(dsEmailAddr + \'?subject=E-mail from web page\');"'); 
	document.write(' onmouseover="window.status=\'Click to send email to David M. Sherman\';return true"');
	document.write(' onmouseout="window.status=\'\';return true">');
	document.write(dsEmailAddr);
	document.write('</A><BR>');
	document.write('<BR>');
	document.write('<FONT SIZE=-3>This page was created in September 1998 by ');
	document.write('<A HREF="javascript:doEmail(dbEmailAddr + \'?subject=From David Sherman\'s Page\');"');
	document.write(' onmouseover="window.status=\'Click to send email to the web page designer\';return true"'); 
	document.write(' onmouseout="window.status=\'\';return true">');
	document.write('Daryl Beattie');
	document.write('</A>.<BR>');
	if (modifiedInfo != null) {
		document.write(modifiedInfo);
	}
	else {
		document.write(GLOBAL_LAST_MODIFIED_INFO);
	}
	document.write('</FONT></FONT></CENTER><BR><BR>');
	document.close();
}

/*
 * This is basically here to try to hide my e-mail address
 * from web scouring programs.
 */
function doEmail(emailAddr) {
	location.replace("mailto:" + emailAddr);
}

/*
 * This is basically here to try to hide my e-mail address
 * from web scouring programs.
 */
function writeAddress(emailAddr) {
	document.open();
	document.write(emailAddr);
	document.close();
}
