function getSelect(id) {
	return document.getElementById(id).options[document.getElementById(id).selectedIndex].value;
}

function ShowLoading(id){
	$j('#' + id).html('<img src="' + BASE_URL + 'templates/admin/images/ajax-loader.gif" />');
}

function ProcessMsgs(msg_txt, err_txt) {
	if (msg_txt !== '' || err_txt !== '') {
		$j('#msgsBlock').load(BASE_URL + 'admin/messages.php?PROVIDER_STARTED=' + PROVIDER_STARTED,
			{msg: msg_txt, err: err_txt},
			function() {
				$j('#msgsBlock').show();
				
				var iterations = 1;
				
				if (err_txt) {
					for (i = 0; i < iterations; i++) {
						$j('.contentBlock').effect('highlight', {color: 'red'});
					}
				} else if (msg_txt) {
					for (i = 0; i < iterations; i++) {
						$j('.contentBlock').effect('highlight', {color: 'green'});
					}
				}
				
				if (msg_txt != '' && err_txt == '') {
					setTimeout(function() {
						$j('#msgsBlock').fadeOut(1000);
					}, 3000);
				}
			}
		);
	} else {
		$j('#msgsBlock').html('');
	}
	return false;
}

function ClearMsgs() {
	$j('#msgsBlock').html('');
	return false;
}

function isCookieEnabled() {
	var cookieEnabled = (navigator.cookieEnabled) ? true : false;

	if (typeof navigator.cookieEnabled == "undefined" && !cookieEnabled) {
		document.cookie = "testcookie";
		cookieEnabled   = (document.cookie == "testcookie") ? true : false;
		document.cookie = "";
	}

	return cookieEnabled;
}

function SelectAllToVis() {
	$j('input[rel="rel_for_vis"]').each(function(){$j(this).check('on');})
}

function UnSelectAllToVis() {
	$j('input[rel="rel_for_vis"]').each(function(){$j(this).check('off');})
}

function SelectAllToDel() {
	$j('input[rel="rel_for_del"]').each(function(){$j(this).check('on');})
}

function UnSelectAllToDel() {
	$j('input[rel="rel_for_del"]').each(function(){$j(this).check('off');})
}