///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//Disable right mouse click Script
//By Maximus (maximus@nsimail.com) w/ mods by DynamicDrive
//For full source code, visit http://www.dynamicdrive.com	
function clickIE4() { if (event.button==2) return false; }
function clickNS4(e) { if (document.layers||document.getElementById&&!document.all) { if (e.which==2||e.which==3) return false; } }
if (document.layers) { document.captureEvents(Event.MOUSEDOWN); document.onmousedown=clickNS4(); }
else if (document.all&&!document.getElementById) { document.onmousedown=clickIE4(); }
document.oncontextmenu=new Function("return false;");
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function GetXmlHttpObject()
{
  var xmlHttp=null;
  try
  {
        // Firefox, Opera 8.0+, Safari
        xmlHttp=new XMLHttpRequest();
  }
  catch (e)
  {
        // Internet Explorer
        try
        {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (e)
        {
            xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
  }
  return xmlHttp;
}

function showPage(theurl,b)
{
    xmlHttp=GetXmlHttpObject();
    if (xmlHttp==null) { alert ("Your browser does not support AJAX!"); return; }
    xmlHttp.onreadystatechange=function()
    {
        if (xmlHttp.readyState==4) document.getElementById(b).innerHTML=xmlHttp.responseText;
    }
    xmlHttp.open("GET",theurl,true);
    xmlHttp.send(null);
    
    // thickbox
    setTimeout("tb_init(\"a.thickbox, area.thickbox, input.thickbox\")",500);
}

function showPageAdmin(theurl)
{
    theViewer = document.getElementById("pageViewerAdmin");
    theViewer.src = theurl;
}

function setTheValue(a,b)
{	
	where=document.getElementById(a);
	where.value=b;
	//alert(where.name+" - "+where.value);
	
	selHidden=document.getElementById("catSelection");
	sel=document.getElementById("theSelect");
	selHidden.value=sel.options[0].value;
	//alert(selHidden.value);
}

function getConfirmation(k)
{	
	var confirmation=window.confirm("ATTENTION!\n\n Changing or deleting an element is an irreversible action. If you are sure that you want to perform the selected action press OK. If you are not sure press Cancel.");
	if (confirmation) eval(k);
	else;
}

//Hides all status bar messages
//Visit rainbow.arch.scriptmania.com for this script and more
function hidestatus()
{
	window.status='';
	return true;
}

document.onmouseover=hidestatus;
document.onmouseout=hidestatus;
document.onclick=hidestatus;
document.onmousedown=hidestatus;

function slideEffect(a)
{
    theDiv = document.getElementById(a);
    if (theDiv.style.display == "none") slidedown(a);
    else slideup(a);
}

function makeHtml(a,b)
{    
    theTextarea = document.getElementById(a);    
    theSelection = theTextarea.value.substr(theTextarea.selectionStart, theTextarea.selectionEnd - theTextarea.selectionStart);
    
    if (b == 'link'){
        theLink = window.prompt("Give the url for the link. If you want to link to an e-mail address add\n\nmailto:\n\nin front of the e-mail address. Otherwise write the full url\n\ne.g. http://www.gogtzilas.com \n\n");
        newText = "<a href='" + theLink + "'>"+theSelection+"</a>";
    }
    else if (b == 'bold'){        
        newText = "<b>"+theSelection+"</b>";
    }
    
    theTextarea.value =  theTextarea.value.substring(0,theTextarea.selectionStart) + newText + theTextarea.value.substring(theTextarea.selectionEnd,theTextarea.value.length);    
}