
var timeout         = 400;
var closetimer		= 0;
var ddmenuitem      = 0;

function popup650x1000(mylink, windowname) {
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, 'width=650,height=1000,scrollbars=yes');
return false;
}

function mopen(id) {
mcancelclosetime();
if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
		ddmenuitem = document.getElementById(id);
		ddmenuitem.style.visibility = 'visible';
}

function mclose() {
if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
}

function mclosetime() {
closetimer = window.setTimeout(mclose, timeout);
}

function mcancelclosetime() {
if(closetimer) {
	window.clearTimeout(closetimer);
	closetimer = null;
	}
}

document.onclick = mclose; 

function popUp(url,name,param) {
name=window.open(url,name,param)
if(window.focus) {
	name.focus()
	}
}

function openNewWindow(URLtoOpen, windowName, windowFeatures) {
window.open(URLtoOpen, windowName, windowFeatures);
if(window.focus) {
	name.focus()
	}
}

function loadMenu(){
	$('#nlOuterWrapper').load('/tools/inc/adsmenu.html', function(){
		setCrumbs();
	});
	
}
function loadContent(){
	$('#contentContainer').load('/ads/uploads/ubr_file_upload_insert.php');
}
function setCrumbs(){

	var vcompany = document.getElementById("nlCompany");
	var vservices = document.getElementById("nlServices");
	var vsupport = document.getElementById("nlSupport");
	var vportfolio = document.getElementById("nlPortfolio");
	var vprojects = document.getElementById("nlProjects");
	var vcommunity = document.getElementById("nlCommunity");
	var vextras = document.getElementById("nlExtras");

	var uri = encodeURI(window.location.href).toLowerCase();
	var suri = uri.toString();
	
	if(suri.indexOf("company") !=-1) {
	vcompany.className += " nlCurrent ";
	}
	
	if(suri.indexOf("services") !=-1) {
	vservices.className += " nlCurrent ";
	}

	if(suri.indexOf("support") !=-1) {
	vservices.className += " nlCurrent ";
	}
	
	if(suri.indexOf("portfolio") !=-1) {
	vclients.className += " nlCurrent ";
	}	

	if(suri.indexOf("projects") !=-1) {
	vdownloads.className += " nlCurrent ";
	}
	
	if(suri.indexOf("community") !=-1) {
	vcommmunity.className += " nlCurrent ";
	}

	if(suri.indexOf("extras") !=-1) {
	vextras.className += " nlCurrent ";
	}

}

