window.onerror = handleErrors; // or null to suppress error message
function handleErrors(msg, url, line)
 { return true; }
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; 
	for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; 
  if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
// popup
function popup(URL) {
var wda = 790;
var hta = 571;
var wint = (screen.height - hta) / 2;
var winl = (screen.width - wda) / 2;
wina = window.open(URL, 'main', 'width=790,height=571,top='+wint+',left='+winl+',scrollbars=yes')
if (parseInt(navigator.appVersion) >= 4) { wina.window.focus(); }
}
// add to favorites
function bookmark(){
window.external.AddFavorite(document.location,document.title);
var url=document.location;
var title=document.title;
}

function setTotal()
{
  //theform.card_amt.value=1095
  if(theform.Spouse.checked)
  {
    theform.card_amt.value = parseInt(theform.card_amt.value) + 295
  } else {
    theform.card_amt.value = parseInt(theform.card_amt.value) - 295
  }
  
  
}

function validate() {
	var msg='';
	if(document.theform.first.value == '')	
		{ msg=msg+"First Name \r"; }
	if(document.theform.last.value == '')
		{ msg=msg+"Last Name \r"; }
	if(document.theform.coname.value.length < 3)
		{ msg=msg+"Company Name \r";}
	if(document.theform.phone.value.length < 7)
		{ msg=msg+"Phone Number \r";}
	if(document.theform.address.value.length < 5)
		{ msg=msg+"Address \r";}
	if(document.theform.city.value.length < 3)
		{ msg=msg+"City \r";}
//	if(document.theform.state.value == '')
//		{ msg=msg+"State \r"; }
//	if(document.theform.zip.value.length < 5)
//		{ msg=msg+"Zip/Country Code \r";}
	str=document.theform.email.value;
	if((str.indexOf(".") > 0) && (str.indexOf("@") > 0))
		{ }
		else
		{ msg=msg+" - Valid Email Address \r"; }
	if(msg.length > 0)	
		{ alert("Please correct the following input errors:  \r" + msg); 
		return false;
		}
	if(msg.length == 0)	
		{ document.theform.submit(); }	
}	

var to
function showNext( i )
{
	clearTimeout( to );
	if(i == items.length)
	{
		i = 0;
	}
	if(document.all)
		news.innerHTML = items[ i ];
	if(document.layers)
	{
		document.layers.news.document.open();
		document.layers.news.document.write(items[ i ]);
		document.layers.news.document.close();
	}
	if( items[ i ].indexOf( "href" ) >= 0 ) tm = 25; else tm = 50;
	to = setTimeout( "showNext( "+ ++i +" )", 500 + items[ i - 1 ].length * tm );
}
items = new Array()
items[0] = "<div class=bnr1>Who Should Attend:<br>R & D Managers</div>Discover the latest research on the health benefits of whey protein."
items[1] = "<div class=bnr1>Who Should Attend:<br>Whey Marketers</div>Explore the benefits of whey proteins for consumers and see new products using whey proteins."
items[2] = "<div class=bnr1>Who Should Attend:<br>Operations Managers</div>Learn the newest techniques of processing whey proteins."
items[3] = "<div class=bnr1>Who Should Attend:<br>Sales Managers</div>Find out why whey proteins are better than other competitive proteins."
items[4] = "<div class=bnr1>Who Should Attend:<br>Whey Buyers</div>Learn about the value-added characteristics of whey ingredients in food & beverage products."
to = setTimeout( "showNext(0)", 1000 );
