var ORD_STATUS = false;
var MDW_STATUS = false;
var MIL_STATUS = false;
var ROC_STATUS = false;
var ORD = "ORD";
var MDW = "MDW";
var MIL = "MIL";
var ROC = "ROC";

var TECH_STATUS = false;
var ADMIN_STATUS = false;
var MGR_STATUS = false;
var TECH = "tech";
var ADMIN = "admin";
var MGR = "mgr";

var IMG_DISPLAYED = 1;

var SLIDE_MAN = 1;
var SLIDE_AUTO = 2;


function writeLogo()
{
	var date = new Date();
	document.write("<td width=20% class=logo align='center' valign=middle onMouseOver='hideSubMenu()'>");
																											  document.write("<IMG ALT='Bley LLC' SRC='images/Bley_logo_Sml.jpg'>");
	document.write("</td>");
}

function writeSearch()
{
	//Photo
			document.write("<fieldset style=font-size:11>");
					document.write("<legend align='left' style=color:#ffffff><b>Photo Gallery</b></legend>");
			document.write("Services, Products and Company Events... ");			
			
			document.write("<center>");
					document.write("<A HREF='photoGallery.html' border=0 onMouseOver='changeImage(\"photo\",\"images/Camera1.gif\")' onMouseOut='changeImage(\"photo\",\"images/Camera2.gif\")'><IMG ALT='Bley Photos' border=0 SRC='images/Camera2.gif' name=photo></A>");
			document.write("</center>");	
			document.write("</fieldset>");
			
			document.write("<P>");
			
	//Search 
			/*document.write("<fieldset style=font-size:11>");
					document.write("<legend align='left' style=color:#ffffff>Web Assistant</legend>");
			document.write("<BR>");
			document.write("Enter a keyword or expression here to search for specific information on Bley");
			document.write("<BR>");
			document.write("<input type=text name=search size=20><BR><BR>");
			document.write("<A HREF='index.html' CLASS='buttontext'	onMouseOver='this.className=\"buttonover\";' onMouseOut='this.className=\"buttontext\";'>");
				document.write("<DIV ID='buttonV' style='width:30'>Search..</DIV></A>");			
			document.write("<P>");
			document.write("</fieldset>");*/
			document.write("&nbsp");
	
}


function writeDocsAndArchives()
{
	document.write("<BR><fieldset>");
		document.write("<legend><b>Company Brochure</b></legend>");
					document.write("<center>");
					document.write("<IMG ALT='Bley PDF' HEIGHT=30 SRC='images/document.gif' WIDTH=20>");
					document.write("<BR><I>PDF Format (coming soon)</I>");
					document.write("</center>");	 
	document.write("</fieldset>");				 
	document.write("<P>");
	document.write("<fieldset>");
		document.write("<legend><b>Archives</b></legend>");
					document.write("<B>November 2005</B><BR>");
					document.write("Bley adds a high speed machining center.");
					document.write("<BR><BR>");
					document.write("<B>September 2005</B><BR>");
					document.write("Bley adds VTL to meet growth expectations.");
					document.write("<BR><BR>");
					document.write("<B>June 2005</B><BR>");
					document.write("Installs boring mill to meet customer demands.");			
	document.write("</fieldset>"); 		
}

function writeCopyWrite()
{
	document.write("<td colspan=2 class='copyright' align='center'>");
			document.write("<BR><A HREF='contactUs.html' CLASS='buttonBlueText'>Contact Us</A>&nbsp;|&nbsp;<A HREF='javascript:privacyStatement();' CLASS='buttonBlueText'>Privacy Statement</A><BR>");
			document.write("Copyright &copy; 2005 Bley LLC. All Rights Reserved.<BR>"); 
	document.write("</td>");
}

function privacyStatement()
{
	var wnd = window.open("privacyStatement.html","","scrollbars=yes,resizable=yes,width=350,height=350");
}

function bleyGermany()
{
	var wnd = window.open("http://www.bley-maschinenbau.de","","location=yes,menubar=yes,titlebar=yes,status=yes,toolbar=yes,resizable=yes,scrollbars=yes,width=450,height=350");
}

function polyMount()
{
	var wnd = window.open("http://www.bleyproducts.com","","location=yes,menubar=yes,titlebar=yes,status=yes,toolbar=yes,resizable=yes,scrollbars=yes,width=450,height=450");
}

function enlargeImage(imgURL)
{
	var imgWnd = window.open("","","titlebar=yes,status=yes,resizable=yes,scrollbars=yes,width=450,height=450");
	imgWnd.document.write("<HTML><HEAD><LINK HREF='style.css' MEDIA=screen REL=stylesheet TYPE=text/css></HEAD>");
	imgWnd.document.write("<BODY class=index><IMG ALT='Laser Welding' border=0 SRC='images/"+imgURL+"'></BODY></HTML>");
}

function photoGallery(URL,slideType)
{
	if(slideType == SLIDE_MAN){
	var imgWnd = window.open(URL,"","titlebar=yes,status=yes,resizable=yes,scrollbars=yes,width=600,height=500");
	}
	else{
		var imgWnd = window.open(URL,"","titlebar=yes,status=yes,resizable=yes,scrollbars=yes,width=650,height=500");
	}
}

function changeImage (element,imgUrl) {
document.all[element].src = imgUrl;
}


function displayDirections(fromCode)
{
   if(fromCode == ORD)
   {
      if(ORD_STATUS == false){
	  	 document.all["from"+fromCode].style.display = "list-item";
		 ORD_STATUS = true;
	  }else{
	  	 document.all["from"+fromCode].style.display = "none";
		 ORD_STATUS = false;  	
	  }
   }
   else if(fromCode == MDW)
   {
      if(MDW_STATUS == false){
	  	 document.all["from"+fromCode].style.display = "list-item";
		 MDW_STATUS = true;
	  }else{
	  	 document.all["from"+fromCode].style.display = "none";
		 MDW_STATUS = false;  	
	  }
   }
   else if(fromCode == MIL)
   {
      if(MIL_STATUS == false){
	  	 document.all["from"+fromCode].style.display = "list-item";
		 MIL_STATUS = true;
	  }else{
	  	 document.all["from"+fromCode].style.display = "none";
		 MIL_STATUS = false;  	
	  }
   }
   else if(fromCode == ROC)
   {
      if(ROC_STATUS == false){
	  	 document.all["from"+fromCode].style.display = "list-item";
		 ROC_STATUS = true;
	  }else{
	  	 document.all["from"+fromCode].style.display = "none";
		 ROC_STATUS = false;  	
	  }
   }
 }
 
 function displayVacancies(vacType)
 {
 	if(vacType == TECH)
   {
      if(TECH_STATUS == false){
	  	 document.all[vacType].style.display = "list-item";
		 TECH_STATUS = true;
	  }else{
	  	 document.all[vacType].style.display = "none";
		 TECH_STATUS = false;  	
	  }
   }
   else if(vacType == ADMIN)
   {
      if(ADMIN_STATUS == false){
	  	 document.all[vacType].style.display = "list-item";
		 ADMIN_STATUS = true;
	  }else{
	  	 document.all[vacType].style.display = "none";
		 ADMIN_STATUS = false;  	
	  }
   }
   else if(vacType == MGR)
   {
      if(MGR_STATUS == false){
	  	 document.all[vacType].style.display = "list-item";
		 MGR_STATUS = true;
	  }else{
	  	 document.all[vacType].style.display = "none";
		 MGR_STATUS = false;  	
	  }
   }
 }
 
 function displayFirst(galCd,firstImgNbr,lastImgNbr)
 {
	 var imgNbr = firstImgNbr +1;
	 for(var i=imgNbr;i<=lastImgNbr;++i) {
		 document.all[galCd+i].style.display = "none";		 
	 }
	 document.all[galCd+firstImgNbr].style.display = "list-item";
	 IMG_DISPLAYED = firstImgNbr;
	 
	 document.all["first"].disabled = false;
	 document.all["next"].disabled = false;
	 document.all["prev"].disabled = true;
	 document.all["last"].disabled = false;
 }
 
 function displayLast(galCd,firstImgNbr,lastImgNbr)
 {
	 for(var i=firstImgNbr;i<lastImgNbr;++i) {
		 document.all[galCd+i].style.display = "none";		 
	 }
	 document.all[galCd+lastImgNbr].style.display = "list-item";	 
	 IMG_DISPLAYED = lastImgNbr;
	 
	 document.all["first"].disabled = false;
	 document.all["next"].disabled = true;
	 document.all["prev"].disabled = false;
	 document.all["last"].disabled = false;
 }
 
 function displayNext(galCd,firstImgNbr,lastImgNbr)
 {
	 var imgNbr = IMG_DISPLAYED + 1;
	 if(imgNbr >= firstImgNbr && imgNbr <= lastImgNbr){
	 	for(var i=firstImgNbr;i<=lastImgNbr;++i) {
			if(i == imgNbr)
				document.all[galCd+imgNbr].style.display = "list-item";
			else	
		 		document.all[galCd+i].style.display = "none";		 
	 	}	 	
	 	IMG_DISPLAYED = imgNbr;
	 }
	 
	if(imgNbr == lastImgNbr){
	 	document.all["next"].disabled = true;
		document.all["prev"].disabled = false;
	 }
		
 }
 
 function displayPrev(galCd,firstImgNbr,lastImgNbr)
 {
	 var imgNbr = IMG_DISPLAYED - 1;
	 if(imgNbr >= firstImgNbr && imgNbr <= lastImgNbr){
	 	for(var i=firstImgNbr;i<=lastImgNbr;++i) {
		 	if(i == imgNbr)
				document.all[galCd+imgNbr].style.display = "list-item";
			else	
		 		document.all[galCd+i].style.display = "none";			 
	 	}
	 	IMG_DISPLAYED = imgNbr;
	 }
	 
	 if(imgNbr == firstImgNbr){
	 	document.all["next"].disabled = false;
		document.all["prev"].disabled = true;
	 }
 }
 
 