
var SetTimeOutPeriod;
function PlayVideo(divname,filename,picturename)
{
  var so = new SWFObject('http://www.nationalable.org/player.swf','mpl','200','180','9');
  so.addParam('allowfullscreen','true');
  so.addParam('allowscriptaccess','always');
  so.addParam('wmode','opaque');
  so.addVariable('file','http://www.nationalable.org/Video_Audio/' + filename);
  so.addVariable('image','http://www.nationalable.org/images/' + picturename);
  so.write(divname);	
}
/*
function SendEmpSurvey()
{
	var open1, open2, open3, open4, skills1, skills2, skills3, skills4 = "";	
	open1 = document.FormMail.open1.value;
	open2 = document.FormMail.open2.value;
	open3 = document.FormMail.open3.value;
	open4 = document.FormMail.open4.value;
	skills1 = document.FormMail.skills1.value;
	skills2 = document.FormMail.skills1.value;
	skills3 = document.FormMail.skills1.value;
	skills4 = document.FormMail.skills1.value;
	
	if (window.XMLHttpRequest)
	  {
	  // code for IE7+, Firefox, Chrome, Opera, Safari
	  xmlhttp=new XMLHttpRequest();
	  }
	else if (window.ActiveXObject)
	  {
	  // code for IE6, IE5
	  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	  }
	else
	  {
	  alert("Your browser does not support XMLHTTP!");
	  }
	xmlhttp.onreadystatechange=function()
	{
		if(xmlhttp.readyState==4)
	  {
		
	  }
	}
	
xmlhttp.open("POST",'http://www.nationalable.org/EmailAccessRegistrations.asp?company='+company+'&room='+room+'&address='+address+'&city='+city+'&phone='+phone+'&email='+email+'&state='+state+'&zip='+zip+'&contact='+contact+'&contact_title='+contact_title+'&fax='+fax+'&outlet='+outlet+'&oversized='+oversized+'&categories='+categories+'&business_type='+business_type ,true);
xmlhttp.send('');
window.location = "regresult.html";
}
*/
function launchApp(strCmdLine)
  {
	var obj = new ActiveXObject("LaunchinIE.Launch");
    obj.LaunchApplication(strCmdLine);	
  }

function SendRegistrationMail()
{
	var xmlhttp;
	var company, business_type, address, city, state, zip, contact, contact_title, phone, fax, email, outlet, oversized, categories, room, room_text;
	room = document.FormMail.room;
	room_text = "";
for (i=0; i<room.length; i++)

  if (room[i].checked == true)
  {
		room_text = room[i].value;
  }
	
	
	company = document.FormMail.company.value;
	address =document.FormMail.address.value;
	city = document.FormMail.city.value;
	state = document.FormMail.state.value;
	zip = document.FormMail.zip.value;
	contact = document.FormMail.contact.value;
	contact_title = document.FormMail.contact_title.value;
	phone = document.FormMail.phone.value;
	fax = document.FormMail.fax.value;
	email = document.FormMail.email.value;
	business_type = document.FormMail.business_type.value;
	outlet = 'Outlet needed';
	oversized = 'Oversized exhibit';
	
	if(document.FormMail.outlet.checked == false)
		outlet = 'Outlet not needed';

	if(document.FormMail.oversized.checked == false)
		oversized = 'Not an oversized exhibit';
		
	categories = "";
	if(document.FormMail.a.checked == true)
		categories = 'Administrative, ';
	if(document.FormMail.b.checked == true)
		categories += 'Professional, ';
	if(document.FormMail.c.checked == true)
		categories += 'Technical, ';
	if(document.FormMail.d.checked == true)
		categories += 'Sales, ';
	if(document.FormMail.e.checked == true)
		categories += 'Clerical, ';
	if(document.FormMail.f.checked == true)
		categories += 'Managerial, ';
	if(document.FormMail.g.checked == true)
		categories += 'Service, ';
	if(document.FormMail.h.checked == true)
		categories += document.FormMail.OtherOcc.value + '.';

	
	if (window.XMLHttpRequest)
	  {
	  // code for IE7+, Firefox, Chrome, Opera, Safari
	  xmlhttp=new XMLHttpRequest();
	  }
	else if (window.ActiveXObject)
	  {
	  // code for IE6, IE5
	  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	  }
	else
	  {
	  alert("Your browser does not support XMLHTTP!");
	  }
	xmlhttp.onreadystatechange=function()
	{
		if(xmlhttp.readyState==4)
	  {
		
	  }
	}
	if((room_text != "") && (company != ""))
	{
		xmlhttp.open("POST",'http://www.nationalable.org/EmailAccessRegistrations.asp?company='+company+'&room='+room_text+'&address='+address+'&city='+city+'&phone='+phone+'&email='+email+'&state='+state+'&zip='+zip+'&contact='+contact+'&contact_title='+contact_title+'&fax='+fax+'&outlet='+outlet+'&oversized='+oversized+'&categories='+categories+'&business_type='+business_type ,true);
		xmlhttp.send('');
		window.location = "regresult.html";
	}
	else
	{
		window.alert("Please fill out all the required fields.");
	}
}

function SendMail(Type)
{

var Content;
var QuestionType;
var Name;
var Company;
var Phone;
var Email;
var Subject;

if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else if (window.ActiveXObject)
  {
  // code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
else
  {
  alert("Your browser does not support XMLHTTP!");
  }
xmlhttp.onreadystatechange=function()
{
if(xmlhttp.readyState==4)
  {
  	document.getElementById("Response").innerHTML = "Your question was submitted successfully.";
  }
}
Content = document.FormMail.Content.value;
if(Type != "")
{
	QuestionType = document.FormMail.QuestionType.value;
}
else
{
	QuestionType = "";
}
Name = document.FormMail.Name.value;
Company = document.FormMail.Company.value;
Phone = document.FormMail.Phone.value;
Email = document.FormMail.Email.value;
Subject = document.FormMail.Subject.value;
xmlhttp.open("POST",'http://www.nationalable.org/SendMail.asp?Content='+Content+'&QuestionType='+QuestionType+'&Name='+Name+'&Company='+Company+'&Phone='+Phone+'&Email='+Email+'&Subject='+Subject ,true);
xmlhttp.send('');
}

function CheckMailForm(form)
{
	if(form.Email.value == null || form.Email.value == "")
	{
		alert("Please provide us with your e-mail address so we may reach you with an answer.");
		form.Email.focus();
		return false;
	}
	
	if(form.Content.value == null || form.Content.value == "")
	{
		alert("Please tell us what you are inquiring about.");
		form.Content.focus();
		return false;
	}

	return true;
}

function calcage(secs, num1, num2) {
  s = ((Math.floor(secs/num1))%num2).toString();
  if (LeadingZero && s.length < 2)
    s = "0" + s;
  return "<b>" + s + "</b>";
}

function CountBack(secs) {
  if (secs < 0) {
    document.getElementById("cntdwn").innerHTML = FinishMessage;
    return;
  }
  DisplayStr = DisplayFormat.replace(/%%D%%/g, calcage(secs,86400,100000));
  DisplayStr = DisplayStr.replace(/%%H%%/g, calcage(secs,3600,24));
  DisplayStr = DisplayStr.replace(/%%M%%/g, calcage(secs,60,60));
  DisplayStr = DisplayStr.replace(/%%S%%/g, calcage(secs,1,60));

  document.getElementById("cntdwn").innerHTML = DisplayStr;
  if (CountActive)
    setTimeout("CountBack(" + (secs+CountStepper) + ")", 1000);	
}

function putspan(backcolor, forecolor) {
 document.write("<span id='cntdwn' style='background-color:" + backcolor + 
                "; color:" + forecolor + "'></span>");
}

function startTimer(date)
{
	
	if (typeof(BackColor)=="undefined")
	  BackColor = "white";
	if (typeof(ForeColor)=="undefined")
	  ForeColor= "black";
	if (typeof(TargetDate)=="undefined")
	  TargetDate = date;
	if (typeof(DisplayFormat)=="undefined")
	  DisplayFormat = "%%D%% D, %%H%% Hr, %%M%% Min, %%S%% Sec";
	if (typeof(CountActive)=="undefined")
	  CountActive = true;
	if (typeof(FinishMessage)=="undefined")
	  FinishMessage = "";
	if (typeof(CountStepper)!="number")
	  CountStepper = -1;
	if (typeof(LeadingZero)=="undefined")
	  LeadingZero = true;
		
	
	CountStepper = Math.ceil(CountStepper);
	if (CountStepper == 0)
	  CountActive = false;
	SetTimeOutPeriod = (Math.abs(CountStepper)-1)*1000 + 990;
	putspan(BackColor, ForeColor);
	var dthen = new Date(date);
	var dnow = new Date();
	if(CountStepper>0)
	  ddiff = new Date(dnow-dthen);
	else
	  ddiff = new Date(dthen-dnow);
	  
	gsecs = Math.floor(ddiff.valueOf()/1000);
	
	CountBack(gsecs);	
}

function getDescription(txt,id){

for (i = 1;i < (num+1);i++)
	{
	   document.getElementById(i).style.backgroundColor = "#FFFFFF";
	}
	document.getElementById(id).style.backgroundColor = "#DCDCDC";
	
	if( typeof XMLHttpRequest == "undefined" )
	{
		var httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
	}
	else{
		var httpRequest = new XMLHttpRequest();
	}
	httpRequest.open('GET', txt, false);
	httpRequest.send(null);
	document.getElementById('director').innerHTML=httpRequest.responseText;	
	
	return false;
}

function showPublication(name,id)
{
	for (i = 1;i < (num+1);i++)
	{
	   document.getElementById(i).style.backgroundColor = "#FFFFFF";
	}
	document.getElementById(id).style.backgroundColor = "#DCDCDC";
	document.getElementById('director').innerHTML='<object data="Publications/' + name + '" type="application/pdf" width="478" height="695">alt : <a href="Publications/' + name + '">' + name +'</a></object>';
}

function getContactInfo(name, id)
{
	for (i = 1;i < (num+1);i++)
	{
	   document.getElementById(i).style.backgroundColor = "#FFFFFF";
	}
	document.getElementById(id).style.backgroundColor = "#DCDCDC";
	document.getElementById('director').innerHTML='<b>' + document.getElementById(name).innerHTML + '</b>';
}

function getBulletPts(name)
{
	if (name == 'job_seekers')
	{
		document.getElementById('desc').innerHTML = '<font color="#616584"><b>Job Seeker Services</b></font><br>' +
													'<ul class="jobseekers"><li><font color="black">Career development service and job placement assistance</font></li>' +
													'<li><font color="black">Remedial and vocational skills training</font></li>' +
													'<li><font color="black">Multi-level computer applications training</font></li>' +
													'<li><font color="black">Job readiness preparation including resume writing and mock interviews</font></li>' +
													'<li><font color="black">Community network referrals</font></li></ul>';
	}
	else if (name == 'employer_services')
	{
				document.getElementById('desc').innerHTML = '<font color="#578886"><b>Employer Services</b></font><br>' +
													'<ul class="empservices"><li><font color="black">Provides qualified, pre-screened candidates matched to employer requirements</font></li>' +
													'<li><font color="black">Recruiting expertise that has a cost benefit to employers</font></li>' +
													'<li><font color="black">Outplacement services for companies experiencing downsizing</font></li>' +
													'<li><font color="black">Temporary staffing resources</font></li>' +
													'<li><font color="black">Community network referrals</font></li></ul>';	
	}
	else if (name == 'community_services')
	{
				document.getElementById('desc').innerHTML = '<font color="#5D7054"><b>Community Services</b></font><br>' +
													'<ul class="comservices"><li><font color="black">Subsidized training and employment programs</font></li>' +
													'<li><font color="black">Internet-based job listings</font></li>' +
													'<li><font color="black">Job fair participation and referrals</font></li>' +
													'<li><font color="black">Integration of community resources and service programs</font></li>';
	}
}
function initializeMap() {
	if (GBrowserIsCompatible()) {
		var la = document.desc.la.value;
		var lo = document.desc.lo.value
		var map = new GMap2(document.getElementById("map_canvas"));
		map.setCenter(new GLatLng(la,lo), 15);
				
		var html =	'<br><form action="http://maps.google.com/maps" method="get" target="_blank">' +
					'<table><tr><td><label for="saddr"><font color="#406B7B" size="2" face="Verdana"><b>Address:</b></font></label></td>' +
					//'<input type="text" name="saddr" id="saddr"/></td></tr>' +
					'<td><font color="#406B7B" size="2" face="Verdana">' + document.desc.street.value + '<br>' + document.desc.city.value + ', ' + document.desc.zip_state.value + '<br>';
					
					if((document.desc.phone.value != ""))
					{
						html = html + document.desc.phone.value + '<br>';
					}
					
					if((document.desc.tty.value != ""))
					{
						html = html + document.desc.tty.value + '<br>';
					}
					if(document.desc.fax.value != "")
					{
						html = html + document.desc.fax.value + '<br>';
					}
					
					
		html = html + '</font></td></tr><tr><td colspan="2" align="right"><input type="submit" width="20" value="Get Directions" /></td></tr></table><input type="hidden" name="daddr" value="' + document.desc.location_address.value +  '">' +
					'<input type="hidden" name="hl" value="en" />' +
					'</form>';
					
        var iconG = new GIcon(); 
        iconG.image = '../images/icon.png'; 
        iconG.iconSize = new GSize(20, 40); 
        iconG.shadowSize = new GSize(22, 20); 
        iconG.iconAnchor = new GPoint(6, 20); 
        iconG.infoWindowAnchor = new GPoint(6, 6); 		
		var point = new GLatLng(la,lo);
		var marker = new GMarker(point, iconG);
		GEvent.addListener(marker, "click", function() {
		  marker.openInfoWindowHtml(html);
		});
		
		map.addOverlay(marker);
		marker.openInfoWindowHtml(html);
		map.addControl(new GSmallMapControl());
	}
}