function transclick() {
var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById('trans');
  else if( document.all ) // this is the way old msie versions work
      elem = document.all['trans'];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers['trans'];
  vis = elem.style;
  // if the style.display value is blank we try to figure it out here
  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
    vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
  vis.display = (vis.display==''||vis.display=='block')?'none':'block';

         var elem1, vis1;
  if( document.getElementById ) // this is the way the standards work
    elem1 = document.getElementById('freevector-panel');
  else if( document.all ) // this is the way old msie versions work
      elem1 = document.all['freevector-panel'];
  else if( document.layers ) // this is the way nn4 works
    elem1 = document.layers['freevector-panel'];
  vis1 = elem1.style;
  // if the style.display value is blank we try to figure it out here
  if(vis1.display==''&&elem1.offsetWidth!=undefined&&elem1.offsetHeight!=undefined)
    vis1.display = (elem1.offsetWidth!=0&&elem1.offsetHeight!=0)?'block':'none';
  vis1.display = (vis1.display==''||vis1.display=='block')?'none':'block';
        }

function downloadclick(link) {
	document.getElementById('docname').value=link;
	var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById('trans');
  else if( document.all ) // this is the way old msie versions work
      elem = document.all['trans'];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers['trans'];
  vis = elem.style;
  // if the style.display value is blank we try to figure it out here
  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
    vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
  vis.display = (vis.display==''||vis.display=='block')?'none':'block';
document.getElementById('download-panel').style.display = 'block';}

function downloadcancelclick() {
var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById('trans');
  else if( document.all ) // this is the way old msie versions work
      elem = document.all['trans'];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers['trans'];
  vis = elem.style;
  // if the style.display value is blank we try to figure it out here
  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
    vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
  vis.display = (vis.display==''||vis.display=='block')?'none':'block';

         var elem1, vis1;
  if( document.getElementById ) // this is the way the standards work
    elem1 = document.getElementById('download-panel');
  else if( document.all ) // this is the way old msie versions work
      elem1 = document.all['download-panel'];
  else if( document.layers ) // this is the way nn4 works
    elem1 = document.layers['download-panel'];
  vis1 = elem1.style;
  // if the style.display value is blank we try to figure it out here
  if(vis1.display==''&&elem1.offsetWidth!=undefined&&elem1.offsetHeight!=undefined)
    vis1.display = (elem1.offsetWidth!=0&&elem1.offsetHeight!=0)?'block':'none';
  vis1.display = (vis1.display==''||vis1.display=='block')?'none':'block';
        }

function DownloadForm_Validator()
{
	if (trimAll(document.getElementById('download_name').value) == "Name*" || trimAll(document.getElementById('download_name').value) == "" )
	{
	alert("Please enter a value for the \"Name\" field.");
	document.getElementById('download_name').focus();
	return (false);
	}
	
	//E-Mail
	if (trimAll(document.getElementById('download_email').value) == "" )
	{
	alert("Please enter a value for the \"E-Mail\" field.");
	document.getElementById('download_email').focus();
	return (false);
	}
	var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890_.@ \t\r\n\f";
	var checkStr = document.getElementById('download_email').value;
	var allValid = true;
	var validGroups = true;
	for (i = 0; i < checkStr.length; i++)
	{
	ch = checkStr.charAt(i);
	for (j = 0; j < checkOK.length; j++)
	if (ch == checkOK.charAt(j))
	break;
	if (j == checkOK.length)
	{
	allValid = false;
	break;
	}
	if (checkStr.indexOf('@') == -1 || checkStr.indexOf('.') == -1 )
	{
	allValid = false;
	break;
	}
	}
	if (!allValid)
	{
	alert("Please enter a valid id in the \"E-Mail \" field.");
	document.getElementById('download_email').focus();
	return (false);
	}
	if (trimAll(document.getElementById('download_name').value) != "" && trimAll(document.getElementById('download_email').value) != "" )
	{
	alert("Login to TWB Extranet to download all Case Study/ Position Paper/ Whitepaper");
	return (true);
	}
	return (true);
}
function trimAll(sString)
{
while (sString.substring(0,1) == ' ')
{
sString = sString.substring(1, sString.length);
}
while (sString.substring(sString.length-1, sString.length) == ' ')
{
sString = sString.substring(0,sString.length-1);
}
return sString;
}
