You are here

Javascript

Subscribe to Syndicate
The Web Pages that are used by the Web Sales Module contain javascript that performs different functions. There are 3 javascripts that are used and each one is called into the page by the tags. All 3 javascript functions reside in their own page within the tmScripts folder. Below is a description of all three javascripts.

Location:

/WebPagesEN/tmScripts

buttonRollover.html

Description:

<SCRIPT LANGUAGE="JavaScript">
<!--
function pviiClassNew(obj, new_style) {
obj.className = new_style;
}
//-->
</SCRIPT>

Since the buttons that are contained within the tmnavButtons.html page are form inputs, they require Cascading Style Sheets in order to customize their colours and styles. This script allows the buttons to roll from one style to another.

The variables onMouseOver="pviiClassNew(this,'buttonover')" onMouseOut="pviiClassNew(this,'button')" are included in each tag for each button.

dropDownMenuFuctions.html

Description:

<script language="Javascript">
<!--
function submitForm(form, action){
//Change the name of the hidden input, hiddenSubmit, to be the name of the action we need to perform
document.getElementById(form).hiddenSubmit.name = action;
document.getElementById(form).submit();
}
//-->
</script>

This function is used to submit a form when a <!select /> list is used. The page must include this function as well as a hidden parameter within the form, TMForm. <!input type=hidden name=hiddenSubmit value="">

navSideRollover.html

Description:

<SCRIPT language="JavaScript">
<!--
function NavRollOver(oTd) {if (!oTd.contains(event.fromElement)) {oTd.bgColor="";}}
function NavRollOut(oTd) {if (!oTd.contains(event.toElement)) {oTd.bgColor="";}}
//-->
</SCRIPT>

This script allows the cells within the navSide table to roll from one colour to another, creating dynamic buttons out of table data. The variables onmouseover="NavRollOver(this)" onmouseout="NavRollOut(this)" are contained within the

tag for each cell you wish to rollover.

pleaseWaitMessageFuction.html

Description:

<script language="JavaScript">
<!--
function process() {
var processingMessage = 'Processing...please wait...this takes a few moments';
var messageHeight = '25px';

if (navigator.appName=="Microsoft Internet Explorer") {
pleaseWait.innerHTML = processingMessage;
document.all.pleaseWait.style.height = messageHeight;
document.all.pleaseWait.style.visibility = 'visible';
}

if (navigator.appName=="Netscape") {
document.getElementById("pleaseWait").innerHTML = processingMessage;
document.getElementById("pleaseWait").style.height = messageHeight;
document.getElementById("pleaseWait").style.visibility = 'visible';
}

if (navigator.appName=="Safari") {
document.getElementById("pleaseWait").innerHTML = processingMessage;
document.getElementById("pleaseWait").style.height = messageHeight;
document.getElementById("pleaseWait").style.visibility = 'visible';
}
}
//-->
</script>

showhidediv.html

Description:

<script language="javascript">
<!--
function divdisplay(layer_ref,state) {

if (document.all) { //IS IE 4 or 5 (or 6 beta)
eval( "document.all." + layer_ref + ".style.display = " + state);
}
if (document.layers) { //IS NETSCAPE 4 or below
document.layers[layer_ref].display = state;
}
if (document.getElementById &&!document.all) {
hza = document.getElementById(layer_ref);
hza.style.display = state;
}
}
//-->
</script>

This will show or hide a div statement by name on the screen state= 'none' if you want to see it on the screen state= 'block' if you want it to be disabled from the user.

<script language="javascript">
<!--
function divvisibility(layer_ref,state) {

if (document.all) { //IS IE 4 or 5 (or 6 beta)
eval( "document.all." + layer_ref + ".style.visibility = " + state);
}
if (document.layers) { //IS NETSCAPE 4 or below
document.layers[layer_ref].visibility = state;
}
if (document.getElementById &&!document.all) {
hza = document.getElementById(layer_ref);
hza.style.visibility = state;
}
}
</script>

this will change the visibility of a div by name on the screen state= 'visible' if you want to see it on the screen state= 'hidden' if you want it to be hidden off the screen from the user