Образцы деревянных евроокон

Деревянные евроокна
На службу вашим фантазиям и эстетическим устремлениям мы ставим все свои ресурсы: накопленный опыт, профессионализм специалистов, оригинальность дизайнерских решений. // how many milliseconds we should wait between resizing events var resizeDelay = 10; // how many pixels we should grow or shrink by each time we resize var resizeIncrement = 1; // this will hold information about the images we're dealing with var imgCache = new Object(); /** The getCacheTag function just creates a (hopefully) unique identifier for each that we resize. */ function getCacheTag (imgElement) { return imgElement.src + "~" + imgElement.offsetLeft + "~" + imgElement.offsetTop; } /** We're using this as a class to hold information about the elements that we're manipulating. */ function cachedImg (imgElement, increment) { this.img = imgElement; this.cacheTag = getCacheTag(imgElement); this.originalSrc = imgElement.src; var h = imgElement.height; var w = imgElement.width; this.originalHeight = h; this.originalWidth = w; increment = (!increment) ? resizeIncrement : increment; this.heightIncrement = Math.ceil(Math.min(1, (h / w)) * increment); this.widthIncrement = Math.ceil(Math.min(1, (w / h)) * increment); } /** This is the function that should be called in the onMouseOver and onMouseOut events of an element. For example: The only required parameter is the first one (imgElement), which is a reference to the element itself. If you're calling from onMousexxx, you can just use "this" as the value. The second parameter specifies how much larger or smaller we should resize the image to, as a percentage of the original size. In the example above, we want to resize it to be 150% larger. If this parameter is omitted, we'll assume you want to resize the image to its original size (100%). The third parameter can specify another image that should be used as the image is being resized (it's common for "rollover images" to be similar but slightly different or more colorful than the base images). If this parameter is omitted, we'll just resize the existing image. */ function resizeImg (imgElement, percentChange, newImageURL) { // convert the percentage (like 150) to an percentage value we can use // for calculations (like 1.5) var pct = (percentChange) ? percentChange / 100 : 1; // if we've already resized this image, it will have a "cacheTag" attribute // that should uniquely identify it. If the attribute is missing, create a // cacheTag and add the attribute var cacheTag = imgElement.getAttribute("cacheTag"); if (!cacheTag) { cacheTag = getCacheTag(imgElement); imgElement.setAttribute("cacheTag", cacheTag); } // look for this image in our image cache. If it's not there, create it. // If it is there, update the percentage value. var cacheVal = imgCache[cacheTag]; if (!cacheVal) { imgCache[cacheTag] = new Array(new cachedImg(imgElement), pct); } else { cacheVal[1] = pct; } // if we're supposed to be using a rollover image, use it if (newImageURL) imgElement.src = newImageURL; // start the resizing loop. It will continue to call itself over and over // until the image has been resized to the proper value. resizeImgLoop(cacheTag); return true; } /** This is the function that actually does all the resizing. It calls itself repeatedly with setTimeout until the image is the right size. */ function resizeImgLoop (cacheTag) { // get information about the image element from the image cache var cacheVal = imgCache[cacheTag]; if (!cacheVal) return false; var cachedImageObj = cacheVal[0]; var imgElement = cachedImageObj.img; var pct = cacheVal[1]; var plusMinus = (pct > 1) ? 1 : -1; var hinc = plusMinus * cachedImageObj.heightIncrement; var vinc = plusMinus * cachedImageObj.widthIncrement; var startHeight = cachedImageObj.originalHeight; var startWidth = cachedImageObj.originalWidth; var currentHeight = imgElement.height; var currentWidth = imgElement.width; var endHeight = Math.round(startHeight * pct); var endWidth = Math.round(startWidth * pct); // if the image is already the right size, we can exit if ( (currentHeight == endHeight) || (currentWidth == endWidth) ) return true; // increase or decrease the height and width, making sure we don't get // larger or smaller than the final size we're supposed to be var newHeight = currentHeight + hinc; var newWidth = currentWidth + vinc; if (pct > 1) { if ((newHeight >= endHeight) || (newWidth >= endWidth)) { newHeight = endHeight; newWidth = endWidth; } } else { if ((newHeight