// ****************************************************
// Function to calculate file size for demo download
// To be used: demodownload.html
function GetDemoFileSize(pReload) {

   if (document.forms[0].elements[0].value == 1)
     document.forms[0].elements[3].checked = false;
	
   var platform = document.forms[0].elements[0].value;
   var locale = document.forms[0].elements[1].value;
   var archived = document.forms[0].elements[2].checked;
   var cab = document.forms[0].elements[3].checked;

   var downloadPath = '../downloads/';

   if (locale == 1) 
     downloadPath += 'ru/';
   else if (locale == 2) 
     downloadPath += 'en/';
   else
     downloadPath += 'nonexistpath/';  

   if (platform == 1) 
     downloadPath += 'win32/';
   else if (platform == 2) 
     downloadPath += 'ce/';
   else if (platform == 3)
     downloadPath += 'ce/';
   else
     downloadPath += 'nonexistpath/';   

   if (cab)
     downloadPath += 'BuZZoneSetup.CAB';
   else
     downloadPath += 'BuZZoneSetup.exe';

   if (archived) 
     downloadPath += '.zip';

   document.forms[0].elements[7].value = downloadPath;

   if (pReload) {
     document.forms[0].action = 'free.html#form';
     document.forms[0].submit();
   }

}

// ****************************************************
// Function to calculate file size for Biz demo download
// To be used: demodownload.html
function GetDemoFileSize1(pReload) {

   if (document.forms[0].elements[0].value == 1)
     document.forms[0].elements[3].checked = false;
	
   var platform = document.forms[0].elements[0].value;
   var locale = document.forms[0].elements[1].value;
   var archived = document.forms[0].elements[2].checked;
   var cab = document.forms[0].elements[3].checked;

   var downloadPath = '../downloads/pro/';

   if (locale == 1) 
     downloadPath += 'ru/';
   else if (locale == 2) 
     downloadPath += 'en/';
   else
     downloadPath += 'nonexistpath/';  

   if (platform == 1) 
     downloadPath += 'win32/';
   else if (platform == 2) 
     downloadPath += 'ce/';
   else if (platform == 3)
     downloadPath += 'ce/';
   else
     downloadPath += 'nonexistpath/';   

   if (cab)
     downloadPath += 'BuZZoneSetup.CAB';
   else
     downloadPath += 'BuZZoneSetup.exe';

   if (archived) 
     downloadPath += '.zip';

   document.forms[0].elements[7].value = downloadPath;

   if (pReload) {
     document.forms[0].action = 'demo.html#form';
     document.forms[0].submit();
   }

}


// ****************************************************
// Function to calculate file size for utility download
// To be used: utils.html
function GetUtilFileSize() {

   var platform = document.forms[0].elements[0].value;
   var locale = document.forms[0].elements[1].value;
   //var archived = document.forms[0].elements[4].checked;

   //var util1 = document.forms[0].elements[0].checked;
   //var util2 = document.forms[0].elements[1].checked;

   var downloadPath = '../downloads/';

   if (locale == 1) 
     downloadPath += 'ru/';
   else if (locale == 2) 
     downloadPath += 'en/';
   else
     downloadPath += 'nonexistpath/';  

   if (platform == 1) 
     downloadPath += 'win32/';
   else if (platform == 2) 
     downloadPath += 'ce/';
   else if (platform == 3) 
     downloadPath += 'ce/';
   else
     downloadPath += 'nonexistpath/';   

   downloadPath += 'GetLocalInfo.zip';

   document.forms[0].elements[3].value = downloadPath;

}

// ****************************************************
// Function to validate Submit Bug form
// To be used: bugreport.html
function CheckBugReportForm() {

   if (document.forms[0].elements[2].value == "") {
     alert ("Пожалуйста, опишите ошибку в поле 'Описание ошибки'.");
     return false;
   }
   
   return true;

}

// ****************************************************
// Function to validate Feedback form
// To be used: feedback.html
function CheckFeedbackForm() {

   if (document.forms[0].elements[2].value == "") {
     alert ("Пожалуйста, заполните поле 'Ваш вопрос, пожелание'.");
     return false;
   }
   
   return true;

}

// ****************************************************
// Function to validate Download Demo form
// To be used: downloaddemo.html
function CheckDownloadDemoForm() {

   if (document.forms[0].elements[0].value == -1) {
     alert ("Пожалуйста, выберите вашу платформу.");
     return false;
   } else if (document.forms[0].elements[1].value == -1) {
     alert ("Пожалуйста, выберите локализацию.");
     return false;
   }
   
   return true;

}

// ****************************************************
// Function to validate Biz Download Demo form
// To be used: downloaddemo.html
function CheckDownloadDemoForm1() {

   if (document.forms[1].elements[0].value == -1) {
     alert ("Пожалуйста, выберите вашу платформу.");
     return false;
   } else if (document.forms[1].elements[1].value == -1) {
     alert ("Пожалуйста, выберите локализацию.");
     return false;
   }
   
   return true;

}

// ****************************************************
// Function to validate Download Demo form
// To be used: downloaddemo.html
function CheckDownloadUtilsForm() {

   if (document.forms[0].elements[0].value == -1) {
     alert ("Пожалуйста, выберите вашу платформу.");
     return false;
   } else if (document.forms[0].elements[1].value == -1) {
     alert ("Пожалуйста, выберите локализацию.");
     return false;
   }
   
   return true;

}