/* 
functions to preLoad images and restore them on page 
compiled to make work quickly (especially in IE)
example:
    // init menu items
    writeEmptyImages(['Menu/bg_homeMenu_left.gif','Menu/bg_homeMenu_left_R.gif','Menu/bg_jsMenu_default.gif','Menu/bg_jsMenu_default_R.gif','Menu/bg_jsMenu_default.gif','Menu/bg_jsMenu_default_R.gif','Menu/bg_jsMenu_default.gif','Menu/bg_jsMenu_default_R.gif','Menu/bg_homeMenu_right.gif','Menu/bg_homeMenu_right_R.gif']);
    addLoadEventCompiled(function(){InitMenuBg();});function InitMenuBg(){changeBgSrc(document.getElementById('menuNav1'),'/Media/Images/Menu/bg_homeMenu_left.gif');changeBgSrc(document.getElementById('menuNav2'),'/Media/Images/Menu/bg_jsMenu_default.gif');changeBgSrc(document.getElementById('menuNav3'),'/Media/Images/Menu/bg_jsMenu_default.gif');changeBgSrc(document.getElementById('menuNav4'),'/Media/Images/Menu/bg_jsMenu_default.gif');changeBgSrc(document.getElementById('menuNav5'),'/Media/Images/Menu/bg_homeMenu_right.gif','right');}
setHeightFor2Blocks - function sets height for 2 blocks in the same values (using max of it) or sets to given value (optional last param)
*/
function writeEmptyImages(imgList){var strImageHTML="";var imgContainer=document.getElementById('preLoadImages');for(var i=0;i<imgList.length;i++){if(imgList[i]!="")
strImageHTML="<img src='/Media/Images/"+imgList[i]+"' width='1' height='1' alt='' />";imgContainer.innerHTML+=(strImageHTML);}}
function changeBgSrc(obj,newImg,pos){if(pos==null)
pos="left";obj.style.backgroundImage="url("+newImg+")";obj.style.backgroundPosition=pos;obj.style.backgroundRepeat="no-repeat";}
function changeImgSrc(obj,fileName){obj.src="/Media/Images/"+fileName;}
function addLoadEventCompiled(func){var oldonload=window.onload;if(typeof window.onload!='function'){window.onload=func;}
else{window.onload=function(){oldonload();func();}}}
function setHeightFor2Blocks(elmid1,elmid2,height){var b1=document.getElementById(elmid1);var b2=document.getElementById(elmid2);if(!b1||!b2)return;var h1=b1.offsetHeight;var h2=b2.offsetHeight;if(height){b1.style.height=height+'px';b2.style.height=height+'px';}
else{if(h1>h2){b2.style.height=h1+'px';b1.style.height=h1+'px';}else if(h1<h2){b1.style.height=h2+'px';b2.style.height=h2+'px';}}}
