function showModal(url, iDialogWidth, iDialogHeight)
{
   var dialogWidth = 640;
   var dialogHeight = 500;
   
   if (iDialogWidth > 0)
      dialogWidth = iDialogWidth;
      
   if (iDialogHeight > 0)
      dialogHeight = iDialogHeight;      

   window.showModalDialog(url,null,"resizable:yes;status:no;dialogWidth:"+dialogWidth+"px;dialogHeight:"+dialogHeight+"px;unadorned:yes");

   //window.showModalDialog(url,null,"resizable:yes;status:no;dialogWidth:640px;dialogHeight:500px;unadorned:yes");
}

// Swap Image
function swapImage(ielement, inewimage) 
{  
   ielement.src = inewimage;
}
//

// For Back Button
function historyForward(x)
{
   window.history.forward(x);
}
//

// Set Window Location
function setWindowLocation(newlocation)
{
   window.location=newlocation;
}
//

//
// Help
//

var IE = false;
var vposx = 0;
var vposy = 0;

if (navigator.appName == "Microsoft Internet Explorer"){IE = true}

if (!IE)
{
   document.captureEvents(Event.MOUSEMOVE)
}

document.onmousemove = getMouseXY;
	
function getMouseXY(m)
{
   var iL = 0;
   var iV = 0;
    
   if (IE)	
   {
     vposx = event.clientX;
     vposy = event.clientY;
   }	
 	 else
   {
      vposx = m.pageX;
      vposy = m.pageY;
   }  
	
	 if (IE)	
   {
      if (!document.body.scrollTop)
      {
	   		 iL = document.documentElement.scrollLeft;	
   			 iV = document.documentElement.scrollTop;
      }
      else
      {
        iL = document.body.scrollLeft;	
   			iV = document.body.scrollTop;	
      }
   }

   vposx = vposx + iL;
   vposy = vposy + iV;	
}
  	
function showHelp(ihelpid)
{
   document.getElementById(ihelpid).style.left=vposx;
   document.getElementById(ihelpid).style.top=vposy;   
   document.getElementById(ihelpid).style.display="block"; 
}

function hideHelp(ihelpid)
{
   document.getElementById(ihelpid).style.display="none";
}
//

// Open Remote Site
function openRemoteSite(url)
{
   if(confirm("You are now leaving a Brown & Brown website.\n\n"+
      "The link you have selected is located on another server. "+
      "Please click Ok to leave Brown & Brown's site and proceed to the selected site. "+
      "Brown & Brown does not endorse this web site, its sponsor, "+
      "or any of the policies, activities, products, or services offered on the site or by any advertiser on the site."
      )){
      window.open(url);
   }
}

// Open Window
function openWindow(url, iwindowName, iwindowFeatures) 
{
   window.open(url, iwindowName, iwindowFeatures);
}

