////////////////////////////////////////////////////////////////////////////
//'	* ASP-Nuke Community 1.4 Copyright © 2004 by Rolf Thomassen            *
//'	* (mrspock(a)rediff.com) http://www.rot.dk                             *
////////////////////////////////////////////////////////////////////////////
function ToggleImage(imgId, img_block, img_none) {
	var d = findObj("div_"+imgId);
	var i = findObj("img_"+imgId);
	if (i != null) {
		if (d.style.display != "none")
			i.src = img_block;
		else
			i.src = img_none;
	}
}

function ToggleBlock(divId) {
	var d = findObj(divId);
	if (d != null) 	{
		if (d.style.display != 'none')
			d.style.display = 'none';
		else
			d.style.display = 'block';
	}
//	SetCookie(divId,d.style.display,365);
}

//GfB :: cambio classe CSS
function setCssClass(objName, cls)
{
  obj = findObj(objName);
	obj.className = cls;
}

// time function by Zach Nakaska
function SetCookie(cookieName, cookieValue, nDays) {
	var today = new Date();
	var expire = new Date();
	if (nDays == null || nDays == 0)
		nDays = 1;
	expire.setTime(today.getTime() + 3600000*24*nDays);
	document.cookie = cookieName + "=" + escape(cookieValue) + ";expires=" + expire.toGMTString();
}

function bgc(which,color){
	if (document.all||document.getElementById){
		which.style.backgroundColor= color;
	}
}

function bc(which,color){
	if (document.all||document.getElementById){
		which.style.border="1px solid "+color;
		which.style.cursor="default";
	}
}

// Example: obj = findObj("image1");
function findObj(theObj, theDoc)
{
  var p, i, foundObj;
  
  if(!theDoc) theDoc = document;
  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  {
    theDoc = parent.frames[theObj.substring(p+1)].document;
    theObj = theObj.substring(0,p);
  }
  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  for (i=0; !foundObj && i < theDoc.forms.length; i++) 
    foundObj = theDoc.forms[i][theObj];
  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
    foundObj = findObj(theObj,theDoc.layers[i].document);
  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  
  return foundObj;
}


function disableRightClick(e)
{
  var oggi = new Date();
  var anno = oggi.getYear();
  var message = "evanTV\nCopyright " + anno + " - all right reserved.";
  
  if(!document.rightClickDisabled) // initialize
  {
    if(document.layers) 
    {
      document.captureEvents(Event.MOUSEDOWN);
      document.onmousedown = disableRightClick;
    }
    else document.oncontextmenu = disableRightClick;
    return document.rightClickDisabled = true;
  }
  if(document.layers || (document.getElementById && !document.all))
  {
    if (e.which==2||e.which==3)
    {
      alert(message);
      return false;
    }
  }
  else
  {
    alert(message);
    return false;
  }
}
disableRightClick();
