// JavaScript Document




function selectAll(cbList,bSelect) {
	for (var i=0; i<cbList.length; i++)
	cbList[i].selected = cbList[i].checked = bSelect
}

function reverseAll(cbList) {
	for (var i=0; i<cbList.length; i++) {
		cbList[i].checked = !(cbList[i].checked)
		cbList[i].selected = !(cbList[i].selected)
	}
}

function selectSqlDView(cbList,bSelect) {
	for (var i=0; i<cbList.length; i++) {
		if (cbList[i].value>1)
			cbList[i].selected = cbList[i].checked = bSelect
	}
}



function popupAdmin(linky,windowname)
{
//	var strFeatures="height=700, width=400, scrollbars=1, resizeable=0, left=50, top=50";


	if (! window.focus)return true;
	var href;
	if (typeof(linky) == 'string')
	href=linky;
	else
	href=linky.href;
	window.open(href, windowname, 'height=700, width=400, scrollbars=1, resizeable=0, left=50, top=50');
	return false;
}



/* for the pop-up help window */
function popup(mylink, windowname, params)
{

	if (! window.focus)return true;
	if (! params) params = 'width=400,height=200,scrollbars=yes';
	var href;
	if (typeof(mylink) == 'string')
	href=mylink;
	else
	href=mylink.href;
	window.open(href, windowname, params);
}


function toggle(rowid) {
	if( document.getElementById(rowid).style.display=='none' )
	{
		document.getElementById(rowid).style.display = '';
	}else{
		document.getElementById(rowid).style.display = 'none';
	}
}

function hiderow(rowid) {
		document.getElementById(rowid).style.display = 'none';
}

function toggle_switch(contentId,switchId) {
var c = document.getElementById(contentId);
var s = document.getElementById(switchId);
if(c.style.display == 'none')
{
c.style.display = 'block';
s.innerHTML = 'hide';
} else {
c.style.display = 'none';
s.innerHTML = 'show';
}
}