// JavaScript Document
function onClear(){document.aspnetForm.ctl00$SiteContent$MA_trasnlform$sourceText.value="";document.aspnetForm.ctl00$SiteContent$MA_trasnlform$tbResult.value="";document.aspnetForm.ctl00$SiteContent$MA_trasnlform$sourceText.focus();document.aspnetForm.ctl00$SiteContent$MA_trasnlform$tbResult.disabled="disabled"};function form_Clear(){document.aspnetForm.ctl00$SiteContent$MA_trasnlform$sourceText.value="";document.aspnetForm.ctl00$SiteContent$MA_trasnlform$tbResult.value="";document.aspnetForm.ctl00$SiteContent$MA_trasnlform$sourceText.focus();document.aspnetForm.ctl00$SiteContent$MA_trasnlform$tbResult.disabled="disabled";return false};function Paste1(){if(document.aspnetForm.ctl00$SiteContent$MA_trasnlform$sourceText.createTextRange&&document.all){document.aspnetForm.ctl00$SiteContent$MA_trasnlform$sourceText.createTextRange().execCommand("Paste");if($('#ctl00_SiteContent_MA_trasnlform_sourceText').val.length>maxlen)
{$('#ctl00_SiteContent_MA_trasnlform_sourceText').val=$('#ctl00_SiteContent_MA_trasnlform_sourceText').val.substring(0,maxlen);alert(msg)}
document.aspnetForm.ctl00$SiteContent$MA_trasnlform$sourceText.focus()}
else{alert(msgPaste)}}
function Paste2(){if(document.aspnetForm.ctl00$SiteContent$MA_trasnlform$tbResult.createTextRange&&document.all)
{document.aspnetForm.ctl00$SiteContent$MA_trasnlform$tbResult.createTextRange().execCommand("Paste");document.aspnetForm.ctl00$SiteContent$MA_trasnlform$tbResult.focus()}else{alert(msgPaste)}};function Copy1(){if(document.aspnetForm.ctl00$SiteContent$MA_trasnlform$sourceText.createTextRange&&document.all)
{document.aspnetForm.ctl00$SiteContent$MA_trasnlform$sourceText.createTextRange().execCommand("Copy");document.aspnetForm.ctl00$SiteContent$MA_trasnlform$sourceText.focus()}
else{alert(msgCopy)}}
function Copy2(){if(document.all)
{if(document.aspnetForm.ctl00$SiteContent$MA_trasnlform$tbResult.createTextRange&&document.aspnetForm.ctl00$SiteContent$MA_trasnlform$tbResult.value!="")
{document.aspnetForm.ctl00$SiteContent$MA_trasnlform$tbResult.createTextRange().execCommand("Copy")}
if(document.getElementById('ctl00_SiteContent_MA_trasnlform_divResult').innerHTML!="")
{var txt=document.getElementById('ctl00_SiteContent_MA_trasnlform_divResult').innerText;window.clipboardData.setData("Text",txt)}
if((!document.aspnetForm.ctl00$SiteContent$MA_trasnlform$tbResult.disabled)&&(!document.aspnetForm.ctl00$SiteContent$MA_trasnlform$tbResult.style.display=='none'))
{document.aspnetForm.ctl00$SiteContent$MA_trasnlform$tbResult.focus()}}else{alert(msgCopy)}}
function Delete1(){document.aspnetForm.ctl00$SiteContent$MA_trasnlform$sourceText.value="";clearFeedback();document.aspnetForm.ctl00$SiteContent$MA_trasnlform$sourceText.focus();$('#ctl00_SiteContent_MA_trasnlform_lFromLang').html("");$('#ctl00_SiteContent_MA_trasnlform_lFromAuto').html("");$('#adviseIconDiv').hide();$('.rwinblock').removeClass('topup7');$('.rwinblock').removeClass('yellwarBrdr');$("#alertWindow").dialog("close");}
function Delete2(){document.getElementById('ctl00_SiteContent_MA_trasnlform_divResult').innerHTML="";document.aspnetForm.ctl00$SiteContent$MA_trasnlform$tbResult.value="";$("#ctl00_SiteContent_MA_trasnlform_tbPismo").val("");document.aspnetForm.ctl00$SiteContent$MA_trasnlform$sourceText.focus();document.aspnetForm.ctl00$SiteContent$MA_trasnlform$tbResult.disabled="disabled";$('#ctl00_SiteContent_MA_trasnlform_lToLang').html("");$('#ctl00_SiteContent_MA_trasnlform_lToAuto').html("");$('#adviseIconDiv').hide();$('.rwinblock').removeClass('topup7');$('.rwinblock').removeClass('yellwarBrdr');}

var cur_sLang,cur_rLang;var saveCurent=false;function detectIE6(){var browser=navigator.appName;if(browser=="Microsoft Internet Explorer"){var b_version=navigator.appVersion;var re=/\MSIE\s+(\d\.\d\b)/;var res=b_version.match(re);if(res[1]<=6){return true;}}return false;}
var sve6=detectIE6();function textLimit(){if(document.getElementById('ctl00_SiteContent_MA_trasnlform_sourceText').value.length>maxlen){document.getElementById('ctl00_SiteContent_MA_trasnlform_sourceText').value=document.getElementById('ctl00_SiteContent_MA_trasnlform_sourceText').value.substring(0,maxlen);alert(msg)}}
function checkST(){if(document.getElementById("ctl00_SiteContent_MA_trasnlform_sourceText").value==""){alert(msgNothingToTranslate);document.aspnetForm.ctl00$SiteContent$MA_trasnlform$sourceText.focus();return false}else{return true}}
function checkFRM(){if($("#ctl00_SiteContent_MA_trasnlform_tbKomuAddr").val()=="")
{alert(msgemailNoAddr);$("#ctl00_SiteContent_MA_trasnlform_tbKomuAddr").focus();return false}
else
{if(!reg.test($("#ctl00_SiteContent_MA_trasnlform_tbKomuAddr").val()))
{alert(msgemailIncorrectAddr);$("#ctl00_SiteContent_MA_trasnlform_tbKomuAddr").focus();return false}
else
{if($("#ctl00_SiteContent_MA_trasnlform_tbKopiyaAddr").val()!="")
{if(!reg.test($("#ctl00_SiteContent_MA_trasnlform_tbKopiyaAddr").val()))
{alert(msgemailIncorrectAddr);$("#ctl00_SiteContent_MA_trasnlform_tbKopiyaAddr").focus();return false}
else
return true}
else
return true}}}


var clonedOptions;

function SetTemplates()
{
for (i=0; i<$("#ctl00_SiteContent_MA_trasnlform_rblTemplates .hTmpl").size(); i++){
 if( $("#ctl00_SiteContent_MA_trasnlform_rblTemplates .hTmpl:eq("+i+") a").attr('id')=="img"+$("#ctl00_SiteContent_MA_trasnlform_otherTemplatesInput").val()){
 $("#divOTmpl").html($("#img"+$("#ctl00_SiteContent_MA_trasnlform_otherTemplatesInput").val()).html()+$("#lnk"+$("#ctl00_SiteContent_MA_trasnlform_otherTemplatesInput").val()).html());}
}
$("#ctl00_SiteContent_MA_trasnlform_rblTemplates :input:radio:checked~label").addClass('bold');

$("#ctl00_SiteContent_MA_trasnlform_rblTemplates :input:radio:not(:checked)~label").removeClass('bold');
$("#divOTmpl").removeClass('bold');
if ($("#ctl00_SiteContent_MA_trasnlform_rblTemplates :input:radio:checked").val()=="General"){$("#divOTmpl").addClass('bold');}

if(((curTemp!=$("#ctl00_SiteContent_MA_trasnlform_rblTemplates :input:radio:checked").val())||(curTemp!=$("#ctl00_SiteContent_MA_trasnlform_otherTemplatesInput").val()))&&(uTrType == "text")&&(wasTranslation=="True")&&(document.getElementById('ctl00_SiteContent_MA_trasnlform_sourceText').value!=""))
{  document.aspnetForm.ctl00$SiteContent$MA_trasnlform$bTranslate.click();   } 

if((curTemp!=$("#ctl00_SiteContent_MA_trasnlform_rblTemplates :input:radio:checked").val())&&((wasTranslation=="True")||(document.getElementById('ctl00_SiteContent_MA_trasnlform_sourceText').value!="")))
{   curTemp=($("#ctl00_SiteContent_MA_trasnlform_rblTemplates :input:radio:checked").val()=="General")?$("#ctl00_SiteContent_MA_trasnlform_rblTemplates :input:radio:checked").val():$("#ctl00_SiteContent_MA_trasnlform_otherTemplatesInput").val();
}


}
function SetTemplatesWeb()
{
for (i=0; i<$("#ctl00_SiteContent_MA_trasnlform_rblTemplatesWeb .hTmpl").size(); i++){
 if( $("#ctl00_SiteContent_MA_trasnlform_rblTemplatesWeb .hTmpl:eq("+i+") a").attr('id')=="img"+$("#ctl00_SiteContent_MA_trasnlform_otherTemplatesInputWeb").val()){
 $("#divOTmpl").html($("#img"+$("#ctl00_SiteContent_MA_trasnlform_otherTemplatesInputWeb").val()).html()+$("#lnk"+$("#ctl00_SiteContent_MA_trasnlform_otherTemplatesInputWeb").val()).html());}
}

$("#ctl00_SiteContent_MA_trasnlform_rblTemplatesWeb :input:radio:checked~label").addClass('bold');
 
$("#ctl00_SiteContent_MA_trasnlform_rblTemplatesWeb :input:radio:not(:checked)~label").removeClass('bold');
$("#divOTmpl").removeClass('bold');
if ($("#ctl00_SiteContent_MA_trasnlform_rblTemplatesWeb :input:radio:checked").val()=="General"){$("#divOTmpl").addClass('bold');}


if((curTemp!=$("#ctl00_SiteContent_MA_trasnlform_rblTemplatesWeb :input:radio:checked").val())&&(wasTranslation=="True")&&(document.getElementById('ctl00_SiteContent_MA_trasnlform_sourceURL').value!=""))
{    document.aspnetForm.ctl00$SiteContent$MA_trasnlform$bTranslate1.click();   } 
if((curTemp!=$("#ctl00_SiteContent_MA_trasnlform_rblTemplatesWeb :input:radio:checked").val())&&((wasTranslation=="True")||(document.getElementById('ctl00_SiteContent_MA_trasnlform_sourceURL').value!="")))
{   curTemp=($("#ctl00_SiteContent_MA_trasnlform_rblTemplates :input:radio:checked").val()=="General")?$("#ctl00_SiteContent_MA_trasnlform_rblTemplates :input:radio:checked").val():$("#ctl00_SiteContent_MA_trasnlform_otherTemplatesInput").val();
}}



function ctrl_enter(e,form)
{if(((e.keyCode==13)||(e.keyCode==10))&&(e.ctrlKey==true))document.aspnetForm.ctl00$SiteContent$MA_trasnlform$bTranslate.click();}

function showUTemplates(){closeTranslationLinks();$("#keepClick").show();$('#user_template_span').show();$('#user_template_a').addClass('oUT');

}
function hideUTemplates(m){if (m==1){$('#user_template_span').hide();$('#user_template_a').removeClass('oUT');$('#keepClick').hide();}
if (m==2){$('#user_template').fadeOut('slow');}closeTranslationLinks();}

function showUTemplatesWeb(){$("#keepClickWeb").show();$('#user_template_span_w').show();$('#user_template_a_w').addClass('oUT');

}
function hideUTemplatesWeb(m){if (m==1){$('#user_template_span_w').hide();$('#user_template_a_w').removeClass('oUT');$('#keepClickWeb').hide();}
if (m==2){$('#user_template_w').fadeOut('slow');}}


function getRadioGroupValue(radioGroupObj)
{
  for (var i=0; i < radioGroupObj.length; i++)
    if (radioGroupObj[i].checked) return radioGroupObj[i].value;

  return null;
}
 
function showTite(event){$(this).children('label').children('span').addClass('titleie6').css('display','block');}
function hideTite(event){$(this).children('label').children('span').css('display','none').removeClass('titleie6');}
function showTite1(event){$(this).children('span').addClass('titleie6oT').css('display','block');}
function hideTite1(event){$(this).children('span').css('display','none');}
function showTite2(event){$(this).children('span').addClass('titleie6oTs').css('display','block');}
function hideTite2(event){$(this).children('span').css('display','none').removeClass('titleie6oTs');}



var myVote=0; 
function shRating(n){for (i=1;i<=n;i++){document.getElementById("rs" + i).src = "/images/starfill.gif";}
for (i=n+1; i<6; i++){document.getElementById("rs" + i).src = "/images/starblank.gif";}}
function setVote(n){for (i=1;i<=n;i++){document.getElementById("rs" + i).src = "/images/gstarfill.gif";}
for (i=n+1; i<6; i++){document.getElementById("rs" + i).src = "/images/gstarblank.gif";}}
function clRating(){shRating(myVote); }
function stopVote(){for (i=1; i<6; i++){document.getElementById("rs" + i).onclick=function(){};document.getElementById("rs" + i).onmouseover=function(){};document.getElementById("rs" + i).onmouseout=function(){};$("#rs" + i).removeClass("vt");}}
function emp(){}



