//passQuerystring()
//Author: Andrew Baizen 2/6/04
//this function gets called in the body onload to capture the values in the querystring and pass it
//to the whatever page is linked to from this page, hopefully an asp page.
function passQuerystring() {
var querystring = window.location.search;
var i;
	if (querystring != ''){

	querystring=querystring.replace('?', '');
	
		for (i=0; i < document.links.length; i++){
			var str=document.links[i].href;
			var pos=str.indexOf("?");
			var query=str.indexOf('javascript');
			var internalLink=str.indexOf('#');

			if (query==-1 && internalLink==-1){
				if ((pos>=0))
				{
					document.links[i].href = str + '&' + querystring;
				}
				else
				{
					document.links[i].href = str + '?' + querystring;
				}
			}
		}
		
		for (i=0; i < 1; i++){
			var query=str.indexOf('javascript');
			querystring=querystring.replace('cid=', '');
			
			function addField (form, fieldType, fieldName, fieldValue) {
			  if (document.getElementById) {
			    var input = document.createElement('INPUT');
			      if (document.all) { // what follows should work 
			                          // with NN6 but doesn't in M14
			        input.type = fieldType;
			        input.name = fieldName;
			        input.value = fieldValue;
			      }
			      else if (document.getElementById) { // so here is the
			                                          // NN6 workaround
			        input.setAttribute('type', fieldType);
			        input.setAttribute('name', fieldName);
			        input.setAttribute('value', fieldValue);
			      }
				  if (document.forms.count > 0) {
			    	form.appendChild(input);
					}
			  }
			}

			if (query==-1){
				
				addField(document.forms[i], "hidden", "cid", querystring);

			}
			
		}
	}
}
