function openWin($url) {
  msgWindow= window.open($url,"displayWindow","width=780,height=600,status=no,toolbar=no,menubar=no,scrollbars=yes");
}
function closeIt(){
  window.close();
}




function viewform(m, w, h) {
   var scroll = 'yes';
   var settings;
   var LeftPosition;
   var TopPosition;
   var win;
	      
   LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
   TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
  
   settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll;
   settings = settings + ',resizable=no,maximize=no,status=no,toolbar=no,directories=no,menubar=no,location=no';
		      
   win = window.open(m, 'pre', settings);
   win.name = 'name';
   win.focus();
}
function viewformclose(m, w, h) {
   var scroll = 'yes';
   var settings;
   var LeftPosition;
   var TopPosition;
   var win;
	      
   LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
   TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
  
   settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll;
   settings = settings + ',resizable=no,maximize=no,status=no,toolbar=no,directories=no,menubar=no,location=no';
		      
   win = window.open(m, 'pre', settings);
   win.name = 'name';
   win.focus();
   win.alert('!!!!!');
   win.document.write('window.close();');
}
function viewform2(m, w, h) {
//   var w = 300;
//   var h = 380;
   var scroll = 'yes';
   var settings;
   var LeftPosition;
   var TopPosition;
   var win;
	      
   LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
   TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
  
   settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll;
   settings = settings + ',resizable=no,maximize=no,status=no,toolbar=no,directories=no,menubar=no,location=no';
		      
   win = window.open(m, 'pre', settings);
   win.name = 'name';
   win.focus();
}

function ViewOtherImg(name,main) {

   tmp_src = document.images[main].src;
   document.images[main].src = document.images[name].src;
   document.images[name].src = tmp_src;   
  
}				 

function conf() {
  var reply = confirm('This record will be permanently deleted. Do you want to continue?');

  if(reply) {
     return true;
   } else {
     return false;
   }
}			

function chckSearchForm(frm){
   if (frm.get_area_code.value.length == 0 && frm.get_ref_state.value.length == 0){
      alert ("Please enter your area code or select your state");
      return false;
   }else
   if (frm.get_area_code.value.length > 0 && frm.get_area_code.value.length < 3){
      alert ("Please enter your complete area code");
      return false;

   }else{
      frm.submit();
      return true;
   }
}
function inputUserInfo(frm) {
   var prefix0 = 'get_';
   var input_array = new Array('name','address','city','zip_code','uname','password_1','password_2','ccard','exp_date','cv2');
   var error_array = new Array('Name','Address','City','ZIP','Username','Password','Re-Password','Credit Card Number','Exp.date','CV2 Code');

   for (var i=0; i<input_array.length; i++) {
      var source = prefix0+input_array[i];          
      if (frm.elements[source].value.length == 0) {
         alert(error_array[i].substr(0,1).toUpperCase()+error_array[i].substr(1)+' can not be empty ');
         frm.elements[source].focus();
         return false;
      }
   } 
  
   return true;
}

function loginFormSubmit(){

   for (var i=0; i<document.form2.elements.length; i++){
  
      if(document.form2.elements[i].name == "logintype"){
         if(document.form2.elements[i].checked == true){
            type =  document.form2.elements[i].value;
         }
      }   
   }
   if (type == 'account'){
     document.form2.action="https://www.concito.net/acm/index.php";
     document.form2.username.value = document.loginform.username.value;
     document.form2.password.value = document.loginform.password.value;
    
     return true; 
   }
   if (type == 'webmail'){
      document.form2.action="http://webmail.concito.net/horde/imp/";
      document.form2.imapuser.value=document.loginform.username.value;
      document.form2.pass.value = document.loginform.password.value;
 
     return true;
   }

}


function resize() {
var i=0;
var LeftPosition;
var TopPosition;
var w;
var h;
  if (navigator.appName == 'Netscape') i=40;
  if (document.images[0]) 
  {
    w = document.images[0].width+100;
    h = document.images[0].height+115-i;
    window.resizeTo(w, h);
    LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
    TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
    window.moveTo(LeftPosition, TopPosition); 
  }
  self.focus();
}

function CalcSSLPrice(){
   var custom_fee=0.0;custom_setup_fee=0.0;

   domain_fee = document.SSL_Form.domain_fee.value;
   flag=0;
   for (var i=0; i<document.SSL_Form.elements.length; i++){
      if(document.SSL_Form.elements[i].type == "radio"){   
         if(document.SSL_Form.elements[i].checked == true){

            type = document.SSL_Form.elements[i].value;
            if(type == "geotrust_ssl"){
               ssl_fee = document.SSL_Form.geotrust_fee_.value;
               year = document.SSL_Form.get_year1.options[document.SSL_Form.get_year1.selectedIndex].value;
            }
            if(type == "starter_ssl"){
               ssl_fee = document.SSL_Form.starter_fee_.value;
               year = document.SSL_Form.get_year2.options[document.SSL_Form.get_year2.selectedIndex].value;            
         
            }
            if(type == "myself_ssl"){
               ssl_fee = 0;
               year = 0;
            }            
            custom_ssl = ssl_fee*year;            
         }
      } 
      if(document.SSL_Form.elements[i].name == "get_year0"){
         flag=1;
      }
   }

   if(flag == 1)
      domain_year =  document.SSL_Form.get_year0.options[document.SSL_Form.get_year0.selectedIndex].value;
   else
      domain_year = 1;
          
   total = parseFloat(domain_fee)*domain_year + parseFloat(custom_ssl);

   if (navigator.appName == 'Netscape'){
      document.getElementById('Total').innerHTML = '$'+total.toFixed(2);    
    
   }else{
      document.all.Total.innerHTML = '$'+ total.toFixed(2);
   }
}



