﻿String.prototype.contains = function ( sString ) {
  return this.indexOf ( sString ) !=-1;
}
String.prototype.attach = function ( sClass ) {
  var string = this;
  return string += ( string == "" ? "" : " " ) + sClass;
}
String.prototype.detach = function ( sClass ) {
  var string = this;
  return string.replace (( string.contains ( " " ) ? " " : "" ) + sClass, "" );
}
String.prototype.trim = function () {
  var string = this;
  string = string.replace( /^\s+/g, "" );// strip leading
  return string.replace( /\s+$/g, "" );// strip trailing				
}

if ( !String.prototype.splitStr ) {
  String.prototype.splitStr = function ( sep ) {
    var tempArr=[];
    var rest=true;
    var val=this;
    while (rest) 
    {
      var start=val.indexOf(sep);
      if (start!=-1) 
      {
        tempArr.push(val.substring(0,start));
        val=val.substring(start + sep.length);
      }
      else 
      {
        tempArr.push(val);
        rest=false;
      }
    }
    return tempArr;
  }
}
			
String.prototype.replaceAll = function (item, replacement) {
 var retVal = '';
 try{
  item=item.replace('\\','\\\\').replace('$','\\$').replace('*','\\*').replace('.','\\.').replace('?','\\?').replace('+','\\+').replace('(','\\(').replace(')','\\)').replace('/','\\/').replace('[','\\[').replace(']','\\]').replace('{','\\{').replace('}','\\}').replace('|','\\|');
  retVal=this.replace( new RegExp(item,"g"), replacement );
 }
 catch(ex){
  var str=this, aOccurs = str.splitStr(item);
  for(var i = 0; i < aOccurs.length; i++)
  retVal += aOccurs[i] + ((aOccurs.length - 1)==i ? '' : replacement);
 }
 return retVal;
}
			
var RecaptchaStr_hu = {
    visual_challenge: "Leolvasom a szöveget",
    audio_challenge: "Meghallgatom a szöveget",
    refresh_btn: "Ez nehéz, kérek egy újat",
    instructions_visual: "Írja le a két szót:",
    instructions_audio: "Írja le amit hallott:",
    help_btn: "Segítség",
    play_again: "Lejátszás újra",
    cant_hear_this: "Hang fájl letöltése (mp3)",
    incorrect_try_again: "Nem megfelelő! Próbálja újra."
};
        
function mOpenFeedBackPopup(oSender, sP){
  Shadowbox.open({
            player: 'iframe',
            title: '',
            content: '/' + sP,
            height: 750,
            width: 800,
            keysClose: ['c', 27]
  });
}

function CloseIframe() { 
    Shadowbox.close();
}

