function wr( str)
{
  document.write( str);
}

try{
	str_replace( "", "", "");
} catch( e) {
	function str_replace(t, r, s){
		value = "";
		pos0 = 0;
		pos1 = 0;
		if ( s.length > 0 ){
			while( 1 ){
				pos1 = s.indexOf(t, pos0);
				if ( pos1 < 0 ) break;
				value += s.substring( pos0, pos1) + r;
				pos0 = pos1 + t.length;
			}
			value += s.substring( pos0, s.length);
		}
		return value;
	}
}

function myEscape( str)
{
  return str_replace( "/", "%2F", str_replace( "\\", "%5C", escape( str)));
}

  function valid_email( em )
  {
    if ( em.indexOf("@")>0
         && em.indexOf(".")>0
         && em.indexOf(".")+1<em.length
         && em.indexOf("@")+1<em.length
         && em.indexOf("@")<em.indexOf(".")
       )
      return 1;
    else
      return 0;
  }


  function change_all( this_o, tail)
  {
    try
    {
      if ( !tail ) tail='';
      o = document.fform.elements['' + tail + 'selected_row[]'];
      if ( this_o.checked )
      {
        if ( o && o.length )
        {
          for( i = 0; i < o.length; i++)
          {
            if ( !o[i].disabled )
            {
              o[i].checked = true;
              modify_selected_rows( o[i], tail);
            }
          }
        }
        else
        {
          if ( o )
          {
            if ( !o.disabled )
            {
              o.checked = true;
              modify_selected_rows( o, tail);
            }
          } 
        }
      }
      else
      { 
        if ( o && o.length )
        {
          for( i = 0; i < o.length; i++)
          {
            if ( !o[i].disabled )
            {
              o[i].checked = false;
              modify_selected_rows( o[i], tail);
            }
          }
        }
        else
        {
          if ( o )
          {
            if ( !o.disabled )
            {
              o.checked = false;
              modify_selected_rows( o, tail);
            }
          } 
        }
      }
    }catch( e){};
  }

  function modify_selected_rows( o, tail)
  {  
    if ( !tail ) tail='';
    $ids = document.fform.elements["actioncontext[selected_rows]"].value;
    if ( o.checked )
    {
      $ids += "," + tail + o.value + ",";
    }
    else
    {
      $ids = str_replace( "," + tail + o.value + ",", '', $ids);
    }
    document.fform.elements["actioncontext[selected_rows]"].value = $ids;
    return true;
  }


  function setPointer( theRow, Color, hand)
  {
    if ( Color == "" ) Color = "#ffffff";
    if ( !hand && hand != 0 ) hand = 1;
    var theCells = null;
    if ( typeof( document.getElementsByTagName) != 'undefined')
    {
      theCells = theRow.getElementsByTagName('td');
    }
    else if ( typeof(theRow.cells) != 'undefined' )
    {
      theCells = theRow.cells;
    }
    else {
      return false;
    }

    domDetect = null;
    if (
          typeof(window.opera) == 'undefined'
          && typeof(theCells[0].getAttribute) != 'undefined'
       )
    {
      domDetect    = true;
    }
    else
    {
      domDetect    = false;
    }
    for( i = 0; i < theCells.length; i++)
    {
      if ( domDetect )
      {
        if ( !theCells[i].getAttribute('background') )
        {
          theCells[i].setAttribute( 'bgcolor', Color, 0);
          if ( hand ) theCells[i].style.cursor = "pointer";
        }
      } 
      else
      {
        if ( theCells[i].style.backGround != "#a8cbf0" )
        {
          theCells[i].style.backgroundColor = Color;
          if ( hand ) theCells[i].style.cursor = "pointer";
        }
      }
    }
    return true;
  }

  function set_perm( o, status)
  {
    if ( status == 1 )
    {
      if ( o.checked == false )
      {
        name = o.name;
        n1 = str_replace( "view", "modify", name);
        n2 = str_replace( "view", "delete", name);
        try{
          document.fform.elements[''+n1+''].checked = false;
        } catch ( ex) {};
        try{
          document.fform.elements[''+n2+''].checked = false;
        } catch ( ex) {};
      }
    }
    else if ( status == 2 )
    {
      name = o.name;
      n1 = str_replace( "modify", "view", name);
      n2 = str_replace( "modify", "delete", name);
      if ( o.checked == false )
      {
        try{
          document.fform.elements[''+n2+''].checked = false;
        } catch ( ex) {};
      }
      else
      {
        try{
          document.fform.elements[''+n1+''].checked = true;
        } catch ( ex) {};
      }
    }
    else if ( status == 3 )
    {
      name = o.name;
      n1 = str_replace( "delete", "view", name);
      n2 = str_replace( "delete", "modify", name);
      if ( o.checked == true)
      {
        try{
          document.fform.elements[''+n1+''].checked = true;
        } catch ( ex) {};
        try{
          document.fform.elements[''+n2+''].checked = true;
        } catch ( ex) {};
      }
    }
  }

function open_brochures( page, pid, table)
{   
    popup_ = window.open("","brochures",'scrollbars=1,resizable=no,width=600,height=500');
    popup_.document.open();
    popup_.document.write('<html><body>');
    popup_.document.write('<form name="sub_fform" action="http://www.wf1broward.com/admin.php" method="post">');
    popup_.document.write("<input type='hidden' name='actioncontext[page]' value='"+page+"'>");
    popup_.document.write("<input type='hidden' name='actioncontext[todo]' value=''>");
    popup_.document.write("<input type='hidden' name='actioncontext[pid]' value='"+pid+"'>");
    popup_.document.write("<input type='hidden' name='actioncontext[table]' value='"+table+"'>");
    popup_.document.write("</form>");
    popup_.document.write('</body></html>');
    popup_.document.sub_fform.submit();
    return false;
}


function open_attach( page, pid, table)
{   
    popup_ = window.open("","attachment",'scrollbars=1,resizable=no,width=650,height=500');
    popup_.document.open();
    popup_.document.write('<html><body>');
    popup_.document.write('<form name="sub_fform" action="http://www.wf1broward.com/admin.php" method="post">');
    popup_.document.write("<input type='hidden' name='actioncontext[page]' value='"+page+"'>");
    popup_.document.write("<input type='hidden' name='actioncontext[todo]' value=''>");
    popup_.document.write("<input type='hidden' name='actioncontext[pid]' value='"+pid+"'>");
    popup_.document.write("<input type='hidden' name='actioncontext[table]' value='"+table+"'>");
    popup_.document.write("</form>");
    popup_.document.write('</body></html>');
    popup_.document.sub_fform.submit();
    return false;
}

function open_preview( url, witdth, height)
{   
    popup_ = window.open("","preview",'scrollbars=0,resizable=no,width='+witdth+',height='+height);
    popup_.document.open();
    popup_.document.write('<html><body>');
    popup_.document.write('<center>');
    popup_.document.write('<img name="preview_image" src="'+url+'">');
    popup_.document.write('<br><br><input type=image src="http://www.wf1broward.com/images/but_close2.gif" Onclick="window.close();">');
    popup_.document.write('</center>');
    popup_.document.write('<script language="javascript">\
  resize_window();\
  function resize_window()\
  {\
    if ( document.images["preview_image"].width > 0 )\
    {\
      resizeTo( document.images["preview_image"].width+30, document.images["preview_image"].height+100);\
    }\
    else\
    {\
      setTimeout( "resize_window()", 200);\
    }\
  }\
</script>');
    popup_.document.write('</body></html>');
    return false;
}

function open_preview2( url, witdth, height)
{   
  addLayer( "Preview");
  Preview_ = new PopLayer2( "Preview", "Preview", '<img name="preview_image" src="'+url+'">');
//  Preview_.width = witdth-40;
//  Preview_.height = height;
  Preview_.showMe();
}


function open_video( headline, width, height, type, path)
{   
    headline = str_replace( "\"", "\\\"", headline);
    popup_ = window.open( "http://www.wf1broward.com/lib/util/popup_video.php?headline="+myEscape( headline)+"&width="+myEscape( width)+"&height="+myEscape( height)+"&type="+myEscape( type)+"&path="+myEscape( path), "video",'scrollbars=0,resizable=no,width='+(width-(-40))+',height='+(height-(-100)));
    return false;
}

function open_video2( headline, width, height, type, path)
{   
  headline_orig = headline;
  headline = str_replace( "\"", "\\\"", headline);

  addLayer( "Video");
  Video_ = new PopLayer( "Video", headline_orig, "http://www.wf1broward.com/lib/util/popup_video2.php?headline="+myEscape( headline)+"&width="+myEscape( width)+"&height="+myEscape( height)+"&type="+myEscape( type)+"&path="+myEscape( path));
  Video_.width = (width-(-20));
  Video_.height = (height-(-80));
  Video_.showMe();
}

function get_video_obj( name, headline, width, height, type)
{
  if ( type == 0 ){
    if ( haverp ){
      RPvideoWindow( name, width, height);
    }
    else
    {
      wr( '<div class="category_link">RealPlayer is absent, for download "'+headline+'" click <a class="category_link" href="http://www.wf1broward.com/lib/util/getvideo.php?name='+name+'">here</a></div>');
    }
  } else   if ( type == 1 ){
//    if ( havefl ){
      FLvideoWindow( name, width, height);
//    }
//    else
//    {
//      wr( '<div class="category_link">FlashPlayer is absent, for download "'+headline+'" click <a class="category_link" href="http://www.wf1broward.com/lib/util/getvideo.php?name='+name+'">here</a></div>');
//    }
  } else   if ( type == 2 ){
    if ( havemp ){
      MPvideoWindow( name, width, height);
    }
    else
    {
      wr( '<div class="category_link">MediaPlayer is absent, for download "'+headline+'" click <a class="category_link" href="http://www.wf1broward.com/lib/util/getvideo.php?name='+name+'">here</a></div>');
    }
  } else   if ( type == 3 ){
    if ( haveqt ){
      QTvideoWindow( name, width, height);
    }
    else
    {
      wr( '<div class="category_link">QuickTime is absent, for download "'+headline+'" click <a class="category_link" href="http://www.wf1broward.com/lib/util/getvideo.php?name='+name+'">here</a></div>');
    }
  }
}

function RPvideoWindow( url, width, height)
{
  wr('\
     <object id=video1 classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" height='+height+' width='+width+' align="top">\
       <param name="controls" value="ImageWindow">\
       <param name="console" value="Clip1">\
       <param name="autostart" value="true">\
       <param name="src" value="'+url+'">\
       <embed type="audio/x-pn-realaudio-plugin" console="Clip1" controls="ImageWindow" height='+height+' width='+width+' autostart=true align="top" src="'+url+'">\
       </embed>\
  </object>\
     <BR><align="left"><object id=video1 classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" height=25 width=45 align="top">\
       <param name="controls" value="PlayButton">\
       <param name="console" value="Clip1">\
       <embed type="audio/x-pn-realaudio-plugin" console="Clip1" controls="PlayButton" height=25 width=45 autostart=true align="top">\
       </embed>\
     </object>\
     <object id=video1 classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" height=25 width=35 align="top">\
       <param name="controls" value="StopButton">\
       <param name="console" value="Clip1">\
       <embed type="audio/x-pn-realaudio-plugin" console="Clip1" controls="StopButton" height=25 width=35 autostart=true align="top">\
       </embed>\
     </object>\
  ');
}

function QTvideoWindow( url, width, height)
{
  wr('\
  <OBJECT CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" WIDTH="'+width+'"\
     HEIGHT="'+height+'" CODEBASE="https://www.apple.com/qtactivex/qtplugin.cab">\
     <PARAM name="SRC" VALUE="'+url+'">\
     <PARAM name="AUTOPLAY" VALUE="true">\
     <PARAM name="CONTROLLER" VALUE="true">\
     <EMBED SRC="'+url+'" WIDTH="'+width+'" HEIGHT="'+height+'" AUTOPLAY="true"\
            CONTROLLER="true"\
            PLUGINSPAGE="https://www.apple.com/quicktime/download/">\
     </EMBED>\
  </OBJECT>');
}

function MPvideoWindow( url, width, height)
{
  wr('\
      <OBJECT ID="MediaPlayer" width='+width+' height='+height+'\
        classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"\
        CODEBASE="https://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715"\
        standby="Loading Microsoft Windows Media Player components..." \
        type="application/x-oleobject">\
          <PARAM NAME="AutoStart" VALUE="True">\
          <PARAM NAME="FileName" VALUE="'+url+'">\
          <PARAM NAME="ShowControls" VALUE="True">\
          <PARAM NAME="ShowStatusBar" VALUE="False">\
          <EMBED type="application/x-mplayer2" pluginspage="https://www.microsoft.com/Windows/MediaPlayer/"\
                 SRC="'+url+'"\
                 name="MediaPlayer"\
                 width='+width+'\
                 height='+height+'\
                 autostart=1\
                 showcontrols=1>\
          </EMBED>\
      </OBJECT>');
}

function FLvideoWindow( url, width, height)
{
  wr('\
      <OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"\
        CODEBASE="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"\
        WIDTH='+width+' HEIGHT='+height+'>\
      <PARAM NAME=movie VALUE="'+url+'">\
      <PARAM NAME=quality VALUE=high>\
      <EMBED src="'+url+'" quality=high\
        WIDTH='+width+' HEIGHT='+height+' \
        TYPE="application/x-shockwave-flash" \
        PLUGINSPAGE="https://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">\
      </EMBED>\
      </OBJECT>');
}

function re_sort( field)
{
  if ( document.fform.elements["nav_data[sort_field]"] )
  {
    document.fform.elements["nav_data[sort_field]"].value = field;
  }
  document.fform.submit();
}

function re_direct( field)
{
  if ( document.fform.elements["nav_data[sort_direct]"] )
  {
    if ( document.fform.elements["nav_data[sort_direct]"].value == "DESC" )
    {
      document.fform.elements["nav_data[sort_direct]"].value = "ASC";
    }
    else
    {
      document.fform.elements["nav_data[sort_direct]"].value = "DESC";
    }
  }
  document.fform.submit();
}

function print_layer( l, str)
{
  if (BR.IE) document.all[l].innerHTML = str;
  else if (BR.DOM) document.getElementById(l).innerHTML = str;
  else if (BR.NS){
    with(document.layers[l].document){
      open();
      wr(str);
      close();
    }
  }
}

function resort( sort_order, tail)
{
  if (  document.fform.elements["nav_data[sort_type" + tail + "]"].value ==  '' )  document.fform.elements["nav_data[sort_type" + tail + "]"].value = 'ASC';
  if ( document.fform.elements["nav_data[sort_order"+tail+"]"].value == sort_order )
  {
    if ( document.fform.elements["nav_data[sort_type" + tail + "]"].value == 'DESC' )
    {
      document.fform.elements["nav_data[sort_type" + tail + "]"].value = 'ASC';
    }
    else
    {
      document.fform.elements["nav_data[sort_type" + tail + "]"].value = 'DESC';
    }
  }
  else
  {
    document.fform.elements["nav_data[sort_type" + tail + "]"].value = 'ASC';
    document.fform.elements["nav_data[sort_order"+tail+"]"].value = sort_order;
  }
}

function change_font( o, color)
{
  o.style.cursor = "hand";
  o.style.color = color;
}
function reset_color( input_store, input)
{
  document.fform.elements[input_store].value = "";
  document.fform.elements[input].style.color = "";
}

function reset_bgcolor( input_store, input)
{
  document.fform.elements[input_store].value = "";
  document.fform.elements[input].style.backgroundColor = "";
}

function numberFormat( number, len)
{
  str = ""+number;
  while( str.length < len ) str = "0"+str;
  return str;
}
function getTime( now)
{
  h = now.getHours();
  if ( h > 12 ) 
  {
    ampm  = "pm";
    h -= 12;
  }
  else
  {
    ampm  = "am";
  }
  h = numberFormat( h, 2);
  m = numberFormat( now.getMinutes(), 2);
  s = numberFormat( now.getSeconds(), 2);
  return h+":"+m+":"+s+"&nbsp;"+ampm;
}
function getTime2( time)
{
  h = numberFormat( time.getUTCHours(), 2);
  m = numberFormat( time.getUTCMinutes(), 2);
  s = numberFormat( time.getUTCSeconds(), 2);
  return h+":"+m+":"+s;
}
function writeClock()
{
  IE=false;DOM=false;
  appName   = navigator.appName;
  userAgent = navigator.userAgent;
  if (appName.indexOf("Internet Explorer") != -1) IE = true;
  if (document.getElementById) DOM = true;

  var days = new Array( "Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
  var months = new Array( "January","February","March","April","May","June","July","August","September","October","November","December");
  var now = new Date();
  str = months[now.getMonth()] + "&nbsp;" + now.getDate() + ",&nbsp;" + now.getFullYear() + "&nbsp;&nbsp;|&nbsp;&nbsp;" + getTime( now);

  str = "<span class='clock'>"+str+"&nbsp;&nbsp;&nbsp;&nbsp;</span>";

  if (IE) document.all['clock'].innerHTML = str;
  else if (DOM) document.getElementById('clock').innerHTML = str;
  setTimeout( "writeClock()", 1000);
}

function copy_shipping_info()
{
  o = document.fform;
  o.elements["form_data[bill_first_name]"].value = 	o.elements["form_data[ship_first_name]"].value;
  o.elements["form_data[bill_last_name]"].value = 	o.elements["form_data[ship_last_name]"].value;
  o.elements["form_data[bill_company]"].value = 		o.elements["form_data[ship_company]"].value;
  o.elements["form_data[bill_address]"].value = 		o.elements["form_data[ship_address]"].value;
  o.elements["form_data[bill_post_code]"].value = 	o.elements["form_data[ship_post_code]"].value;
  o.elements["form_data[bill_city]"].value = 		o.elements["form_data[ship_city]"].value;
 
  index = o.elements["form_data[countryship]"].selectedIndex;
  o.elements["form_data[countrybill]"].selectedIndex = index;
  getStatelist( o.elements["form_data[countrybill]"].value, 'bill')

  index = o.elements["form_data[state_provinceship]"].selectedIndex;
  o.elements["form_data[state_provincebill]"].selectedIndex = index;
  o.elements["form_data[state_provincebill]"].value = 		o.elements["form_data[state_provinceship]"].value;

  if ( o.elements["form_data[ship_ponumber]"] )  o.elements["form_data[bill_ponumber]"].value = o.elements["form_data[ship_ponumber]"].value;

  o.elements["form_data[bill_phone]"].value = 		o.elements["form_data[ship_phone]"].value;
}


function trussConLayerWr( name, id)
{
  document.write( "<div ID='"+name+"_"+id+"'><span class=normal>"+l_data[''+id+'']['0'][''+name+'']+"</span></div>");
}
function trussConnectorsSwingLayer( id, index)
{
  IE=false;DOM=false;
  appName   = navigator.appName;
  userAgent = navigator.userAgent;
  if (appName.indexOf("Internet Explorer") != -1) IE = true;
  if (document.getElementById) DOM = true;

  str = "<span class=normal>"+l_data[''+id+''][''+index+'']['units']+"</span>";
  if (IE) document.all['units_'+id].innerHTML = str;
  else if (DOM) document.getElementById( 'units_'+id).innerHTML = str;

  str = "<span class=normal>"+l_data[''+id+''][''+index+'']['lbs']+"</span>";
  if (IE) document.all['lbs_'+id].innerHTML = str;
  else if (DOM) document.getElementById( 'lbs_'+id).innerHTML = str;

  str = "<span class=normal>"+l_data[''+id+''][''+index+'']['price']+"</span>";
  if (IE) document.all['price_'+id].innerHTML = str;
  else if (DOM) document.getElementById( 'price_'+id).innerHTML = str;

  str = "<span class=normal>"+l_data[''+id+''][''+index+'']['price_100']+"</span>";
  if (IE) document.all['price_100_'+id].innerHTML = str;
  else if (DOM) document.getElementById( 'price_100_'+id).innerHTML = str;

}

function reset_list( tail)
{
  document.fform.elements['nav_data[sort_order'+tail+']'].value='';
  document.fform.elements['nav_data[sort_type'+tail+']'].value='';
  o = document.fform.elements;
  len = o.length;
  for( i=0; i<len; i++)
  {
    if ( o[i].name.indexOf( "filter_data") == 0 )
    {
      o[i].value = "";
    }
  }
}

function showHideBlock( id, type, show)
{
  o = document.getElementById( id);
  isEI = (document.all && navigator.userAgent.indexOf("Opera")==-1)?1:0;
  if ( show )
  {
    if ( isEI )
    {
      o.style.display = "inline";
    }
    else
    {
      if ( type == "tr" ) o.style.display = "table-row";
      else if ( type == "td" ) o.style.display = "table-cell";
    }
  } else
  {
    o.style.display = "none";
  }
}

function roundFloat( f, n)
{
  d = Math.pow( 10, n);
  return Math.round( f*d)/d;
}

function getHumanFileSize( size)
{
  if ( size > 1024*1024 )
  {
    size = roundFloat( size/(1024*1024), 3) + "MByte(s)";
  }
  else if ( size > 1024 )
  {
    size = roundFloat( size/(1024), 3) + "KByte(s)";
  }
  else
  {
    size = roundFloat( size, 0) + "Byte(s)";
  }
  return size;
}

function setCookie_(name, value, expires){if ( expires ){d1 = new Date();d2 = new Date( d1.getTime()+expires*1000);str = d2.toGMTString();curCookie = name+"="+escape(value)+"; expires="+str;}else{curCookie = name + "=" + escape(value);}document.cookie = curCookie};
function getCookie_(name){var prefix = name + "=";var cookieStartIndex = document.cookie.indexOf(prefix);if (cookieStartIndex == -1) return null;var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length);if (cookieEndIndex == -1) cookieEndIndex = document.cookie.length;return unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex));}

function addLayer( id)
{
//  deleteAllLayer();
  if ( document.getElementById( id) ) return;
  content = document.getElementById("forLayers").innerHTML;
  content += '<div ID="'+id+'" style="position:absolute;left:-1000;top:-1000"></div>';
  document.getElementById("forLayers").innerHTML = content;
}
function deleteAllLayer()
{
  document.getElementById("forLayers").innerHTML = "";
}

function open_email_to_friend( page, todo, id, pid, area, lng)
{
  addLayer( "Email");
  Email_ = new PopLayer( "Email", "Email To a Friend", "http://www.wf1broward.com/emailtofriend-___"+area+"_"+lng+".htm?page_="+page+"&todo_="+todo+"&id_="+id+"&pid_="+pid);
  Email_.width = 526;
  Email_.height = 405;
  Email_.showMe();
}
function butClick( but)
{
  but.disabled=true;
}

function openGlossaryLayer( title, content)
{   
  addLayer( "GlossaryLayer");
  GlossaryLayer_ = new PopLayer2( "GlossaryLayer", title, content);
  GlossaryLayer_.width = 400;
  GlossaryLayer_.align = "left";
  GlossaryLayer_.bgcolor = "#FFFEA6";
  GlossaryLayer_.showMe();
}


function setObjBgColor( o, Color)
{
  domDetect = null;
  if ( typeof(window.opera) == 'undefined' && typeof( o.getAttribute) != 'undefined' ) domDetect    = true;
  else domDetect = false;
  if ( domDetect )
    o.setAttribute( 'bgcolor', Color, 0);
  else
    o.style.backgroundColor = Color;
}

function setObjAttribute( o, name, data)
{
  o.setAttribute( name, data, 0);
}
function setObjClass( o, name)
{
  o.className=name;
}
function getObjClass( o)
{
  return o.className;
}

//make traditional popup instead
function newWindow(URL) {
		mainWindow = window.open(URL,'mainWin','resizable=yes,scrollbars=yes,width=520,height=500')
		mainWindow.focus()
	}

function openAdaStatement( lng)
{
 newWindow("http://www.wf1broward.com/popuppage-open_2000___"+lng+".html");
  
/*  addLayer( "AdaStat");
  AdaStat_ = new PopLayer( "AdaStat", "ADA Statement", "http://www.wf1broward.com/popuppage-open_2000___"+lng+".html");
  AdaStat_.iframe_width = 520;
  AdaStat_.height = 500;
  AdaStat_.showMe();*/
}
function openTermsOfUse( lng)
{
newWindow("http://www.wf1broward.com/popuppage-open_2001___"+lng+".html");
 /* addLayer( "TermsOfUse");
  TermsOfUse_ = new PopLayer( "TermsOfUse", "Terms of Use", "http://www.wf1broward.com/popuppage-open_2001___"+lng+".html");
  TermsOfUse_.iframe_width = 520;
  TermsOfUse_.height = 500;
  TermsOfUse_.showMe();*/
}
function openPrivacyPolicy( lng)
{
 newWindow("http://www.wf1broward.com/popuppage-open_2002___"+lng+".html");
  /*addLayer( "Privacy");
  Privacy_ = new PopLayer( "Privacy", "Privacy Policy", "http://www.wf1broward.com/popuppage-open_2002___"+lng+".html");
  Privacy_.iframe_width = 520;
  Privacy_.height = 500;
  Privacy_.showMe();*/
}
function openPublications( lng)
{
 newWindow("http://www.wf1broward.com/popuppage-open_2003___"+lng+".html");
 /* addLayer( "Public");
  Public_ = new PopLayer( "Public", "Publications", "http://www.wf1broward.com/popuppage-open_2003___"+lng+".html");
  Public_.iframe_width = 520;
  Public_.height = 500;
  Public_.showMe();*/
}
function openHelp( lng)
{
 newWindow("http://www.wf1broward.com/popuppage-open_2004___"+lng+".html");
/*
  addLayer( "Help");
  Help_ = new PopLayer( "Help", "Contact Us", "http://www.wf1broward.com/popuppage-open_2004___"+lng+".html");
  Help_.iframe_width = 520;
  Help_.height = 500;
  Help_.showMe();*/
}
function openPhoto( id, width, height, lng)
{
  addLayer( "Photo");
  if ( width < 400 ) width = 400;
  if ( height < 200 ) height = 200;
  Photo_ = new PopLayer( "Photo", "Photo", "http://www.wf1broward.com/photogallery-item_"+id+"___"+lng+".html");
  Photo_.iframe_width = width-(-40);
  Photo_.height = height-(-160);
  Photo_.showMe();
}
function open_email_alert( page, todo, id, pid, area, lng, events_area)
{
  addLayer( "EmailAlert");
  EmailAlert_ = new PopLayer( "EmailAlert", "Email Alert", "http://www.wf1broward.com/emailalert.html?page_="+page+"&todo_="+todo+"&id_="+id+"&pid_="+pid+"&area_="+area+"&lng_="+lng+"&events_area_="+events_area);
  EmailAlert_.iframe_width = 520;
  EmailAlert_.height = 300;
  EmailAlert_.showMe();
}

function preloadImages( data)
{
  _Menu_PreloadImages2 = new Array();
  i = 0;
  for ( i2 in data)
  {
    _Menu_PreloadImages2[i] = new Image();
    _Menu_PreloadImages2[i++].src = data[i2];
  }
}
function replaceImages( name, src)
{
  document.images[name].src = src;
}

view_urls = function( urls) {
    var print_w = window.open("","URLs",'scrollbars=1,resizable=no,width=500,height=100');
	print_w.document.open();
	var base_url = 'http://www.wf1broward.com/'; //document.location.toString().substr( 0, document.location.toString().lastIndexOf( "/")+1);
	print_w.document.write( '<html><head><LINK REL=STYLESHEET href="' + base_url + 'workforce_admin.css" type="text/css"></head><body>');
	print_w.document.write( '<b>English:</b> ' + base_url + urls[0] + "<br>");
	print_w.document.write( '<b>Creole:</b> ' + base_url + urls[1] + "<br>");
	print_w.document.write( '<b>Spanish:</b> ' + base_url + urls[2] + "<br>");
	print_w.document.write( '</body></html>');
	print_w.document.close();
}

function sendScreenShots()
{
   print_w = window.open( '', 'ScreenShots');
   print_w.document.open();
   print_w.document.write( '<html><form name=screenShots method=post action="http://www.wf1broward.com/grab/grab.php">');

   cont = document.body.innerHTML;

   try
   {
     regexp = /ID=((__editor_[^ \"\>]+)|(__jupload)|(__jtextarea_[^ \"\>]+))/ig;
     res = cont.match( regexp);
     for( i=0;i<res.length;i++)
     {
       id = res[i].replace( "id=", "").replace( "ID=", "");
       o = document.getElementById( id);
       if ( id.indexOf( "__editor_") != -1 )
         cont = cont.replace( o.innerHTML, "<center><img src='http://www.wf1broward.com/grab/images/editor.png'></center>");
       else if ( id.indexOf( "__jupload") != -1 )
         cont = cont.replace( o.innerHTML, "<center><img src='http://www.wf1broward.com/grab/images/jupload.png'></center>");
       else if ( id.indexOf( "__jtextarea_") != -1 )
         cont = cont.replace( o.innerHTML, "<center><img src='http://www.wf1broward.com/grab/images/jtextarea.png'></center>");
     }
   } catch( e) {};

   try
   {

     regexp = /ID=((__form_[^ \"\>]+)|(__topBar_[^ \"\>]+)|(__filter_[^ \"\>]+)|(__list_[^ \"\>]+)|(__sortedList_[^ \"\>]+))/ig;
     res = cont.match( regexp);
     for( i=0;i<res.length;i++)
     {
       id = res[i].replace( "id=", "").replace( "ID=", "");
       o = document.getElementById( id);

         cont2 = o.innerHTML;
         regexp2 = /ID=((__editor_[^ \"\>]+)|(__jupload)|(__jtextarea_[^ \"\>]+))/ig;
         res2 = cont2.match( regexp2);
         try
         {
           for( i2=0;i2<res2.length;i2++)
           {
             id2 = res2[i2].replace( "id=", "").replace( "ID=", "");
             o2 = document.getElementById( id2);
             if ( id2.indexOf( "__editor_") != -1 )
               cont2 = cont2.replace( o2.innerHTML, "<img src='http://www.wf1broward.com/grab/images/editor.png'>");
             else if ( id2.indexOf( "__jupload") != -1 )
               cont2 = cont2.replace( o2.innerHTML, "<img src='http://www.wf1broward.com/grab/images/jupload.png'>");
             else if ( id2.indexOf( "__jtextarea_") != -1 )
               cont2 = cont2.replace( o2.innerHTML, "<center><img src='http://www.wf1broward.com/grab/images/jtextarea.png'></center>");
           }
         } catch( e) {};
       print_w.document.write( '<input type=hidden name=dataHTML['+i+'] value="">\
                                <input type=hidden name=name['+i+'] value="">');
       print_w.document.screenShots.elements["dataHTML["+i+"]"].value = cont2;
       print_w.document.screenShots.elements["name["+i+"]"].value = id;
     }
   } catch( e) {};
   print_w.document.write( '</form></html>');
   print_w.document.screenShots.submit();
   print_w.document.close();
}
