function setmail(idstr){	addr = idstr+'@dsscorp.com';	anc = '<a href="mailto:'+addr+'">'+addr+'</a>';	//alert (anc);	document.getElementById(idstr).innerHTML = anc;}//Search functionsfunction initOverLabels () {  if (!document.getElementById) return;        var labels, id, field;  // Set focus and blur handlers to hide and show   // labels with 'overlabel' class names.  labels = document.getElementsByTagName('label');  for (var i = 0; i < labels.length; i++) {    if (labels[i].className == 'overlabel') {      // Skip labels that do not have a named association      // with another field.      id = labels[i].htmlFor || labels[i].getAttribute ('for');      if (!id || !(field = document.getElementById(id))) {        continue;      }       // Change the applied class to hover the label       // over the form field.      labels[i].className = 'overlabel-apply';      // Hide any fields having an initial value.      if (field.value !== '') {        hideLabel(field.getAttribute('id'), true);      }      // Set handlers to show and hide labels.      field.onfocus = function () {        hideLabel(this.getAttribute('id'), true);      };      field.onblur = function () {        if (this.value === '') {          hideLabel(this.getAttribute('id'), false);        }      };      // Handle clicks to label elements (for Safari).      labels[i].onclick = function () {        var id, field;        id = this.getAttribute('for');        if (id && (field = document.getElementById(id))) {          field.focus();        }      };    }  }};function hideLabel (field_id, hide) {  var field_for;  var labels = document.getElementsByTagName('label');  for (var i = 0; i < labels.length; i++) {    field_for = labels[i].htmlFor || labels[i].getAttribute('for');    if (field_for == field_id) {      //labels[i].style.left = (hide) ? '-500px' : '65px';      labels[i].style.top= (hide) ? '-20px' : '3px';      return true;    }  }}/////////////////////////////////////////////////////////////////////////////////////////////////////function validEmail(src) {     var emailReg = "^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$";     var regex = new RegExp(emailReg); 	return src.match(regex);  }//#################################################// ajax newsub to webservices//#################################################var msg_success = 'Thank you';var msg_fail = 'Failed to connect';var msg_emailfail = "That is not a valid address.";var msg_label = 'Email';var myGlobalHandlers = {	onCreate: function(){		$('aj_prcsimg').src = 'aj_loading.gif';		Form.disable('aj_nwsform');			},	onComplete: function() {		if(Ajax.activeRequestCount == 0){			$('aj_prcsimg').src = 'gb.gif';			Form.enable('aj_nwsform');		}	}};function subeml(){	//check email	var poststr = escape($F('nws_email'));	if (validEmail(poststr)){		poststr = 'email='+poststr;		var url = 'imasurvey_submit?openagent';		var myAjax = new Ajax.Request(			url, 			{				method: 'post', 				parameters: poststr, 				onSuccess: nws_success,				onFailure: nws_fail			});	}else{		//alert(poststr);		var id = "aj_nwsmsg";		$(id).update(msg_emailfail);		if( !($(id).hasClassName('nws_mfail')) ){			$(id).toggleClassName('nws_mfail');		}	}}function nws_success(originalRequest){	var nwsmsg = $('aj_nwsmsg');    if (originalRequest.responseText.match('true')){      nwsmsg.update(msg_success).setStyle({ background: '#dfd' });    }else{      nwsmsg.update(msg_fail).setStyle({ background: '#fdd' });	}	$('nws_email').value = msg_label;}function nws_fail(){	var id = "aj_nwsmsg";	$(id).update(msg_fail);	if( !($(id).hasClassName('nws_mfail'))){			$(id).toggleClassName('nws_mfail');		}}function subeml_key(e) {	subeml();	Event.stop(e); //stop submit on enter when js is enabled}function eml_label(e) {	var email = Event.element(e);	emailval = email.value;	if( emailval == msg_label || emailval == msg_success || emailval == msg_fail){		email.value = '';		$('aj_nwsmsg').update('');	}}function eml_label_off(e) {	var email = Event.element(e);	if(email.value == '' || emailval == msg_success || emailval == msg_fail){		email.value = msg_label;	}}function aj_nwsformobservers(){	var id = "nws_email";	if ($('aj_nwsform')){		Event.observe('aj_nwsform', 'submit', subeml_key);		Event.observe(id, 'click', eml_label);		Event.observe(id, 'blur', eml_label_off);		Event.observe(id, 'focus', eml_label);	}}//#################################//window onload init eventswindow.onload = function () {	initOverLabels();	Ajax.Responders.register(myGlobalHandlers);	aj_nwsformobservers();}