$(function() {
    $("#supportButton").click(function() {
      return false;
    });
  });

function contactQuestion()
{
      $('#queryReturn').empty();
     $('#queryReturn').append('<center><img src="http://img.guitar-pro.com/gen/ajax-loader.gif"></center>');
 $.ajax({
   url: '/ajax/contact-question.php?query='+encodeURI(document.getElementById('gsfn_search_query').value)+'&lng='+document.getElementById('lng').value,
   success: function(data) {
     $('#queryReturn').empty();
     $('#queryReturn').append(data);
   }
 });

 //return false;
}

function validateForm()
{
 return true;
}

function createGetSatisfactionTopic()
{
 document.getElementById('gsfn_search_query').value = no_accent(document.getElementById('gsfn_search_query').value);
 document.getElementById('gsfn_search_query').name = 'topic[subject]';
 document.getElementById('getSatForm').submit();
 return true;
}

	function no_accent (my_string) {
		var new_string = "";
		var pattern_accent = new Array("é", "è", "ê", "ë", "ç", "à", "â", "ä", "î", "ï", "ù", "ô", "ó", "ö");
		var pattern_replace_accent = new Array("e", "e", "e", "e", "c", "a", "a", "a", "i", "i", "u", "o", "o", "o");
		if (my_string && my_string!= "") {
			new_string = preg_replace(pattern_accent, pattern_replace_accent, my_string);
		}
		return new_string;
	}

	function preg_replace (array_pattern, array_pattern_replace, my_string)  {
	var new_string = String (my_string);
		for (i=0; i<array_pattern.length; i++) {
			var reg_exp= RegExp(array_pattern[i], "gi");
			var val_to_replace = array_pattern_replace[i];
			new_string = new_string.replace (reg_exp, val_to_replace);
		}
		return new_string;
	}


$.extend({URLEncode:function(c){var o='';var x=0;c=c.toString();var r=/(^[a-zA-Z0-9_.]*)/;
  while(x<c.length){var m=r.exec(c.substr(x));
    if(m!=null && m.length>1 && m[1]!=''){o+=m[1];x+=m[1].length;
    }else{if(c[x]==' ')o+='+';else{var d=c.charCodeAt(x);var h=d.toString(16);
    o+='%'+(h.length<2?'0':'')+h.toUpperCase();}x++;}}return o;},
URLDecode:function(s){var o=s;var binVal,t;var r=/(%[^%]{2})/;
  while((m=r.exec(o))!=null && m.length>1 && m[1]!=''){b=parseInt(m[1].substr(1),16);
  t=String.fromCharCode(b);o=o.replace(m[1],t);}return o;}
});
