﻿function change_parent_url()
        {
	    document.location=document.location.href;
        }		

 function setLex(v) {
  if (v == 'Y' || v == 't') {
    enableLA();
    document.search.laKey.value = 'Wik9275';
  }
  else
    disableLA();
}
function flashtxt(txt)
{                
  document.getElementById( txt ).style.color = "#FF0000";
  document.getElementById( txt ).style.fontWeight = "bold"; 
}
function flashtxtoff(txt)
{                
  document.getElementById( txt ).style.color = "#000000";
  document.getElementById( txt ).style.fontWeight = "normal"; 
}
function aratDiv(divid) {
 if (document.layers) document.layers[divid].display="block";
  else  document.getElementById(divid).style.display="block";
}
function ascundDiv(divid) {
  if (document.layers) document.layers[divid].display="none";
  else document.getElementById(divid).style.display="none";
}


function truncate_txt(div, len,limb)
{ 
var p = document.getElementById(div);
if (p) {

  var trunc = p.innerHTML;
  if (trunc.length > len) {

    /* Truncate the content of the P, then go back to the end of the
       previous word to ensure that we don't truncate in the middle of
       a word */
    trunc = trunc.substring(0, len);
    trunc = trunc.replace(/\w+$/, '');

    /* Add an ellipses to the end and make it a link that expands
       the paragraph back to its original size */
    trunc += '<a href="#" ' +
      'onclick="this.parentNode.innerHTML=' +
      'unescape(\''+escape(p.innerHTML)+'\'); transpre();   return false;">' +
      '[Citeşte]<\/a>';
    p.innerHTML = trunc;
  }
}
}  
 

function textCounter(field,cntfield,maxlimit) {
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
// otherwise, update 'characters left' counter
else
cntfield.value = maxlimit - field.value.length;
}
//  End -->


function KeyDownHandler(e)	
	{	
	var intKeyCode;
	var cautaretxt=document.getElementById('tbCauta').value; 
            if( document.all )
            { 
                  intKeyCode = event.keyCode;
                  strTagName = event.srcElement.tagName;
            }
            else
            {                 
	             if(e && e.which){
	             e = e
	             intKeyCode = e.which
	             }
	             else{
	             e = event
	             intKeyCode = e.keyCode
	             }	
            } 
            // Is this enter?
            if( ( intKeyCode != null && intKeyCode == 13 ) )
            { 
            var link = "http://www.onlinepress.eu/" + cautaretxt.replace(/ /, "~")	 + ",1.html";
               location.href=link;	
            }				
	}
	function CautaHandler()	
	{	
	var cautaretxt=document.getElementById('tbCauta').value;
	//alert(window.location.href);		
    location.href="http://www.onlinepress.eu/" + cautaretxt.replace(/ /, "~")	 + ",1.html";	
			
	}

