 // Maian Greetings v2.0
 // Javascript Functions

 //--------------------------------
 // Function submit_confirm()
 // Desc: Pop up confirmation
 //--------------------------------

 function submit_confirm(txt,url)
 {
   var txt;
   var url;
   var confirmSub = confirm(txt);
   
   if (confirmSub)
   {
     window.location = url;
   }
   else
   {
     return false;
   }
 }
 
 //------------------------------
 // Function: no_favourites()
 // Desc: Pop up notification
 //------------------------------

 function no_favourites(txt)
 {
   var txt;
   alert(txt);
 }
 
 //-------------------------------
 // Function: selectall()
 // Desc: Checks/unchecks boxes
 //-------------------------------

 function selectAll()
 {
   for (var i=0;i<document.MyForm.elements.length;i++)
   {
     var e = document.MyForm.elements[i];

     if ((e.name != 'log') && (e.type=='checkbox'))
     {
       e.checked = document.MyForm.log.checked;
     }
   }
 }
 
 //------------------------------------
 // Function: add_bb_code()
 // Desc: Adds BB code to comments
 //------------------------------------

 function add_bb_code(code)
 {
   document.MyForm.comments.value=document.MyForm.comments.value+code;
   document.MyForm.comments.focus();
   return;
 }
 
 //------------------------------------
 // Function: count_down()
 // Desc: Counts text in textarea
 //------------------------------------
 
 function count_down(field,countfield,maxlimit)
 {
   if (field.value.length > maxlimit)
   {
     field.value = field.value.substring(0, maxlimit);
   }
   else
   {
     countfield.value = maxlimit - field.value.length;
   }
 }
 
 //----------------------------
 // Function: popWindow()
 // Desc: Pop up window
 //----------------------------

 function popWindow(URL,LEFT,TOP,WIDTH,HEIGHT,SCROLLBARS,RESIZE)
 {
  day = new Date();
  id = day.getTime();
   
  eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=" + SCROLLBARS + ",location=0,statusbar=0,menubar=0,left=" + LEFT + ",top=" + TOP + ",screenX=0,screenY=0,resizable=" + RESIZE + ",width=" + WIDTH + ",height=" + HEIGHT + "');");
}
 
 //-----------------------------------
 // Function: add_emoticon_window()
 // Desc: Adds emoticon to comments
 //-----------------------------------

 function add_emoticon_window(code)
 {
   opener.document.MyForm.comments.value += ' ' + code + ' ';
 }