function selectText() {
	var f = document.tfb_sf.bn;
	if (f.value == 'search your favorite brand here...') {
		f.value = '';
	}
	else if (f.value == '') {
		f.value = 'search your favorite brand here...';
	}
	else {
		f.select();
	}
}

function deleteCookie ( cookie_name )
{
	var cookie_date = new Date ( );  // current date & time
	cookie_date.setTime ( cookie_date.getTime() - 1 );
	document.cookie = cookie_name += "=; expires=" + cookie_date.toGMTString() + ";path=/";
}

function getCookie ( cookie_name )
{
	var results = document.cookie.match ( '(^|;) ?' + cookie_name + '=([^;]*)(;|$)' );

	if ( results )
		return ( unescape ( results[2] ) );
	else
		return null;
}

function showRecaptcha(element) {
  Recaptcha.create("6Lcu1QoAAAAAALJF4fUz0yoc6QY2_OJqfvutoykx", element, {
        theme: 'white',
        tabindex: 0,
        callback: Recaptcha.focus_response_field
  });
}

function getRecaptchaChallenge() {
  return Recaptcha.get_challenge();
}

function getRecaptchaResponse() {
  return Recaptcha.get_response();
}

function destroyRecaptchaWidget() {
  Recaptcha.destroy();
}

function highlightCoupon(eventName, idNum) {
	if(eventName=='mouseOver') {
	   style = document.getElementById('zc_code_'+idNum).style
	   if (document.getElementById('zc_status_'+idNum).innerHTML != 'copied!') {
		style['backgroundColor'] = '#fff94b'
		document.getElementById('zc_status_' + idNum).innerHTML = 'click to copy and claim it now!';
		document.getElementById('zc_status_'+ idNum).style.display='block';
	   }
	}
	else if(eventName=='mouseOut') {
	   style = document.getElementById('zc_code_'+idNum).style
	   if (document.getElementById('zc_status_'+idNum).innerHTML != 'copied!') {
		style['backgroundColor'] = 'transparent'
		document.getElementById('zc_status_'+idNum).style.display='none';
	   }
	}
}

function search(searchForm, act) {
	searchForm.action = act;
	searchForm.submit();
}

function bookmarkPage(url, title){
	if (window.sidebar){ // firefox
	    window.sidebar.addPanel(title, url, "");
	}
	else if(window.opera && window.print){ // opera
	    var elem = document.createElement('a');
	    elem.setAttribute('href',url);
	    elem.setAttribute('title',title);
	    elem.setAttribute('rel','sidebar');
	    elem.click();
	}
	else if(document.all)// ie
	    window.external.AddFavorite(url, title);
}