
function toggle_portfolio_dropdown ( targetId, text1 ){
  if (document.getElementById){
  		target = document.getElementById( targetId );
  			
		div1 = 	document.getElementById( 'ws_ul' );
		div2 = 	document.getElementById( 'oa_ul' );
		div3 = 	document.getElementById( 'dcp_ul' );
		ul 	 =  document.getElementById( 'firstcol');
			
		div1.style.display = "none";
		div2.style.display = "none";
		div3.style.display = "none";
		target.style.display = "";
		
		if ( innerTxt =  document.getElementById('firstboxselect')) {
			innerTxt.innerHTML = text1;  	
		   }

  	}
}

function toggle( targetId ){

  if (document.getElementById){

  		target = document.getElementById( targetId );

  			if (target.style.display == "none"){

  				target.style.display = "";

  			} else {

  				target.style.display = "none";

  			}

  	}

}


function openWindow(url, width, height, left, top, name, scroll, resize) {
	if (width == null) width = 500;
	if (height == null) height = 400;
	if (left == null) left = 10;
	if (top == null) top = 10;
	if (name == null) name = 'tjd_popup';
	if (scroll == null) scroll = 'no';
	if (resize == null) resize = 'no';

	window.open(url, name, 'toolbar=no,location=no,status=no,directories=no,menubar=no,scrollbars='+scroll+',resizable='+resize+',width='+width+',height='+height+',left='+left+',top='+top, 'replace=false');
}

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

function insertAfter(newElement,targetElement) {
  var parent = targetElement.parentNode;
  if (parent.lastChild == targetElement) {
    parent.appendChild(newElement);
  } else {
    parent.insertBefore(newElement,targetElement.nextSibling);
  }
}

function addClass(element,value) {
  if (!element.className) {
    element.className = value;
  } else {
    newClassName = element.className;
    newClassName+= " ";
    newClassName+= value;
    element.className = newClassName;
  }
}
