function validateForm (formname,loginemail){
	var errorstring='';
	if (formname=='bullfighter'){
		var cdnum=document.regform.quant_bullfighter_cd.value;	
		if (cdnum){
			if (cdnum<1 || cdnum>12 || isNaN (cdnum)){
			errorstring=errorstring + '   -Enter 1-12 Copies\n';	
			}
		} else {
			errorstring=errorstring + '   -Enter CD Quantity.\n';
		}
	}

	if (formname=='rightsize'){
		var location=document.regform.location.options[document.regform.location.selectedIndex].value; 
		if (location==''){
			errorstring=errorstring + '   -Please Select Event Location\n';
		}
	}

	if (formname=='straighttalk'){
		//Book 1
		var quant_book1=document.regform.quant_book1.value;
		var language1=document.regform.language1.options[document.regform.language1.selectedIndex].value;   
		if (fieldValid (quant_book1,'number',12)==false || isNaN (quant_book1)){
			errorstring=errorstring + '   -Book 1: Enter Quantity (Max. 12 Copies)\n';
		}	
		if (parseInt (quant_book1)>0 && language1==''){
			errorstring=errorstring + '   -Book 1: Please Select Language\n';
		}	
		if (language1!='' && quant_book1==''){
			errorstring=errorstring + '   -Book 1: Enter Quantity (Max. 12 Copies)\n';
		}
		//Book 2
		var quant_book2=document.regform.quant_book2.value;
		var language2=document.regform.language2.options[document.regform.language2.selectedIndex].value;   
		if (fieldValid (quant_book2,'number',12)==false || isNaN (quant_book2)){
			errorstring=errorstring + '   -Book 2: Enter Quantity (Max. 12 Copies)\n';
		}	
		if (parseInt (quant_book2)>0 && language2==''){
			errorstring=errorstring + '   -Book 2: Please Select Language\n';
		}	
		if (language2!='' && quant_book2==''){
			errorstring=errorstring + '   -Book 2: Enter Quantity (Max. 12 Copies)\n';
		}
		//Book 3
		var quant_book3=document.regform.quant_book3.value;
		var language3=document.regform.language3.options[document.regform.language3.selectedIndex].value;   
		if (fieldValid (quant_book3,'number',12)==false || isNaN (quant_book3)){
			errorstring=errorstring + '   -Book 3: Enter Quantity (Max. 12 Copies)\n';
		}	
		if (parseInt (quant_book3)>0 && language3==''){
			errorstring=errorstring + '   -Book 3: Please Select Language\n';
		}	
		if (language3!='' && quant_book3==''){
			errorstring=errorstring + '   -Book 3: Enter Quantity (Max. 12 Copies)\n';
		}
		//Book 3 European
		var quant_book3_eu=document.regform.quant_book3_eu.value;
		var language3_eu=document.regform.language3_eu.options[document.regform.language3_eu.selectedIndex].value;   
		if (fieldValid (quant_book3_eu,'number',12)==false  || isNaN (quant_book3_eu)){
			errorstring=errorstring + '   -Book 3 (Euro): Enter Quantity (Max. 12 Copies)\n';
		}	
		if (parseInt (quant_book3_eu)>0 && language3_eu==''){
			errorstring=errorstring + '   -Book 3 (Euro): Please Select Language\n';
		}	
		if (language3_eu!='' && quant_book3_eu==''){
			errorstring=errorstring + '   -Book 3 (Euro): Enter Quantity (Max. 12 Copies)\n';
		}
		//Book 4
		var quant_book4=document.regform.quant_book4.value;
		var language4=document.regform.language4.options[document.regform.language4.selectedIndex].value;   
		if (fieldValid (quant_book4,'number',12)==false  || isNaN (quant_book4)){
			errorstring=errorstring + '   -Book 4: Enter Quantity (Max. 12 Copies)\n';
		}	
		if (parseInt (quant_book4)>0 && language4==''){
			errorstring=errorstring + '   -Book 4: Please Select Language\n';
		}	
		if (language4!='' && quant_book4==''){
			errorstring=errorstring + '   -Book 4: Enter Quantity (Max. 12 Copies)\n';
		}
		//Check for a Book Order
		if (quant_book1=='' && quant_book2=='' && quant_book3=='' && quant_book3_eu=='' && quant_book4==''){
			errorstring=errorstring + '   -Please Select at Least One Book\n';
		}
	
	}
	

	//Contact Us
	if (formname=='contactus'){
		if (fieldValid (document.regform.comments.value,'',10)==false){
			errorstring=errorstring + '   -Enter Contact Issue\n';
		}
	}

	//Validate Profile Form
	if (fieldValid (document.regform.fname.value,'',3)==false){
		errorstring=errorstring + '   -Enter First Name\n';
	}
	if (fieldValid (document.regform.lname.value,'',3)==false){
		errorstring=errorstring + '   -Enter Last Name\n';
	}	
	if (fieldValid (document.regform.email.value,'email',0)==false){
		errorstring=errorstring + '   -Enter Valid E-Mail Address\n';
	}
	if (loginemail =='' && formname!='bullfighter' && formname!='peoplesoft_luau' && formname!='del_invite' && formname!='contactus' && formname!='straighttalk' &&formname!='rightsize'){
		if (fieldValid (document.regform.password.value,'',5)==false){
			errorstring=errorstring + '   -Enter a Password (Min. 5 Characters)\n';
		}
		if (document.regform.confirmpassword.value !=document.regform.password.value){
			errorstring=errorstring + '   -Password & Confirmation Do Not Match)\n';
		}
	}
	
	if (formname!='contactus'){
		if (fieldValid (document.regform.org.value,'',3)==false){
			errorstring=errorstring + '   -Enter Your Organization\n';
		}  
		if (fieldValid (document.regform.jobtitle.value,'',3)==false){
			errorstring=errorstring + '   -Enter Title or "Student"\n';
		} 
		if (document.regform.industry.value=='' || document.regform.industry.value==''){
			errorstring=errorstring + '   -Please Select Industry / Sector\n';
		}
		if (formname!='peoplesoft_luau'){
			if (document.regform.country.options[document.regform.country.selectedIndex].value==''){
				errorstring=errorstring + '   -Select Country\n';
			}
		}
	}
	
	if (formname=='bullfighter' || formname=='straighttalk'){
		var address=document.regform.address.value;
		var city=document.regform.city.value;
		var state=document.regform.state.value;
		var zip=document.regform.zip.value;
		if (fieldValid (address,'',6)==false){
			errorstring=errorstring + '   -Enter Address\n';
		}
		if (fieldValid (city,'',3)==false){
			errorstring=errorstring + '   -Enter City\n';
		}
		if (fieldValid (state,'',2)==false){
			errorstring=errorstring + '   -Enter State\n';
		}
		if (fieldValid (zip,'',2)==false){
			errorstring=errorstring + '   -Enter Zip or "N/A"\n';
		}
	}
	
	if (formname=='peoplesoft_luau'){
		var invitedby=document.regform.invitedby.value;	
		var state_province=document.regform.state_province.value;
		if (invitedby==''){
			errorstring=errorstring + '   -Entered Invited By\n';
		}
		if (state_province==''){
			errorstring=errorstring + '   -Entered State / Province\n';
		}
	}
	
	if (formname=='del_invite'){
		var invitedby=document.regform.invitedby.value;	
		if (invitedby==''){
			errorstring=errorstring + '   -Entered Invited By\n';
		}
		if (document.regform.sponsor.options[0].selected){
			errorstring=errorstring + '   -Entered Sponsor\n';
		}
	}
	
	if (errorstring !=''){
		alert ('Please Provide the Following Information:    \n\n' + errorstring);
		return false;
	}
	return true;
}
//Validate Field
function fieldValid (fieldvalue,validatetype,requirelength){	
	var fieldvalid=true;
	if (validatetype=='email'){
		//Check for Valid e-Mail Address
		var validchars=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','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','0','1','2','3','4','5','6','7','8','9','@','.','!','_','-','+','~','`','\'');
		if (fieldvalue==''){
		fieldvalid=false;
		}
		for (a = 0; a < fieldvalue.length; a++){
			var tmpval=fieldvalue.substring (a,a+1);
			aok=0;
			for (b = 0; b < validchars.length; b++){
				var tmpchk=validchars[b];
				if (tmpchk==tmpval){
					aok=1;
				}
			}
			if (aok==0){
				fieldvalid=false;
			}
		}
		var tmplocat=fieldvalue.indexOf ('@');
		var tmplocdot=fieldvalue.indexOf ('.',tmplocat);
		if (tmplocat<1 || tmplocdot<1){
		 	fieldvalid=false;	
		}
	} if (validatetype=='number'){
		//Check for Number
		var tmpnum=parseInt(fieldvalue);
		if (tmpnum=='NaN'){
			fieldvalid=false;
		}
		if (tmpnum>requirelength){
			fieldvalid=false;
		}
	}
	
	else {
		//Check for Whitespace 
		var tmpstring=crunchWhite (fieldvalue);
		if (tmpstring.length<requirelength){
			fieldvalid=false;
		}	
	}
	return fieldvalid;
}

//Return a String with No White Space
function crunchWhite (instring){
	if (instring==''){
          	return instring;
        }
        var returnstring='';
        
	// Look for Whitespace
	for (a = 0; a < instring.length; a++){
		var tmpchar = instring.substring(a, a+1);
                if (tmpchar!=' ' || tmpchar!='\t'){
                	returnstring=returnstring+tmpchar;
                }
	}
           return returnstring;
}

//Trim White Space (Off Edges of String)
function trim(instring) {
	var returnstring = instring;
	var ch = returnstring.substring(0, 1);
	while (ch == " ") { 
	   returnstring = returnstring.substring(1, returnstring.length);
	   ch = returnstring.substring(0, 1);
	}
	ch = returnstring.substring(returnstring.length-1, returnstring.length);
	while (ch == " ") {
	   returnstring = returnstring.substring(0, returnstring.length-1);
	   ch = returnstring.substring(returnstring.length-1, returnstring.length);
	}
	while (returnstring.indexOf("  ") != -1) {
	   returnstring = returnstring.substring(0, returnstring.indexOf("  ")) + returnstring.substring(returnstring.indexOf("  ")+1, returnstring.length); // Again, there are two spaces in each of the strings
	}
	return returnstring;
}




/////////////////////////////////////////
// Set Recent Pages
/////////////////////////////////////////


function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}


function setRecentPages (thishandle,thisurl){
	
	var h=_getCookie ('pagehandles');
	var u=_getCookie ('pageurls');
	if (u.length>0){
	var handlearray=h.split ('|');
	var urlarray=u.split ('|');
	totalitems=urlarray.length;
	} else {
	 handlearray=new Array ();
	 urlarray=new Array ();
	 totalitems=0;
	}
	//document.write ('Pre Array-{' + handlearray.toString ()+'}<br><br>');
	
	//Add Item To Array
	if (u.indexOf (thisurl)==-1){
	handlearray [totalitems]=thishandle;
	urlarray [totalitems]=thisurl;
	totalitems=urlarray.length;
	//document.write ('Post Array-{' + handlearray.toString ()+'}<br><br>');
	}
	//Trim Array if Needed
	var maxpages=3;
		if (totalitems>=maxpages){
			handlearrayc=handlearray.slice (totalitems-maxpages);
			handlearray=handlearrayc;
			urlarrayc=urlarray.slice (totalitems-maxpages);
			urlarray=urlarrayc;	          
	}
	
	
	//Create Cookie String From Array
	writeh='';
	writeu='';
	totalitems=urlarray.length;
	for (a=0;a<totalitems;a++){
		writeh=writeh+handlearray [a];
		writeu=writeu+urlarray [a];
		if (a<(totalitems-1)){
			writeh=writeh + '|';
			writeu=writeu + '|';
		}
		
	}
	
		reset=0;
		if (reset==1){
		writeh='';
		writeu='';
		}
		_setCookie ('pagehandles',writeh);
		_setCookie ('pageurls',writeu);
	
		
		//document.write ('Set:' + writeh +'<br><br><br>');
		//document.write ('Set:' + writeu +'<br>');
}
/////////////////////////////////////////
// Get Recent Pages
/////////////////////////////////////////
function getRecentPages (){
	var h=_getCookie ('pagehandles');
	var u=_getCookie ('pageurls');
	var handlearray=h.split ('|');
	var urlarray=u.split ('|');
	var recentstring ='';
	if (handlearray.length>1){
		recentstring='<div align="right"><font color="#333333" size="1">Recent Pages: ';
		for (a=0;a<handlearray.length;a++){
			recentstring = recentstring + '<a href="' + urlarray [a] + '" class="blue">' + handlearray [a] + '</a>';
			if (a<(handlearray.length-1)){
				recentstring=recentstring + ' | ';
			}
		}
		recentstring=recentstring + '</font><img src="/images/spacer.gif" width="5" height="5" border="0"></div>';
	}
	return recentstring;
}

function getRecentPagesNoLink (){
	var h=_getCookie ('pagehandles');
	var u=_getCookie ('pageurls');
	var handlearray=h.split ('|');
	var urlarray=u.split ('|');
	var recentstring ='';
	if (handlearray.length>1){
		recentstring='Recent Pages: ';
		for (a=0;a<handlearray.length;a++){
			recentstring = recentstring + handlearray [a];
			if (a<(handlearray.length-1)){
				recentstring=recentstring + ' | ';
			}
		}
	}
	return recentstring;
}

function isEmail (val){
	return true;
}


function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}

function changeImage(lyr, imgName, src){
	if(document.images){
		if(document.layers && lyr != null) eval('document.'+ lyr +'.document.images.'+ imgName +'.src = src')
			else	document.images[imgName].src = src
	}
}

function preload(){
	var args = arguments
	var arglen = args.length
	for(var i=0; i < arglen; i++){
		eval('img' + i +' = new Image()')
		eval('img' + i + '.src = "'+ args[i] +'" ')
	}
	return true;
}

var arrayDay = new Array('Sunday', 'Monday', 'Tuesday', 'Wednesday' , 'Thursday', 'Friday', 'Saturday')
var arrayMonth = new Array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December')
function doDate(el){
	var strDT = ""
	dt = new Date()
	switch(el){
		case "wkDay":
			strDT = arrayDay[dt.getDay()]
			break
		case "mnth":
			strDT = arrayMonth[dt.getMonth()]
			break
		case "day":
			strDT = (dt.getDate() < 10)? "0"+dt.getDate():dt.getDate()
			break
		case "year":
			strDT = dt.getFullYear()
			break

	}
	return 	strDT
}



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_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.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];}
}
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_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}




/**
Comments to Wellington Fan, beef@interport.net
**/

/**
_showArray(a):
	Array a;
	Returns String;
**/
function _showArray(a){
	var s="";
	for (var prop in a){
		s += "["+prop+"]\t=\t"+a[prop]+"\n<br>";
	}
	return s;
}

/**
_splitOn(s,sep):
	String s;
	String sep;
	Returns Array();
**/
function _splitOn(s,sep){
	if (s == null || s == "") { return "";}
	if (sep == null || sep == ""){ sep = " ";}
	var ax=0;
	var bx=0;
	var ix=0;
	var temp = new Array();
	while ( (bx=s.indexOf(sep,ax)) != -1 ) {
		temp[ix++] = s.substring(ax,bx);
		ax = bx + 1;
	}
	temp[ix] = s.substring(ax);
	return temp;
}

/**
_iswhite(c):
	Char c;
	Returns Boolean;
**/
function _iswhite(c){
	var firstchar=c.charAt(0);
	if (c =="\t" || c==" " || c=="\n") {
		return true;
	} else {
		return false;
	}
}

/**
_noWhite(s):
	String s;
	Returns String;
	Removes ALL whitespace form string;
**/
function _noWhite(s){
	var newS="";
	if (s == null || s == "") { return "";}
	for (i=0; i<s.length; i++){
		newS += ( _iswhite(s.charAt(i)) )? "":s.charAt(i);
	}
	return newS;
}


/**
_trim(s):
	String s;
	Returns String;
**/
function _trim(s){
	if (s == null || s == "") { return "";}
	var lastidx=0;
	var c="";
	var buf="";
	var trimmed="";
	while ( lastidx < s.length && _iswhite(c=s.charAt(lastidx++)) ){
		continue;
	}
	lastidx--;
	while (lastidx < s.length) {
		c = s.charAt(lastidx++);
		if ( _iswhite(c) ) {
			buf += c;
		} else {
			trimmed += buf + c;
			buf = "";
		}
	}
	return trimmed;					
}

/**
_cookies2Array():
	Returns Array;
**/
function _cookies2Array(){
	var temparr = new Array();
	var assocArray = new Array();
	var names="";
	var values="";
	var cookieString = document.cookie;
	temparr = _splitOn(cookieString,";");
	for (var idx=0; idx < temparr.length; idx++) {
		names = temparr[idx].substring(0,(temparr[idx]+"=").indexOf("="));
		values = temparr[idx].substring((temparr[idx]+"=").indexOf("=")+1);
		assocArray[_trim(unescape(names))]=unescape(values);
	}
	return assocArray;
}

/**
_setCookie():
	Returns true;
**/
function _setCookie(name, value, expire) {
	document.cookie = name + "=" + escape(value) + "; path=/"
	+ ((expire == null) ? "" : ("; expires=" + expire.toGMTString()));
	return true;
}

/**
_getCookie():
	Wrapper for _cookies2Array();
	Returns unescaped string.
**/
function _getCookie(name) {
	var val = _cookies2Array()[name];
	return (val == null) ? "":val;
}

function drawDate (){
	var today=new Date ();
	var days =new Array ('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
	var months=new Array ('January','February','March','April','May','June','July','August','September','October','November','December');
	var displaystring='<font class="headertext">' + days [today.getDay ()] + ', ' + months[today.getMonth ()] + ' ' + today.getDate () + ', ' + today.getFullYear ()  + '</font>';
	document.write (displaystring);
}


function drawFlash (filename,flashid,width,height,altimage){
	var MM_contentVersion = 5;
	var MM_PluginVersion;
	var MM_FlashCanPlay = false;
	var randid=Math.floor(Math.random()*999999);
	var qsep='?';
	if (filename.indexOf ('?')>-1){
		qsep='&';
	}	
	var plugin = ((navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0);
	if ( plugin ) {
			var words = new Array();
			words = navigator.plugins["Shockwave Flash"].description.split(" ");
			document.write('<li>----------------WORDS[]');
			for (var i = 0; i < words.length; ++i){
				document.write('<li>' + words[i]);
				if (isNaN(parseInt(words[i]))) continue;
				MM_PluginVersion = words[i]; 
			}
			MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
			
	} else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
		&& (navigator.appVersion.indexOf("Win") != -1)) {
		document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
		document.write('on error resume next \n');
		document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
		document.write('</SCR' + 'IPT\> \n');
	}
	var MM_FlashCanPlay = true;
	if ( MM_FlashCanPlay ) {
		document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
		document.write('  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ');
		document.write(' ID="' + flashid + '" WIDTH="' + width + '" HEIGHT="' + height + '" ALIGN="">');
		document.write(' <PARAM NAME=movie VALUE="' + flashname + qsep +'randid=' + randid +'"> <PARAM NAME=quality VALUE=best> <PARAM NAME=bgcolor VALUE=#FFFFFF>  '); 
		document.write(' <EMBED src="' + flashname + qsep +'randid=' + randid + '" quality=best bgcolor=#FFFFFF  ');
		document.write(' swLiveConnect=FALSE WIDTH="' + width + '" HEIGHT="' + height + '" NAME="' + flashid + '" ALIGN=""');
		document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">');
		document.write(' </EMBED>');
		document.write(' </OBJECT>');
	} else {
		if (altimage.length>0){
			document.write('<IMG SRC="' + altimage + '" WIDTH="' + width + '" HEIGHT="' + height + '" BORDER="0">');
		} else {
			document.write('<IMG SRC="/nav/spacer.gif" WIDTH="' + width + '" HEIGHT="' + height + '" BORDER="0">');	
		}
	}
}
function setSector(chosen) {
	var sectselect = document.regform.sectselect;
	document.regform.industry.value ='';
	sectselect.options.length = 0;
	if (chosen == "") {
	  sectselect.options[sectselect.options.length] = new Option('Please Select Industry',' ');
	}
	if (chosen == "cw:") {
	  sectselect.options[sectselect.options.length] = new Option('Please Select...','');
	  sectselect.options[sectselect.options.length] = new Option('Wireless/Internet','cw:wireless/internet');
	  sectselect.options[sectselect.options.length] = new Option('Cable','cw:cable');
	  sectselect.options[sectselect.options.length] = new Option('Networking/Fiber','cw:networking/fiber');
	  sectselect.options[sectselect.options.length] = new Option('Telephone','cw:telephone');
	  sectselect.options[sectselect.options.length] = new Option('ISP','cw:isp'); 
	}
	if (chosen == "cb:") {
	  sectselect.options[sectselect.options.length] = new Option('Please Select...','');
	  sectselect.options[sectselect.options.length] = new Option('Retail','cb:retail');
	  sectselect.options[sectselect.options.length] = new Option('Wholesale','cb:wholesale');
	    sectselect.options[sectselect.options.length] = new Option('Manufacturing','cb:manufacturing');
	  sectselect.options[sectselect.options.length] = new Option('Distribution','cb:distribution');
	}
	if (chosen == "eb:") {
	  sectselect.options[sectselect.options.length] = new Option('Please Select...','');
	  sectselect.options[sectselect.options.length] = new Option('B2B','eb:b2b');
	  sectselect.options[sectselect.options.length] = new Option('B2C','eb:b2c');
	  sectselect.options[sectselect.options.length] = new Option('E-market/Portal','eb:e-market/portal');
	  sectselect.options[sectselect.options.length] = new Option('Professional Svcs','eb:prof. services');
	  
	 
	}
	if (chosen == "e:") {
	  sectselect.options[sectselect.options.length] = new Option('Please Select...','');
	  sectselect.options[sectselect.options.length] = new Option('Oil/Gas','e:oil/gas');
	  sectselect.options[sectselect.options.length] = new Option('Water','e:water');
	  sectselect.options[sectselect.options.length] = new Option('Electricity','e:electricity');
	  sectselect.options[sectselect.options.length] = new Option('Energy/Distribution','e:energy/distribution');
	}
	if (chosen == "fs:") {
	  sectselect.options[sectselect.options.length] = new Option('Please Select...','');
	  sectselect.options[sectselect.options.length] = new Option('Banking','fs:banking');
	  sectselect.options[sectselect.options.length] = new Option('Securities','fs:securities');
	  sectselect.options[sectselect.options.length] = new Option('Insurance','fs:insurance');
	  sectselect.options[sectselect.options.length] = new Option('Real Estate/Asset Mgt','fs:real estate/asset management');
	
	}
	if (chosen == "hc:") {
	  sectselect.options[sectselect.options.length] = new Option('Please Select...','');
	  sectselect.options[sectselect.options.length] = new Option('HMO/Insurer','hc:hmo/insurer');
	  sectselect.options[sectselect.options.length] = new Option('Hospital','hc:hospital');
	  sectselect.options[sectselect.options.length] = new Option('Health System','hc:health system');
	  sectselect.options[sectselect.options.length] = new Option('Medical Center','hc:medical center');
	}
	if (chosen == "m:") {
	  sectselect.options[sectselect.options.length] = new Option('Please Select...','');
	  sectselect.options[sectselect.options.length] = new Option('Automotive','m:automotive');
	  sectselect.options[sectselect.options.length] = new Option('Aerospace','m:aerospace');
	  sectselect.options[sectselect.options.length] = new Option('Process/Chemical','m:process/chemical');
	  sectselect.options[sectselect.options.length] = new Option('High Technology','m:high technology');
	  sectselect.options[sectselect.options.length] = new Option('Life Sciences','m:life sciences');
	}
	if (chosen == "ps:") {
	  sectselect.options[sectselect.options.length] = new Option('Please Select...','');
	  sectselect.options[sectselect.options.length] = new Option('Federal Government','ps:federal govt.');
	  sectselect.options[sectselect.options.length] = new Option('State Government','ps:state govt');
	  sectselect.options[sectselect.options.length] = new Option('Local Government','ps:local govt.');
	  sectselect.options[sectselect.options.length] = new Option('Education','ps:Education');
	}
	if (chosen == "t:") {
	  sectselect.options[sectselect.options.length] = new Option('Please Select...','');
	  sectselect.options[sectselect.options.length] = new Option('Hardware','t:hardware');
	  sectselect.options[sectselect.options.length] = new Option('Software','t:software');
	}
	if (chosen == "other:") {
	  sectselect.options[sectselect.options.length] = new Option('Please Select...','');
	  sectselect.options[sectselect.options.length] = new Option('Consulting Student','other:student');
	  sectselect.options[sectselect.options.length] = new Option('University/College Faculty','other:faculty');
	  sectselect.options[sectselect.options.length] = new Option('media/advertising/marketing/pr','other:media/adver/mrkt/pr');
	  sectselect.options[sectselect.options.length] = new Option('Audit/Accounting','other:audit/accounting');
	  sectselect.options[sectselect.options.length] = new Option('Transportation','other:transportation');
	  sectselect.options[sectselect.options.length] = new Option('Human Resources','other:hr');
	  sectselect.options[sectselect.options.length] = new Option('Other','other:other');
	}
}

function showPDF(pdfname,pdftitle) {
	var urlname="/insights/research/tools/pdfviewer.asp?reportname=" + pdfname + "&title=" + escape(pdftitle) + "&t=0"; 
	window.location = urlname;
}

function showPDF(pdfname,pdftitle,tf) {
	var skiplogin='';
	if (tf=='1'){
		var skiplogin= "&SkipLogin=1";
	}
	var urlname="/insights/research/tools/pdfviewer.asp?reportname=" + pdfname + "&title=" + escape(pdftitle) + skiplogin; 
	window.location = urlname;
}

//Validate Field
function fieldValid (fieldvalue,validatetype,requirelength){	
	var fieldvalid=true;
	if (validatetype=='email'){
		//Check for Valid e-Mail Address
		var validchars=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','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','0','1','2','3','4','5','6','7','8','9','@','.','!','_','-','+','~','`','\'');
		if (fieldvalue==''){
		fieldvalid=false;
		}
		for (a = 0; a < fieldvalue.length; a++){
			var tmpval=fieldvalue.substring (a,a+1);
			aok=0;
			for (b = 0; b < validchars.length; b++){
				var tmpchk=validchars[b];
				if (tmpchk==tmpval){
					aok=1;
				}
			}
			if (aok==0){
				fieldvalid=false;
			}
		}
		var tmplocat=fieldvalue.indexOf ('@');
		var tmplocdot=fieldvalue.indexOf ('.',tmplocat);
		if (tmplocat<1 || tmplocdot<1){
		 	fieldvalid=false;	
		}
	} if (validatetype=='number'){
		//Check for Number
		var tmpnum=parseInt(fieldvalue);
		if (tmpnum=='NaN'){
			fieldvalid=false;
		}
		if (tmpnum>requirelength){
			fieldvalid=false;
		}
	}
	
	else {
		//Check for Whitespace 
		var tmpstring=crunchWhite (fieldvalue);
		if (tmpstring.length<requirelength){
			fieldvalid=false;
		}	
	}
	return fieldvalid;
}

//Return a String with No White Space
function crunchWhite (instring){
	if (instring==''){
          	return instring;
        }
        var returnstring='';
        
	// Look for Whitespace
	for (a = 0; a < instring.length; a++){
		var tmpchar = instring.substring(a, a+1);
                if (tmpchar!=' ' || tmpchar!='\t'){
                	returnstring=returnstring+tmpchar;
                }
	}
           return returnstring;
}

//Trim White Space (Off Edges of String)
function trim(instring) {
	var returnstring = instring;
	var ch = returnstring.substring(0, 1);
	while (ch == " ") { 
	   returnstring = returnstring.substring(1, returnstring.length);
	   ch = returnstring.substring(0, 1);
	}
	ch = returnstring.substring(returnstring.length-1, returnstring.length);
	while (ch == " ") {
	   returnstring = returnstring.substring(0, returnstring.length-1);
	   ch = returnstring.substring(returnstring.length-1, returnstring.length);
	}
	while (returnstring.indexOf("  ") != -1) {
	   returnstring = returnstring.substring(0, returnstring.indexOf("  ")) + returnstring.substring(returnstring.indexOf("  ")+1, returnstring.length); // Again, there are two spaces in each of the strings
	}
	return returnstring;
}

function FlashInstalled()
{
	result = false;

	if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"])
	{
		result = navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin;
	}
	else if (document.all && (navigator.appVersion.indexOf("Mac")==-1))
	{
		// IE Windows only -- check for ActiveX control, have to hide code in eval from Netscape (doesn't like try)
		eval ('try {var xObj = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");if (xObj)	result = true; xObj = null;	} catch (e)	{}');
	}
	return result;
}

function FlashWrite(url,width,height,backcolor)
{
	document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
	document.write('  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" ');
	document.write('  WIDTH=' + width + ' HEIGHT=' + height + '>');
	document.write(' <PARAM NAME=movie VALUE="' + url + '"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=' + backcolor + '>  '); 
	document.write(' <EMBED src="' + url + '" quality=high bgcolor=' + backcolor + '  ');
	document.write(' swLiveConnect=FALSE WIDTH=' + width + ' HEIGHT=' + height);
	document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">');
	document.write(' </EMBED></OBJECT>');
}
