﻿var divPopup,imgPopup,divLeft,imgHeight;function I(){$('#Login').focus();$('*').filter('div.divLink').css({cursor:'pointer'}).mouseover(function(){$(this).removeClass().addClass('hover');}).mouseout(function(){$(this).removeClass().addClass('divLink');}).click(function(){var link=$('a',this);if(link.attr('href')){if(link.hasClass('newWindow'))window.open(link.attr('href'));else window.location.href=link.attr('href');}}).end().filter('a').filter('.rollover').filter(function(){return $('img',this)[0].alt;}).each(function(){DMP.ButtonSource.registerButton($('img',this)[0],1,1,1,1);}).end().end().filter('.newWindow').click(function(event){event.preventDefault();if(!$(this).parent().hasClass('hover'))window.open(this.href);}).end().filter('.imageWindow').click(function(event){event.preventDefault();DMP.openWindow(this.href,'Photo',this.winw,this.winh,1);}).end().filter(function(){return(t=$(this).attr('href'))&&t.charAt(this.href.length-1)=='#';}).click(function(event){event.preventDefault();}).mousedown(function(event){event.preventDefault();}).end().end().filter('img').filter('.submitForm').click(function(event){event.preventDefault();$(this).parents().filter('form')[0].submit();}).end().filter('.popup').mouseover(function(){t=$(this),i=$(imgPopup),d=$(divPopup);if(f=t.attr('full'))i.attr({src:f});else i.attr({src:t.attr('src')});d.css({display:'block'});divLeft=i.width()/2+10;imgHeight=i.height();d.css({left:$(document).width()/2-divLeft});}).mouseout(function(){$(divPopup).css({display:'none'});}).end().end().filter('input').filter(function(){return $(this).attr('default');}).each(function(){var t=$(this);t.css({color:t.val()==t.attr('default')?'#888':'#333'});}).focus(function(){var t=$(this);if(t.val()==t.attr('default'))t.val('');t.css({color:'#333'});}).blur(function(){var t=$(this);if(t.val()=='')t.val(t.attr('default'));t.css({color:t.val()==t.attr('default')?'#888':'#333'});});if(divPopup==null){var div=document.createElement('div');$(div).attr({id:'divPopup'}).css({background:'#666',border:'1px solid #ddd',display:'none',padding:'0px',position:'absolute',zIndex:'200'});var img=document.createElement('img');$(img).attr({id:'imgPopup',src:'',alt:'Popup Photo'}).css({width:'auto',height:'auto'});div.appendChild(img);document.body.insertBefore(div,document.body.firstChild);divPopup=$('#divPopup')[0];imgPopup=$('#imgPopup')[0];$(divPopup).mouseover(function(){$(this).css({display:'block'});}).mouseout(function(){$(this).css({display:'none'});});$(document.body).mousemove(function(e){var maxY=document.all?document.documentElement.scrollTop+document.documentElement.clientHeight:window.innerHeight+window.pageYOffset;$(divPopup).css({top:e.pageY+20+imgHeight>maxY?e.pageY-imgHeight-20:e.pageY+20});});}}