var app_path = '';

String.prototype.trim = function () { return this.replace(/^\s*|\s*$/,""); };
String.prototype.underscore = function () { return this.replace(/\s*/,"_"); };

function is_obj(objToTest) { 
// This function checks for valid objects - simpler
    var chk=(objToTest == null || objToTest == undefined)?0:1; return chk;
}

// JavaScript Document
// Onload event listening function
function ld_listener(fn){
	if (typeof window.addEventListener != 'undefined'){
		window.addEventListener('load', fn, false);
	} else if (typeof document.addEventListener != 'undefined'){
		document.addEventListener('load', fn, false);
	} else if (typeof window.attachEvent != 'undefined'){
		window.attachEvent('onload', fn);
	} else {
		var oldfn = window.onload;
		if (typeof window.onload != 'function'){
			window.onload = fn;
		} else {
			window.onload = function(){
				oldfn();
				fn();
			};
		}
	}
}

function attachEventListener(target, eventType, functionRef, capture) {
	if (typeof target.addEventListener != "undefined") {
		target.addEventListener(eventType, functionRef, capture);
	} else if (typeof target.attachEvent != "undefined") {
		var functionString = eventType + functionRef;
		target["e" + functionString] = functionRef;
		target[functionString] = function(event) {
			if(typeof event == "undefined"){event = window.event}; target["e" + functionString](event);
		};
		target.attachEvent("on" + eventType, target[functionString]);
	} else {
		eventType = "on" + eventType;
		if (typeof target[eventType] == "function") {
			var oldListener = target[eventType];
			target[eventType] = function() {
				oldListener();
				return functionRef();
			}
		} else {
			target[eventType] = functionRef;
		}
	}
	return true;
}

// OBJ
function get_obj(idx){ return document.getElementById(idx); }

// ROLLOVER
function ro_init(){
	var divs=document.getElementsByTagName("div");
	for(var i=0;i<divs.length;i++){
		dpattern = /^(msk_no)/;
		if(dpattern.test(divs[i].className)){ ro_setup(divs[i]);	}
	}
}
function ro_setup(obj){
  obj.onmouseover=function(){ this.className='msk_pic'; }
  obj.onmouseout=function(){ this.className='msk_no'; }
  //img.out = new Image(); img.out.src = img.src;	img.onmouseout = rollOut; img.onclick = rollOut;
	//img.over = new Image();	img.over.src = app_path+"/images/"+img.alt+".a.gif"; img.onmouseover = rollOver;
}
function rollOver(){ this.src=this.over.src; }
function rollOut(){ this.src=this.out.src; }
function toggle_layer(id){ if(is_obj(id)){get_obj(id).style.display=(get_obj(id).style.display=='block')?'none':'block'; }}
function set_display(id,dis){	if(is_obj(id)){ get_obj(id).style.display=(dis=='n')?'none':'block'; }}
function set_div(id,dis){	if(is_obj(id)){ get_obj(id).className=(dis=='n')?'hdiv':'sdiv'; }}

function set_opacity(obj, val){	obj.style.opacity = val/10; obj.style.filter = 'alpha(opacity=' + val*10 + ')'; }

function write_email(){
  var dough, rey, me, fah, soul, lah, tea; dough='<a '; rey='@'; me='info'; fah=' href="'; soul='ashburnconsulting.com'; lah='mailto:'; tea='">contact'; if(1<2){ document.write(dough+fah+lah+me+rey+soul+tea+' us</a>'); }
}
function display_email(active){
  var dough, rey, me, fah, soul, lah, tea; dough='<a '; rey='@'; me='info'; fah=' href="'; soul='ashburnconsulting.com'; lah='mailto:'; tea='">'; if(active){ document.write(dough+fah+lah+me+rey+soul+tea+me+rey+soul+'</a>'); } else { document.write(me+rey+soul); }
}
function display_resume_email(active){
  var dough, rey, me, fah, soul, lah, tea; dough='<a '; rey='@'; me='resumes'; fah=' href="'; soul='ashburnconsulting.com'; lah='mailto:'; tea='">'; if(active){ document.write(dough+fah+lah+me+rey+soul+tea+me+rey+soul+'</a>'); } else { document.write(me+rey+soul); }
}