

// Send to Home Page function
function GoHome()
{
  var URL = window.location;
  window.location = window.location;
}

// Auction Modal Window Function
function AuctionItem(url,height,width){
//window.minimize();
var retValue = window.showModalDialog(url,"","dialogLeft: 0; dialogTop: 0; dialogHeight: " + height + "px; dialogWidth: " + width + "px; edge: sunken; help: no; center: Yes; status: no; scroll: no; resizable: yes;");
  if (retValue == undefined) {
  //  window.restore();
    return false;
  } else {
  //  window.restore();
    return true;
  }
}

// popUp Modal Window Function
function popUp(url,height,width){
var retValue = window.showModalDialog(url,"","dialogHeight: " + height + "px; dialogWidth: " + width + "px; edge: sunken; help: no; center: Yes; status: no; scroll: no; resizable: yes;");
  if (retValue == undefined) {
    return false;
  } else {
    return true;
  }
}

function NavigateTo(url) {
    window.location.href = url;
    return true;
}

// Limit no of chars in TextArea
function limitLength(field, maxlimit){
  if (field.value.length > maxlimit) {  
      field.value = field.value.substring(0, maxlimit);
  }
}

function GoTo(url){
  window.location=url
}

// updates the hidden field with the current scroll position
function rememberScrollPos() {
  document.all['txtScroll'].value = document.body.scrollTop;
}

// resets the document scroll position from where it was last time
function setScrollPosFromHistory() {
  if (document.all['txtScroll'].value != '') {
    document.body.scrollTop = document.all['txtScroll'].value; 
  }
}
// PasteFromClipboard
function PasteFromClipBoard(InTxtBox) 
{
  Copied = InTxtBox.createTextRange();
  Copied.execCommand("Paste");
}
// CopyToClipboard
function CopyToClipBoard(InTxtBox) 
{
  Copied = InTxtBox.createTextRange();
  Copied.execCommand("Copy");
}
// OLD JavaScript.js code
/*

// Edit Aution
function EditAuction(InId){
  mywin = window.open("Dialogs/EditAuction.aspx?InId=" + InId + "&Rdm=" + Math.random * 99999 ,
                      "",
                      "Height=450; Width=400; Left=0; Right=0; alwaysRaised=no; edge: sunken; help: no; status: no; scroll: no; resizable: yes;");
  }
// Auction Stock Item
function AuctionStockItem(InId){
  mywin = window.open("Dialogs/AuctionStockItem.aspx?InId=" + InId + "&Rdm=" + Math.random * 99999 ,
                                    "",
                                    "Height=450; Width=80; Left=0; Right=0; resizable=yes; alwaysRaised=no; edge: sunken; help: no; status: no; scroll: no; : yes;");
  }
// Add New Stock Item
function NewStockItem(){
  var retValue = window.showModalDialog("Dialogs/NewStockItem.aspx?Rdm=" + Math.random * 99999 ,
                                    "",
                                    "dialogHeight: 250px; dialogWidth: 460px; edge: sunken; help: no; center: Yes; status: no; scroll: no; resizable: yes;");
  return retValue 
  }

// Add Stock Image
function AddStockImage(InId){
  var retValue = window.showModalDialog("Dialogs/AddStockImage.aspx?InId=" + InId + "&Rdm=" + Math.random * 99999 ,
                                    "",
                                    "dialogHeight: 250px; dialogWidth: 370px; edge: sunken; help: no; center: Yes; status: no; scroll: no; resizable: yes;");
  return retValue 
  }
// Edit Stock Item
function EditStockItem(InId){
  var retValue = window.showModalDialog("Dialogs/EditStockItem.aspx?InId=" + InId + "&Rdm=" + Math.random * 99999 ,
                                    "",
                                    "dialogHeight: 315px; dialogWidth: 470px; edge: sunken; help: no; center: Yes; status: no; scroll: no; resizable: yes;");
  return retValue 
  }
  
// updates the hidden field with the current scroll position
function rememberScrollPos() {
  document.all['txtScroll'].value = document.body.scrollTop;
}

// resets the document scroll position from where it was last time
function setScrollPosFromHistory() {
  if (document.all['txtScroll'].value != '') {
    document.body.scrollTop = document.all['txtScroll'].value; 
  }
}
*/
