
function showDiv(divName) {
	document.getElementById(divName).style.display = 'block';
}

function hideDiv(divName) {
	document.getElementById(divName).style.display = 'none';
}

function showResponse(req, target){
    $(target).innerHTML= req.responseText;
}

function redirect(url) {
	window.location = url;
}

function instanceRedirect(text, li) {

	showDiv('instanceIndicatorResult');

	redirect(li.id)
	
}

function slideDownDiv(div) {
	showDiv(div);
}


function clickCampainClick() {
	new Ajax.Request("/ajax/clickCampain/click.php",
		{
		method: 'post',
        postBody: 'click=yesbox',
		onComplete: function(transport)
			{
			    $('calendar_clickcampain_container').innerHTML= transport.responseText;
            }
    	});

}


function getCheckedValue(radioObj) {
		if(!radioObj)
			return "";
		var radioLength = radioObj.length;
		if(radioLength == undefined)
			if(radioObj.checked)
				return radioObj.value;
			else
				return "";
		for(var i = 0; i < radioLength; i++) {
			if(radioObj[i].checked) {
				return radioObj[i].value;
			}
		}
		return "";
	}
	
	
	
function disableEnterKey(e)
{
     var key;      
     if(window.event)
          key = window.event.keyCode; //IE
     else
          key = e.which; //firefox      

     return (key != 13);
}



function goToAnchor(nameAnchor){
     //window.location.hash=nameAnchor;
     window.location = String(window.location).replace(/\#.*$/, "") + "#" + nameAnchor;
}