$(document).ready(function(){
  	                   
	        
	 $('#banner_slideshow1').innerfade({
		 speed: 'slow',
		 timeout: 5000,
		 type: 'random',
		 containerheight: '80px'
	 });
	
	 $('#banner_slideshow2').innerfade({
		 speed: 'normal',
		 timeout: 4000,
		 type: 'random',
		 containerheight: '80px'
	 });
	
	 $('#banner_slideshow3').innerfade({
		 speed: 'slow',
		 timeout: 7000,
		 type: 'random',
		 containerheight: '80px'
	 });
	 
	 
 }); 
  
  
  function backToSearch(){
	  var city = getCookie('m_city');
	  var country = getCookie('m_country');
	  var area = getCookie('m_area');
	  var region = getCookie('m_region');
	  var zip = getCookie('m_zip');
	  
//	  setCookie('m_country', '', 1, '/');
//	  setCookie('m_city', '', 1, '/');
//	  setCookie('m_area', '', 1, '/');
//	  setCookie('m_zip', '', 1, '/');
	  
	  if(city != '' || city != undefined || city != null) {
		  $('#m_city').val(city);
	  }
	  
	  if(country != '' || country != undefined || country != null) {
		  $('#m_country').val(country);
	  }
	  
	  if(area != '' || area != undefined || area != null) {
		  $('#m_area').val(area);
	  }
	  
	  if(region != '' || region != undefined || region != null) {
		  $('#m_region').val(region);
	  }
	  
	  if(zip != '' || zip != undefined || zip != null) {
		  $('#m_zip').val(zip);
	  }
	  
	  $('#search_derm').submit();
	  
  }
  
  function utf8_decode ( str_data ) {
	    // Converts a UTF-8 encoded string to ISO-8859-1  
	    // version: 810.1317
	  
	    var tmp_arr = [], i = ac = c1 = c2 = c3 = 0;

	    str_data += '';

	    while ( i < str_data.length ) {
	        c1 = str_data.charCodeAt(i);
	        if (c1 < 128) {
	            tmp_arr[ac++] = String.fromCharCode(c1);
	            i++;
	        } else if ((c1 > 191) && (c1 < 224)) {
	            c2 = str_data.charCodeAt(i+1);
	            tmp_arr[ac++] = String.fromCharCode(((c1 & 31) << 6) | (c2 & 63));
	            i += 2;
	        } else {
	            c2 = str_data.charCodeAt(i+1);
	            c3 = str_data.charCodeAt(i+2);
	            tmp_arr[ac++] = String.fromCharCode(((c1 & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
	            i += 3;
	        }
	    }

	    return tmp_arr.join('');
	}


  function getCookie(c_name)
  {
  if (document.cookie.length>0)
    {
    c_start=document.cookie.indexOf(c_name + "=");
    if (c_start!=-1)
      {
      c_start=c_start + c_name.length+1;
      c_end=document.cookie.indexOf(";",c_start);
      if (c_end==-1) c_end=document.cookie.length;
      return unescape(document.cookie.substring(c_start,c_end));
      }
    }
  return "";
  }
  


  