function $(id) { return document.getElementById(id); } function get_over_src(src) { return '/i/'+ src.replace(/.[a-zA-Z]{3}$/, "").replace (/(http.*)\/i\//, "") + '_over.' + src.replace(/.*\./, ""); } function get_normal_src(src) { return '/i/' + src.replace(/_over/, "").replace (/(http.*)\/i\//, ""); } function img_over(img) { img.src = get_over_src(img.src); } function img_out(img) { img.src = get_normal_src(img.src); } function preload_images() { var img = new Object(); arguments = preload_images.arguments; for( i=0; i < arguments.length; i++) { img[i] = new Image(); img[i].src = arguments[i]; } i = 0; images = document.getElementsByTagName('img') while( image = images[i++] ) { if( image.className.match(/over/, "") ) { image.onmouseover = function() { this.src = get_over_src(this.src); } image.onmouseout = function() { this.src = get_normal_src(this.src); } } /* blur if require */ image.parentNode.onfocus = function() { this.blur() } } } onload = function() { preload_images( '/i/en/m/about_over.gif', '/i/en/m/about/news_over.gif', '/i/en/m/boys_over.gif', '/i/en/m/girls_over.gif', '/i/en/m/kittens_over.gif', '/i/en/m/gallery_over.gif', '/i/en/m/links_over.gif', '/i/en/m/contacts_over.gif', '/i/en/m/kittens/available_over.gif', '/i/en/m/kittens/litters_over.gif', '/i/en/m/kittens/planned_over.gif', '/i/en/h/index_boys_over.gif', '/i/en/h/index_girls_over.gif' ); } function sf( s, id, w, h, t, l ) { var cWidth = 0, cHeight = 0; if (typeof(window.innerWidth) == 'number') { cWidth = window.innerWidth; cHeight = window.innerHeight; } else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) { cWidth = document.documentElement.clientWidth; cHeight = document.documentElement.clientHeight; } else if (document.body && (document.body.clientWidth || document.body.clientHeight)) { cWidth = document.body.clientWidth; cHeight = document.body.clientHeight; } var scrOfX = 0, scrOfY = 0; if(typeof(window.pageYOffset) == 'number') { scrOfY = window.pageYOffset; scrOfX = window.pageXOffset; } else if (document.body && (document.body.scrollLeft || document.body.scrollTop)) { scrOfY = document.body.scrollTop; scrOfX = document.body.scrollLeft; } else if (document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) { scrOfY = document.documentElement.scrollTop; scrOfX = document.documentElement.scrollLeft; } w += 0; h += 0; ch = h+70; var wc = parseInt((cWidth-w)/2) + scrOfX - 100; var hc = parseInt((cHeight-h)/2) + scrOfY - 40; if( $('popup') ) { $('overlay').style.height = cHeight ; if( document.body.scrollHeight && document.body.scrollHeight > cHeight ) $('overlay').style.height = document.body.scrollHeight ; $('overlay').style.display = 'block'; $('popup').style.top = hc + "px"; $('popup').style.left = wc + "px"; $('popup').style.width = w + "px"; $('popup').style.height = ch + "px"; $('popup').style.display = 'block'; if( $('ptext') ) $('ptext').style.marginTop = (h+20) + "px"; $('pimg').style.display = 'none'; var isrc = 'http://'+window.location.host+l+'/p/'+s+'/'+id+'.img'; if( $('pimg').src != isrc ) { $('pimg').onload = function() { this.style.display = 'block'; if( $('ptext') ) $('ptext').style.marginTop = 0; } $('pimg').src = l+'/p/'+s+'/'+id+'.img'; } else { $('ptext').style.marginTop = 0; $('pimg').style.display = 'block'; } $('pimg').title = t ; if( $('ptext') ) $('ptext').innerHTML = t; } return false ; } function hf() { $('popup').style.display = 'none'; $('overlay').style.display = 'none'; $('overlay').style.height = "100%"; }