var visibleinputs=new Array();
var visibleinputsvalues=new Array();

function handleError(errorMessage, url, line) {
	alert('There has been a javascript error: \n\n' + errorMessage + ' \n\nPage: ' + url + ' \n\nLine: ' + line);
    	return true;
}

//Joe, quickie function for geting a array_unique tool for js
function inArray(arrname, v, arr){

	//alert(arrname + ' ' + v + ' '  + 'compare: ' + arr);

	for(var i=0; i<arr.length; i++){

		//alert(arr[i]);

		if(v == arr[i]){//is the exact match present?

			return true;

		}
	}
	return false;
}

//all this does is save these values to the js array
function fnSavetoValidationArray(vname, vvalue){

	//initilize the array	
	var compareresult;
	
	//check to see if its currently in the validateArray
	compareresult=inArray('VIS INPUTS', vname, visibleinputs);
	
	//if its not in the arry then add it it to the array
	if(compareresult==false){//this are the missing values
		visibleinputs.push(vname);
	}
	
	//check to see if its currently in the validateArray
	//compareresult=inArray('VIS INPUT VALUES', vvalue, visibleinputsvalues);
	
	//if(compareresult==false){//this are the missing values
		//alert(compareresult);
	//	visibleinputsvalues.push(vvalue);	
	//}
	
	//alert(visibleinputs);	
}

function showDiv(DIVNAME){

	divtoshow=document.getElementById(DIVNAME);

	if (divtoshow.style.display=="block"){
		divtoshow.style.display="none";
	}else{
		divtoshow.style.display="block";
	}
}


function hideDiv(DIVNAME){

	divtohide=document.getElementById(DIVNAME);
	divtohide.style.display="none";

}

function highLight(ITEMNAME){

	//alert(ITEMNAME);
	var currentinput;
	currentinput=document.getElementById(ITEMNAME);	
	//alert(currentinput);
	currentinput.style.color="red";
	
}

function removehighLight(ITEMNAME){

	var input;
	currentinput=document.getElementById(ITEMNAME);	
	currentinput.style.background="#DFDFDF";
	
}


function activehighLight(ITEMNAME){

	var input;
	currentinput=document.getElementById(ITEMNAME);	
	currentinput.style.background="#FEFFBF";
	
}

function removeactivehighLight(ITEMNAME){

	var input;
	currentinput=document.getElementById(ITEMNAME);

	if(currentinput.value!=''){
		//alert(currentinput.value);
		currentinput.style.background="white";
	}else{
		currentinput.style.background="#DFDFDF";
	}
	
	
}


function ConfirmInput(){

	

}
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=1,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=500');");
}



function ValidateDate(field){
	
	//alert(field)

}