//Modified By Kevin L. on 15 Feb 2006
//Added coded to set page margin for CustomPages.aspx
//N.B. This is ONLY require for CustomPages.aspx

var reCustPage = /(custompages)|(kev)/gi;
var sTopURL = top.location.href;


if (reCustPage.test(sTopURL)) {
  document.writeln('<style >');
  //document.writeln('TABLE#Table2{padding:5px 5px 5px 5px; }');
  document.writeln('#TRForTopRow {height:5px ; }');
  document.writeln('#TDForLeftCell {width:5px ; }');
  document.writeln('#TDForRightCell {width:5px ; }');

  document.writeln('</style >');
}


function HandleAgentSearch(evt, strFirm) {

	if (evt.keyCode == 13)
	{
	
		goFindAgent(strFirm)
		
		if (!document.all && document.getElementById) {
			evt.preventDefault();
			evt.stopPropagation();
		}
		evt.cancelBubble = true;
		evt.returnValue = false;
		return false;

	}
	
}

function goFindAgent(strFirm) {
	if (strFirm == "") {
		alert('Enter location to search');
		return;
	}
	else
		top.location.href="CustomPages.aspx?FunctionID=8&QS1=" + escape(strFirm);
	
}
var MM_FlashCanPlay = false;
function showFlashOrJpeg(strObjID, strFlashPath, strImagePath, intWidth, intHeight) {
  if (! document.getElementById)
    return;
  if (! document.getElementById(strObjID))
    return;
  var objContainer = document.getElementById(strObjID);
  var strHTML = '';
  var MM_contentVersion = 6;
  var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
  
  if ( plugin ) {
		var words = navigator.plugins["Shockwave Flash"].description.split(" ");
	    for (var i = 0; i < words.length; ++i)
	    {
		if (isNaN(parseInt(words[i])))
		continue;
		var MM_PluginVersion = words[i]; 
	    }
	MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
  }
  else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
   && (navigator.appVersion.indexOf("Win") != -1)) {

	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
	document.write('on error resume next \n');
	document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.' + MM_contentVersion + '")))\n');
	document.write('</SCR' + 'IPT\> \n');

	
  }
  //Start checking
  if ( MM_FlashCanPlay) {
	strHTML = '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" \n';
	strHTML += ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" \n';
	strHTML += ' ID="script" WIDTH="' + intWidth +'" HEIGHT="' + intHeight + '" ALIGN="">\n';
	strHTML += ' <PARAM NAME=movie VALUE="' + strFlashPath+ '"><PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF>  \n'; 
	strHTML += ' <param name="wmode" value="transparent"> \n';
	strHTML += ' <EMBED src="' + strFlashPath + '" quality=high bgcolor=#FFFFFF  \n';
	strHTML += ' swLiveConnect=FALSE WIDTH="' + intWidth + '" HEIGHT="' + intHeight + '" NAME="script" ALIGN=""\n ' ;
	strHTML += '  wmode="transparent" \n';
	strHTML += ' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">\n';
	strHTML += ' </EMBED>\n';
	strHTML += ' </OBJECT>\n';
  } else{
	strHTML = '<IMG SRC="'+ strImagePath + '" WIDTH="'+ intWidth +'" HEIGHT="' + intHeight+ '" BORDER=0>';
  }
  objContainer.innerHTML = strHTML;
}

