function rightOf(what,howmanychar) {
	return what.substr(what.length-howmanychar,howmanychar)
	}
function midOf(what,fromwhere) {
	return what.substr(fromwhere-1,what.length-fromwhere+1)
	}
function leftOf(what,howmanychar) {
	return what.substr(0,howmanychar)
	}
function changestatus(which,whichmenu,whichsubmenu) {
	currentlocation = "" + document.location + "";
	if (currentlocation.indexOf("?") == -1)
		{ document.location = document.location + "?expand=" + which.toString() + "&amp;menu=" + whichmenu.toString() + "&amp;submenu=" + whichsubmenu.toString(); }
	else
		{ 
		currentMenu = leftOf(midOf(currentlocation,currentlocation.indexOf("?")+7),1);
		currentSubmenu = leftOf(midOf(currentlocation,currentlocation.indexOf("?")+17),1);
		if ((which!=currentMenu)||(whichmenu!=currentMenu)||(whichsubmenu!=currentSubmenu))
			{ document.location = leftOf(currentlocation,currentlocation.indexOf("?")) + "?expand=" + which.toString() + "&amp;menu=" + whichmenu.toString() + "&amp;submenu=" + whichsubmenu.toString(); }
		}
	}
function xxtest() {
	document.getElementById("ctest").innerHTML="<li>another item here</li>";
	}
function ltrim(s) {
	return s.replace( /^\s*/, "" );
	}
function rtrim(s) {
	return s.replace( /\s*$/, "" );
	}
function trim(s) {
	return rtrim(ltrim(s));
	}
function validate()	{
	if (trim(frmSend.name.value)!="")
		{
		if (trim(frmSend.email.value)!="")
			{
			if (frmSend.email.value.indexOf("@")>=1)
				{
				if (trim(frmSend.source.value)!="")
					{
					if ((document.getElementById('zupform').style.visibility=='hidden')&&(document.getElementById('xxxstatus').innerHTML!='transfer completed successfully'))
						{ alert("The file transfer isn't finished..."); }
					else	
						{ frmSend.submit(); }
					}
				else
					{ alert("field 'How did you hear about Response?' is mandatory"); }
				}
			else
				{ alert("The Email field must contain the @ sign"); }
			}
		else
			{ alert("Email field is mandatory"); }
		}
	else
		{ alert("Name field is mandatory"); }
	}
function checkStatus() {
	if (document.getElementById('wsdd').innerHTML.substring(0,7)=="message")
		{
		document.getElementById('xxxstatus').innerHTML=document.getElementById('wsdd').innerHTML.substring(7);
		}
	if (document.getElementById('wsdd').innerHTML.substring(0,7)=="failure")
		{
		document.getElementById('xxxstatus').innerHTML='transfer failed';
		}
	else
		{
		
			document.getElementById('xxxstatus').innerHTML='transfer completed successfully';
			frmSend.xuploadedfile.value=document.getElementById('wsdd').innerHTML.substring(7);
				}
	}


  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-28329718-1']);
  _gaq.push(['_setDomainName', 'responsebio.com']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();



  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-28329718-1']);
  _gaq.push(['_setDomainName', 'responsebio.com']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();



