// GLOBAL SETTINGS document.domain = "www.makeviolins.com"; debugOn = false; portalType = "public"; portalSystemMode = "0"; // DEAD FUNCTIONS // Retained for backward compatability function statusWrite (a,b) { } function monitorWrite (a,b) { } // ALERTS function alertReload (alertReloadImg,alertReloadImgSrc) { // try { alertReloadImgObj = document.getElementById (alertReloadImg); alertReloadImgObj.src = alertReloadImgSrc; // } // catch (e) { } } // AGREEMENT function agreeEnforce (agreeEnforceElmt) { if (agreeEnforceElmt.checked) { return true } alert ("You must agree to the terms and conditions"); return false; } // AJAX function ajaxInit ( ) { try { // Firefox, Opera 8.0+, Safari return new XMLHttpRequest (); } catch (e) { // Internet Explorer 6+ try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { // Internet Explorer 5.5 try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { alert("Your browser does not support AJAX!"); return false; } } } } function ajaxJavascript (ajaxJavascriptTgtId,ajaxJavascriptRequestTgtId) { ajaxRequestJsObj[ajaxJavascriptRequestTgtId] = ajaxJavascriptTgtId; } ajaxRequestJsObj = Array (); function ajaxOnready (ajaxOnreadyTargetId,ajaxOnreadyCode) { if (ajaxOnreadyCode) { // Add the code ajaxOnreadyEval[ajaxOnreadyTargetId] = ajaxOnreadyCode; } if (!ajaxOnreadyEval[ajaxOnreadyTargetId]) { // No code stored return; } for (tmp in ajaxRequestLog) { if (ajaxRequestLog[tmp]==ajaxOnreadyTargetId) { ajaxOnreadyId = tmp; } } if (ajaxRequestObj[ajaxOnreadyId]) { // AJAX not done setTimeout ("ajaxOnready('"+ajaxOnreadyTargetId+"')",1000); return; } try { // Try evaluating the code //alert (ajaxOnreadyEval[ajaxOnreadyTargetId]); eval (ajaxOnreadyEval[ajaxOnreadyTargetId]); } catch (e) { // Code evaluation failed } // Delete the code ajaxOnreadyEval[ajaxOnreadyTargetId] = null; } ajaxOnreadyEval = Array (); function ajaxRequest (ajaxRequestUrl,ajaxRequestTgtId,ajaxRequestWaitImg,ajaxRequestId,ajaxRequestForceful) { ajaxRequestNum++; if (!ajaxRequestId) { ajaxRequestId = ajaxRequestNum; } try { ajaxRequestTgt[ajaxRequestId] = document.getElementById (ajaxRequestTgtId); } catch (e) { alert ("Could not identify element id="+ajaxRequestTgtId); return false; } if (ajaxRequestForceful) { // Clear any old request for this ajaxRequestId ajaxRequestObj[ajaxRequestId] = null; ajaxRequestTgt[ajaxRequestId] = null; } if (ajaxRequestObj[ajaxRequestId]) { alert ("Cannot make an unforceful request because previous response for request '"+ajaxRequestId+"' is incomplete..."); } if (ajaxRequestWaitImg) { ajaxRequestHtmlTmp = ""; } else { ajaxRequestHtmlTmp = " "; } ajaxRequestLog[ajaxRequestId] = ajaxRequestTgtId; ajaxRequestObj[ajaxRequestId] = ajaxInit (); if (!ajaxRequestObj[ajaxRequestId]) { alert ("Could not initialise AJAX"); return false; } ajaxRequestObj[ajaxRequestId].onreadystatechange = ajaxResponse; ajaxRequestObj[ajaxRequestId].open ("GET",ajaxRequestUrl,true); ajaxRequestObj[ajaxRequestId].send (null); ajaxRequestTgt[ajaxRequestId].innerHTML = ajaxRequestHtmlTmp; } ajaxRequestLog = Array (); ajaxRequestObj = Array (); ajaxRequestTgt = Array (); ajaxRequestNum = 0; function ajaxResponse ( ) { ajaxResponseNum++; for (tmp in ajaxRequestObj) { if (ajaxRequestObj[tmp]) { if (ajaxRequestObj[tmp].readyState==4) { if (ajaxRequestObj[tmp].status==200) { ajaxRequestTgt[tmp].innerHTML = ajaxRequestObj[tmp].responseText; ajaxResponseDel[tmp] = true; if (ajaxRequestJsObj[ajaxRequestLog[tmp]]) { ajaxResponseJsObj = document.getElementById (ajaxRequestJsObj[ajaxRequestLog[tmp]]); if (ajaxResponseJsObj) { eval (ajaxResponseJsObj.innerHTML); ajaxRequestJsObj[ajaxRequestLog[tmp]] = false; } /* try { } catch (e) { alert ("Could not find javascript "+ajaxRequestJsObj[ajaxRequestLog[tmp]]); } */ } } } } } for (tmp in ajaxResponseDel) { try { ajaxRequestObj[tmp] = null; ajaxRequestTgt[tmp] = null; } catch (e) { } } ajaxResponseDel = Array (); } ajaxResponseDel = Array (); ajaxResponseNum = 0; // FOR INTERNET EXPLORER function blinkForIE (blinkForIEWinName) { if (!document.all) { return; } if (window.blinkForIETimeout) { clearTimeout(blinkForIETimeout); blinkForIETimeout = false; } if (!window.blinkForIEWinArray) { blinkForIEWinArray = new Array (); } // Add new window/frame if (blinkForIEWinName) { ok = true; try { blinkForIEWin = eval ("window."+blinkForIEWinName); } catch (e) { ok = false; } if (ok && !blinkForIEWinArray[blinkForIEWinName]) { blinkForIEWinArray[blinkForIEWinName] = blinkForIEWin; } } for (tmp1 in blinkForIEWinArray) { ok = true; try { tmp2 = blinkForIEWinArray[tmp1]; tmp2 = tmp2.document.all.tags('blink'); } catch (e) { ok = false } if (ok) { for (i=0;i7) { colorPickerMoveRGB.value = colorPickerMoveRGB.value.substr(0,7); } colorPickerMoveVal = ""; for (i=1;i<7;i++) { if (i>colorPickerMoveRGB.value.length) { break; } if (colorPickerRGBchr.indexOf(colorPickerMoveRGB.value.substr(i,1))<0) { colorPickerMoveVal += "0"; } else { colorPickerMoveVal += colorPickerMoveRGB.value.substr(i,1); } } colorPickerMoveRGB.value = "#" + colorPickerMoveVal; while (colorPickerMoveVal.length<6) { colorPickerMoveVal += "0"; } // Refresh colour display colorPickerMoveBox = document.getElementById ("colorPickerDisplayNew"); colorPickerMoveBox.style.backgroundColor = "#" + colorPickerMoveVal; // Generate normalised RGBMinMax input array colorPickerMoveIn = new Array (); tmpMin = 1; tmpMax = 0; for (i=0;i<3;i++) { colorPickerMoveIn[i] = ""; for (j=0;j<2;j++) { colorPickerMoveIn[i] += colorPickerMoveVal.substr((2*i)+j,1); } // Hex to normalised 4DP colorPickerMoveIn[i] = parseInt (colorPickerMoveIn[i],16) / 255; colorPickerMoveIn[i] = numberExtract (1000*colorPickerMoveIn[i]) / 1000; if (colorPickerMoveIn[i]tmpMax) { tmpMax = colorPickerMoveIn[i]; } } colorPickerMoveIn[3] = tmpMin; colorPickerMoveIn[4] = tmpMax; // Perform space conversion colorPickerMoveOut = new Array (); // HUE if (colorPickerMoveIn[3]==colorPickerMoveIn[4]) { colorPickerMoveOut[0] = 0; } else if (colorPickerMoveIn[0]==colorPickerMoveIn[4]) { // R IS MAX if (colorPickerMoveIn[1]= B colorPickerMoveOut[0] = colorPickerMoveIn[1] - colorPickerMoveIn[2]; colorPickerMoveOut[0] /= colorPickerMoveIn[4] - colorPickerMoveIn[3]; colorPickerMoveOut[0] *= Math.PI / 3; } } else if (colorPickerMoveIn[1]==colorPickerMoveIn[4]) { // G IS MAX colorPickerMoveOut[0] = colorPickerMoveIn[2] - colorPickerMoveIn[0]; colorPickerMoveOut[0] /= colorPickerMoveIn[4] - colorPickerMoveIn[3]; colorPickerMoveOut[0] += 2; colorPickerMoveOut[0] *= Math.PI / 3; } else { // B IS MAX colorPickerMoveOut[0] = colorPickerMoveIn[0] - colorPickerMoveIn[1]; colorPickerMoveOut[0] /= colorPickerMoveIn[4] - colorPickerMoveIn[3]; colorPickerMoveOut[0] += 4; colorPickerMoveOut[0] *= Math.PI / 3; } // BRIGHTNESS/LUMINANCE if (colorPickerMode=="HSL") { colorPickerMoveOut[2] = colorPickerMoveIn[3] + colorPickerMoveIn[4]; colorPickerMoveOut[2] /= 2; } else { colorPickerMoveOut[2] = colorPickerMoveIn[4]; } // SATURATION if (colorPickerMode=="HSL") { if (colorPickerMoveOut[2]==0 || colorPickerMoveIn[4]==colorPickerMoveIn[3]) { colorPickerMoveOut[1] = 0; } else if (colorPickerMoveOut[2]>0.5) { colorPickerMoveOut[1] = colorPickerMoveIn[4] - colorPickerMoveIn[3]; colorPickerMoveOut[1] /= 2 - (colorPickerMoveIn[4] + colorPickerMoveIn[3]); } else { colorPickerMoveOut[1] = colorPickerMoveIn[4] - colorPickerMoveIn[3]; colorPickerMoveOut[1] /= colorPickerMoveIn[4] + colorPickerMoveIn[3]; } } else { if (colorPickerMoveIn[4]==0) { colorPickerMoveOut[1] = 0; } else { colorPickerMoveOut[1] = colorPickerMoveIn[4] - colorPickerMoveIn[3]; colorPickerMoveOut[1] /= colorPickerMoveIn[4]; } } // Move markers tmpX = Math.cos (colorPickerMoveOut[0]); tmpX = numberExtract (colorPickerSlider[0]["constraintR"]*tmpX); tmpY = Math.sin (colorPickerMoveOut[0]); tmpY = numberExtract (colorPickerSlider[0]["constraintR"]*tmpY); tmpY = 0 - tmpY; tmp = document.getElementById ("colorPickerMarker0"); tmp.style.left = numberExtract (colorPickerSlider[0]["constraintOx"]+tmpX-(tmp.offsetWidth/2)); tmp.style.top = numberExtract (colorPickerSlider[0]["constraintOy"]+tmpY-(tmp.offsetHeight/2)); tmpX = 255 * colorPickerMoveOut[1]; tmp = document.getElementById ("colorPickerMarker1"); tmp.style.left = numberExtract (colorPickerSlider[1]["constraintXmin"]+tmpX-(tmp.offsetWidth/2)); tmp.style.top = numberExtract (colorPickerSlider[1]["constraintY"]-(tmp.offsetHeight/2)); tmpX = 255 * colorPickerMoveOut[2]; tmp = document.getElementById ("colorPickerMarker2"); tmp.style.left = numberExtract (colorPickerSlider[2]["constraintXmin"]+tmpX-(tmp.offsetWidth/2)); tmp.style.top = numberExtract (colorPickerSlider[2]["constraintY"]-(tmp.offsetHeight/2)); return true; } function colorPickerReturn (colorPickerReturnVal) { if (window.colorPickerTarget) { colorPickerTarget.value = colorPickerReturnVal; } if (window.colorPickerReturnAction) { eval (colorPickerReturnAction); } } function colorPickerWrite ( ) { // Check mode if (!window.colorPickerMode) { alert ("Mode was not defined (HSB/HSL)"); return false; } colorPickerDebugTxt = ""; // Normalise values of markers colorPickerWriteIn = new Array (); for (i=0;i<3;i++) { colorPickerWriteIn[i] = document.getElementById ("colorPickerMarker"+i); tmpX = numberExtract (colorPickerWriteIn[i].offsetLeft); tmpX += numberExtract (colorPickerWriteIn[i].offsetWidth/2); if (i==0) { tmpY = numberExtract (colorPickerWriteIn[i].offsetTop); tmpY += numberExtract (colorPickerWriteIn[i].offsetHeight/2); tmpX -= colorPickerSlider[0]["constraintOx"]; tmpY -= colorPickerSlider[0]["constraintOy"]; colorPickerWriteIn[0] = dragTheta (tmpX,tmpY) / (2*Math.PI); } else { tmpX -= colorPickerSlider[i]["constraintXmin"]; colorPickerWriteIn[i] = tmpX / 255; } } colorPickerDebugTxt += "H="+numberDP(360*colorPickerWriteIn[0],0)+"deg :: "; colorPickerDebugTxt += "S="+numberDP(colorPickerWriteIn[1],4)+" :: "; colorPickerDebugTxt += "H="+numberDP(colorPickerWriteIn[2],4)+" :: "; // Calculate RGB value from sliders colorPickerWriteOut = new Array (); if (colorPickerMode=="HSL") { if (colorPickerWriteIn[1]==0) { for (i=0;i<3;i++) { colorPickerWriteOut[i] = colorPickerWriteIn[2]; } } else { if (colorPickerWriteIn[2]<0.5) { tmpQ = colorPickerWriteIn[2]; tmpQ *= 1 + colorPickerWriteIn[1]; colorPickerDebugTxt += "Low L: Q="+numberDP(tmpQ,4)+"
"; } else { tmpQ = colorPickerWriteIn[2] + colorPickerWriteIn[1]; tmpQ -= colorPickerWriteIn[2] * colorPickerWriteIn[1]; colorPickerDebugTxt += "High L: Q="+numberDP(tmpQ,4)+"
"; } tmpP = 2 * colorPickerWriteIn[2]; tmpP -= tmpQ; colorPickerWriteOut[0] = colorPickerWriteIn[0] + 1/3; colorPickerWriteOut[1] = colorPickerWriteIn[0]; colorPickerWriteOut[2] = colorPickerWriteIn[0] - 1/3; for (i=0;i<3;i++) { colorPickerDebugTxt += "
"; if (colorPickerWriteOut[i]<0) { colorPickerWriteOut[i]++; } else if (colorPickerWriteOut[i]>1) { colorPickerWriteOut[i]--; } colorPickerDebugTxt += "start ["+i+"] = "+numberDP(colorPickerWriteOut[i],4)+"
"; if ((6*colorPickerWriteOut[i])<1) { colorPickerWriteOut[i] *= 6 * tmpP; colorPickerWriteOut[i] *= tmpQ - tmpP; colorPickerWriteOut[i] += tmpP; colorPickerDebugTxt += "start < 1/6 ["+i+"] = "+numberDP(colorPickerWriteOut[i],4)+"
"; } else if ((2*colorPickerWriteOut[i])<1) { colorPickerDebugTxt += "start < 1/2 ["+i+"] = "+numberDP(colorPickerWriteOut[i],4)+"
"; colorPickerWriteOut[i] = tmpQ; } else if ((3*colorPickerWriteOut[i])<2) { colorPickerWriteOut[i] = 2/3 - colorPickerWriteOut[i]; colorPickerWriteOut[i] *= 6 * (tmpQ - tmpP); colorPickerWriteOut[i] += tmpP; colorPickerDebugTxt += "start < 2/3 ["+i+"] = "+numberDP(colorPickerWriteOut[i],4)+"
"; } else { colorPickerWriteOut[i] = tmpP; colorPickerDebugTxt += "start >= 2/3 ["+i+"] = "+numberDP(colorPickerWriteOut[i],4)+"
"; } colorPickerDebugTxt += "Normalised (a): ["+i+"]="+numberDP(colorPickerWriteOut[i],4)+"
"; colorPickerWriteOut[i] *= 255; colorPickerWriteOut[i] = Math.floor (colorPickerWriteOut[i]+0.5); colorPickerDebugTxt += "Decimal: ["+i+"]="+colorPickerWriteOut[i]+" :: "; colorPickerWriteOut[i] = numberDecToHex (colorPickerWriteOut[i]); if (colorPickerWriteOut[i].length==1) { colorPickerWriteOut[i] = "0" + colorPickerWriteOut[i]; } colorPickerDebugTxt += "Hex converted: "+colorPickerWriteOut[i]+"
"; } } } else { colorPickerWriteIn[0] *= 6; if (colorPickerWriteIn[0]>=6) { colorPickerWriteIn[0] -= 6; } if (colorPickerWriteIn[0]<0) { colorPickerWriteIn[0] += 6; } colorPickerDebugTxt += "H6 = "+numberDP(colorPickerWriteIn[0],2)+" :: "; tmpHi = Math.floor (colorPickerWriteIn[0]); colorPickerDebugTxt += "Hi = "+tmpHi+"
"; tmpF = colorPickerWriteIn[0] - tmpHi; tmpP = colorPickerWriteIn[2]; tmpP *= 1 - colorPickerWriteIn[1]; colorPickerDebugTxt += "p = "+numberDP(tmpP,4)+" :: "; tmpQ = colorPickerWriteIn[2]; tmpQ *= 1 - tmpF*colorPickerWriteIn[1]; colorPickerDebugTxt += "q = "+numberDP(tmpQ,4)+" :: "; tmpT = colorPickerWriteIn[2]; tmpT *= 1 - (1-tmpF*colorPickerWriteIn[1]); colorPickerDebugTxt += "t = "+numberDP(tmpT,4)+"
"; if (tmpHi==0) { colorPickerWriteOut[0] = colorPickerWriteIn[2]; colorPickerWriteOut[1] = tmpT; colorPickerWriteOut[2] = tmpP; } else if (tmpHi==1) { colorPickerWriteOut[0] = tmpQ; colorPickerWriteOut[1] = colorPickerWriteIn[2]; colorPickerWriteOut[2] = tmpP; } else if (tmpHi==2) { colorPickerWriteOut[0] = tmpP; colorPickerWriteOut[1] = colorPickerWriteIn[2]; colorPickerWriteOut[2] = tmpT; } else if (tmpHi==3) { colorPickerWriteOut[0] = tmpP; colorPickerWriteOut[1] = tmpQ; colorPickerWriteOut[2] = colorPickerWriteIn[2]; } else if (tmpHi==4) { colorPickerWriteOut[0] = tmpT; colorPickerWriteOut[1] = tmpP; colorPickerWriteOut[2] = colorPickerWriteIn[2]; } else { colorPickerWriteOut[0] = colorPickerWriteIn[2]; colorPickerWriteOut[1] = tmpP; colorPickerWriteOut[2] = tmpQ; } for (i=0;i<3;i++) { colorPickerDebugTxt += "
"; colorPickerDebugTxt += "Normalised (b): ["+i+"]="+numberDP(colorPickerWriteOut[i],4)+"
"; colorPickerWriteOut[i] *= 255; colorPickerWriteOut[i] = Math.floor (colorPickerWriteOut[i]+0.5); colorPickerDebugTxt += "Decimal: ["+i+"]="+colorPickerWriteOut[i]+" :: "; colorPickerWriteOut[i] = numberDecToHex (colorPickerWriteOut[i]); if (colorPickerWriteOut[i].length==1) { colorPickerWriteOut[i] = "0" + colorPickerWriteOut[i]; } colorPickerDebugTxt += "Hex converted: "+colorPickerWriteOut[i]+"
"; } } colorPickerWriteOut = "#" + colorPickerWriteOut.join(""); if (colorPickerDebug) { colorPickerDebug.innerHTML = colorPickerDebugTxt; } // Write to RGB input box colorPickerWriteRGB = document.getElementById ("colorPickerDisplayRGB"); colorPickerWriteRGB.value = colorPickerWriteOut; colorPickerWriteBox = document.getElementById ("colorPickerDisplayNew"); colorPickerWriteBox.style.backgroundColor = colorPickerWriteOut; return true; } // CONFERENCE FUNCTIONS conferenceFocusAllow = true; conferenceFormObj = false; conferenceId = false; conferenceIndicatorHalt = false; conferenceIndicatorWait = false; conferenceIndicatorLoad = false; conferenceIsInstigator = false; conferenceListArray = new Array (); conferenceListLoaded = false; conferenceMsgArray = new Array (); conferenceMsgLoaded = false; conferenceNameDefault = false; conferencePostNewClear = false; conferenceRefreshImage = false; conferenceRefreshPending = false; conferenceSetIndicatorType = false; conferenceTimeoutGo = false; conferenceTimeoutName = false; conferenceTimeoutRefresh = false; conferenceType = false; conferenceUpdateUrl = "https://www.makeviolins.com/?A=conference_update"; function cI (cIform,cIlist,cImsg) { // Initialise this conference update if (!window.portalType) { alert ("Variable portalType is either unspecified or null"); return; } if (!conferenceType) { if (portalType=="staff") { conferenceType = "staff"; } else { conferenceType = "admin"; } } if (portalType=="staff") { if (conferenceType=="public") { alert ("Public conferences may not be run at a staff portal"); return; } conferenceNameDefault = "no conference selected"; } else { if (conferenceType=="staff") { alert ("Staff conferences may not be run at a public portal"); return; } if (conferenceType=="admin") { conferenceNameDefault = "disconnected"; } else { conferenceNameDefault = "no chat room selected"; } } if (portalType=="staff" || conferenceType!="admin") { blinkForIE ("conferenceConf"); } if (!conferenceIndicatorHalt) { alert ("URL of indicator image conferenceIndicatorHalt was not given"); } if (!conferenceIndicatorWait) { alert ("URL of indicator image conferenceIndicatorWait was not given"); } if (!conferenceIndicatorLoad) { alert ("URL of indicator image conferenceIndicatorLoad was not given"); } conferenceRefreshPending = false; conferenceFormObj = cIform; document.conference.name.value = "[" + conferenceNameDefault + "]"; if (cIlist.length>0) { conferenceList (cIlist); } if (cImsg.length>0) { conferenceMsg (cImsg); } try { // A big number of pixels down window.conferenceView.scrollTo (0,10000); } catch (e) { // Never mind } conferenceRefreshStart (); } function conferenceFocusAllowOff () { // Used by main window - not conference window if (!window.conferenceWin || window.conferenceWin.closed) { // The conference window does not exist return true; } if (!window.conferenceWin.conferenceUpdate) { // The conference window does not contain the conference tool return false; } window.conferenceWin.conferenceFocusAllow = false; } function conferenceFocusAllowOn () { conferenceFocusAllow = true; } function conferenceJoin (conferenceJoinId) { if (!conferenceJoinId) { alert ("Conference was not identified"); return; } if (conferenceRefreshPending) { tmp = "try{conferenceJoin(conferenceJoinId)}"; tmp += "catch(e){"; tmp += "debugAlert('conferenceJoin timeout problem')"; tmp += "}"; debugAlert (tmp); conferenceTimeoutGo = setTimeout (tmp,1000); return; } if (conferenceTimeoutGo) { debugAlert ("Clearing conferenceTimeoutGo"); clearTimeout (conferenceTimeoutGo); conferenceTimeoutGo = false; } document.conference.name.value = "[" + conferenceNameDefault + "]"; conferenceFormObj.r.value = 0; conferenceMsgArray = new Array (); conferenceWr (window.conferenceView.document,"msgDiv",""); tmp = conferenceUpdateUrl; tmp += "&t="; tmp += conferenceType; tmp += "&join="; tmp += conferenceJoinId; conferenceFormObj.action = tmp; conferenceRefreshDo (); } function conferenceList (conferenceListData) { if (!conferenceListLoaded) { if (portalType=="staff" || conferenceType!="admin") { // Try again in 1 second tmp = "conferenceList(conferenceListData)"; debugAlert (tmp); setTimeout (tmp,1000); return; } } document.conference.name.value = "[" + conferenceNameDefault + "]"; conferenceListData = conferenceListData.split ("\r"); // Use supplied data to modify list array for (i=0;conferenceListData[i];i++) { conferenceListData[i] = conferenceListData[i].split ("\n"); tmp = conferenceListData[i][0]; // STATUS: 0=remove 1=standby 2=message(s) 3=idle/administrated 4=unseen 5=focused if (conferenceListData[i][1]=="0") { // REMOVE if (conferenceListArray[tmp]) { // Remove element from conferenceListArray conferenceListArray.splice (tmp,1); } } else { // ADD NEW if (!conferenceListArray[tmp]) { conferenceListArray[tmp] = new Array (); // Set status to 3 if idle/administrated, otherwise 4 if (conferenceListData[i][1]=="3") { conferenceListArray[tmp][0] = "3"; } else { conferenceListArray[tmp][0] = "4"; } // Conference WAS not present - adopt data from Data conferenceListArray[tmp][1] = conferenceListData[i][2]; conferenceListArray[tmp][2] = conferenceListData[i][3]; } else { // MODIFY EXISTING if (conferenceListArray[tmp][0]=="5") { // Array WAS in focus (IS blurred) - adopt status from Data // either 1=standby or 2=messages conferenceListArray[tmp][0] = conferenceListData[i][1]; } else { if (conferenceListData[i][1]=="2") { // Data IS showing messages - adopt status 2 // Change conference status to 2 (changes) conferenceListArray[tmp][0] = "2"; } } } // Add display name and instigator flag if (conferenceListData[i][4]) { conferenceListArray[tmp][3] = conferenceListData[i][4]; conferenceListArray[tmp][4] = conferenceListData[i][5]; } } } if (portalType=="staff" || conferenceType!="admin") { conferenceListSuppress = false; } else { conferenceListSuppress = true; } conferenceListHtml = new Array (); i = 0; for (tmp in conferenceListArray) { if ((1*tmp)==(1*conferenceFormObj.c.value)) { // Set this conference conferenceId = tmp; conferenceIsInstigator = conferenceListArray[tmp][4]; // Set status to focused conferenceListArray[tmp][0] = "5"; conferenceListBlink = false; document.conference.name.value = conferenceListArray[tmp][3]; } else { // Set blink if (conferenceListArray[tmp][0]=="2") { conferenceListBlink = true; } else { conferenceListBlink = false; } if (portalType=="staff" && conferenceType=="admin") { if (conferenceListArray[tmp][0]=="4") { conferenceListBlink = true; } } } // Construct HTML if (!conferenceListSuppress) { conferenceListHtml[i] = ""; conferenceListHtml[i] += ""; conferenceListHtml[i] += ""; conferenceListHtml[i] += "0;j--) { conferenceListHtmlOut += conferenceListHtml[j-1]; } conferenceListHtmlOut += ""; conferenceWr (window.conferenceConf.document,"conferenceDiv",conferenceListHtmlOut); } function conferenceMsg (conferenceMsgData) { if (!conferenceMsgLoaded) { // Try again in 1 second tmp = "conferenceMsg(conferenceMsgData)"; debugAlert (tmp); setTimeout (tmp,1000); return; } conferenceMsgData = conferenceMsgData.split ("\r"); conferenceMsgTmp = new Array (); // Use supplied data to modify view array for (i=0;conferenceMsgData[i];i++) { conferenceMsgData[i] = conferenceMsgData[i].split ("\n"); if (conferenceMsgData[i][0]=="0") { tmp = conferenceMsgTmp.length; // Message is temporary conferenceMsgTmp[tmp] = new Array(); conferenceMsgTmp[tmp][0] = conferenceMsgData[i][0]; conferenceMsgTmp[tmp][1] = conferenceMsgData[i][1]; conferenceMsgTmp[tmp][2] = conferenceMsgData[i][2]; } else { // Add to message array; tmp = conferenceMsgArray.length; conferenceMsgArray[tmp] = new Array(); conferenceMsgArray[tmp][0] = conferenceMsgData[i][0]; conferenceMsgArray[tmp][1] = conferenceMsgData[i][1]; conferenceMsgArray[tmp][2] = conferenceMsgData[i][2]; } } conferenceMsgHtml = ""; for (i=0;conferenceMsgArray[i];i++) { conferenceMsgHtml += ""; conferenceMsgHtml += ""; conferenceMsgHtml += "dayAdjustMnthLen["x"+dayAdjustMonthElmt.value]) { dayAdjustDayElmt.selectedIndex = 0; return; } if (dayAdjustMonthElmt.value=="xx") { dayAdjustDayElmt.selectedIndex = 0; return; } } // DEBUG function debugAlert (debugAlertMsg) { if (!window.debugOn) { return } alert (debugAlertMsg); } // DRAG FUNCTIONS function dragInit (dragInitClassName) { if (!window.dragClassNames) { dragClassNames = new Array (); } dragClassNames.push (dragInitClassName); dragDebug = document.getElementById ("dragInfo"); dragMouse = new Object (); dragMouse.startX = 0; dragMouse.startY = 0; dragMouse.startTheta = 0; dragLimit (); document.onmousedown = dragMouseDown; document.onmouseup = dragMouseUp; } function dragLimit (dragLimitP,dragLimitA,dragLimitB,dragLimitC) { if (!dragLimitP) { // Clear constraints dragConstraint = new Object (); dragConstraint.mAngle = 0; // Angle of mouse from layer centre dragConstraint.isRect = true; dragConstraint.isCirc = false; dragConstraint.xMin = 0; dragConstraint.xMax = document.body.clientWidth; dragConstraint.yMin = 0; dragConstraint.yMax = document.body.clientHeight; dragConstraint.origX = 0; dragConstraint.origY = 0; dragConstraint.radius = 10; return true; } if (dragLimitP=="X") { // Narrow X-axis constraint parameters dragConstraint.isRect = true; dragConstraint.isCirc = false; tmp = numberExtract (dragLimitA); if (tmp>dragConstraint.xMin) { dragConstraint.xMin = tmp; } tmp = numberExtract (dragLimitB); if (tmpdragConstraint.yMin) { dragConstraint.yMin = tmp; } tmp = numberExtract (dragLimitB); if (tmpdocument.body.clientWidth) { dragConstraint.origX = document.body.clientWidth; } dragConstraint.origY = numberExtract (dragLimitB); if (dragConstraint.origY<0) { dragConstraint.origY = 0; } if (dragConstraint.origY>document.body.clientHeight) { dragConstraint.origY = document.body.clientHeight; } dragConstraint.radius = numberExtract (dragLimitC); if (dragConstraint.radius<10) { dragConstraint.radius = 10; } return true; } return false; } function dragMouseDown (e) { dragDebugTxt = ""; // Left click: Firefox = 0, IE = 1 if (e==null) { // Assume IE e = window.event; dragEventButton = 1; } else { dragEventButton = 0; } if (e.button!=dragEventButton) { return true; } if (e.target) { tmp = e.target; } else { tmp = e.srcElement; } if (!dragIsDragClass(tmp)) { return true; } dragElement = tmp; // Element position dragElementX = numberExtract (dragElement.offsetLeft); dragElementX += numberExtract (dragElement.offsetWidth/2); dragElementY = numberExtract (dragElement.offsetTop); dragElementY += numberExtract (dragElement.offsetHeight/2); dragElementZ = dragElement.style.zIndex; dragElement.style.zIndex = 10000; // Mouse start position dragMouse.startX = e.clientX; dragMouse.startY = e.clientY; if (dragConstraint.isCirc) { dragDebugTxt += "Constrain to circular locus
"; // Element angle tmpX = numberExtract (dragElementX-dragConstraint.origX); tmpY = numberExtract (dragElementY-dragConstraint.origY); dragDebugTxt += "Element from origin: ("+tmpX+","+tmpY+")
"; dragElementTheta = dragTheta (tmpX,tmpY); dragDebugTxt += "Element starting at "+numberExtract (180*dragElementTheta/Math.PI)+" deg
"; // Mouse angle tmpX = numberExtract (e.clientX-dragConstraint.origX); tmpY = numberExtract (e.clientY-dragConstraint.origY); dragDebugTxt += "Mouse from origin: ("+tmpX+","+tmpY+")
"; dragMouse.startTheta = dragTheta (tmpX,tmpY); dragDebugTxt += "Mouse starting at "+numberExtract (180*dragMouse.startTheta/Math.PI)+" deg
"; } else { dragDebugTxt += "Constrain to rectangular area
"; } if (dragDebug) { dragDebug.innerHTML = dragDebugTxt; } // Capture mouse movement document.onmousemove = dragMouseMove; // Prevent text selection document.body.focus(); document.onselectstart = function () { return false; }; return false; } function dragMouseMove (e) { if (!window.dragElement) { return true; } if (e==null) { var e = window.event; } dragDebugTxt = "Mouse at ("+e.clientX+","+e.clientY+")
"; if (dragConstraint.isCirc) { // Constrain layer centre to a circular locus dragDebugTxt += "Circular locus constraint
"; e.clientDeltaX = e.clientX - dragConstraint.origX; e.clientDeltaY = e.clientY - dragConstraint.origY; dragDebugTxt += "Mouse from origin ("+e.clientDeltaX+","+e.clientDeltaY+")
"; e.clientTheta = dragTheta (e.clientDeltaX,e.clientDeltaY); dragDebugTxt += "as an angle: "+(180*e.clientTheta/Math.PI)+" deg
"; dragDebugTxt += "add element "+(180*dragElementTheta/Math.PI)+" deg
"; tmpTheta = e.clientTheta + dragElementTheta; dragDebugTxt += "less mouse at start "+(180*dragMouse.startTheta/Math.PI)+" deg
"; tmpTheta -= dragMouse.startTheta; dragDebugTxt += "gives: "+(180*tmpTheta/Math.PI)+" deg
"; dragDebugTxt += " = "+numberExtract(180*tmpTheta/Math.PI)+" deg
"; dragDebugTxt += "with a radius of "+dragConstraint.radius+"px
"; tmpX = numberExtract (dragConstraint.radius*Math.cos (tmpTheta)); tmpY = numberExtract (dragConstraint.radius*Math.sin (tmpTheta)); tmpY = 0 - tmpY; dragDebugTxt += "gives layer centre from origin: ("+tmpX+","+tmpY+")
"; tmpX += dragConstraint.origX; tmpY += dragConstraint.origY; dragDebugTxt += "gives absolute layer centre: ("+tmpX+","+tmpY+")
"; } else { // Constrain layer top left to a rectangular space dragDebugTxt += "Rectangular area constraint
"; tmpX = dragElementX + e.clientX - dragMouse.startX; if (tmpXdragConstraint.xMax) { tmpX = dragConstraint.xMax; } tmpY = dragElementY + e.clientY - dragMouse.startY; if (tmpYdragConstraint.yMax) { dragDebugTxt += "y from "+tmpY+" to "+dragConstraint.yMax+" :: "; tmpY = dragConstraint.yMax; } } // tmpX,2 are centred - reference to top left tmpX -= dragElement.offsetWidth / 2; tmpY -= dragElement.offsetHeight / 2; dragDebugTxt += "gives absolute left top: ("+tmpX+","+tmpY+")
"; dragElement.style.left = numberExtract(tmpX) + "px"; dragElement.style.top = numberExtract(tmpY) + "px"; dragDebugTxt += "Style: left:"+dragElement.style.left+"; top:"+dragElement.style.top; if (dragDebug) { dragDebug.innerHTML = dragDebugTxt; } return true; } function dragMouseUp ( ) { if (!window.dragElement) { return true; } dragLimit (); try { dragElement.style.zIndex = dragElementZ; } catch (e) { } document.onmousemove = null; document.onselectstart = null; dragElement = false; if (dragDebug) { dragDebug.innerHTML = "Mouse up"; } } function dragIsDragClass (dragIsDragClassInput) { for (i=0;dragClassNames[i];i++) { if (dragIsDragClassInput.className==dragClassNames[i]) { return true; } } return false; } function dragTheta (dragThetaX,dragThetaY) { dragDebugTxt += " dragTheta ("+dragThetaX+","+dragThetaY+")
"; dragThetaX = numberExtract (dragThetaX); dragThetaY = numberExtract (dragThetaY); dragDebugTxt += " dragTheta ("+dragThetaX+","+dragThetaY+")
"; if (dragThetaX==0) { if (dragThetaY<0) { dragDebugTxt += " dragTheta() => 90 deg
"; return (1 * Math.PI/2); } else { dragDebugTxt += " dragTheta() => 270 deg
"; return (3 * Math.PI/2); } } dragDebugTxt += " dragTheta() => "+(0-dragThetaY)+" / "+dragThetaX+"
"; dragThetaO = Math.atan ((0-dragThetaY)/dragThetaX); if (dragThetaX<0) { dragThetaO += 1 * Math.PI; } if (dragThetaO<0) { dragThetaO += 2 * Math.PI; } dragDebugTxt += " dragTheta() => "+numberExtract(180*dragThetaO/Math.PI)+" deg
"; return dragThetaO; } // GALLERY VIEWER function galleryBack ( ) { if (!window.gallery) { alert ("galleryBack(): gallery not initialised by galleryIni()"); return; } gallery.ptr--; if (gallery.ptr<0) { gallery.ptr = 0; return; } if (gallery.img[gallery.ptr-gallery.cch] && !gallery.rdy[gallery.ptr-gallery.cch]) { galleryLoad (gallery.ptr-1); } gallerySee ( ); } function galleryFwrd ( ) { if (!window.gallery) { alert ("galleryFwrd(): gallery not initialised by galleryIni()"); return; } gallery.ptr++; if (gallery.ptr>(gallery.url.length-1)) { gallery.ptr = gallery.url.length - 1; return; } if (gallery.img[gallery.ptr+gallery.cch] && !gallery.rdy[gallery.ptr+gallery.cch]) { galleryLoad (gallery.ptr+1); } gallerySee (); } function galleryIni (galleryIniB,galleryIniF,galleryIniI,galleryIniT,galleryIniR,galleryIniC) { gallery = new Object (); try { gallery.elmBack = document.getElementById (galleryIniB); gallery.elmFwrd = document.getElementById (galleryIniF); gallery.elmImg = document.getElementById (galleryIniI); } catch (e) { alert (e+'\nGallery was not initialised'); gallery = false; return; } try { gallery.elmTtl = document.getElementById (galleryIniT); } catch (e) { gallery.elmTtl = false; } gallery.root = galleryIniR; gallery.img = new Array (); gallery.ldg = new Array (); gallery.rdy = new Array (); gallery.elmLdg = new Image (); gallery.elmLdg.src = gallery.root + "/gallery_loading.gif"; gallery.ptr = 0; gallery.cch = 1 * galleryIniC; if (gallery.cch<1) { gallery.cch = 1; } gallery.url = new Array (); gallery.ttl = new Array (); gallery.dsc = new Array (); } function galleryIniDesc (galleryIniDescObj) { if (!window.gallery) { alert ("galleryIniDesc(): gallery not initialised by galleryIni()"); return; } try { gallery.elmDsc = document.getElementById (galleryIniDescObj); } catch (e) { gallery.elmDsc = false; } } function galleryLoaded (galleryLoadedImg) { if (!window.gallery) { alert ("galleryLoaded(): gallery not initialised by galleryIni()"); return false; } gallery.ldg[galleryLoadedImg.num] = false; gallery.rdy[galleryLoadedImg.num] = true; } function galleryLoad (galleryLoadPtr,galleryLoadForce) { if (!window.gallery) { alert ("galleryLoad(): gallery not initialised by galleryIni()"); return false; } if (!gallery.img[galleryLoadPtr]) { return false; } if (gallery.ldg[galleryLoadPtr]) { return true; } if (gallery.rdy[galleryLoadPtr] && !galleryLoadForce) { return true; } gallery.img[galleryLoadPtr].num = galleryLoadPtr; gallery.img[galleryLoadPtr].src = gallery.url[galleryLoadPtr]; gallery.img[galleryLoadPtr].onload = function(){galleryLoaded(this)} gallery.ldg[galleryLoadPtr] = true; return true; } function galleryPush (galleryPushTtl,galleryPushUrl,galleryPushDsc,galleryPushLoad) { if (!window.gallery) { alert ("galleryPush(): gallery not initialised by galleryIni()"); return; } tmp = gallery.img.length; gallery.url[tmp] = galleryPushUrl; gallery.ttl[tmp] = galleryPushTtl; gallery.dsc[tmp] = galleryPushDsc; gallery.img[tmp] = new Image(); if (galleryPushLoad) { galleryLoad (tmp); } } function gallerySee () { if (!window.gallery) { alert ("gallerySee(): gallery not initialised by galleryIni()"); return; } // Define inputs if (!gallery.url[gallery.ptr]) { return; } if (!gallery.img[gallery.ptr]) { return; } if (gallery.timeoutSee) { clearTimeout (gallery.timeoutSee); gallery.timeoutSee = null; } // Display title if (gallery.elmTtl) { gallery.html = ""+gallery.ttl[gallery.ptr]+""; gallery.html += " ["+(gallery.ptr+1)+" of "+gallery.url.length+"]"; gallery.elmTtl.innerHTML = gallery.html; } if (gallery.elmDsc) { gallery.htmlDsc = gallery.dsc[gallery.ptr]; gallery.elmDsc.innerHTML = gallery.htmlDsc; } // Update cursors if (gallery.ptr>0) { if (!gallery.img[gallery.ptr-1].complete) { gallery.img[gallery.ptr-1].src = gallery.url[gallery.ptr-1]; } gallery.elmBack.src = gallery.root + "/point_left.gif"; } else { gallery.elmBack.src = gallery.root + "/point_left_faded.gif"; } if (gallery.ptr<(gallery.url.length-1)) { if (!gallery.img[gallery.ptr+1].complete) { gallery.img[gallery.ptr+1].src = gallery.url[gallery.ptr+1]; } gallery.elmFwrd.src = gallery.root + "/point_right.gif"; } else { gallery.elmFwrd.src = gallery.root + "/point_right_faded.gif"; } // Display image if (gallery.rdy[gallery.ptr]) { if (gallery.elmImg.src!=gallery.img[gallery.ptr].src) { gallery.elmImg.src = gallery.img[gallery.ptr].src; } } else { if (gallery.elmImg.src!=gallery.elmLdg.src) { gallery.elmImg.src = gallery.elmLdg.src; } gallery.timeoutSee = setTimeout ("gallerySee()",1000); } } // IMAGE ROLLOVER function imgLoad (imgLoadSrc) { if (!window.imgLoadObj) { imgLoadObj = new Array (); } tmp = imgLoadObj.length; imgLoadObj[tmp] = new Image (); imgLoadObj[tmp].src = imgLoadSrc; } function imgRoll (imgRollObj,imgRollSrc) { imgRollObj.src = imgRollSrc; } // INFORMATION function infoReport (infoReportMsg,infoReportW,infoReportH) { try { window.top.infoShow (infoReportMsg,infoReportW,infoReportH); } catch (e) { } } function infoShow (infoShowMsg,infoShowW,infoShowH) { if (!infoToggleOn) { return; } try { infoShowDiv = document.getElementById ("iceInfoDiv"); } catch (e) { if (infoShowMsg) { infoToggleOn = false; alert ("Information pane is not working and has been switched OFF"); } return; } if (!infoShowDiv) { infoToggleOn = false; alert ("
element was not correctly identified; information pane has been switched OFF"); return; } if (!infoShowMsg) { infoShowDiv.innerHTML = ""; return; } if (infoShowW) { infoShowW += "px"; } else { infoShowW = "100%"; } if (!infoShowH) { infoShowH = infoShowHeight; } infoShowH += "px"; infoShowMsg = infoShowMsg.split("\n"); infoShowMsg = infoShowMsg.join("
"); infoShowStr = "0) { infoShowStr += ";height:" + infoShowH; } infoShowStr += ";padding:8px"; infoShowStr += ";color:#000000"; infoShowStr += ";background-color:#FFFFFF"; infoShowStr += ";font-size:11pt"; infoShowStr += "\""; infoShowStr += ">"; infoShowStr += ""; infoShowStr += infoShowMsg; infoShowStr += ""; infoShowStr += "
"; infoShowDiv.innerHTML = infoShowStr; } infoShowHeight = 100; function infoToggle ( ) { if (confirm('Visit ICE web site?')) { return true; } if (infoToggleOn) { if (confirm('Switch information pane OFF?')) { infoToggleOn = false; } return false; } if (confirm('Switch information pane ON?')) { infoToggleOn = true; } return false; } infoToggleOn = true; // LAYER HANDLING function layerFromEvent (layerFromEventE) { if (layerFromEventE.target) { layerFromEventL = layerFromEventE.target; } else if (layerFromEventE.srcElement) { layerFromEventL = layerFromEventE.srcElement; } else { return false; } // Safari bug if (layerFromEventE.nodeType==3) { layerFromEventL = layerFromEventE.parentNode; } return layerFromEventL; } function layerHd (layerHdElmt,layerHdSrc,layerHdTxtSh) { window.layerList[layerHdElmt] = 0; try { layerHdElmt = document.getElementById (layerHdElmt); layerHdElmt.style.visibility = 'hidden'; layerHdSrc.innerHTML = layerHdTxtSh; } catch (e) { alert ("layerHd(): "+e); return false; } return true; } function layerSquish (layerSquishObjId,layerSquishYes) { try { layerSquishObj = document.getElementById (layerSquishObjId); } catch (e) { return false; } if (layerSquishYes=="_TOGGLE") { if (layerSquishObj.style.height=="0") { layerSquishYes = false; } else { layerSquishYes = true; } } if (layerSquishYes) { layerSquishVal = "0"; } else { layerSquishVal = "auto"; } try { layerSquishObj.style.height = layerSquishVal; } catch (e) { return false; } return true; } function layerSh (layerShElmt,layerShSrc,layerShTxtHd) { window.layerList[layerShElmt] = 1; try { layerShElmt = document.getElementById (layerShElmt); layerShElmt.style.visibility = 'visible'; layerShSrc.innerHTML = layerShTxtHd; } catch (e) { alert ("layerSh(): "+e); return false; } return true; } function layerSw (layerSwElmt,layerSwSrc,layerSwTxtSh,layerSwTxtHd) { if (!window.layerList) { layerList = new Array (); } if (window.layerList[layerSwElmt]) { // On, so hide layerHd (layerSwElmt,layerSwSrc,layerSwTxtSh); return; } // On, so hide layerSh (layerSwElmt,layerSwSrc,layerSwTxtHd); } function layerVisible (layerVisibleObjId,layerVisibleYes) { try { layerVisibleObj = document.getElementById (layerVisibleObjId); } catch (e) { return false; } if (layerVisibleYes=="_TOGGLE") { if (layerVisibleObj.style.visibility=="visible") { layerVisibleYes = false; } else { layerVisibleYes = true; } } if (layerVisibleYes) { layerVisibleVal = "visible"; } else { layerVisibleVal = "hidden"; } try { layerVisibleObj.style.visibility = layerVisibleVal; } catch (e) { return false; } return true; } // LOGON function logonRequest (logonRequestDomain,logonRequestPath,logonRequestAlert) { logonRequestCookie = "lreq=1;path=" + logonRequestPath + ";"; if (logonRequestDomain.length>0) { logonRequestCookie += "domain=" + logonRequestDomain + ";"; } document.cookie = logonRequestCookie; return true; } // MENU OPTIONS function menuOptionProcess (menuOptionProcessObj) { try { menuOptionProcessVal = menuOptionProcessObj.options[menuOptionProcessObj.selectedIndex].value; } catch (e) { return false; } if (!menuOptionProcessVal) { return false; } if (!menuOptionTargetWin) { menuOptionTargetWin = window.self; } menuOptionProcessVal = menuOptionProcessVal.split(","); if (menuOptionProcessVal[0]=="js") { menuOptionProcessVal.shift(); if (menuOptionProcessVal.length==0) { return false; } if (menuOptionProcessVal[0]=="favourites" && menuOptionProcessVal.length>1) { if (menuOptionProcessVal[1]=="list") { menuOptionProcessUrl = "https://www.makeviolins.com/?A=favourite_list"; } else { menuOptionProcessUrl = menuOptionProcessVal[1]; } menuOptionTargetWin.location.href = menuOptionProcessUrl; } return false; } else { if (menuOptionProcessVal[0]=="filter" && menuOptionProcessVal.length>1) { menuOptionCurrentIdx = menuOptionProcessObj.selectedIndex; } } return true; } menuOptionCurrentIdx = 0; menuOptionTargetWin = false; // NO RIGHT CLICK function noRightClick ( ) { if (document.layers) { document.captureEvents (Event.MOUSEDOWN); document.onmousedown = noRightClickNS4; } else if (document.all && !document.getElementById) { document.onmousedown = noRightClickIE4; } document.oncontextmenu = new Function ("return false"); } function noRightClickIE4 ( ) { if (event.button==2) { return false; } } function noRightClickNS4 (e) { if (document.layers || document.getElementById && !document.all) { if (e.which==2 || e.which==3){ return false; } } } // NUMBERS function numberExtract (numberExtractValue) { numberExtractValue = parseInt (numberExtractValue); if (numberExtractValue==null || isNaN(numberExtractValue)) { return 0; } return numberExtractValue; } function numberDP (numberDPin,numberDPs) { numberDPs = parseInt(numberDPs); numberDPout = new Array (); numberDPout[0] = Math.floor (numberDPin); numberDPout[1] = numberDPin - numberDPout[0]; numberDPout[1] *= Math.pow (10,numberDPs); numberDPout[1] = String (Math.floor(numberDPout[1]+0.5)); while (numberDPout[1].length15) { numberDecToHexIn >>= 4; numberDecToHexOut = numberDecToHexDef.substr(numberDecToHexIn&15,1) + numberDecToHexOut; } return numberDecToHexOut; } // BODY EVENTS function bodyOnloadIni ( ) { } function bodyOnunloadIni ( ) { } // OPACITY function opacityChange (opacityChangeObj,opacityChangeValue) { opacityChangeObj.style.opacity = opacityChangeValue; opacityChangeOp = numberExtract (100*opacityChangeValue); opacityChangeObj.style.filter = "alpha(opacity="+opacityChangeOp+")"; } // WINDOW OPENERS function openAction (openActionUrl,openActionParams) { try { if (!window.actionWin || window.actionWin.closed) { actionWin = window.open("","actionWindow",openActionParams); if (actionWin.opener==null) { actionWin.opener = self } } actionWin.focus(); if (openActionUrl) { try { actionWin.location.href = openActionUrl; } catch (e) { alert ("Error occured while relocating HTML window 'actionWindow'"); return false; } } } catch (e) { alert ("Error occured while opening HTML window 'actionWindow'"); return false; } return true; } function openAffiliatelink (openAffiliatelinkHandle,openAffiliatelinkDontFocus) { try { if (!window.affiliatelinkWin || window.affiliatelinkWin.closed) { affiliatelinkWin = window.open("","affiliatelinkWindow"); if (affiliatelinkWin.opener==null) { affiliatelinkWin.opener = self } } openAffiliatelinkUrl = "/?A=affiliate_link&affiliatelink=" + openAffiliatelinkHandle; affiliatelinkWin.location.href = openAffiliatelinkUrl; if (openAffiliatelinkDontFocus) { return true } affiliatelinkWin.focus(); } catch (e) { alert ("Error occured while opening HTML window 'affiliatelinkWindow'"); return false; } return true; } function openAlert (openAlertMessage,openAlertDontClear) { try { if (openAlertDontClear==null) { openAlertMessageClear = true; } else { openAlertMessageClear = false; } openAlertMessageBuffer = openAlertMessage; if (!window.alertWin || window.alertWin.closed) { openAlertWriteTarget = null; alertWin = window.open("https://www.makeviolins.com/?A=alert","alertWindow","width=350,height=250,toolbar=0,directories=0,status=0,scrollbars=1,resizable=0,menubar=0,location=0"); openAlertDefeat (openAlertMessage); if (alertWin.opener==null) { alertWin.opener = self } } else { alertWin.alertWrite(); } alertWin.focus(); } catch (e) { alert ("Error occured while opening HTML window 'alertWindow'"); return false; } return true; } openAlertMessageClear = true; openAlertMessageBuffer = ""; function openAlertDefeat (openAlertDefeatCheck) { if (openAlertDefeatCheck==null) { // Alert window calls this function with openAlertDefeatCheck=null debugAlert ("Clearing openAlertDefeatTimeout"); clearTimeout (openAlertDefeatTimeout); openAlertDefeatTimeout = false; openAlertDefeatStrike = 0; // alert ("Alert window has responded"); return true; } if (openAlertDefeatStrike>openAlertDefeatStrikeOut) { // alert ("openAlert() was defeated"); alert (openAlertMessageBuffer); return true; } openAlertDefeatStrike++; // alert ("Alert NOT responded - strike "+openAlertDefeatStrike); debugAlert ("openAlertDefeat(1)"); openAlertDefeatTimeout = setTimeout ("openAlertDefeat(1)",openAlertDefeatTryTime); } openAlertDefeatTryTime = 100; // ms openAlertDefeatStrikeOut = 40; // num of tries openAlertDefeatStrike = 0; // current tries openAlertDefeatTimeout = false; function openConference (openConferenceX,openConferenceY) { if (!openConferenceX) { openConferenceX = 980; } if (!openConferenceY) { openConferenceY = 570; } if (!window.conferenceWin || window.conferenceWin.closed) { conferenceWin = window.open("","conferenceWindow","width="+openConferenceX+",height="+openConferenceY+",toolbar=0,directories=0,status=0,scrollbars=1,resizable=1,menubar=0,location=0,screenX=10,screenY=10,left=10,top=10"); if (conferenceWin.opener==null) { conferenceWin.opener = self } return true; } conferenceWin.focus(); try { tmp = conferenceWin.conferenceUpdateUrl; } catch (e) { return true; } if (!tmp) { return true; } return false; } function openColorPicker ( ) { if (!window.colorPickerTarget) { alert ("Target form element for the colour picker was not selected"); return false; } if (!window.colorPickerWin || window.colorPickerWin.closed) { try { colorPickerWin = window.open("./?A=colorpicker&color="+escape(colorPickerTarget.value),"colorPickerWindow","width=460,height=460,scrollbars=1,resizable=1,screenX=10,screenY=10,left=10,top=10"); if (colorPickerWin.opener==null) { colorPickerWin.opener = self } } catch (e) { alert ("Error occured while opening HTML window 'colorPickerWindow'"); return false; } } colorPickerWin.focus(); return true; } function openConferenceFile ( ) { try { if (!window.conferenceFileWin || window.conferenceFileWin.closed) { conferenceFileWin = window.open("","conferenceFileWindow","toolbar=0,directories=0,status=0,scrollbars=1,resizable=1,menubar=1,location=0,width=400,height=250,screenX=10,screenY=10,left=10,top=10"); if (conferenceFileWin.opener==null) { conferenceFileWin.opener = self } } conferenceFileWin.focus(); } catch (e) { alert ("Error occured while opening HTML window 'conferenceFileWindow'"); return false; } return true; } function openImage (openImageUrl,openImageWidth,openImageHeight,openImageTitle) { openImageWinWidth = openImageWidth + 30; openImageWinHeight = openImageHeight + 30; openImageUrlBuffer = openImageUrl; openImageWidthBuffer = openImageWidth; openImageHeightBuffer = openImageHeight; try { if (openImageTitle!=null) { openImageTitleBuffer = openImageTitle; } if (window.imageWin && !window.imageWin.closed) { imageWin.resizeTo (openImageWinWidth+12,openImageWinHeight+30); imageWin.imageWrite(); } else { openImageWriteTarget = null; imageWin = window.open ("https://www.makeviolins.com/?A=image","imageWindow","width="+openImageWinWidth+",height="+openImageWinHeight+",toolbar=0,directories=0,status=0,scrollbars=0,resizable=1,menubar=0,location=0,screenX=10,screenY=10,left=10,top=10"); if (imageWin.opener==null) { imageWin.opener = self } } imageWin.focus(); } catch (e) { alert ("Error occured while opening HTML window 'imageWindow'"); return false; } return true; } openImageUrlBuffer = ""; openImageWidthBuffer = 0; openImageHeightBuffer = 0; openImageTitleBuffer = "Untitled"; function openLogon ( ) { try { if (!window.logonWin || window.logonWin.closed) { logonWin = window.open("","logonWindow","toolbar=0,directories=0,status=0,scrollbars=1,resizable=1,menubar=1,location=0,width=400,height=250,screenX=10,screenY=10,left=10,top=10"); if (logonWin.opener==null) { logonWin.opener = self } } logonWin.focus(); } catch (e) { alert ("Error occured while opening HTML window 'logonWindow'"); return false; } return true; } function openMain (openMainUrl) { try { if (window.opener && !window.opener.closed) { try { if (openMainUrl) { window.opener.location.href = openMainUrl; } window.opener.focus(); return true; } catch (e) { // Permission denied so use a new window } } if (openMainUrl=="") { openMainUrl = "./?A=welcome"; } mainWin = window.open(openMainUrl,"mainWindow","location=1,toolbar=1,menubar=1,scrollbars=1,resizable=1,status=1,width=800,height=600,screenX=0,screenY=0,left=0,top=0"); } catch (e) { alert ("Error occured while opening HTML window 'mainWindow'"); return false; } return true; } function openPayment (openPaymentW,openPaymentH,openPaymentQuiet) { try { if (!window.paymentWin || window.paymentWin.closed) { paymentWin = window.open("","paymentWindow","toolbar=0,directories=0,status=0,scrollbars=1,resizable=1,menubar=1,location=0,screenX=10,screenY=10,left=10,top=10,width="+openPaymentW+",height="+openPaymentH); if (paymentWin.opener==null) { paymentWin.opener = self } } paymentWin.focus(); } catch (e) { if (!openPaymentQuiet) { alert ("Error occured while opening HTML window 'paymentWindow'"); } return false; } return true; } function openPicture (openPictureW,openPictureH) { openPictureW = (1*openPictureW) + 50; openPictureH = (1*openPictureH) + 50; try { if (!window.pictureWin || window.pictureWin.closed) { pictureWin = window.open("","pictureWindow","toolbar=0,directories=0,status=0,scrollbars=0,resizable=1,menubar=0,location=0,screenX=10,screenY=10,left=10,top=10,width="+openPictureW+",height="+openPictureH); if (pictureWin.opener==null) { pictureWin.opener = self } } else { try { pictureWin.resizeTo (openPictureW,openPictureH) } catch (e) { } } pictureWin.focus(); } catch (e) { // alert ("Error occured while opening HTML window 'pictureWindow'"); return false; } return true; } function openPrint ( ) { try { if (!window.printWin || window.printWin.closed) { printWin = window.open("","printWindow","toolbar=0,directories=0,status=0,scrollbars=1,resizable=1,menubar=1,location=0,screenX=10,screenY=10,left=10,top=10,width=700,height=600"); if (printWin.opener==null) { printWin.opener = self } } printWin.focus(); } catch (e) { alert ("Error occured while opening HTML window 'printWindow'"); return false; } return true; } // POST REQUEST COOKIE function postRequest (postRequestDomain,postRequestPath,postRequestAlert) { tmp = document.cookie.split("preq="); if (tmp[1]) { tmp = tmp[1].split(";"); postRequestCookie = 1 * tmp[0]; } else { postRequestCookie = 0; } if (postRequestCookie) { // Post request cookie will be unset by the server if (postRequestAlert) { alert ("Form is currently being posted and returned\nIf this message persists, close down all browser windows and try again"); } return 0; } postRequestCookie = "preq=1;"; postRequestCookie += "path=" + postRequestPath + ";"; if (postRequestDomain.length>0) { postRequestCookie += "domain=" + postRequestDomain + ";"; } document.cookie = postRequestCookie; try { window.top.document.getElementById("iceIconImg").src = iceIconImgSrc; } catch (e) { } return 1; } iceIconImgSrc = "https://www.makeviolins.com/?A=media&file=%252Fimage%252Ficon_header_posting.gif"; function postRequestImgChange (postRequestImgChangeSrc) { try { window.top.document.getElementById("iceIconImg").src = postRequestImgChangeSrc; } catch (e) { } } postRequestImgChangeSrc = "https://www.makeviolins.com/?A=media&file=%252Fimage%252Ficon_header.gif"; // PRINT READABLE function printReadable (printReadableVar,printReadableVarRtn,printReadableFilter) { printReadableOut = ""; try { printReadableFilterLen = printReadableFilter.length; for (printReadableProperty in printReadableVar) { tmp = false; if (printReadableFilterLen) { tmp2 = printReadableProperty.substr (0,printReadableFilterLen); if (tmp2==printReadableFilter) { tmp = true; } } else { tmp = true; } if (tmp) { printReadableOut += printReadableProperty+"\n"; } } } catch (e) { try { printReadableOut += printReadableVar.value+"\n"; } catch (e) { printReadableOut += printReadableVar; } } if (printReadableVarRtn) { return printReadableOut; } alert (printReadableOut); } // MORE DATE AND TIME function reportTimeLoc (reportTimeLocRepeat) { // Report client local time via session cookie "tloc" reportTimeLocNow = new Date(); reportTimeLocString = reportTimeLocNow.getYear(); reportTimeLocString += ":"; temp = reportTimeLocNow.getMonth() + 1; reportTimeLocString += temp; reportTimeLocString += ":"; reportTimeLocString += reportTimeLocNow.getDate(); reportTimeLocString += ":"; reportTimeLocString += reportTimeLocNow.getHours(); reportTimeLocString += ":"; reportTimeLocString += reportTimeLocNow.getMinutes(); reportTimeLocCookie = "tloc="+reportTimeLocString+";" reportTimeLocCookie += "path=/;domain=www.makeviolins.com;" document.cookie = reportTimeLocCookie; if (reportTimeLocRepeat!=null) { if (reportTimeLocRepeat<1) { reportTimeLocRepeat = 1; } debugAlert ("reportTimeLoc("+reportTimeLocRepeat+")"); setTimeout ("reportTimeLoc("+reportTimeLocRepeat+")",1000*reportTimeLocRepeat); } } reportTimeLoc (60); // CLIENT SNIFFING function sniffBrowser ( ) { if (sniffPfm=="lnx") { return } if (sniffApn!="n/k") { return } sniffThisApp = navigator.appName.toLowerCase(); if (sniffThisApp.indexOf('netscape')!=-1) { sniffApn = "nsc"; if (sniffApv>=5) { sniffThisAgent = navigator.userAgent.toLowerCase(); sniffPointer = sniffThisAgent.indexOf('netscape6/'); sniffVerAsString = sniffThisAgent.substr(sniffPointer+10,3); sniffApv = parseFloat(sniffVerAsString); } } else { sniffApv = 0; } sniffResult = "binf="+sniffPfm+","+sniffApn+","+sniffApv+";"; document.cookie = sniffResult+"path=/;domain=www.makeviolins.com;"; } sniffPfm = ""; sniffApn = ""; sniffApv = ""; sniffBrowser(); // FORM MANAGEMENT function stringTrim (stringTrimStr) { while (stringTrimStr.substring(0,1)==" ") { stringTrimStr = stringTrimStr.substring(1,stringTrimStr.length); } while (stringTrimStr.substring(stringTrimStr.length-1,stringTrimStr.length)==" ") { stringTrimStr = stringTrimStr.substring(0,stringTrimStr.length-1); } return stringTrimStr; } function textareaRestrict (textareaRestrictFld,textareaRestrictCnt,textareaRestrictMax) { if (textareaRestrictFld.value.length>textareaRestrictMax) { textareaRestrictFld.value = textareaRestrictFld.value.substring (0,textareaRestrictMax); } textareaRestrictCnt.value = textareaRestrictMax - textareaRestrictFld.value.length; } // WINDOW SCROLLING function windowScrollBy (windowScrollDx,windowScrollDy) { windowScrollx0 = 1 * window.pageXOffset; if (windowScrollx0) { windowScrolly0 = 1 * window.pageYOffset; } else { windowScrollx0 = 1 * document.body.scrollLeft; windowScrolly0 = 1 * document.body.scrollTop; } windowScrollx1 = windowScrollx0 + (1*windowScrollDx); windowScrolly1 = windowScrolly0 + (1*windowScrollDy); try { window.scrollTo (windowScrollx1,windowScrolly1); } catch (e) { } }