var id;$(document).ready(function(){$('a[name=modal]').click(function(e){$('select').hide();e.preventDefault();id=$(this).attr('href');doAction(id);fadeMask(id)});$('a[class=close]').click(function(e){e.preventDefault();$('#mask').hide();$('.window').hide();$('select').show()});$('#mask').click(function(e){$(this).hide();$('.window').hide();$('select').show()});$(window).resize(function(){doAction(id)});function fadeMask(id){$('#mask').show();$('#mask').fadeTo("fast",0.8);$(id).fadeIn(500)};function doAction(id){var browserType=navigator.userAgent.toLowerCase();var maskHeight=$(document).height();var maskWidth=$(window).width();var winH=$(window).height();var winW=$(window).width();$('#mask').css({'width':maskWidth,'height':maskHeight});if($('.window').innerHeight()>=(winH-100)){$(id).css('top',(winH/2-$(id).height()/2-15))}else{$(id).css('top',winH/2-$(id).height()/2)}$(id).css('left',winW/2-$(id).width()/2);if(winH<700&&$('.window').innerHeight()>=winH){$('.window').css({position:'absolute'});$(id).css('top',2)}else if(browserType.indexOf("msie")==-1){$('.window').css({position:'fixed'})}}});
