		//previousEl='RP<%=FirstRPDoc%>';
		previousEl='';
		function showNews(id)
		{
		//debugger;
			c_id='content_'+id;
			if(previousEl!='')
			{
				el = document.getElementById('content_'+previousEl);
				el.style.display="none";
				el.style.visibility="hidden";
				document.getElementById('div_'+previousEl).style.backgroundColor="#f7f3e7";
			}
			el = document.getElementById(c_id);
			el.style.display="block";
			el.style.visibility="visible";
			document.getElementById('div_'+id).style.backgroundColor="yellow";
			document.getElementById('articleDiv').scrollTop = 0;
			previousEl=id;
//			document.getElementById('document').value = id;
			
			childel = document.getElementById('content_'+id);
			child = childel.getElementsByTagName('SPAN');
			myhref=child[0].id;
			
			myel = document.getElementById('downloadButtons');
			myel.childNodes[0].href = myhref;
			//mychildnode = myel.childNodes[0];
			//mychildnode.setAttribute("href", "test.html");
			myel.innerHTML='<a href="'+myhref+'"><img src="i/DOWNLOAD1.gif"></a>';
		}
		previousForm = '';
		function show(divName)
		{
			if(previousForm!='')
			{
				el = document.getElementById(previousForm);
				el.style.display='none';
				el.style.visibility='hidden';
				previousForm = '';
			}
			if(divName!='')
			{
				el = document.getElementById(divName);
				el.style.display='block';
				el.style.visibility='visible';
				previousForm=divName;
			}
		}
		
		
function validate_required(value)
{
   if (value==null||value==""){return false}
   else {return true}   
}

function validate_form(frm)
{
     var err_count;
     //var x=document.getElementById('frm');
     x=frm;
     var fname=x.fname.value;
     var lname=x.lname.value;
     var comp=x.company.value;
     var email=x.email.value;
     var jfun=x.jfunction.value;
     var sect=x.sector.value;
     if (frm.id=='cmnt')
		var comments=x.comments.value;
     var err_msg="";

     document.getElementById('errs').innerHTML="";
     x.fname.style.backgroundColor="white";
     x.lname.style.background="white";
     x.company.style.background="white";
     x.email.style.background="white";
     x.jfunction.style.background="white";
     x.sector.style.background="white";
     if (frm.id=='cmnt')
		x.comments.style.background="white";
     err_count = 0;

     if (validate_required(fname)==false)
        {
        err_count++;
        err_msg="First name required!<br>";
        x.fname.style.background="yellow";
        }

     if (validate_required(lname)==false)
        {
        err_count++;
        err_msg="Last name required!<br>";
        x.lname.style.background="yellow";
        }

     if (validate_required(comp)==false)
        {
        err_count++;
        err_msg="Company name required!<br>";
        x.company.style.background="yellow";
        }

     if (validate_required(email)==false)
        {
        err_count++;
        err_msg="Email required!<br>";
        x.email.style.background="yellow";
        }

     if (validate_required(jfun)==false)
        {
        err_count++;
        err_msg="Job function required!<br>";
        x.jfunction.style.background="yellow";
        }

     if (sect=="Select Sector")
     {
		err_count++;
		err_msg="Select sector required!<br>";
		x.sector.style.background="yellow";
	 }

	if(frm.id=='cmnt')
	{
		if (comments=="")
		{
			err_count++;
			err_msg="Please enter your comments.";
			x.comments.style.background="yellow";
		}
	}
	
     if (err_count > 1){err_msg="All fields are required!"}
     document.getElementById('errs').innerHTML=err_msg;

     if (err_count == 0)
     {
		getPage(frm);
     } else {return false}
}



var http_request = false;

function makePOSTRequest(url, parameters)
{
	http_request = false;
	if (window.XMLHttpRequest)
	{ // Mozilla, Safari,...
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType)
		{
			// set type accordingly to anticipated content type
			//http_request.overrideMimeType('text/xml');
			http_request.overrideMimeType('text/html');
		}
	}
	else if (window.ActiveXObject)
	{ // IE
		try {
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				http_request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}
	
	if (!http_request)
	{
		alert('Cannot create XMLHTTP instance');
		return false;
	}

	http_request.onreadystatechange = alertContents;
	http_request.open('POST', url, true);
	http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	http_request.setRequestHeader("Content-length", parameters.length);
	http_request.setRequestHeader("Connection", "close");
	http_request.send(parameters);
}

	function alertContents()
	{
		if (http_request.readyState == 4)
		{
			if (http_request.status == 200)
			{
				//alert(http_request.responseText);
				result = http_request.responseText;
				//alert(result);
				if (result=='succeeded')
				{
					el = document.getElementById('Comments');
					el.style.display = 'none';
					el.style.visibility = 'hidden';
					el = document.getElementById('commentsSucceeded');
					el.style.display = 'block';
					el.style.visibility = 'visible';
					previousForm = 'commentsSucceeded';
				}
				else
				{
					document.getElementById('Comments').innerHTML = 'ERROR';
				}
			}
			else
			{
				alert('There was a problem with the request.');
				alert(http_request.responseText);
			}
		}
	}
   
	function getPage(frm) 
	{
	//alert(frm.id);
		var poststr = "fname=" + encodeURI( frm.fname.value ) +
                    "&lname=" + encodeURI( frm.lname.value ) + 
                    "&email=" + encodeURI( frm.email.value ) +
                    "&company=" + encodeURI( frm.company.value ) +
                    "&jfunction=" + encodeURI( frm.jfunction.value ) +
                    "&sector=" + encodeURI( frm.sector.value );
		if(frm.id=='cmnt')
			poststr += "&comments=" + encodeURI( frm.comments.value) + "&formType=" + encodeURI( "comment" ) + "&document=" + encodeURI( previousEl );
		else
			poststr += "&formType=" + encodeURI( "download" ) + "&document=" + encodeURI( previousEl );
		//alert(poststr);				
		makePOSTRequest('ajaxTest.asp', poststr);
	}

