

var pw;

function popUp(picPath,picWidth,picHeight){
	pw=picWidth;
	var winLeft = screen.availWidth;
	winLeft=winLeft/2-210;

	newwin=window.open("/pic.asp?picPath="+picPath+"&w="+picWidth+"&h="+picHeight,"Informations","width=" + picWidth + ",height=" + picHeight + ",left=" + winLeft + ",top=0,menubar=0,location=0,toolbar=0,personalbar=0,status=1,resizable=1,scrollbars=0");
}


var cellOverColor='#FFFFCC';
var cellOutColor='#FFFFFF';
var highlightColor='#CCCCCC';
var curPos=null;

function cellOver(cid,pos){
	if(document.all || document.getElementById){
		if(pos==null || pos !=curPos){
			cid.style.backgroundColor=cellOverColor;
		}
  	}
}

function cellOut(cid,pos){
	if(document.all || document.getElementById){
		if(pos==null || pos !=curPos){
			cid.style.backgroundColor=cellOutColor;
		}
	}
}

function cellHighlight(cid, highlight){
	if(document.all || document.getElementById){
		if(highlight == 1){
			cid.style.backgroundColor=highlightColor;
		}
		else{
			cid.style.backgroundColor=cellOutColor;
		}	
  	}
}



/* AJAX STUFF */
var xmlHttp;

function GetXmlHttpObject(){    
	var xmlHttp=null;

	try{    // Firefox, Opera 8.0+, Safari    
	  xmlHttp=new XMLHttpRequest();
	}catch (e){    // Internet Explorer
	  try{
		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	  }catch (e){
		xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");        
	  }
	}

	return xmlHttp;
}


/* MEN'S NIGHT FUNCTIONS */

	var total=0;
	var curTotal=0;
	
	function check(){
		if(document.forms[0].tDate.selectedIndex==0){
			alert("Please select a date");
			document.forms[0].tDate.focus();
		}else{
			document.forms[1].submit();
		}
	}
	
	function addToTotal(row){
		var tot=0 ;
		for (x=1;x<50;x++){
			tot+=parseFloat(0+eval("document.frmStep1.money"+x+".value"));
		}
		document.forms[1].bigTotal.value = toDollarsAndCents(tot);
	}
	
	function onlyNumber(row){
		if (isNaN(row.value)){
			row.value="";
		}else{
			addToTotal(row);
		}
	}
	
	function toDollarsAndCents(n) {
	  var s = "" + Math.round(n * 100) / 100
	  var i = s.indexOf('.')
	  if (i < 0) return s + ".00"
	  var t = s.substring(0, i + 1) + s.substring(i + 1, i + 3)
	  if (i + 2 == s.length) t += "0"
	  return t
	}			
	
	function validateTextBox(txtBox){
		if(txtBox.value.length == 0 || isNaN(txtBox.value)){
			txtBox.value='';
			}
	}	
	
	function do_search(txt_field,sel_list){
		
		//txt_field.value=txt_field.value.toUpperCase();
		
		var txt_word=txt_field.value.toUpperCase();
		var word_len=txt_word.length;
		var list_len=sel_list.length;
		
		sel_list[0].selected=true;
		
		for(x=0;x<list_len;x++){
			txt_word=txt_word.toUpperCase();
			lst_word=sel_list[x].text.toUpperCase();
			lst_word=lst_word.substring(0, word_len);

			if(lst_word==txt_word){
				sel_list[x].selected=true;
				break;
			}
		}
	}	
