// JavaScript Document
function showPopup(){
	if (document.getElementById('emailJoe').style.display == 'block'){
		document.getElementById('emailJoe').style.display = 'none';
		return true;
	}else if (document.getElementById('emailJoe').style.display == 'none'){
		document.getElementById('emailJoe').style.display = 'block';
		return true;
	}		
}
/// function to hide or display a div element
function hideNseek(vId){
	velem = document.getElementById(vId)
	if (velem.style.display == "none" || velem.style.display == "undefined" || velem.style.display == ""){
		velem.style.display = "block";
	}else if(velem.style.display == "block") {
		velem.style.display = "none";
	}
}


function getRefresh()
{
//	$("#jcAdminShout").fadeIn("slow");
	var param 	= "action1=BLOG&rand="+randomString(6)+"";
	var url 	= "http://www.joecigar.com/jcAdminShout.asp?"+param;
	$j("#jcAdminShout").load(url, '', callback);
}


function callback()
{
//	$("#jcAdminShout").fadeOut("slow");
	$j("#jcAdminShout").jScrollPane();
	setTimeout("getRefresh();", 10000);
}

/// Returns a very random number so ajax pages don't cache on request.
function randomString(len) 
{
	var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
	var string_length = len;
	var randomstring = "";
	for (var i=0; i <= string_length; ++i)
	{
		var rnum = Math.floor(Math.random() * chars.length);
		randomstring += chars.substring(rnum,rnum+1);
	}
	return randomstring;
}

