// JavaScript Document

var domainroot="www.dlcinc.com"

function Gsitesearch(curobj){
	curobj.q.value="site:"+domainroot+" "+curobj.qfront.value
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function openpage(theUrl,W,H){
    var theWin ="'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width="+W+",height="+H+"'"
	littleWin = window.open(theUrl,'opened',theWin);
	littleWin.resizeTo(W+10,H+29);
 	littleWin.focus();
}

//window.onload=montre;
function montre(id) {
	var d = document.getElementById(id);
	if (d) {
		d.style.display='block';
		highlightLink(d);
	}

	for (var i = 1; i<=13; i++) {
		var e = document.getElementById('smenu'+i);
		if (e && e != d) {
			e.style.display='none';
		}
	}

	for (var i = 1; i<=13; i++) {
		if (document.getElementById('smenu'+i+"a")) {
			document.getElementById('smenu'+i+"a").className=null;
		}
	}
	if (id) {
		var e = document.getElementById(id + "a");
		if (e) {
			e.className="highlight";
		}
	}

}


function t()  {
	if (window.location.pathname.match("company")) {
	montre('smenu1');
	}
	if (window.location.pathname.match("news")) {
	montre('smenu2');
	}
	if (window.location.pathname.match("services")) {
	montre('smenu3');
	}
	if (window.location.pathname.match("solutions")) {
	montre('smenu4');
	}
	if (window.location.pathname.match("ourindustry")) {
	montre('smenu5');
	}
	if (window.location.pathname.match("clients")) {
	montre('smenu6');
	}
	if (window.location.pathname.match("industries")) {
	montre('smenu7');
	}
	if (window.location.pathname.match("careers")) {
	montre('smenu8');
	}
	if (window.location.pathname.match("contact")) {
	montre('smenu9');
	}
}

var print = false;
function togglePrint() {
	if (print) {
		v();
		print = false;
	} else {
		u();
		print = true;
	}
}

function u() {
	var w = document.getElementById("header");
	w.style.display = "none";
	var w = document.getElementById("leftcolumn");
	w.style.display = "none";
	var w = document.getElementById("rightcolumn");
	w.style.display = "none";
	var w = document.getElementById("footer1");
	w.style.display = "none";
	var w = document.getElementById("footer2");
	w.style.display = "none";

	var p = document.getElementById("pcontent");
	p.className = "print";
	p.style.display = "block";
}

function v() {
	var w = document.getElementById("header");
	w.style.display = "block";
	var w = document.getElementById("leftcolumn");
	w.style.display = "block";
	var w = document.getElementById("rightcolumn");
	w.style.display = "block";
	var w = document.getElementById("footer1");
	w.style.display = "block";
	var w = document.getElementById("footer2");
	w.style.display = "block";

	var p = document.getElementById("pcontent");
	p.className = "no_print";
}

function v() {
	if (document.location.search.match("print")) {
		u();
	}
}

function openPrint() {
	window.open( document.location.href.replace("#", "") + "?print", 'popupwindow', 
  'width=530,height=600,scrollbars,resizable,toolbar,menubar')
}

function highlightLink(node) {

	if (node) {

		if (node.nodeName == "A") {

			var s = document.location.pathname;
			if (node.href.match(s) && !s.match(/\/$/)) {				

				node.className = "highlightLink";
			}
			return;
		}

		var children = node.childNodes
		if (children) {
			for (var i = 0; i < children.length; i++) {	
				var child = children[i];
				if (child.hasChildNodes()) {
					highlightLink(child);
				}
			}
		}
	}
}

