function apply(id){
    document.getElementById(id).style.display = 'block';
}

function n_apply(id){
    document.getElementById(id).style.display = 'none';
}

function change_image(id,poza){
    document.getElementById(id).src = poza;
}

function textCounter(field, countfield, maxlimit) {
        if (field.value.length > maxlimit)
           field.value = field.value.substring(0, maxlimit);
        else
           countfield.value = maxlimit - field.value.length;
}

function add_pict(){
   document.getElementById('adit_photos').innerHTML += '<div class="formpair"><div class="formlabel"><label>{/literal}{$add_photo}{literal}</label></div><div class="forminput"><input type="file" name="adit_photo[]"/></div></div>';
  }
function add_field(){
   document.getElementById('adit_fields').innerHTML += '<div class="formpair"><div class="formlabel"><label>{/literal}{$title}{literal}</label></div><div class="forminput"><input type="text" name="adit_tit[]" /></div></div></br><div class="formpair"><div class="formlabel"><label>{/literal}{$description}{literal}</label></div><div class="forminput"><textarea cols="5" rows="5" name="adit_desc[]"></textarea></div></div>';
}
function go(){
        box = document.forms[1].template;
        destination = box.options[box.selectedIndex].value;
        if(destination){
                        document.getElementById('img').innerHTML = '<a target=\"_blank\" href=\"../files/templates/pict-big-'+destination+'.jpg\" ><img  style="border:1px solid #333" src=\"../files/templates/pict-small-'+destination+'.jpg\" />';
                }else{
                        document.getElementById('img').innerHTML = '';
                }
}

function got(){
        box = document.forms[1].template;
        destination = box.options[box.selectedIndex].value;
        if(destination){
                        document.getElementById('img').innerHTML = '<a target=\"_blank\" href=\"files/templates/pict-big-'+destination+'.jpg\" ><img  style="border:1px solid #333" src=\"files/templates/pict-small-'+destination+'.jpg\" />';
                }else{
                        document.getElementById('img').innerHTML = '';
                }
}


