function popup(img,title) {
	var leftx=(screen.width-1000)/2;
	var topy=0;
	loc="/foto.php?img=" + img + "&title="+ title;
	kisablak=window.open(loc,'kep_window','width=1000,height=750,left='+leftx+',top='+topy+',scrollbars=no');
}

function normal (sStr){
         sRet='';
         for (i=0;i<sStr.length;i++)
             if(sStr.charCodeAt(i)!=13)
               sRet+=sStr.charAt(i);
         return sRet;
}

function limit(sName,iLimit){
         //alert(sName);
         //oObj=
         sWork=normal(document.getElementById(sName).value);
         //if(sWork.length>3)
         //  for(i=1;i<sWork.length;i++){
         //    alert(sWork.charCodeAt(i));
         //  }
         var iLen=sWork.length;
         //alert(iLen);
         if(iLen>iLimit){
                        document.getElementById(sName).value=sWork.substring(0,iLimit);
         }
         document.getElementById("l"+sName).value=iLimit-iLen;
}

function radio(sName){
         //alert(sName);
         var obj1=document.getElementById(sName+1);
         var obj2=document.getElementById(sName+2);
         if(obj1.checked){

            document.getElementById('h1p').style.backgroundColor="rgb(213,234,240)";
            document.getElementById('h2p').style.backgroundColor="white";
         }
         else{
           document.getElementById('h1p').style.backgroundColor="white";
           document.getElementById('h2p').style.backgroundColor="rgb(213,234,240)";
         }
}

function countWords(sName){
         //alert(megy);
         //sName=normal(sName);
         sWork=normal(document.getElementById(sName).value);
         var wordarray=sWork.split(" ");
         var finalarr= new Array();
         for (i=0;i<wordarray.length;i++){
           //alert(wordarray[i]);
           if(wordarray[i].length>0){
             tmparr=wordarray[i].split("\n");
             for(j=0;j<tmparr.length;j++)
               if(tmparr[j].length>0)
                 finalarr.push(tmparr[j]);
           }
         }
         document.getElementById('l'+sName).value=finalarr.length  ;
         //alert(sName);

}



