
function advpage(url) 
{
NewWindow=window.open(url,"_blank","valign='middle',toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=yes, width=350 , height=320"); 
}

function ViewAdv(url) 
{
	NewWindow=window.open(url,"_blank","valign='middle',toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=yes, width=500 , height=400"); 
}

function SylFilter(obj,op){
	if(op == 1) obj.style.filter = "alpha(opacity=75);";
	if(op == 0) obj.style.filter = "alpha(opacity=100);";
}


function isDateFormat(dateStr) 
{

	//var datePat = /^(\d{1,2})(\/|-)(\d{1,2})(\/|-)(\d{4})$/; //MM/DD/YYYY
	var datePat = /^(\d{4})(\-|-)(\d{1,2})(\-|-)(\d{1,2})$/; //YYYY-MM-DD
	
	
	var matchArray = dateStr.match(datePat); // is the format ok?

	if (matchArray == null) return false; 
	else return true;
}
//alert('yes');
function openWindow(url, wname, width, height) 
{

	window.open(url, wname, "height="+height+",width="+width+",location = 1, status = 1, resizable = 1, scrollbars=1, toolbar = 1");
}

/*
function insertOptionBefore(num)
{
	var elSel = document.getElementById('selectX');
	if (elSel.selectedIndex >= 0) {
		var elOptNew = document.createElement('option');
		elOptNew.text = 'Insert' + num;
		elOptNew.value = 'insert' + num;
		var elOptOld = elSel.options[elSel.selectedIndex];	
		try {
			elSel.add(elOptNew, elOptOld); // standards compliant; doesn't work in IE
		}
		catch(ex) {
			elSel.add(elOptNew, elSel.selectedIndex); // IE only
		}
	}
}

function removeOptionSelected()
{
	var elSel = document.getElementById('selectX');
	var i;
	for (i = elSel.length - 1; i>=0; i--) {
		if (elSel.options[i].selected) {
			elSel.remove(i);
		}
	}
}
*/

function addOptionLast(objSel, OpValue, opText)
{
	var elOptNew = document.createElement('option');
	elOptNew.text = opText;
	elOptNew.value = OpValue;
	//var elSel = document.getElementById('selectX');
	objSel.add(elOptNew); 
	/*
	try {
		objSel.add(elOptNew, null); // standards compliant; doesn't work in IE
	}
	catch(ex) {
		objSel.add(elOptNew); // IE only
	}
	*/
	
}


function removeOptionLast(objSel)
{
	//var elSel = document.getElementById('selectX');
	if (objSel.length > 0)
	{
		objSel.remove(objSel.length - 1);
	}
}

function limitText(limitField, limitNum) 
{
	if (limitField.value.length > limitNum) 
	{
		limitField.value = limitField.value.substring(0, limitNum);
	} 
	
}

