function printpage() {
	var newurl = location.href + "?print=yes";	
	var url = location.href.toString();
	var regex = new RegExp("(.*)\\?(.*)");	
	var match = url.match(regex);
	if(match != null) {
		newurl = match[1] + "?print=yes&" + match[2];
		
	}	
	window.open(newurl,"printwin");
}
function winClose() {
     myWindow.close()
}
var myWindow;
function showMenu(menuId) {
	if (menuId == '99_99_99') {
		myWindow = window.open("welcome.html", "tinyWindow", 'width=550, height=350, left=20, top=20, resizable=0')		
		self.setTimeout('winClose()', 8000)
	}
	else {
		var divname = 'smenu' + menuId + '';
		var regex = new RegExp("smenu(\\d+)_(\\d+)_(\\d+)");
		var matcharray = divname.toString().match(regex);

		var menulink = document.getElementById("menu" + menuId);
		if(menulink)
			menulink.className = "linktextblue";
		if(matcharray != null) {
			level1 = matcharray[1];
			level2 = matcharray[2];
			level3 = matcharray[3];


			menu1 = document.getElementById("smenu" + level1 + "_00_00");
			if (menu1)
			{
				menu1.style["display"] = "block";
				var menulink = document.getElementById("menu" + level1 + "_00_00");
				if(menulink)
					menulink.className = "linktextblue";
			}
			menu2 = document.getElementById("smenu" + level1 + "_" + level2 + "_00");
			if (menu2 && level2 != "00")
			{
				menu2.style["display"] = "block";
				var menulink = document.getElementById("menu" + level1 + "_" + level2 + "_00");
				if(menulink)
					menulink.className = "linktextblue";
			}
		}      
    }
}

function changeLanguage(sessionLanguage, newLanguage) {
	if(newLanguage == "print") return;
	var url = location.href.toString();
	var regex = new RegExp("(.*)\\/" + sessionLanguage + "\\/(.*)");	
	var match = url.match(regex);
	if(match != null) {
		location.href = match[1] + "/" + newLanguage + "/" + match[2];
		
	}
}


function popup(url, width, heigth) {
	var newwindow = window.open (url, "newwindow", "width=" + width + ",heigth=" + heigth + ", location=0,status=0,scrollbars=1,menubar=0"); 
	if (window.focus) {newwindow.focus()}
	return false;
	
}

function listnames(letter) {
	var temp = eval('namesarray[\'' + letter + '\']');
	if(temp) {
		var str = '<ul>';
		for (i = 0; i < temp.length; i++){
			str += '<li>' + temp[i] + '</li>\n';
		}
		str += '</ul>';	
		alert(str);
		var obj = document.getElementById('listnobullets');	
		if(obj) {
			obj.innerHTML = str;
		}
	}
}

function showletterlink() {
	var letters = new Array('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X', 'Y', 'Z');
	var linkstr = '';
	for (var key in letters) {
		linkstr += "<a href='#' onclick='location.hash=\"anchor-"+ letters[key] + "\";'>" + letters[key] + "</a>&nbsp;&nbsp;";
	}
	
	return linkstr;
	
}


var url = "getjobdetails.asp?jID="; // The server-side script
function handleHttpResponse() {   
	if (http.readyState == 4) {
	      if(http.status==200) {
		  var results=http.responseText;
		      document.getElementById('jobdetails').innerHTML = results;
		}
      }
}
       
function GetJobDetails(jId) {                 
    http.open("GET", url + escape(jId), true);
    http.onreadystatechange = handleHttpResponse;
    http.send(null);
}

function getHTTPObject() {
  var xmlhttp;

  if(window.XMLHttpRequest){
    xmlhttp = new XMLHttpRequest();
  }
  else if (window.ActiveXObject){
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    if (!xmlhttp){
        xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
   
}
  return xmlhttp;
}
var http = getHTTPObject(); // We create the HTTP Object


function displayinfo(id) {
	objdiv = document.getElementById(id);
	if(objdiv) {
		if(objdiv.style.display == "none") {
			objdiv.style.display="block";
		}
		else {
			objdiv.style.display="none";
		}
	}
}