﻿window.onload = initlinks

function initlinks() {
	var alllinks = document.getElementsByTagName("a");
	for (var n = 0; n < alllinks.length; n++) {
		if (alllinks[n].id.indexOf("popup") > -1) {
			alllinks[n].onclick = popup;
		}
	}
}

	
function popup() {
	window.open(this.href, 'name', 'height=600,width=820');
	return false;
	if (window.focus) {newwindow.focus();
	}
}

function changeskin()
{
	name = window.location.href; 
	name = name.toLowerCase();
	var a = name.substring(0, name.indexOf('content'));
	var b = "\default_CSH.htm#";
	var c = name.substring(name.indexOf('content') + 8);
	var d = "\|Default";
	window.name = null;
	parent.location.href = a + b + c + d;
}

function mailpage(name)
{
	// get location of the document

	// Make sure title is OK
	var theTitle = (document.title) ? "\"" + document.title + "\"" :  " this";
	var mail_str = "?subject=For your review: "
		+ encodeURIComponent(theTitle)
		+ "&body="
		+ encodeURIComponent("I thought you might be interested in the following Technical Support article: ")
		+ encodeURIComponent("\n \n")
		+ encodeURIComponent("Article Title: ")
		+ encodeURIComponent(theTitle)
		+ encodeURIComponent("\n \n")
		+ encodeURIComponent("You can view it at: ")
		+ encodeURIComponent(name);
	var mailstring = document.getElementById('mailthis').href;
	document.getElementById('mailthis').href = "mailto:" + mail_str
	return false;
}
 