function initSearch(formid) {
    var urlString = 'http://www.remixjunkee.com';
	var vid = 0;
	var cid = 0;
	if (formid == 'fProducer') {
	 vid = document.getElementById('vid').value;
	 //alert(vid);
	 var optionArray = vid.split(',');
	 //alert('ID: ' + optionArray[0] + ' TYPE:' + optionArray[1]);
	 if (optionArray[1] == 'num') {
	 	document.location = urlString + '/vendor/?vid=' + optionArray[0];
	 }
	 else if (optionArray[1] == 'str') {
	 	document.location = urlString + '/' + optionArray[0];
	 }
	}
	else if (formid == 'fCat') {
	 cid = document.getElementById('cid').value;
	 var optionArray = cid.split(',');
	 if (optionArray[1] == 'num') {
	 	document.location = urlString + '/category/?cid=' + cid;
	 }
	 else if (optionArray[1] == 'str') {
	 	document.location = urlString + '/' + optionArray[0];
	 }
	}
}

function validateSideNavForm() {
  var errorAlert = "";
  var reqbgcolor = '#FFD2D2';
  var errorStartPos = 0;

  if (document.getElementById("EmailAddressSideNav").value.length < 5) {
	errorAlert += "- Please enter a valid Email address\n";
	document.getElementById("EmailAddressSideNav").focus();
	document.getElementById("EmailAddressSideNav").style.backgroundColor = reqbgcolor; //ie
	errorStartPos = 1;
  }
  if (document.getElementById("PasswordSideNav").value.length < 5) {
	errorAlert += "- Please enter your password\n";
	if (errorStartPos == 0) {
		document.getElementById("PasswordSideNav").focus();
		errorStartPos = 2;
	}
	document.getElementById("PasswordSideNav").style.backgroundColor = reqbgcolor;
  }
  if (errorAlert != "") {
	alert(errorAlert);
	return false;
  }
  else {
	return true;
  }

}

function checkShippingSelected() {
	var selectedService = null;
	for (i=0;i<document.fBilling.rShipSelection.length;i++) {
		if (document.fBilling.rShipSelection[i].checked) {
			selectedService = document.fBilling.rShipSelection[i].value;
		}
	}
	if (selectedService == null) {
		//set first shipping service radio button in group
		if (document.fBilling.rShipSelection.length >= 1) {
			document.fBilling.rShipSelection[0].checked = true;
		}
		else {
			document.fBilling.rShipSelection.checked = true;
		}
	}
}

function clearContents(fieldId) {
	 document.getElementById(fieldId).value = "";
}
