function countAreaChars(areaName,counter,limit)
{
if (areaName.value.length>limit)
areaName.value=areaName.value.substring(0,limit);
else
counter.value = limit - areaName.value.length;
}


function resizeimages(){

if(document.getElementsByTagName){

for(images=0; images<document.getElementsByTagName('img').length; images++){

img = document.getElementsByTagName('img')[images];
imgh = img.getAttribute('alt');
if(imgh == "image"){
if(img.width > 580){
img.style.width = '580px';
eval("imgpop" + String(images) + " = new Function(\"imgpop = window.open('" + img.src + " ','fullscale','scrollbars=1,resizable=1'); imgpop.focus();\")");
eval("img.onclick = imgpop" + String(images) + ";");
if (document.all) img.style.cursor = 'hand';
if (!document.all) img.style.cursor = 'pointer';
img.title = 'Кликни за да уголемиш картинката.';
}
}
}
}
}
window.onload = resizeimages;

function login_inputs_change(flag, sender) {
 switch(flag) {
  case "focus":
   if(sender.value == sender.defaultValue)
    sender.value = "";
  break;
  case "blur":
   if(sender.value == "")
    sender.value = sender.defaultValue;
  break;
 }
}