// JavaScript Document -- main.js


// accessible popup window

var newWin = null; 
function popUp(strURL, strType, strHeight, strWidth) { 
 if (newWin != null && !newWin.closed) 
   newWin.close(); 
 var strOptions=""; 
 if (strType=="console") 
   strOptions="resizable,height="+ 
     strHeight+",width="+strWidth; 
 if (strType=="fixed") 
   strOptions="status,height="+ 
     strHeight+",width="+strWidth; 
 if (strType=="fixedscroll") 
   strOptions="status,scrollbars,screenX=300,left=300,screenY=200,top=50,height="+ 
     strHeight+",width="+strWidth; 
 if (strType=="elastic") 
   strOptions="scrollbars,"+ 
     "resizable,height="+ 
     strHeight+",width="+strWidth; 
 if (strType=="print_access")
   strOptions="scrollbars,menubar,status,resizable,height="+strHeight+",width="+strWidth; 
 newWin = window.open(strURL, 'newWin', strOptions); 
 newWin.focus(); 
}

// bookmark function

function Bookmark(){
 if(window.external){
  window.external.AddFavorite(location.href,document.title);
 }else{
  alert("PC users:\n\tClick 'Ctrl + D' to add this page to your bookmarks.\n\tOpera users: 'Ctrl + T'\n\nMacintosh users: \n\tClick 'Apple + D' to add this page to your bookmarks.\n\tOpera users: 'Apple + T'");
 }
} 



var hst_toggle;
function toggleDiv( id ){
 var o = document.getElementById( id );
 if( o ){
  if( hst_toggle && o != hst_toggle ){
   hst_toggle.style.display = 'none';
  }
  o.style.display = ( o.style.display == 'block' ) ? 'none' : 'block';
  hst_toggle = o;
 }
}



function validateForm(contact)
{

if(""==document.forms.contact.fname.value)
{
alert("Please enter your first name.");
return false;
}

if(""==document.forms.contact.comp.value)
{
alert("Please enter your company name.");
return false;
}


if(""==document.forms.contact.country.value)
{
alert("Please enter your country name.");
return false;
}



if(""==document.forms.contact.phone.value)
{
alert("Please enter your phone number.");
return false;
}

if(""==document.forms.contact.email.value)
{
alert("Please enter your email.");
return false;
}

if(""==document.forms.contact.enquiry.value)
{
alert("Please enter your enquiry.");
return false;
}


}

function disclaimWin(theUrl, winName) 
{
window.open(theUrl,winName,'toolbar=yes,status=yes,width=420,height=265,directories=no,SCROLLbars=yes,resize=no,menubar=yes,top=10,left=10')
}


var theImages = new Array()  

theImages[0] = '/impax/images/quote_1.jpg'
theImages[1] = '/impax/images/quote_2.jpg'
theImages[2] = '/impax/images/quote_3.jpg'


var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write('<img src="'+theImages[whichImage]+'">');
}

