// JavaScript Document
function addEvent( obj, type, fn ){  // the add event function
	if (obj.addEventListener) obj.addEventListener( type, fn, false );
	else if (obj.attachEvent) {
	  obj["e"+type+fn] = fn;
	  obj[type+fn] = function() {
		obj["e"+type+fn]( window.event );
	  };
	  obj.attachEvent( "on"+type, obj[type+fn] );
	}
}
//open popup window
var myWindow;
function openCenteredWindow(url, width, height) {
    var left = parseInt((screen.availWidth/2) - (width/2));
    var top = parseInt((screen.availHeight/2) - (height/2));
    var windowFeatures = "width=" + width + ",height=" + height + 
        ",status,resizable,left=" + left + ",top=" + top + 
        ",screenX=" + left + ",screenY=" + top + ", status=no";
    myWindow = window.open(url, "DigitalCopiers", windowFeatures);
}
//open normal window
function openCenteredNormal(url, width, height) {
    var left = parseInt((screen.availWidth/2) - (width/2));
    var top = parseInt((screen.availHeight/2) - (height/2));
    var windowFeatures = "width=" + width + ",height=" + height + 
        ",status,resizable,left=" + left + ",top=" + top + 
        ",screenX=" + left + ",screenY=" + top + ", status=yes, menubar=yes, scrollbars=yes";
    myWindow = window.open(url, "DigitalCopiers", windowFeatures);
}
// add to favorites
function addBookmark(title,url) {
	if (window.sidebar) { 
		window.sidebar.addPanel(title, url,""); 
	} else if( document.all ) {
		window.external.AddFavorite( url, title);
	} else if( window.opera && window.print ) {
		return true;
	}
}
// BB Forum emoticons custom function
function emoticon(field,text){
    var post = document.getElementById(field);
    
    post.value = post.value+' '+text;
}