var email_usernames = ['info', 'bralston', 'cjwalsh', 'cwwalsh', 'adennis', 'jdennis', 'jbloom', 'canderson', 'mhaley', 'bbadger', 'dlottero', 'pcombs'];
var email_domain = 'iwvsales.com';
var email_subjects = ['Website Inquiry', 'Website Comment or Suggestion'];

function makeMailto(emailIndex,subjIndex){
	location.href = "mailto:" + email_usernames[emailIndex] + "@" + email_domain + "?subject=" + email_subjects[subjIndex];
}

function popUpA(page,name,w,h,type)
{ 
	name = "foo";
	page = page.split(" ").join("%20");
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	
	if (type == 1) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable,scrollbars,toolbar,menubar,status,location,directories';
	if (type == 2) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable,scrollbars,toolbar,menubar,status,location';
	if (type == 3) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable,scrollbars,toolbar,menubar,status';
	if (type == 4) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable,scrollbars,toolbar,menubar';
	if (type == 5) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable,scrollbars,toolbar';
	if (type == 6) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable,scrollbars';
	if (type == 7) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable';
	if (type == 8) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable,toolbar,menubar,status,location,directories';
	if (type == 9) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable,toolbar,menubar,status,location';
	if (type == 10) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable,toolbar,menubar,status';
	if (type == 11) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable,toolbar,menubar';
	if (type == 12) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable,toolbar';
	if (type == 13) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable,menubar,status,location,directories';
	if (type == 14) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable,menubar,status,location';
	if (type == 15) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable,menubar,status';
	if (type == 16) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable,menubar';
	if (type == 17) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable,status,location,directories';
	if (type == 18) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable,status,location';
	if (type == 19) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable,status';
	if (type == 20) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable,location,directories';
	if (type == 21) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable,location';
	if (type == 22) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable,directories';
	
	if (type == 23) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars,toolbar,menubar,status,location,directories';
	if (type == 24) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars,toolbar,menubar,status,location';
	if (type == 25) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars,toolbar,menubar,status';
	if (type == 26) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars,toolbar,menubar';
	if (type == 27) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars,toolbar';
	if (type == 28) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars';
	if (type == 29) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars,menubar,status,location,directories';
	if (type == 30) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars,menubar,status,location';
	if (type == 31) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars,menubar,status';
	if (type == 32) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars,menubar';
	if (type == 33) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars,status,location,directories';
	if (type == 34) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars,status,location';
	if (type == 35) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars,status';
	if (type == 36) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars,location,directories';
	if (type == 37) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars,location';
	if (type == 38) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars,directories';
	
	if (type == 39) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',directories';
	if (type == 40) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',location';
	if (type == 41) winprop  = 'height='+h+',width='+w+',top='+wint+',left='+winl+',status';
	
	bar = window.open(page, name, winprop);
	bar.focus();
}


function pagePreLoad() {
  var d=document;
  if(d.images){
    if(!d.pL) d.pL=new Array();
    var i,j=d.pL.length,a=pagePreLoad.arguments;
	for(i=0; i<a.length; i++){
      if (a[i].indexOf("#")!=0){
	  d.pL[j]=new Image;
	  d.pL[j++].src=a[i];
	  }
	}
  }
}

function sitePreLoad() {

  var theseImages = new Array(
	'/images/icons/home_u.gif', 
	'/images/icons/company_u.gif',
	'/images/icons/products_u.gif',
	'/images/icons/services_u.gif',
	'/images/icons/solutions_u.gif',
	'/images/icons/contact_u.gif'
	)

  var d=document;
  if(d.images){
    if(!d.pL) d.pL=new Array();
    var i,j=d.pL.length,a=theseImages;
	for(i=0; i<a.length; i++){
      if (a[i].indexOf("#")!=0){
	  d.pL[j]=new Image;
	  d.pL[j++].src=a[i];
	  }
	}
  }
}

function xuzz(table,value) {
eval("document.getElementById('"+table+"').style.display='"+value+"'");
}
function showNewsIntro(thisNum, thisTable, numb, showAll) {
	
	if (showAll == true){
		for (a=1;a<=numb;a++){
		var tblname = (thisTable + a);
		document.getElementById(tblname).style.display='block';
		}
	}
	else
	{
		for (a=1;a<=numb;a++){
		var tblname = (thisTable + a);
	
			if (a == thisNum){
			var state = document.getElementById(tblname).style.display;
			var n = 'none';
			var b = 'block';
			var t = tblname;
			
				if (state != 'block')
				setTimeout(function (){
				xuzz(t,b);
				},400);
				else
				xuzz(t,n);
				
			}
			else
			{
			document.getElementById(tblname).style.display='none';
			}
		}
	}
}