//main functions

   bname = navigator.appName;
     bver = parseFloat(navigator.appVersion);    
     home = 'http://www.clearanswers.co.uk/';
     //home = 'http://10.20.0.52/Development/CLEARANSWERS/'; 
     v4=false;
     if (bver >= 4)
      {
      v4=true;


      ba1=new Image(); ba2=new Image ();
      ba1.src=home + "images/b1.gif"; ba2.src=home + "images/b1a.gif";
      bb1=new Image(); bb2=new Image ();
      bb1.src=home + "images/b2.gif"; bb2.src=home + "images/b2a.gif";
      bc1=new Image(); bc2=new Image ();
      bc1.src=home + "images/b3.gif"; bc2.src=home + "images/b3a.gif";
      bd1=new Image(); bd2=new Image ();
      bd1.src=home + "images/b4.gif"; bd2.src=home + "images/b4a.gif";
      be1=new Image(); be2=new Image ();
      be1.src=home + "images/b5.gif"; be2.src=home + "images/b5a.gif";
      bf1=new Image(); bf2=new Image ();
      bf1.src=home + "images/b6.gif"; bf2.src=home + "images/b6a.gif";
      bg1=new Image(); bg2=new Image ();
      bg1.src=home + "images/b7.gif"; bg2.src=home + "images/b7a.gif";     

      bh1=new Image(); bh2=new Image ();
      bh1.src=home + "images/b8.gif"; bh2.src=home + "images/b8a.gif";
      bi1=new Image(); bi2=new Image ();
      bi1.src=home + "images/b9.gif"; bi2.src=home + "images/b9a.gif";
      bj1=new Image(); bj2=new Image ();
      bj1.src=home + "images/b10.gif"; bj2.src=home + "images/b10a.gif";
      bk1=new Image(); bk2=new Image ();
      bk1.src=home + "images/b11.gif"; bk2.src=home + "images/b11a.gif";
      bm1=new Image(); bm2=new Image ();
      bm1.src=home + "images/b12.gif"; bm2.src=home + "images/b12a.gif";      
      bn1=new Image(); bn2=new Image ();
      bn1.src=home + "images/b13.gif"; bn2.src=home + "images/b13a.gif";


      bl1=new Image(); bl2=new Image ();
      bl1.src=home + "images/but1.gif"; bl2.src=home + "images/but1a.gif";    
   }
     else (alert("WARNING !!! Your browser is too old and will not display the page optimally !\n           Please upgrade to Netscape Communicator 4.X\n        Download it FREE from http://home.netscape.com !"));
     
   function s1(imagE)
      {
         if (v4) document [imagE].src=eval(imagE+"2.src");
      }
 
    function s2(imagE)
        {
            if (v4) document  [imagE].src=eval(imagE+"1.src");
      }

// gallery
   function s3(imagE)   { if (v4) document.main_gallery.src=imagE; }

   
// pop up window

function openWindow(URL, h, w, s) 
   {
   var gg = typeof (popupWin);
   if (gg =='object')
      { 
      if (popupWin.closed ) {}
         else { popupWin.close();  }
      };
   popupWin = window.open(URL, 'popup', 'dependent=0,height='+h+',width='+w+',screenX=20,left=10,screenY=150,top=10,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=0,scrollbars='+s+',status=0,toolbar=0', 'launcher');

   if (window.focus)
      {
      popupWin.focus();
      }
   }

// email cloaking function
function cloak( c_user , c_domain_sld , c_domain_tld , c_caption , c_class )
{
   c_mail = c_user + '@' + c_domain_sld + '.' + c_domain_tld;

   if( c_caption == '' )
   {
      c_caption = c_mail;
   }

   if( c_class != '' )
   {
      c_cls = ' class="' + c_class + '"';
   }
   else
   {
      c_cls = '';
   }
   document.write( '<a href="mailto:' + c_mail + '"'+ c_cls +'>'+ c_caption + '</a>'  );
}

// search empty check
function verif()
   {
    if (!document.f_search.w_search.value.length)
      {
      alert("Please enter a word in the search field");
      document.f_search.w_search.focus();
      }
    if (document.f_search.w_search.value.length)
      {
      document.f_search.submit();
      }
   }
   
//// right form check
function right_f_check()
{
	frm = document.getElementById( 'right_side_form' );
	
	_name = document.getElementById( 'right_name' );
	_email = document.getElementById( 'right_email' );
	_phone = document.getElementById( 'right_phone' );
	_mobile = document.getElementById( 'right_mobile' );
	_best_time = document.getElementById( 'right_best_time' );
	_type = document.getElementById( 'right_type' );
	
/*
	if( ! _name.value.length )
	{
	   	alert("Please enter the name");
    	_name.focus();
    	return;
	}
	if( ! _email.value.length )
	{
	   	alert("Please enter the email");
    	_email.focus();
    	return;
	}
	if( ! _phone.value.length )
	{
	   	alert("Please enter the telephone");
    	_phone.focus();
    	return;
	}
	if( ! _mobile.value.length )
	{
	   	alert("Please enter the mobile");
    	_mobile.focus();
    	return;
	}
	
	if( ! _best_time.value.length )
	{
	   	alert("Please enter the best time to call");
    	_best_time.focus();
    	return;
	}
*/
	
	if( _type.options.selectedIndex == 0 )
	{
	   	alert("Please choose the accident type"  );
    	_type.focus();
    	return;
	}
	
	frm.action = _type.options[ _type.options.selectedIndex ].value;
	
	frm.submit();
}   
 