function Focus(input) { if( input.value == input.title ) { input.value = ''; //input.setStyle({ color: '#222222' }); } } function Blur(input) { //input.setStyle({ border: '1px solid #9a9a9a' }); if( input.value.strip() == '' ) { input.value = input.title; //input.setStyle({ color: '#BBBBBB' }); } } function search() { var div = $('search'); var text = $('sinput'); if( text.value.strip().length < 2 || text.value == text.title ) { div.down('p').removeClassName('hidden'); return false; } div.down('form').submit(); return true; } function checkMail( input ) { var result = ( /^\w+[A-Za-z0-9\-\_\.]{1,50}\w+@\w+\.?[a-z0-9\-\_]{1,30}\.[a-z]{2,4}$/.test( input.value ) ) ? true : false; return result; } var ShowCnt = Class.create(); ShowCnt.prototype = { initialize: function( block, item_class ) { this.block = $(block); this.item_class = item_class; this.browser_width = document.documentElement.clientWidth || document.body.clientWidth || window.innerWidth || 0; this.browser_width = parseInt( this.browser_width ); this.browser_height = document.documentElement.clientHeight || document.body.clientHeight || window.innerHeight || 0; this.browser_height = parseInt( this.browser_height ); this.IE = ( navigator.userAgent.indexOf('MSIE') != -1 ) ? true : false; this.loader = '

Loading... Loading...

'; this.close_btn = 'close'; this.template = ''; new Insertion.Bottom('body', this.template); this.sbg = $('sbg'); this.scnt = $('scnt'); this.clsbtn = $('close_btn'); this.scnt.setStyle({ height: (this.browser_height - 90) + 'px' }); this.padding_left = Math.ceil( this.browser_width / 2 ); this.padding_top = Math.ceil( this.browser_height / 2 ); this.img_width = parseInt( this.scnt.getWidth() ); this.img_height = parseInt( this.scnt.getHeight() ); this.scnt.setStyle( {top: (this.padding_top - Math.ceil(this.img_height / 2)) + 'px', left: (this.padding_left - Math.ceil(this.img_width / 2)) + 'px'} ); this.init(); }, init: function() { this.index = false; this.ids = new Array(); this.cache = new Array(); this.items = $A( this.block.getElementsByClassName('item') ); if( !this.items.length ) return false; for( i=0; i= this.max ) return true; opacity += this.step; } if( this.IE ) this.items_block.setStyle({ filter: 'alpha(opacity='+opacity+')' }); else this.items_block.setStyle({ opacity: opacity }); this.timeout = setTimeout( this.reload.bind(this, hide, opacity) ); } }