
function init_site(){
	dropdown();

	printCmd = document.getElementById('print');
	
	printCmd.onclick = function(){
		window.print();
	}
		
	bookmarkCmd = document.getElementById('bookmark');
	
	bookmarkCmd.onclick = bookmark;

	var alinks = document.getElementsByTagName("A");
	for(var i=0; i<alinks.length; i++){

		link = alinks[i].getAttribute('href');

		if(/.wma$/.test(link)){
			var wmaObject = top.document.createElement('object');
			var wmaParam1 = top.document.createElement('param');
			var wmaParam2 = top.document.createElement('param');
			var wmaParam3 = top.document.createElement('param');
			var wmaEmbed = top.document.createElement('embed');

			wmaObject.setAttribute('height', '46');
			wmaObject.setAttribute('codebase', 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112');
			wmaObject.setAttribute('type', 'application/x-oleobject');
			wmaObject.setAttribute('standby', 'Loading Windows Media Player components...');
			wmaObject.setAttribute('classid', 'CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95');

			wmaParam1.setAttribute('name', 'FileName');
			wmaParam1.setAttribute('value', link);

			wmaParam2.setAttribute('name', 'Showcontrols');
			wmaParam2.setAttribute('value', 'True');
			wmaParam3.setAttribute('name', 'autoStart');
			wmaParam3.setAttribute('value', 'True');

			wmaEmbed.setAttribute('height', '46');
			wmaEmbed.setAttribute('type', 'application/x-mplayer2');
			wmaEmbed.setAttribute('src', link);
			wmaEmbed.setAttribute('name', 'MediaPlayer');

			wmaObject.appendChild(wmaParam1);
			wmaObject.appendChild(wmaParam2);
			wmaObject.appendChild(wmaParam3);
			wmaObject.appendChild(wmaEmbed);

			linkParent = alinks[i].parentNode;

			linkParent.insertBefore(wmaObject, alinks[i]);
			alinks[i].parentNode.removeChild(alinks[i]);
		}
	}
}

function dropdown() {
	var listElement = document.getElementById("topNav").getElementsByTagName("LI");
	for (var i=0; i<listElement.length; i++) {
		listElement[i].onmouseover=function() {
			this.className+=" hover";
		}
		listElement[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp("hover\\b"), "");
		}
	}
}

function bookmark(){
    var title="Cascade Aids Project"
    var url=location.href

    if (window.sidebar) window.sidebar.addPanel(title, url,"");

    else if( window.opera && window.print )
    {
    	var mbm = document.createElement('a');
    	mbm.setAttribute('rel','sidebar');
    	mbm.setAttribute('href',url);
    	mbm.setAttribute('title',title);
    	mbm.click();
    }

    else if( document.all ) window.external.AddFavorite( url, title);
}