function openWin(url) {
	win = window.open(url, '_blank', 'toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1');
	win.blur();
}

function reveal(id)
{
	if (document.getElementById(id).style.marginRight != "2px")
	{
		document.getElementById(id).style.display = "none";
	}
}

function hide(id)
{
	if (document.getElementById(id).style.marginRight != "2px")
	{
		document.getElementById(id).style.display = "block";
	}
}


//this is the frontpage click function, this extends the size of the box the code is in
function fpclicked(id, url, code,input, box)
{
	document.getElementById(id).style.display = "none";
    document.getElementById(id).style.marginRight = "2px";
    document.getElementById('c'+id).style.overflow = "visible";
	document.getElementById(box).style.paddingBottom = "24px";
    var theInput = document.getElementById(input);
    copy(code);
	openWin(url);
    
    theInput.focus();
    theInput.select();

}

function clicked(id, url, code,input)
{
	document.getElementById(id).style.display = "none";
    document.getElementById(id).style.marginRight = "2px";
	var x = document.getElementById('c'+id);
    x.style.overflow = "visible";
	x.style.height = "43px";
	
    var theInput = document.getElementById(input);
    copy(code);
	openWin(url);
    
    theInput.focus();
    theInput.select();
}

function clickedNoId(url, code,input)
{
    var theInput = document.getElementById(input);
    copy(code);
	openWin(url);
    
    theInput.focus();
    theInput.select();
}

function copy(code) 
{
  if (code.createTextRange) {
    var range = code.createTextRange();
    if (range && BodyLoaded==1)
      range.execCommand('Copy');
    } 
    else 
    {
        ///for firefox?
    }
}