//////////////////////////////
// Script: avatu.js
// Purpose: Commonly used javascript functions
// @date: 11/15/2003
// @author: dvella1@hotmail.com
//////////////////////////////


//////////////////////////////
// Function: confirmForRedirect
// Purpose: Prompts user with strMessage.  
//          A confirmation results in a 
//          redirection to strUrl.
// @date: 05/17/2000
// @author: dvella1@hotmail.com
//////////////////////////////
function confirmForRedirect(strUrl, strMessage){
   if(!confirm(strMessage)){
      return;
   }
   window.location = strUrl;
}

function confirmPopupWindow(strMessage, strUrl, intWidth, intHeight){
   if(!confirm(strMessage)){
      return;
   }
   var i = window.open(strUrl, "DLX_CONF", "alwaysRaised=yes,menubar=no,width="+intWidth+",height="+intHeight+",toolbar=no,scrollbars=yes,resizable=yes");
   i.focus();
}

//////////////////////////////
// Function: showPopupWindow
// Purpose: Popup help window
// @date: 05/17/2000
// @author: dvella1@hotmail.com
//////////////////////////////
function showPopupWindow(strUrl){
   var i = window.open(strUrl, "avatu1", "alwaysRaised=yes,menubar=yes,width=800,height=700,toolbar=yes,scrollbars=yes,resizable=no");
   i.focus();
}

//////////////////////////////
// Function: showPopupWindow2
// Purpose: Popup help window
// @date: 05/17/2000
// @author: dvella1@hotmail.com
//////////////////////////////
function showPopupWindow2(strUrl, intWidth){
   var i = window.open(strUrl, "avatu2", "alwaysRaised=yes,menubar=no,width="+intWidth+",height=350,toolbar=no,scrollbars=yes,resizable=no");
   i.focus();
}

//////////////////////////////
// Function: showPopupWindow3
// @date: 05/17/2000
// @author: dvella1@hotmail.com
//////////////////////////////
function showPopupWindow3(strUrl, intWidth, intHeight){
   var i = window.open(strUrl, "avatu3", "alwaysRaised=yes,menubar=no,width="+intWidth+",height="+intHeight+",toolbar=no,scrollbars=no,resizable=no");
   i.focus();
}

//////////////////////////////
// Function: showPopupWindow4
// @date: 05/17/2000
// @author: dvella1@hotmail.com
//////////////////////////////
function showPopupWindow4(strUrl,name){
   var i = window.open(strUrl, name, "alwaysRaised=yes,menubar=no,width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");
   i.focus();
}

//////////////////////////////
// Function: showPopupWindow5
// @date: 05/17/2000
// @author: dvella1@hotmail.com
//////////////////////////////
function showPopupWindow5(strUrl, name ,intWidth, intHeight){
   var i = window.open(strUrl, name, "alwaysRaised=yes,menubar=no,width="+intWidth+",height="+intHeight+",toolbar=no,scrollbars=no,resizable=no");
   i.focus();
}


//////////////////////////////
// Function: showPopupWindow3
// @date: 05/17/2000
// @author: dvella1@hotmail.com
//////////////////////////////
function showCenterPopupWindow(strUrl, intWidth, intHeight,centerLeft,centerTop){
   var i = window.open(strUrl, "avatu3", "alwaysRaised=yes,menubar=no,width="+intWidth+",height="+intHeight+",left="+centerLeft+",top="+centerTop+",toolbar=no,scrollbars=yes,resizable=no");
   i.focus();
}



function SelectAll(field,length) {
	var i = new Number();
	var formField = Object();
	for(i=0;i<length;i++) {
        //formField=document.forms.assetCartViewForm.assetUid[i];
        //alert("formField: " + formField);
		formField=field[i];
        formField.checked=true;
	}
}

function DeSelectAll(field,length) {
	var i = new Number();
	var formField = Object();
	for(i=0;i<length;i++) {
		formField=field[i];
		formField.checked=false;
	}
}


/*
	
		function RequireAtLeastOneAssetType() {
			var i = new Number();
			var formField = Object();
			var c = new Number();
			c = 0;
			for(i=0;i<24;i++) {
				formField=document.forms.frmSearch.searchAssetTypes[i];
				if(formField.checked==true) c++;
			}
			if (c==0) {
				alert("You have not checked any Asset Types to search for.  You can select as few as 1 or as many as all.  (You may click the Asset Type checkboxes individually or click the \'select all\' link at the top of the search form to quickly select them all.)");
				return false;
			}
			else {
				return true;
			}
		}
	*/

function showPopupWindowTEST(strUrl){
   var i = window.open(strUrl, "avatu1");
   i.focus();
}


 

