<!--
function paint(what,color,bgColor){
  what.style.color=color;
  what.style.backgroundColor=bgColor;
}

function openWindow(windowUrl, windowName, windowWidth, windowHeight, resizable){
	newWindow = window.open(windowUrl,windowName, "screenX=10,screenY=10,top=100,left=100,width="+windowWidth+",height="+windowHeight+",scrollbars=yes,resizable="+resizable);
	newWindow.focus();
}


function popWindow(windowUrl,windowName,windowWidth,windowHeight,resizable){
    var winl = (screen.width-windowWidth)/2;
    var wint = (screen.height-windowHeight)/2;
    newWindow = window.open(windowUrl,windowName, "screenX=10,screenY=10,top="+wint+",left="+winl+",width="+windowWidth+",height="+windowHeight+",scrollbars=yes,resizable="+resizable);
	newWindow.focus();
}



function langChanged(query){
	newlang=document.langform.lang.options[document.langform.lang.selectedIndex].value;
	if(newlang != null && newlang.length>0)
         document.location.href = query+"&lang="+newlang;
}  

function set(What,Value) {
//alert(What + '\n' + Value);
    if (document.layers && document.layers[What] != null){
		// document.layers[What].visibility = Value;
    //if (document.layers){
	    if(Value == 'visible')
	        document.layers[What].visibility = 'show';
	    else
	    	document.layers[What].visibility = 'hide';
		
		//document.layers[What].visibility = Value;

    }else if (document.all) 
		eval('document.all.'+What+'.style.visibility ="'+ Value+'"');
	else if (document.getElementById){
		var obj = document.getElementById(What);
		obj.style.visibility=Value;
	}
} 


/*
Highlight Image Script II- 
© Dynamic Drive (www.dynamicdrive.com)
For full source code, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
*/

function borderit(which,color){
//if IE 4+ or NS 6+
if (document.all||document.getElementById){
which.style.borderColor=color
}
}


/***********************************************
* Tab Content script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

//Set tab to intially be selected when page loads:
//[which tab (1=first tab), ID of tab content to display]:
var initialtab=[1, "sc1","link1", "link2"]

////////Stop editting////////////////

function cascadedstyle(el, cssproperty, csspropertyNS){
if (el.currentStyle)
return el.currentStyle[cssproperty]
else if (window.getComputedStyle){
var elstyle=window.getComputedStyle(el, "")
return elstyle.getPropertyValue(csspropertyNS)
}
}

var previoustab=""

function expandcontent(cid, link1, link2){
if (document.getElementById){
if (previoustab!="")
document.getElementById(previoustab).style.display="none"
document.getElementById(cid).style.display="block"
document.getElementById(link1).style.display="none"
document.getElementById(link2).style.display="block"
previoustab=cid
return false
}
else
return true
}


function do_onload(){
expandcontent(initialtab[1], initialtab[2],initialtab[3])
}


      function submitForm(brand){
		 document.productsSearchForm.searchBrand.value=brand;
		 document.productsSearchForm.submit();
      }	   


	  function scale()
	  {
		  var img = this.getElementsByTagName('img')[0];	 

		  img.src = img.smallSrc;

		  if (aPicCheck[0] == "new") {
			  aPicCheck[0] = img;
		  }
		  else if (aPicCheck[0] != img) {
			  aPicCheck[1] = img;
			  aPicCheck[0].setAttribute('width', aPicCheck[0].smallWidth);
			  aPicCheck[0].setAttribute('height', aPicCheck[0].smallHeight);
			  aPicCheck[0].src = aPicCheck[0].smallSrc;
			  window.clearInterval(interval);
			  aPicCheck[0].state = 'small';
		  }

		  if (! img.preloaded)
		  {
			  img.preloaded = new Image();
			  img.preloaded.src = img.largeSrc;
		  }

		  var interval = window.setInterval(scaleStep, 10);
		  return false;

		  function scaleStep()
		  {

			  var step = 10;
			  var width = parseInt(img.getAttribute('width'));
			  var height = parseInt(img.getAttribute('height'));

			  if (img.state == 'small')
			  {
				  width += step;
				  height += Math.floor(step * img.ratio);

				  img.setAttribute('width', width);
				  img.setAttribute('height', height);

				  if (width > img.largeWidth - step)
				  {
					  img.setAttribute('width', img.largeWidth);
					  img.setAttribute('height', img.largeHeight);
					  window.clearInterval(interval);
					  img.state = 'large';
					  aPicCheck[0] = img;
				  }
			  }
			  else
			  {
				  width -= step;
				  height -= Math.floor(step * img.ratio);

				  img.setAttribute('width', width);
				  img.setAttribute('height', height);

				  if (width < img.smallWidth + step)
				  {
					  img.setAttribute('width', img.smallWidth);
					  img.setAttribute('height', img.smallHeight);
					  img.src = img.smallSrc;
					  window.clearInterval(interval);
					  img.state = 'small';
				  }//if
			  }//else
		  }//scale step			
	  }//scale


function ShowHideLayer(boxID, imagesUrl) {
	/* Obtain reference for the selected boxID layer and its button */
	var box = document.getElementById("box"+boxID);
	//var boxbtn = document.getElementById("btn"+boxID);

	/* If the selected box is currently invisible, show it */
	if(box.style.display == "none" || box.style.display=="") {
		box.style.display = "block";
 		//boxbtn.src = imagesUrl+"arrow_tree_open.gif";
	}
	/* otherwise hide it */
	else {
		box.style.display = "none";
		//boxbtn.src = imagesUrl+"arrow_tree_closed.gif";
	}
}

function ShowHideBrandsLayer(boxID){
    var box = document.getElementById("box"+boxID);
    /* If the selected box is currently invisible, show it */
	if(box.style.display == "none" || box.style.display=="") {
		box.style.display = "block";
	}
	/* otherwise hide it */
	else {
		box.style.display = "none";
	}
}
/*
 * This should be used to dynamically get list of customers that sell some brand and displys it inside boxID element.
 * for _url see : (modules.shop.GetCustomersForBrandServlet)
*/
function getCustomersForBrand(boxID, _url) {
    var box = document.getElementById("box"+boxID);

    /* If the selected box is currently invisible, show it */
	if(box.style.display == "none" || box.style.display=="") {
        box.style.display = "block";
        //get list of brands from server
        dojo.xhrGet( {
            url: _url,
            handleAs: "text",

            timeout: 10000, // Time in milliseconds

            // The LOAD function will be called on a successful response.
            load: function(response, ioArgs) {
              dojo.byId("box"+boxID).innerHTML = response;
              return response;
            },

            // The ERROR function will be called in an error case.
            error: function(response, ioArgs) {
                console.error("HTTP status code: ", ioArgs.xhr.status);
                //show error in box
                dojo.byId("box"+boxID).innerHTML = "Error loading brands";
                return response;
            }
        });
	}
	/* If the selected box is currently visible hide it */
	else {
		box.style.display = "none";
	}
}

function httpLoad(divId, _url){
    //dojo.byId(divId).innerHTML = "<img alt='Please wait...' src='http://localhost:8081/devcity/ajax-loader.gif'/>";

    dojo.xhrGet( {

        url: _url,
        handleAs: "text",

        timeout: 20000, // Time in milliseconds

        // The LOAD function will be called on a successful response.
        load: function(response, ioArgs) {
          dojo.byId(divId).innerHTML = response;
          return response;
        },

        // The ERROR function will be called in an error case.
        error: function(response, ioArgs) {
            console.error("HTTP status code: ", ioArgs.xhr.status);
            //show error in box
            dojo.byId(divId).innerHTML = "Error loading page";
            return response;
        }
    });
}

function loadInDiv(divId,content){
    dojo.byId(divId).innerHTML = content;
}

/*
if (document.images) {
     button_1on= new Image(25,20);
     button_1on.src="../images/buttonBar/c4y-city-selection-hover.gif";

     button_1off= new Image(25,20);
     button_1off.src="../images/buttonBar/c4y-city-selection.gif";
   }

function lightup(imgName) {
   if (document.images) {
      imgOn=eval(imgName + "on.src");
      document[imgName].src= imgOn;
    }
 }

function turnoff(imgName) {
   if (document.images)  {
      imgOff=eval(imgName + "off.src");
      document[imgName].src= imgOff;
    }
 }
 */

/*********************** hover effect on button (change image on mouseover) **********************************/
function changeImage(imgName,imgUrl) {
    document[imgName].src= imgUrl;
}


//-->





