function ConfirmDelete(name)

{

      return confirm("You are about to DELETE " + '\n' + name + '\n' +

                   "Click OK to continue or Cancel to abort.");

}

function addList1()
{
   var MyElement = document.getElementById("description");
   MyElement.value += "<ul>"+'\n'+"<li>Type Here</li>"+'\n';
   str = "Type Here";
   var TRange=null;
   var strFound;
   if (window.find) {
   window.find(str);
   MyElement.focus();
   }
   else  {
   TRange=MyElement.createTextRange()
   strFound=TRange.findText(str)
   if (strFound) TRange.select()
   }
   return true;
}

function addList2()
{
   var MyElement = document.getElementById("description");
   MyElement.value += "<li>Type Here</li>"+'\n';
   str = "Type Here";
   var TRange=null;
   var strFound;
   if (window.find) {
   window.find(str);
   MyElement.focus();
   }
   else if (navigator.appName.indexOf("Microsoft")!=-1) {
   TRange=MyElement.createTextRange()
   strFound=TRange.findText(str)
   if (strFound) TRange.select()
   }
   return true;
}

function addList3()
{
   var MyElement = document.getElementById("description");
   MyElement.value += "</ul>";

   return true;
}

function addImage1()
{
   var MyElement = document.getElementById("description");
   MyElement.value += '<img src="/image/application_header.gif" alt="Ideal For..." />';

   return true;
}

function addImage2()
{
   var MyElement = document.getElementById("description");
   MyElement.value += '<img src="/image/features_header.gif" alt="Features" />';

   return true;
}

function addImage3()
{
   var MyElement = document.getElementById("description");
   MyElement.value += '<img src="/image/instructions_header.gif" alt="Instructions" />';

   return true;
}

function addImage4()
{
   var MyElement = document.getElementById("description");
   MyElement.value += '<img src="/image/supplied_header.gif" alt="Supplied With..." />';

   return true;
}

function addImage5()
{
   var MyElement = document.getElementById("description");
   MyElement.value += '<img src="/image/video_header.gif" alt="Video Review" />';

   return true;
}


function addParagraph()
{
   var MyElement = document.getElementById("description");
   MyElement.value += "<p>Type Here</p>"+'\n';
   str = "Type Here";
   var TRange=null;
   var strFound;
   if (window.find) {
   window.find(str);
   MyElement.focus();
   }
   else if (navigator.appName.indexOf("Microsoft")!=-1) {
   TRange=MyElement.createTextRange()
   strFound=TRange.findText(str)
   if (strFound) TRange.select()
   }
   return true;
}

function addBold()
{
   var MyElement = document.getElementById("description");
   MyElement.value += "<b>Type Here</b>"+'\n';
   str = "Type Here";
   var TRange=null;
   var strFound;
   if (window.find) {
   window.find(str);
   MyElement.focus();
   }
   else if (navigator.appName.indexOf("Microsoft")!=-1) {
   TRange=MyElement.createTextRange()
   strFound=TRange.findText(str)
   if (strFound) TRange.select()
   }
   return true;
}

function addParagraphBold()
{
   var MyElement = document.getElementById("description");
   MyElement.value += "<p><b>Type Here</b></p>"+'\n';
   str = "Type Here";
   var TRange=null;
   var strFound;
   if (window.find) {
   window.find(str);
   MyElement.focus();
   }
   else if (navigator.appName.indexOf("Microsoft")!=-1) {
   TRange=MyElement.createTextRange()
   strFound=TRange.findText(str)
   if (strFound) TRange.select()
   }
   return true;
}

function autocompoff() {
if (!document.getElementById) return false;
var f = document.getElementById('search');
f.setAttribute("autocomplete", "off");
}

function disabledrop(str) {
var select1 = str.name;
var input1 = document.getElementById("new"+select1);
var submit = document.getElementById("submit");
if (str.value == 'new')
  {
  input1.disabled=false;
  }
else
  {
  input1.disabled=true;
  input1.value='';
  }
if (str.value == '')
  {
  submit.disabled=true;
  }
  else
  {
  submit.disabled=false;
  }
}






function showProducts(str, ltr)
 {
 var xmlhttp;
 xmlhttp=GetXmlHttpObject();
 if (xmlhttp==null)
   {
   alert ("Browser does not support HTTP Request");
   return;
   }
 var url="/admin/script/getproducts.php";
 url=url+"?brand="+str;
 url=url+"&ltr="+ltr;
 url=url+"&sid="+Math.random();
 xmlhttp.onreadystatechange=function()
  {
  if(xmlhttp.readyState==3)
   {
   document.getElementById("products"+ltr).innerHTML="<select disabled=\"disabled\"><option>Loading...</option></select>";
   }
  else if (xmlhttp.readyState==4)
   {
   document.getElementById("products"+ltr).innerHTML=xmlhttp.responseText;
   }
  }
 xmlhttp.open("GET",url,true);
 xmlhttp.send(null);
 }

function GetXmlHttpObject()
 {
 if (window.XMLHttpRequest)
   {
   // code for IE7+, Firefox, Chrome, Opera, Safari
   return new XMLHttpRequest();
   }
 if (window.ActiveXObject)
   {
   // code for IE6, IE5
   return new ActiveXObject("Microsoft.XMLHTTP");
   }
 return null;
 }





function addNewModifierInput() 
  {
  var ni = document.getElementById('Modifiers');
  var numi = document.getElementById('NumberOfModifiers');
  var num = (document.getElementById('NumberOfModifiers').value -1)+ 2;
  numi.value = num;
  var row = document.createElement("tr");
  var rowName = 'modifierrow'+num;
  row.setAttribute('id',rowName);
  var cell1 = document.createElement("td");
  var cellText1 = document.createElement("input");
  cellText1.setAttribute('name', 'ProductCode'+num);
  cellText1.setAttribute('type', 'text');
  cell1.appendChild(cellText1);
  row.appendChild(cell1);
  var cell2 = document.createElement("td");
  var cellText2 = document.createElement("input");
  cellText2.setAttribute('name', 'ModifierValue'+num);
  cellText2.setAttribute('type', 'text');
  cell2.appendChild(cellText2);
  row.appendChild(cell2);
  var cell3 = document.createElement("td");
  var cellText3 = document.createElement("input");
  cellText3.setAttribute('name', 'CostPrice'+num);
  cellText3.setAttribute('type', 'text');
  cell3.appendChild(cellText3);
  row.appendChild(cell3);
  var cell4 = document.createElement("td");
  var cellText4 = document.createElement("input");
  cellText4.setAttribute('name', 'Price'+num);
  cellText4.setAttribute('type', 'text');
  cell4.appendChild(cellText4);
  row.appendChild(cell4);
  var cell5 = document.createElement("td");
  var cellText5 = document.createElement("input");
  cellText5.setAttribute('name', 'Weight'+num);
  cellText5.setAttribute('type', 'text');
  cell5.appendChild(cellText5);
  row.appendChild(cell5);
  ni.appendChild(row);
  }




function removeModifierInput() 
  {
  var ni = document.getElementById('Modifiers');
  var numi = document.getElementById('NumberOfModifiers');
  var oldnum = numi.value;
  var rowName = 'modifierrow'+oldnum;
  var oldrow = document.getElementById(rowName);
  if(oldnum > 1)
    {
    var num = (document.getElementById('NumberOfModifiers').value -2)+ 1;
    numi.value = num;
    ni.removeChild(oldrow);
    }
  }


