function ShowHide (id, v) {
	o = document.getElementById(id);
	if (v==0) o.style.display = 'none';
	else o.style.display = 'block';
}

function checkAll(oForm, cbName, checked)
{
	for (var i=0; i < oForm[cbName].length; i++) oForm[cbName][i].checked = checked;
}

function placeholder(name,string){
	$j("input[name="+name+"]").focus(function() {
		if (this.value == string) this.value = "";

	});

	$j("input[name="+name+"]").blur(function() {
		if ($j.trim(this.value) == "") this.value = string;
	});

	$j("input[name="+name+"]").parents('form').submit(function(){
		$j(this).find("input[name*="+name+"]").each(function(){
			if(this.value==string) this.value="";
		});
		return true;

	})
}

function setCookie(name, value, expires, path, domain, secure) {
	if (!name || !value) return false;
	var str = name + '=' + encodeURIComponent(value);

	if (expires) str += '; expires=' + expires.toGMTString();
	if (path)    str += '; path=' + path;
	if (domain)  str += '; domain=' + domain;
	if (secure)  str += '; secure';

	document.cookie = str;
	return true;
}

function getCookie(name) {
	var pattern = "(?:; )?" + name + "=([^;]*);?";
	var regexp  = new RegExp(pattern);

	if (regexp.test(document.cookie))
	return decodeURIComponent(RegExp["$1"]);

	return false;
}

function deleteCookie(name, path, domain) {
	setCookie(name, null, new Date(0), path, domain);
	return true;
}
