function checkCommentName() {
   if(document.getElementById('username').value == '')
   {
      alert('Моля, напишете Вашето име преди да оставите коментар');
      document.getElementById('username').focus();
      document.getElementById('username').select();
      return false;
   }

   if(document.getElementById('comment').value == '')
   {
      alert('Моля, напишете Вашият коментар');
      document.getElementById('comment').focus();
      document.getElementById('comment').select();
      return false;
   }

   return true;
}
function c(id) {
        id.style.backgroundColor = '#FF8442';
        id.style.color = '#000000';
return true;
}


function b(id, color) {
        id.style.backgroundColor = color;
return true;
}

function checklen()
{
   if(document.getElementById('search').value.length < 3)
      document.getElementById('livesearch').style.display = 'none';
}

function setID(id) {
   var old = 0;
   var nid = id.split(',');

   if (nid[1] != '') {
      old = readCookie('imgID').split(',');
      if (old[1] != '') { document.getElementById('img'+old[1]).src = '/img/user_review_stars_'+old[0]+'.gif'; }
   }

   document.cookie = "imgID="+id+"; path=/";
}



function readCookie(name) {
        var nameEQ = name + "=";
        var ca = document.cookie.split(';');
        for(var i=0;i < ca.length;i++) {
                var c = ca[i];
                while (c.charAt(0)==' ') c = c.substring(1,c.length);
                if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
        }
        return null;
}

function showIMG(img) {
        var imgID = readCookie('imgID').split(',');
        document.getElementById('img'+imgID[1]).src = '/img/user_review_stars_'+img+'.gif';
}

setID(',');

if ((screen.width>=1024) && (screen.height>=768))
{
        // Main Table width, Characters per title
        var value = '800,100';
        document.cookie = "options = "+value+';';
}
else
{
        var value = '750,70';
        document.cookie = "options = "+value+';';
}