function pupSecureWindow(page) {
w=800;h=600;
l=(screen.availWidth-10 - w) / 2;
t=(screen.availHeight-20 - h) / 2;
var pupWindow = window.open(page,'','addressbar=yes,scrollbars=yes,menubar=no,width='+w+',height='+h+',top='+t+',left='+l+',resizable=no,toolbar=no,location=no,status=no');
}


function pupBarcodeLabel(style,size,barcode,labelX,labelY) {
var load = window.open('pupBarcodeLabel.asp?style=' + style + '&size=' + size + '&barcode=' + barcode + '&labelX=' + labelX + '&labelY=' + labelY,'','scrollbars=yes,menubar=no,height=500,width=500,resizable=yes,toolbar=no,location=no,status=no');
}


function DHTMLSound(surl) {
  document.getElementById("embedSound").innerHTML=
    "<embed src='"+surl+"' hidden=true autostart=true loop=false>";
}


function pupReportWindow(page) {
w=800;h=600;
l=(screen.availWidth-10 - w) / 2;
t=(screen.availHeight-20 - h) / 2;
var pupWindow = window.open(page,'','addressbar=no,scrollbars=yes,menubar=no,width='+w+',height='+h+',top='+t+',left='+l+',resizable=no,toolbar=no,location=no,status=no');
}


function pupPlannerWindow(page) {
w=1024;h=768;
l=(screen.availWidth-10 - w) / 2;
t=(screen.availHeight-20 - h) / 2;
var pupWindow = window.open(page,'','addressbar=no,scrollbars=yes,menubar=no,width='+w+',height='+h+',top='+t+',left='+l+',resizable=yes,toolbar=no,location=no,status=no');
}


function pupPublicationWindow(page) {
w=800;h=600;
l=(screen.availWidth-10 - w) / 2;
t=(screen.availHeight-20 - h) / 2;
var pupWindow = window.open(page,'','addressbar=no,scrollbars=yes,menubar=yes,width='+w+',height='+h+',top='+t+',left='+l+',resizable=yes,toolbar=no,location=no,status=no');
}


function refreshLog(logFile) {
window.location.href="pupActivityLog.asp?LogDate=" + logFile;
}


function callingAlert48() {
if (document.getElementById("Calling").checked == 1) {
alert("Please Note 48 Hours Notice\nIs Required For Collections");
}
}


function ReqDateASAP() {
if (document.getElementById("ASAP").checked == 1) {
document.getElementById("ReqDate").value = "A.S.A.P";
}
}


function resetReqDate() {
document.getElementById("ReqDate").value = "A.S.A.P";
document.getElementById("ASAP").checked = 1;
}


function resetInvDate() {
document.getElementById("InvDate").value = "";
}


function textCounter(field,remaining,maxlimit) {
obj1 = document.getElementById(field);
obj2 = document.getElementById(remaining);
obj2.innerHTML = maxlimit - obj1.value.length;
}


function confirmCancelOrder(OrderID) {
inputBox=confirm ("Are You Sure You Want To Cancel Order ID." + OrderID + " ?\nThis Action Is Not Reversible");
if (inputBox==true) {return true;}
else {return false;}
}


function confirmUnlockOrder(OrderID) {
inputBox=confirm ("Are You Sure You Want To Unlock This Order?\nPlease Ensure You Lock It Again Afterwards");
if (inputBox==true) {return true;}
else {return false;}
}


function confirmDeleteLine(StyleNo) {
inputBox=confirm ("Are You Sure You Want To Delete " + StyleNo + " From Your Order?\nThis Action Is Not Reversible");
if (inputBox==true) {return true;}
else {return false;}
}


function confirmDeleteLogs() {
inputBox=confirm ("Are You Sure You Want To Delete ALL Old Log Files?\nThis Action Is Not Reversible");
if (inputBox==true) {return true;}
else {return false;}
}


function disableclick(e) {
if(event.button==2) {
alert("Images & Source Code Copyright \251 UK Distributors (Ftwr) Ltd\n\nIf You Wish To Use Our Images You Must Obtain Permission Using\nThe Online Image Request Form");
return false;
}
}


function updateParent(url) {
if (opener && !opener.closed) {
window.opener.location.href = url;
}
}


function checkSearchForm(Box) {
obj1 = document.getElementById(Box);
// if (obj1.value.replace(/ /g,"") == null || obj1.value.replace(/ /g,"") == ""){obj1.className='errInput';obj1.value="";obj1.focus();return false;}
if (obj1.value.length < 3){obj1.className='errInput';obj1.value="";obj1.focus();return false;}
return true ;
}


function toggleLargePhoto() {
if (document.getElementById){
obj1 = document.getElementById('largePhoto');
obj2 = document.getElementById('mainWrapper');
if (obj1.style.display == "none"){
obj1.style.display = "";
} else {
obj1.style.display = "none";
}}}


function toggleThumbNail(style) {
if (document.getElementById){
obj1 = document.getElementById('thumbNail' + style);
if (obj1.style.display == "none"){
obj1.style.display = "";
} else {
obj1.style.display = "none";
}}}


function toggleBarcode(div,totalDivs) {
if (document.getElementById){
var i=0;
for (i=0;i<=totalDivs;i++){
document.getElementById('barcode'+i).style.display="none";
}
document.getElementById('barcode'+div).style.display="";
}}


function showHideDiv2(div,totalDivs) {
if (document.getElementById){
var i=1;
for (i=1;i<=totalDivs;i++){
document.getElementById("div"+i).style.display="none";
document.getElementById("list"+i).className="";
}
document.getElementById("div"+div).style.display="";
document.getElementById("list"+div).className="selected";
}}


function closeBarcodeDiv(div) {
if (document.getElementById){
obj1 = document.getElementById('barcode' + div);
obj1.style.display = "none";
}}


function toggleDiv(id){
if (document.getElementById){
obj1 = document.getElementById(id);
if (obj1.style.display == "none"){
obj1.style.display = "";
} else {
obj1.style.display = "none";
}}}


function showHide(id, arrow){
if (document.getElementById){
obj1 = document.getElementById(id);
obj2 = document.getElementById(arrow);
if (obj1.style.display == "none"){
obj1.style.display = "";
obj2.src= "images/hide.gif";
setCookie(id,"show",365);
} else {
obj1.style.display = "none";
obj2.src= "images/show.gif";
setCookie(id,"hide",365);
}}}


function setCookie(name,value,duration){
cookiestring=name+"="+escape(value)+";EXPIRES="+getExpiryDate(duration);
document.cookie=cookiestring;
}


function getExpiryDate(nodays){
var UTCstring;
Today = new Date();
nomilli=Date.parse(Today);
Today.setTime(nomilli+nodays*24*60*60*1000);
UTCstring = Today.toUTCString();
return UTCstring;
}


function addEntry(DATE) {
var load = window.open('pupPlannerEntry.asp?date=' + DATE,'','scrollbars=yes,menubar=no,height=350,width=350,resizable=no,toolbar=no,location=no,status=no');
}

function amendEntry(ID) {
var load = window.open('pupPlannerEntry.asp?id=' + ID,'','scrollbars=yes,menubar=no,height=350,width=350,resizable=no,toolbar=no,location=no,status=no');
}

function confirmDeleteEntry() {
confirmBox = confirm("Are You Sure You Want To Delete This Entry?\nNB: This Action Is Not Reversible");
if (confirmBox == true) {
return true;
}
else
{
return false;
}
}



