//--------JAVASCRIPT.js--------START--------*/
// DEFINE VARIABLES

// whitespace characters
var whitespace = " \t\n\r";


//Check whether string s is empty.
function isEmpty(s){
  return ((s == null) || (s.length == 0));
}


// Returns true if string s is empty or
// whitespace characters only.
function isWhitespace (s){
	 var i;

    // Is s empty?
    if (isEmpty(s))
    	 return true;

    // Search through string's characters one by one
    // until we find a non-whitespace character.
    // When we do, return false; if we don't, return true.

    for (i = 0; i < s.length; i++){
			// Check that current character isn't whitespace.
			var c = s.charAt(i);

			if (whitespace.indexOf(c) == -1)
				return false;
    }

    // All characters are whitespace.
    return true;
}

// whitespace characters only.
function isWhitespace2(s){
	 var i;

    // Is s empty?
    if (isEmpty(s))
    	 return true;

    // Search through string's characters one by one
    // until we find a non-whitespace character.
    // When we do, return false; if we don't, return true.

    for (i = 0; i < s.length; i++){
			// Check that current character isn't whitespace.
			var c = s.charAt(i);
			if (whitespace.indexOf(c) != -1)
				return true;
    }

    // All characters are whitespace.
    return false;
}

// Check whether string field is number.
function isNumber(value){
  myReint=/\D/;
  return myReint.test(value);
}


// Displays an alert box with the passed in string...
function promptErrorMsg(field,showFieldName,strError){
  alert("You have entered an invalid value for " + showFieldName + ".\n" + strError);
  eval(field).focus();
}

function checkForceMoney(form,field,display){
  var formName="document." + form;
  var fieldName="document." + form + "." + field;

  return ForceMoney(eval(fieldName),display);
}


// Returns true if the string passed in is a valid money
//  (no alpha characters except a decimal place),
//   else it displays an error message

function ForceMoney(objField, FieldName){
	var strField = new String(objField.value);

  if(isWhitespace(strField)){
     alert("You need to enter information for (" + FieldName + ") as this is a required field.");
     objField.focus();
     return false;
  }

	var i = 0;

	for (i = 0; i < strField.length; i++)
		if ((strField.charAt(i) < '0' || strField.charAt(i) > '9') && (strField.charAt(i) != '.') && (strField.charAt(i) != '-')) {
			alert(FieldName + " must be a valid numeric entry.  Please do not use commas or dollar signs or any non-numeric symbols.");
			objField.focus();
			return false;
		}

	return true;
}


// Checks to see if a required field is blank.  If it is, a warning
// message is displayed...
function checkForceEntry(form,field,display){
  var formName="document." + form;
  var fieldName="document." + form + "." + field;

  if(eval(fieldName))
  	return ForceEntry(eval(fieldName),display);
  return true;
}


// Checks to see if a required field is blank.  If it is, a warning
// message is displayed...
function ForceEntry(objField, FieldName){
  var strField = objField.value;

  if(isWhitespace(strField)){
     alert("You need to enter information for (" + FieldName + ") as this is a required field.");
     objField.focus();
     return false;
  }
  return true;
}


//For use with any telephone numbers
function SYMBOL_CHECK(TheObjValue){
  var lengthof = TheObjValue.length;

  if (TheObjValue.match(/[\\*'`~!#%^_&\)\(\{\}\]\[\";:?<>,+=]/)) {
	return true;
  }

  if (TheObjValue.match(/[a-z]/)) {
	return true;
  }

  if (TheObjValue.match(/[A-Z]/)) {
	return true;
  }

  return false;
}



function checkForceNumber(form,field,display){
  var formName="document." + form;
  var fieldName="document." + form + "." + field;
  var value=eval(fieldName).value;

  if(!ForceNumber(value,display)){
      eval(fieldName).focus();
      return false;
  }
  return true;

}


function ForceNumber(value, FieldName){

  if(isNumber(value)){
     alert("You need to enter only Numbers for (" + FieldName + ").");
     return false;
  }
  return true;
}


function isValidCCExpiry(month,year){
  var today = new Date();
  var todayMonth = today.getMonth() + 1;<!--starts from 0-->
  var todayYear  = today.getYear() + "";<!--convert to string-->

  <!--should get the last two digits of the returned year as netscape and ie are not returing the same values-->
  var length = todayYear.length;
  var todayYear = todayYear.substring( length, 2);
  var todayYear = eval(todayYear);<!--convert to integer-->

  var monthInteger = month.selectedIndex;
  var monthValue   = month.options[monthInteger].value;

  var yearInteger = year.selectedIndex;
  var yearValue   = year.options[yearInteger].value;

  if ( (yearValue <= todayYear) && (monthValue < todayMonth)  ){
       alert("Your Credit Card has been expired");
	 alert("Please select a valid Expiry Date.");

	 return false;
     }
  else{
     return true;
  }
}


function checkPasswordsSame(form,password1,password2){
  var formName="document." + form;
  var fieldName1="document." + form + "." + password1;
  var fieldName2="document." + form + "." + password2;
  var value1=eval(fieldName1).value;
  var value2=eval(fieldName2).value;

  if(value1 != value2){
  	alert("Your passwords are not the same");
  	eval(fieldName1).focus();
  	return false;
  }

  return true;
}


//validating a image
function validateImage(file_location){

  var regexp = /gif|jpg|jpeg/i;
  var resultArray = (eval(file_location).value).match(regexp);

  if(!resultArray)
  {
  	  promptErrorMsg(file_location,'File Location',
  	  					'Please select only GIF, JPG or JPEG images.');
  	  return false;
   }

  return true;
}


function giveMeTrue(){
  return true;
}

function ForcePhoneNumbers(objField,type,phone_type){
  value=objField.value;
  //required number
  if(type == "RN"){
   	 if(isNumber(value)){
	  		alert("Only characters[0-9] are permitted for the Phone,Fax and Mobile Numbers.\nPlease remove any other characters.");
        objField.focus();
	     	 return false;
     	}

   	 if((phone_type=='phone') || (phone_type=='fax')){
   	 		if(value.length<10){
	  			alert("Phone and Fax Numbers should be 10 characters.");
        	objField.focus();
	     	 return false;
	     	}
     }
  }

  //optional number
  if ( (type == "ON") && (value != '') ){
   	 if(isNumber(value)){
	  		alert("Only characters[0-9] are permitted for the Phone,Fax and Mobile Numbers.\nPlease remove any other characters.");
        objField.focus();
	     	 return false;
     	}

   	 if((phone_type=='phone') || (phone_type=='fax')){
   	 		if(value.length<10){
	  			alert("Phone and Fax Numbers should be 10 characters.");
        	objField.focus();
	     	 return false;
	     	}
     }
  }

  return true;
}


function checkForcePhoneNumbers(form,field,type,phone_type){
  var formName="document." + form;
  var fieldName="document." + form + "." + field;

  if(eval(fieldName)){
  	if(!ForcePhoneNumbers(eval(fieldName),type,phone_type)){
  		  eval(fieldName).focus();
  	  	return false;
  	}
  }
  return true;
}

function ForceEmail(field, FieldName){
  if(!isValidEmail(field.value)){
     alert("You need to enter valid Email Address for ( " + FieldName + ").");
     field.focus();
     return false;
  }

  return true;
}

function isValidEmail(s){
    // is s whitespace?
    if(s == '')
       return false;

    // there must be >= 1 character before @, so we
    // start looking at character position 1
    // (i.e. second character)
    var i = 1;
    var sLength = s.length;

    // look for @
    while ((i < sLength) && (s.charAt(i) != "@"))
    { i++
    }

    if ((i >= sLength) || (s.charAt(i) != "@")) return false;
    else i += 2;

    // look for .
    while ((i < sLength) && (s.charAt(i) != "."))
    { i++
    }

    // there must be at least one character after the .
    if ((i >= sLength - 1) || (s.charAt(i) != ".")) return false;
    else return true;
}

function getImageCode(srcPath){
  // get image code from path
  locationString = srcPath;
  locIndex=locationString.lastIndexOf("\\");
  locIndex++;
  locIndex1=locationString.lastIndexOf(".");
  var ei_code = locationString.substring(locIndex,locIndex1);
  return ei_code;
}
//--------JAVASCRIPT.js--------FINISH--------*/


//--------JAVASCRIPT.js--------START--------*/
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_nbGroup(event, grpName) { //v6.0
  var i,img,nbArr,args=MM_nbGroup.arguments;
  if (event == "init" && args.length > 2) {
    if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
      img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
      if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
      nbArr[nbArr.length] = img;
      for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
        if (!img.MM_up) img.MM_up = img.src;
        img.src = img.MM_dn = args[i+1];
        nbArr[nbArr.length] = img;
    } }
  } else if (event == "over") {
    document.MM_nbOver = nbArr = new Array();
    for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])? args[i+1] : img.MM_up);
      nbArr[nbArr.length] = img;
    }
  } else if (event == "out" ) {
    for (i=0; i < document.MM_nbOver.length; i++) {
      img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
  } else if (event == "down") {
    nbArr = document[grpName];
    if (nbArr)
      for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
    document[grpName] = nbArr = new Array();
    for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
      nbArr[nbArr.length] = img;
  } }
}
//--------JAVASCRIPT.js--------FINISH--------*/

//--------JAVASCRIPT.js--------START--------*/
function printWindow(obj){
  obj.print();
}

function processTrolleyItem(form){
  form.submit();
}
//--------JAVASCRIPT.js--------FINISH--------*/

/*---- gen_overview.js ------- START ------- */

//get the labels for this page

//checks or unchecks all the checkboxes
function checkAll(selectAllCheckbox,fieldName,counter){
  var isSelectAllChecked = selectAllCheckbox.checked;

  for ( var i=1; i<=counter; i++ ){
    eval(fieldName +'_'+ i).checked = isSelectAllChecked;
    eval(fieldName +'_'+ i).fireEvent('onClick');
  }
}


//selects a checkbox
function selectCheckBox(field){
  field.checked = true;
  if(field.fireEvent)
     field.fireEvent('onClick');
}


// when the checkbox is unchecked, this will uncheck the 'select all' checkbox
function setCheckAll(selectAllCheckbox,cb){
  if ( !cb ){
    selectAllCheckbox.checked = false;
  }
}


//if the users clicks update or delete, this checks whether any checkbox is checked.
//if none are checked, alertbox will be shown.
function isAnyChecked(fieldName,counter){
  for ( var i=1; i<=counter; i++ ){
    if ( eval(fieldName +'_'+ i).checked ){
      return true;
    }
  }

  alert('You need to check at least one record.');
  return false;
}


function makeArray() {
  for ( var i=0; i<makeArray.arguments.length; i++ )
    this[i+1] = makeArray.arguments[i];
}


function printDateTime(datetime) {
  var months = new makeArray('January','February','March','April',
                             'May','June','July','August',
                             'September','October','November','December');

  var datetimeobj = datetime.split(' ');
  var date = datetimeobj[0];
  var time = datetimeobj[1];

  var dateobj = date .split('-');
  var day  = Number(dateobj[2]);
  var month = Number(dateobj[1]);
  var yy = dateobj[0];
  var year = (yy < 1000) ? yy + 1900 : yy;

  document.write(day + ' ' + months[month] + ' ' + year + ' ' + time);
}


function printDate(date) {
  var months = new makeArray('January','February','March','April',
                             'May','June','July','August',
                             'September','October','November','December');

  var dateobj = date.split('/');
  var day  = Number(dateobj[1]);
  var month = Number(dateobj[0]);
  var yy = dateobj[2];
  var year = (yy < 1000) ? yy + 1900 : yy;

  document.write(day + ' ' + months[month] + ' ' + year);
}


function highLight(CB,value){
  if ( CB.checked )
    hL(CB);
  else
    dL(CB,value);
}


//highlight the table row
function hL(E){
  while ( E.tagName != 'TR' ){
    E = E.parentElement;
  }

  E.className = 'H';
}


//make the table row normal
function dL(E,value){
  while ( E.tagName != 'TR' ){
    E = E.parentElement;
  }

 	E.className = value;
}


//highlight next row in overviews
function highLightNextRow(CB,obj,start,end,prevRowClass){
  var rowClass = '';

  if ( CB.checked )
    rowClass = 'H';
  else
    rowClass = prevRowClass;

  for ( var i=start; i<start+end; i++ ){
    var objString = obj + i;

    if ( document.getElementById(objString) ){
      eval(objString).className = rowClass;
    }
  }
}


function ignoreValues(aValue,bValue,ignoreObj){
  var flag1 = 0;
  var flag2 = 0;

  for ( var i=0; i<ignoreObj.length; i++ ){
    if ( (aValue) == ignoreObj[i] )
      flag1 = 1;

    if ( (bValue) == ignoreObj[i] )
      flag2 = 1;
  }

  if ( flag1 == 1 || flag2 == 1 )
    return true;

  return false;
}


function sortSelectList(obj,ignoreObj,ignoreColorObj){
  //alert(obj.options[0].text);
  var o = new Array();

  for ( var i=0; i<obj.options.length; i++ ){
    o[o.length] = new Option(obj.options[i].text,
                             obj.options[i].value,
                             obj.options[i].defaultSelected,
                             obj.options[i].selected);
    o[i].style.color = obj.options[i].style.color;
  }

  o = o.sort(
              function(a,b) {
                if ( ignoreValues(a.value, b.value, ignoreObj) ){
                  return 0;
                }

                if ( (a.text+"") < (b.text+"")) {
                  return -1;
                }

                if ( (a.text+"") > (b.text+"") ){
                  return 1;
                }

                if ( (a.text+"") == (b.text+"") ){
                  return 0;
                }
              }
            );

  for ( var i=0; i<o.length; i++ ){
    obj.options[i] = new Option(o[i].text,
                                o[i].value,
                                o[i].defaultSelected,
                                o[i].selected);
    obj.options[i].style.color = o[i].style.color;

    for ( var j=0; j<ignoreObj.length; j++ ){
      if ( obj.options[i].value == ignoreObj[j] )
        obj.options[i].style.color = ignoreColorObj[j];
    }
  }

  //alert("sorted");
}

function getCodeFromPath(srcPath){
  // get code from path
  locationString = srcPath;
  locIndex = locationString.lastIndexOf("\\");
  locIndex++;

  locIndex1 = locationString.lastIndexOf(".");
  var code 	= locationString.substring(locIndex,locIndex1);

  return code;
}



/*---- gen_overview.js ------- FINISH ------ */

// Title: tigra menu
// Description: See the demo at url
// URL: http://www.softcomplex.com/products/tigra_menu/
// Version: 1.0
// Date: 01-09-2002 (mm-dd-yyyy)
// Author: Denis Gritcyuk <denis@softcomplex.com>
// Notes: Registration needed to use this script on your web site.
// 	Registration for this version (1.0) is free of charge.
//	See official site for details
// Got questions - visit forum http://www.softcomplex.com/products/tigra_menu/forum/

var menus = [];

// --- menu class ---
function menu (item_struct, pos, styles) {
	// browser check
	this.item_struct = item_struct;
	this.pos = pos;
	this.styles = styles;
	this.id = menus.length;
	this.items = [];
	this.children = [];

	this.add_item = menu_add_item;
	this.hide = menu_hide;

	this.onclick = menu_onclick;
	this.onmouseout = menu_onmouseout;
	this.onmouseover = menu_onmouseover;
	this.onmousedown = menu_onmousedown;

	var i;
	for (i = 0; i < this.item_struct.length; i++)
		new menu_item(i, this, this);
	for (i = 0; i < this.children.length; i++)
		this.children[i].visibility(true);
	menus[this.id] = this;
}
function menu_add_item (item) {
	var id = this.items.length;
	this.items[id] = item;
	return (id);
}
function menu_hide () {
	for (var i = 0; i < this.items.length; i++) {
		this.items[i].visibility(false);
		this.items[i].switch_style('onmouseout');
	}
}
function menu_onclick (id) {
	var item = this.items[id];
	return (item.fields[1] ? true : false);
}
function menu_onmouseout (id) {
	this.hide_timer = setTimeout('menus['+ this.id +'].hide();',
		this.pos['hide_delay'][this.active_item.depth]);
	if (this.active_item.id == id)
		this.active_item = null;
}
function menu_onmouseover (id) {
	this.active_item = this.items[id];
	clearTimeout(this.hide_timer);
	var curr_item, visib;
	for (var i = 0; i < this.items.length; i++) {
		curr_item = this.items[i];
		visib = (curr_item.arrpath.slice(0, curr_item.depth).join('_') ==
			this.active_item.arrpath.slice(0, curr_item.depth).join('_'));
		if (visib)
			curr_item.switch_style (
				curr_item == this.active_item ? 'onmouseover' : 'onmouseout');
		curr_item.visibility(visib);
	}
}
function menu_onmousedown (id) {
	this.items[id].switch_style('onmousedown');
}
// --- menu item Class ---
function menu_item (path, parent, container) {
	this.path = new String (path);
	this.parent = parent;
	this.container = container;
	this.arrpath = this.path.split('_');
	this.depth = this.arrpath.length - 1;
	// get pointer to item's data in the structure
	var struct_path = '', i;
	for (i = 0; i <= this.depth; i++)
		struct_path += '[' + (Number(this.arrpath[i]) + (i ? 2 : 0)) + ']';
	eval('this.fields = this.container.item_struct' + struct_path);
	if (!this.fields) return;

	// assign methods
	this.get_x = mitem_get_x;
	this.get_y = mitem_get_y;
	// these methods may be different for different browsers (i.e. non DOM compatible)
	this.init = mitem_init;
	this.visibility = mitem_visibility;
	this.switch_style = mitem_switch_style;

	// register in the collections
	this.id = this.container.add_item(this);
	parent.children[parent.children.length] = this;

	// init recursively
	this.init();
	this.children = [];
	var child_count = this.fields.length - 2;
	for (i = 0; i < child_count; i++)
		new menu_item (this.path + '_' + i, this, this.container);
	this.switch_style('onmouseout');
}
function mitem_init() {
	document.write (
		'<a id="mi_' + this.container.id + '_'
			+ this.id +'" class="m' + this.container.id + 'l' + this.depth
			+'o" href="' + this.fields[1] + '" style="position: absolute; top: '
			+ this.get_y() + 'px; left: '	+ this.get_x() + 'px; width: '
			+ this.container.pos['width'][this.depth] + 'px; height: '
			+ this.container.pos['height'][this.depth] + 'px; visibility: hidden;'
			+' background: black; color: white; z-index: ' + this.depth + ';" '
			+ 'onclick="return menus[' + this.container.id + '].onclick('
			+ this.id + ');" onmouseout="menus[' + this.container.id + '].onmouseout('
			+ this.id + ');" onmouseover="menus[' + this.container.id + '].onmouseover('
			+ this.id + ');" onmousedown="menus[' + this.container.id + '].onmousedown('
			+ this.id + ');"><div class="m'  + this.container.id + 'l' + this.depth + 'i">'
			+ this.fields[0] + "</div></a>\n"
		);
	this.element = document.getElementById('mi_' + this.container.id + '_' + this.id);
}
function mitem_visibility(make_visible) {
	if (make_visible != null) {
		if (this.visible == make_visible) return;
		this.visible = make_visible;
		if (make_visible)
			this.element.style.visibility = 'visible';
		else if (this.depth)
			this.element.style.visibility = 'hidden';
	}
	return (this.visible);
}
function mitem_get_x() {
	var value = 0;
	for (var i = 0; i <= this.depth; i++)
		value += this.container.pos['block_left'][i]
		+ this.arrpath[i] * this.container.pos['left'][i];
	return (value);
}
function mitem_get_y() {
	var value = 0;
	for (var i = 0; i <= this.depth; i++)
		value += this.container.pos['block_top'][i]
		+ this.arrpath[i] * this.container.pos['top'][i];
	return (value);
}
function mitem_switch_style(state) {
	if (this.state == state) return;
	this.state = state;
	var style = this.container.styles[state];
	for (var i = 0; i < style.length; i += 2)
		if (style[i] && style[i+1])
			eval('this.element.style.' + style[i] + "='"
			+ style[i+1][this.depth] + "';");
}
// that's all folks

//donot change this part
	//set menu abs top here
	var menuTop 	= 	308;
	var menuLeft 	= 	20;

	function reposGroupMenu(){
	  //alert(document.getElementById("categoryImageID").offsetTop);
	  //prompt('Test',document.body.innerHTML);

	  var newTop 	= menuTop - document.getElementById("categoryImageID").offsetTop;
	  var newLeft 	= menuLeft - document.getElementById("categoryImageID").offsetLeft;

	  var allLinks = document.getElementsByTagName("A");
	  //alert(allLinks.length);
	  for (var i=0; i<allLinks.length; i++){
	    //alert(allLinks[i].id.substring(0,3));
	    if ( allLinks[i].id.substring(0,3) == 'mi_' ){
	        var thisLinkTop = eval('document.getElementById("'+allLinks[i].id+'")').style.top;
	        thisLinkTop = thisLinkTop.replace("px","");
	        //alert(thisLinkTop);
	        eval('document.getElementById("'+allLinks[i].id+'")').style.top =  thisLinkTop - newTop;

	        var thisLinkLeft = eval('document.getElementById("'+allLinks[i].id+'")').style.left;
	        thisLinkLeft = thisLinkLeft.replace("px","");
	        //alert(thisLinkLeft);
	        eval('document.getElementById("'+allLinks[i].id+'")').style.left =  thisLinkLeft - newLeft;

	    }
	  }
	  //prompt("",document.getElementById("groupMenuDiv").innerHTML);
	  document.getElementById("groupMenuDiv").style.display="block";
	}
//end

/* --- geometry and timing of the menu --- */
var MENU_POS = new Array();

	// Horizontal menu alignment - (left, center, right) ***
	MENU_POS['align'] = 'center';

	// item sizes for different levels of menu
	MENU_POS['height']     = [22, 22, 22];
	MENU_POS['width']      = [165, 165, 165];

	// menu block offset from the origin:
	//  for root level origin is upper left corner of the page
	//  for other levels origin is upper left corner of parent item
	MENU_POS['block_top']  = [menuTop, 0, 0];
	MENU_POS['block_left'] = [menuLeft, 165, 165];

	// offsets between items of the same level
	MENU_POS['top']        = [23, 20, 20];
	MENU_POS['left']       = [0, 0, 0];

	// time in milliseconds before menu is hidden after cursor has gone out
	// of any items
	MENU_POS['hide_delay'] = [4000, 4000, 4000];

/* --- dynamic menu styles ---
note: you can add as many style properties as you wish but be not all browsers
are able to render them correctly. The only relatively safe properties are
'color' and 'background'.
*/

var MENU_STYLES = new Array();

	// default item state when it is visible but doesn't have mouse over
	MENU_STYLES['onmouseout'] = [
		'background', ['#FFFFFF', '#FFFFFF', '#FFFFFF'],
		'color', ['#000000', '#000000', '#000000'],
	];

	// state when item has mouse over it
	MENU_STYLES['onmouseover'] = [
		'background', ['#FFFFFF', '#FFFFFF', '#FFFFFF'],
		'color', ['#000000', '#000000', '#000000'],
	];

	// state when mouse button has been pressed on the item
	MENU_STYLES['onmousedown'] = [
		'background', ['#FFFFFF', '#FFFFFF', '#FFFFFF'],
		'color', ['#000000', '#000000', '#000000'],
	];



//home page random images
var imgPop = new Array();
function radomImage() {
  var imgNo 	= Math.round((imgCount-1)*Math.random()) + 1;

  //check if this image is already popped
  for (var i=0;i<imgPop.length;i++) {
    if( imgPop[i] == imgNo ){
    	return radomImage();
    }
  }

  //store the popped img
  imgPop[imgPop.length] = imgNo;

  //alert("http://www.diggy.net.au/xsstock/web_static/images/home_random/" + imgNo + ".gif");
  return "http://www.xsstock.com.au/images/home_random/" + imgNo + ".gif";
}
