﻿//<script language="javascript">
//Reset the visibility of the complex search page
function toggleDisplay(args){
    var obj = convertToObj(arguments[0]);
    if (obj.selectedIndex>0){
        for (var i=1; i<args.length; i++){
            if (arguments[i]!=null){
                enable(arguments[i]);
                show(arguments[i]);
             }
        }
    }
    else{
        for (var i=1; i<args.length; i++){
            if (arguments[i]!=null){
                disable(arguments[i]);
                hide(arguments[i]);
            }
        }
    }
}

function toggleSelect(args){
    var obj = convertToObj(arguments[0]);
    if (obj.selectedIndex!=-1){
        for (var i=1; i<args.length; i++){
            if (arguments[i]!=null){
                enable(arguments[i]);
                show(arguments[i]);
             }
        }
    }
    else{
        for (var i=1; i<args.length; i++){
            if (arguments[i]!=null){
                enable(arguments[i]);
                hide(arguments[i]);
            }
        }
    }
}

//disable object
function disable(id) {
      var obj = convertToObj(id);
      obj.disabled = true;
}
  
//enable object 
function enable(id) {
      var obj = convertToObj(id);
      obj.disabled = false;
}

//reset all objects
function initForm() {
   try {
      d.forms[0].reset();
   } catch (e) {}
}

//change background color
function background(id, color){
    var obj = convertToObj(id);
    obj.style.background=color;
}

//uncheck the object
function clearChecked(id) {
      var obj = convertToObj(id);
      obj.checked = false;
}

//clear selection
function clearSelection(id) {
      var obj = convertToObj(id);
      obj.selectedIndex = -1;
      for (var i = 0; i < el.options.length; i++) {
         obj.options[i].selected = false;
      }
}

//clear input text
function clearText(id) {
      var obj = convertToObj(id);
      obj.text == null ? obj.value = "" : obj.text = "";
}

function loadPricePage(img,imgN) {
	totalImg = imgN;
	imgName = img;
	browver= parseInt(navigator.appVersion);
	browtype = navigator.appName;
	browsertype = "old";
	if (browtype == "Netscape" && !(browver < 3)) {
		browsertype = "new"; 
	}
	if (browtype == "Microsoft Internet Explorer" && !(browver < 4)) {
		browsertype = "new";
	}
	if (browsertype == "new") {
		thetimer = setTimeout("changePriceImage()", 2500);
		curImgNum = 0;
		scrollingImgs = new Array(totalImg);
		for (i=0; i<totalImg; i++){
			scrollingImgs[i] = new Image();
			scrollingImgs[i].src = "images/"+imgName +i+".gif";
		}
	}
}


function changePriceImage(){
	if (browsertype == "new") {
		curImgNum = curImgNum + 1
		if (curImgNum == totalImg) {
			curImgNum = 0
		}
		imagesource = "images/"+imgName+curImgNum + ".gif";
		window.document.bannerad.src = imagesource;
		thetimer = setTimeout("changePriceImage()", 2500);
	}
}	
//</script>

