function sample(fn) {
var X, Y, sl, a, ra, link;
ra = /:/;
a = location.href.search(ra);
if (a == 2)
X = 14;
else
X = 7;
sl = "\\";
Y = location.href.lastIndexOf(sl) + 1;
link = 'file:///' + location.href.substring(X, Y) + '../samples/' + fn;
//location.href = link;
window.open(link, '', 'toolbar,location,scrollbars,resizable');
}

// sidebar collapsing expanding stuff
function doSection (secNum){
//display the section if it's not displayed; hide it if it is displayed
if (secNum.className=="ExpandedText"){secNum.className="ExpandedOpenText"}
else{secNum.className="ExpandedText"}

}

function noSection (secNum){
//remove the section when user clicks in the opened DIV
if (secNum.style.display==""){secNum.style.display="none"}
}

function msiever()
{
	var ua = window.navigator.userAgent;
	var msie = ua.indexOf("MSIE ");
	if (msie > 0) {
		// is Microsoft Internet Explorer; return version number
		return(parseInt(ua.substring(msie+5,ua.indexOf(".", msie))));
	}
	// is other browser
	return(0);
}

function msiecss(){
	if (msiever() >= 4) { // if IE4
	 document.write(
'<STYLE type="text/css">'+
'a.ExpandLink { font-weight: bold; text-decoration: underline; color: blue; cursor: hand }'+
'DIV.ExpandedText { display:none; }'+
'DIV.ExpandedOpenText { display:visible; background-color: #f9f9f9; ; padding-right: 10px; padding-left: 10px; padding-top: 1px; padding-bottom: 8px}'+
'</STYLE>');
	}
	else {
	 document.write(
'<STYLE type="text/css">'+
'a.ExpandLink { font-weight: bold; color: green; }'+
'DIV.ExpandedText { display:visible;}'+
'</STYLE>');
 }
}

