    <!--
//init globals
var rez_path;
var media_path;
var table_width;

table_width = 1280;    
rez_path = 1280;    
media_path = 1280;    
    
function get_table_width() {
  return(table_width);
}  
function get_resolution() {
  return(rez_path);
}
function get_media_path() {
  return(media_path);
}  

function get_margin_size() {
  var adjusted_size = Math.round(table_width/250);
  var font_size = adjusted_size+'px';
  return(font_size );
}      
    
 function record_editor(field_name) {
        storage_name = field_name+'_storage';
        if (typeof(form_state) == 'undefined') {
        } else if (form_state=="1") { 
          current = parent.frames[0].document.body.innerHTML;         
            document.getElementById(storage_name).innerHTML=current;
        }
 }
 function share_editor() {
    current = parent.frames[0].document.body.innerHTML;         
    document.getElementById('editor_field').innerHTML=current;
 } 
 
  function retrieve_editor(field_name) {
        storage_name = field_name+'_storage';
        current = document.getElementById(storage_name);
        if(current!=null){ 
          current = document.getElementById(storage_name).innerHTML;
          if (current!=null){
            parent.frames[0].document.getElementById('editor_div').innerHTML = current;
          }
        }        
  }   
  
      
        function submit_eform()  {
           var editor_innerhtml = parent.frames[0].document.body.innerHTML;
           document.getElementById('editor_field').value = editor_innerhtml;	 	 
        	 document.register.submit()
        } 

        function submit_form()  {
          document.getElementById ('register').submit() ;
        }     

    
//editor functions
  var viewMode = 1; // WYSIWYG
    
  function doBold()
  {
	parent.frames[0].document.execCommand('bold', false, null);
	parent.frames[0].focus();
  }

  function doItalic()
  {
	parent.frames[0].document.execCommand('italic', false, null);
	parent.frames[0].focus();
  }

  function doUnderline()
  {
	parent.frames[0].document.execCommand('underline', false, null);
	parent.frames[0].focus();
  }
  
  function doStrike()
  {
	parent.frames[0].document.execCommand('strikethrough', false, null);
	parent.frames[0].focus();
  }  
  
  function doLeft()
  {
    parent.frames[0].document.execCommand('justifyleft', false, null);
    parent.frames[0].focus();
  }

  function doCenter()
  {
    parent.frames[0].document.execCommand('justifycenter', false, null);
    parent.frames[0].focus();
  }

  function doRight()
  {
    parent.frames[0].document.execCommand('justifyright', false, null);
    parent.frames[0].focus();
  }

  function doOrdList()
  {
    parent.frames[0].document.execCommand('insertunorderedlist', false, null);
    parent.frames[0].focus();
  }

  function doBulList()
  {
    parent.frames[0].document.execCommand('insertorderedlist', false, null);
    parent.frames[0].focus();
  }
  
  function doForeCol()
  {
    if (document.getElementById('color_menu').style.display == 'inline') {
      document.getElementById('color_menu').style.display = 'none';
    } else {
      document.getElementById('color_menu').style.display = 'inline';
    } 
    parent.frames[0].focus();
  }
  function doTextCol(tcolor)
  {
    document.getElementById('color_menu').style.display = 'none';    
    
    if(tcolor != null)
      parent.frames[0].document.execCommand('forecolor', false, tcolor);
      parent.frames[0].focus();
  }  

  function doLink()
  {
    var promptURL = prompt("Enter the URL", "");  
    parent.frames[0].document.execCommand('createlink', false, promptURL);
    parent.frames[0].focus();
  }
  
  function doImage()
  {
    if (document.getElementById('emocon_menu').style.display == 'inline') {
      document.getElementById('emocon_menu').style.display = 'none';
    } else {
      document.getElementById('emocon_menu').style.display = 'inline';
    } 
    parent.frames[0].focus();
  }
  function doUpload() {
    if (document.getElementById('editor_span').style.display == 'inline') {
      document.getElementById('editor_span').style.display = 'none'; 
      document.getElementById('upload_span').style.display = 'inline';
      parent.frames[1].focus(); 
    } else {
      document.getElementById('editor_span').style.display = 'inline'; 
      document.getElementById('upload_span').style.display = 'none';
      parent.frames[0].focus();     
    }
  } 
  
  function doInsert(imgSrc)  {   
   if(imgSrc != null) {
      document.getElementById('editor_span').style.display = 'inline'; 
      document.getElementById('upload_span').style.display = 'none';
      parent.frames[0].focus();    
      parent.frames[0].document.execCommand('insertimage', false, imgSrc);
       if(document.all){
           parent.frames[0].presize();
      } else{
          parent.frames[0].presize();
      }
      parent.frames[0].focus();
    }
  }      
     
  function doEmocon(imgSrc)  {   
   if(imgSrc != null) {
      document.getElementById('emocon_menu').style.display = 'none'; 
      parent.frames[0].focus();
      parent.frames[0].document.execCommand('insertimage', false, imgSrc);
       if(document.all){
           parent.frames[0].presize();
      } else{
          parent.frames[0].presize();
      } 

      
      parent.frames[0].focus();
    }
  }  
  
  function doRule()
  {
    parent.frames[0].document.execCommand('inserthorizontalrule', false, null);
    parent.frames[0].focus();
  }
  
  function doUndo()
  {
	 parent.frames[0].document.execCommand('undo', false, null);
	 parent.frames[0].focus();
  }   
  
  function doRedo()
  {
	 parent.frames[0].document.execCommand('redo', false, null);
	 parent.frames[0].focus();
  }     
  
  function doToggleView()
  {  
    if(viewMode == 1)
    {
      iHTML = parent.frames[0].document.body.innerHTML;
      if(document.all){
           parent.frames[0].document.body.innerText = iHTML;
      } else{
          parent.frames[0].document.body.textContent = iHTML;
      }
      // Hide all controls
      parent.frames[0].focus();
      
      viewMode = 2; // Code
    }
    else
    {
      if(document.all){
           iText = parent.frames[0].document.body.innerText;
      } else{
          iText = parent.frames[0].document.body.textContent;
      }  
      parent.frames[0].document.body.innerHTML = iText;
      
      // Show all controls
      parent.frames[0].focus();
      
      viewMode = 1; // WYSIWYG
    }
  }
//end editor functions
      
      if (document.images) { 
         logoon = new Image();
         logoon.src = "images/1280/logo_on.gif";
         
         logooff = new Image();
         logooff.src = "images/1280/logo.gif";
         
          siconplus = new Image();
          siconplus.src = "images/forum_icons/category_plus_grey.gif";    
          siconminus = new Image();
          siconminus.src = "images/forum_icons/category_minus_grey.gif";     
          miconplus = new Image();
          miconplus.src = "images/forum_icons/sub_plus_grey.gif";    
          miconminus = new Image();
          miconminus.src = "images/forum_icons/sub_minus_grey.gif";
      }      
      
      function imgAct(imgName) {
         if (document.images) {
            document[imgName].src = eval(imgName + "on.src");
         }
      }
      
      function imgInact(imgName) {
         if (document.images) {
            document[imgName].src = eval(imgName + "off.src");
         }
      }
      
     function test_image() {
       str = "<a href='http://www.ar-15.com/display.php?process=1&amp;s=1'>Use the experimental live scaling site<\/a><br>";
       document.getElementById("test").innerHTML=str;  
     }          
       
      onload = onresize = function info () {
          document.getElementById("right_cborder").height = document.body.scrollHeight;
          document.getElementById("col_background").height = document.body.scrollHeight;
          document.getElementById("left_cborder").height = document.body.scrollHeight;
                        test_image();
                              
      }
      
  function hide_forum(icon, type, divid) {
    var tbl = document.getElementById(divid);
    var current_display = tbl.style.display;
    var imgName = 'img'+divid;  
    if (current_display == 'block') {
      tbl.style.display = 'none';      
      var new_src = 'images/1280/'+icon+'plus_'+type+'.gif';
      document.getElementById(imgName).src = new_src;
    } else {
      tbl.style.display = 'block';
      var new_src = 'images/1280/'+icon+'minus_'+type+'.gif';
      document.getElementById(imgName).src = new_src;
    }
      document.getElementById("right_cborder").height = document.body.scrollHeight;
      document.getElementById("col_background").height = document.body.scrollHeight;
      document.getElementById("left_cborder").height = document.body.scrollHeight;
  }
  
  // Forum Tooltips
     function forum_tooltip(on,text,font,height,color,cell_id,tt_text) {

        sub_title(text,font,height,color);  
        html_str = "<center>"+tt_text+"<\/center>";
        document.getElementById(cell_id).innerHTML=html_str;                  
 
    }         
      
      
      function jsadjust () {
          //document.getElementById("col_background").height = document.body.scrollHeight;
      }
      function lbadjust () {
          //document.getElementById("left_cborder").height = document.body.scrollHeight;
      }  
      function rbadjust () {
          //document.getElementById("right_cborder").height = document.body.scrollHeight;
      }          
      
     sub_title = function subtitle(text,font,height,color) {
       var html_str = "<span STYLE='color:#"+color+";font-family: Arial, Helvetica, sans-serif;line-height: "+Math.round(height/2048 * 1280) +"px;font-size: "+Math.round(1280/font) +"px;font-weight: bold;'><center>"+text+"<\/center><\/span>";
       document.getElementById("subtitle_content").innerHTML=html_str; 
     }       

     // Editor Menu & Top Buttons
     function editorOver(on,text,font,height,color,clLeft,clTop,clRight,clBot,overID) {
        sub_title(text,font,height,color);  
        var img_id = overID;
        whichEl = document.getElementById(img_id).style;        
        //if (!on) { whichEl.visibility = "hidden"; return }    
        if (!on) {
          whichEl.clip = "rect(" + 1 + " " + 2 + " " + 2 + " " + 1 + ")";
          whichEl.visibility = "visible";
          return 
        }  
        whichEl.clip = "rect(" + clTop + " " + clRight + " " + clBot + " " + clLeft + ")";      
        whichEl.visibility = "visible";
    } 
    
  // Crop Menu
     function cropOver(which,on,text,font,height,color,widepic,tallpic,crop_rule) {
        sub_title(text,font,height,color);
        if (widepic != '') {
          new_image = "images/"+media_path+"/"+widepic;
          var photo_id = "WideTop_"+photo_input_id;
          document.getElementById(photo_id).src=new_image;
        }
        if (tallpic != '') {
          new_image = "images/"+media_path+"/"+tallpic;
          var photo_id = "TallTop_"+photo_input_id;
          document.getElementById(photo_id).src=new_image;
        }
        if (crop_rule != '') {
          var hidden_id = "crop_"+photo_input_id;
          document.getElementById(hidden_id).value=crop_rule;
        }        
        var temp_img_id = arPopups[which][4];
        var img_id = temp_img_id+'_'+photo_input_id;
        var whichEl = document.getElementById(img_id).style;
        
        if (!on) { whichEl.visibility = "hidden"; return }
        var clLeft = arPopups[which][0];
        var clRight = arPopups[which][1];
        var clTop = arPopups[which][2];
        var clBot = arPopups[which][3];        
        whichEl.clip = "rect(" + clTop + " " + clRight + " " + clBot + " " + clLeft + ")";      
        whichEl.visibility = "visible";
    }             
    
    arPopups = new Array();
    function setBeginEnd(which,from,to,top,bot,id) {
        arPopups[which] = new Array();
        arPopups[which][0] = from;
        arPopups[which][1] = to;
        arPopups[which][2] = top;
        arPopups[which][3] = bot;  
        arPopups[which][4] = id;      
    }
    
        setBeginEnd(8,Math.round(2/2048 * table_width),Math.round(57/2048 * table_width),Math.round(2/2048 * table_width),Math.round(57/2048 * table_width),'CropOver');
        setBeginEnd(9,Math.round(2/2048 * table_width),Math.round(57/2048 * table_width),Math.round(61/2048 * table_width),Math.round(117/2048 * table_width),'CropOver');
        setBeginEnd(10,Math.round(2/2048 * table_width),Math.round(57/2048 * table_width),Math.round(121/2048 * table_width),Math.round(176/2048 * table_width),'CropOver');
        setBeginEnd(11,Math.round(61/2048 * table_width),Math.round(117/2048 * table_width),Math.round(2/2048 * table_width),Math.round(57/2048 * table_width),'CropOver');
        setBeginEnd(12,Math.round(61/2048 * table_width),Math.round(117/2048 * table_width),Math.round(61/2048 * table_width),Math.round(117/2048 * table_width),'CropOver');
        setBeginEnd(13,Math.round(61/2048 * table_width),Math.round(117/2048 * table_width),Math.round(121/2048 * table_width),Math.round(176/2048 * table_width),'CropOver');
        setBeginEnd(14,Math.round(121/2048 * table_width),Math.round(176/2048 * table_width),Math.round(2/2048 * table_width),Math.round(57/2048 * table_width),'CropOver');
        setBeginEnd(15,Math.round(121/2048 * table_width),Math.round(176/2048 * table_width),Math.round(61/2048 * table_width),Math.round(117/2048 * table_width),'CropOver');
        setBeginEnd(16,Math.round(121/2048 * table_width),Math.round(176/2048 * table_width),Math.round(121/2048 * table_width),Math.round(176/2048 * table_width),'CropOver');           

        setBeginEnd(17,Math.round(2/2048 * table_width),Math.round(57/2048 * table_width),Math.round(2/2048 * table_width),Math.round(57/2048 * table_width),'PosOver');
        setBeginEnd(18,Math.round(2/2048 * table_width),Math.round(57/2048 * table_width),Math.round(61/2048 * table_width),Math.round(117/2048 * table_width),'PosOver');
        setBeginEnd(19,Math.round(2/2048 * table_width),Math.round(57/2048 * table_width),Math.round(121/2048 * table_width),Math.round(176/2048 * table_width),'PosOver');
        setBeginEnd(20,Math.round(61/2048 * table_width),Math.round(117/2048 * table_width),Math.round(2/2048 * table_width),Math.round(57/2048 * table_width),'PosOver');
        setBeginEnd(21,Math.round(61/2048 * table_width),Math.round(117/2048 * table_width),Math.round(61/2048 * table_width),Math.round(117/2048 * table_width),'PosOver');
        setBeginEnd(22,Math.round(61/2048 * table_width),Math.round(117/2048 * table_width),Math.round(121/2048 * table_width),Math.round(176/2048 * table_width),'PosOver');
        setBeginEnd(23,Math.round(121/2048 * table_width),Math.round(176/2048 * table_width),Math.round(2/2048 * table_width),Math.round(57/2048 * table_width),'PosOver');
        setBeginEnd(24,Math.round(121/2048 * table_width),Math.round(176/2048 * table_width),Math.round(61/2048 * table_width),Math.round(117/2048 * table_width),'PosOver');
        setBeginEnd(25,Math.round(121/2048 * table_width),Math.round(176/2048 * table_width),Math.round(121/2048 * table_width),Math.round(176/2048 * table_width),'PosOver');                        
      
    // -->

