
var $j = jQuery.noConflict();

var ie6 = ($j.browser.msie && $j.browser.version < 7 ) ? true : false;
var ie7 = ($j.browser.msie && $j.browser.version == 7 ) ? true : false;

 

		$j(document).ready(function () {


			// Lightbox prompt
			$j('.get_download, #mnDownload').each( function() {
					$j(this).each( function() {                                                                
							$j(this).click( function(e) { 
								  
									e.preventDefault();
									
									var source = $j(this).attr('href');
									var lightbox = jQuery.fn.lightbox({ 
											overlayId : 'overlay_register',                        
											lightboxId : 'lightbox_register',
											width : 600,
											height : 400,
											source: source
									});                    
									lightbox.open();
									
									
							});
					});
			});
		
	    /*	
 			$j('.get_download, #mnDownload').each( function() {
			
			    var closeBtn;
				var url;
				var overlayerEl = '#overlayer';
				var dialogEl    = '#download_dialog';
				var redirect;	// timeout for redirect
				
				$j(this).click( function(e) {
										 
					e.preventDefault();
					
					// show dialog 
					$j(overlayerEl).fadeIn('fast'); 
					$j(dialogEl).fadeIn('fast');
					
					// get redirect url
					url = $j(this).attr('href');
					
					// set timeout for redirect
					redirect = setTimeout( function() { 
						closeDialog();	
						location.href = url;  
					} , 5000 );					
					
					// close
					if ( $j('.dialog_close').size() == 0 ) { 
						closeBtn = $j('<div class="dialog_close">&nbsp;</div>').appendTo($j(dialogEl)); 
						closeBtn.click( function(e) { clearTimeout(redirect); closeDialog(); });
						$j(overlayerEl).click( function(e) { clearTimeout(redirect); closeDialog(); });
					};
					 
				});	
				
				function closeDialog() {
					$j(overlayerEl).fadeOut('fast');
					$j(dialogEl).fadeOut('fast');
				};
				
			});
			*/
																 
		});
		
		

 /*
    LIGHTBOX
*/


(function($) {
	jQuery.fn.lightbox = function(options) {
		
		// defaults, override with options
		settings = jQuery.extend({
		  overlayId : 'overlay_885-457',
			lightboxId : 'lightbox_885-457',
			overlayClass: 'lightbox_overlay',
			lightboxClass: 'lightbox',
			closeButtonClass: 'lightbox_close',
			contentClass: 'lightbox_content',
			width : 885,
			height : 457,
			source: 'blank.html'
		}, options);
	  
		return this.each(function(){

			// lightbox html
		  var lightbox = '';
			lightbox += '<div id="' + settings.overlayId + '" class="' + settings.overlayClass + '"></div>';
			lightbox += '<div id="' + settings.lightboxId + '" class="' + settings.lightboxClass + '" style="width:' + (settings.width) + 'px; height:' + (settings.height) + 'px; margin-top:-' + Math.round(settings.height/2) + 'px; margin-left:-' + Math.round(settings.width/2) + 'px;">';
			lightbox += '<div class="' + settings.closeButtonClass + '"></div><div class="' + settings.contentClass + '">';
			lightbox += '<iframe id="lightbox_frame" width="'+(settings.width+30)+'" height="'+(settings.height+30)+'" frameborder="0" scrolling="no" allowtransparency="true" src="'+settings.source+'">&lt/iframe>';
			lightbox += '</div></div>';	
			// the iframe is bigger than the overlay to hide scrollbars in chrome, opera
			jQuery.fn.open = function() {
				
				if ( $('.'+settings.overlayClass).size() > 0 ) {
					$('.'+settings.overlayClass).remove();
					$('.'+settings.lightboxClass).remove();				
				};
 
				$lightbox = $('body').append(lightbox);
				$('#'+settings.overlayId).bgiframe();
				
				//$('#lightbox_frame').attr('src',settings.source);
								
				
				if (ie6) {
					// position for IE6
					$('html').css({'height':'100%','overflow-y':'hidden'});
					// position background overlay
					lightboxPos = $('.'+settings.lightboxClass).offset();
					$('.'+settings.overlayClass).css({'background-position':'center '+(lightboxPos.top-150)});
					$('.'+settings.overlayClass).focus();				
					$(window).resize( function() { 
					  if ($('.'+settings.lightboxClass).length!=0) {												 
					  	lightboxPos = $('.'+settings.lightboxClass).offset();
					  	$('.'+settings.overlayClass).css({'background-position':'center '+(lightboxPos.top-150)}); 
						};
				  });
				} 
				$('.'+settings.closeButtonClass).click(function(){$lightbox.close();});
				$('.'+settings.overlayClass).click(function(){$lightbox.close();});
			

				
			}	
			
			

			jQuery.fn.close = function() {
				if (ie6) {
					$('html').css({'height':'auto','overflow-y':'scroll'});
				};
				$('.'+settings.overlayClass).remove();
				$('.'+settings.lightboxClass).remove();
			}
			
			
    });

	};	
})(jQuery);

function closeLightbox() { $j('.lightbox_overlay').remove(); $j('.lightbox').remove(); };

/*_*/


/*
    ----- PLUGINS --------------------------------------------------
*/

/* BGIFRAME
 * Copyright (c) 2006 Brandon Aaron (http://brandonaaron.net)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * $LastChangedDate: 2007-07-21 18:44:59 -0500 (Sat, 21 Jul 2007) $
 * $Rev: 2446 $
 *
 * Version 2.1.1
 */
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(b($){$.m.E=$.m.g=b(s){h($.x.10&&/6.0/.I(D.B)){s=$.w({c:\'3\',5:\'3\',8:\'3\',d:\'3\',k:M,e:\'F:i;\'},s||{});C a=b(n){f n&&n.t==r?n+\'4\':n},p=\'<o Y="g"W="0"R="-1"e="\'+s.e+\'"\'+\'Q="P:O;N:L;z-H:-1;\'+(s.k!==i?\'G:J(K=\\\'0\\\');\':\'\')+\'c:\'+(s.c==\'3\'?\'7(((l(2.9.j.A)||0)*-1)+\\\'4\\\')\':a(s.c))+\';\'+\'5:\'+(s.5==\'3\'?\'7(((l(2.9.j.y)||0)*-1)+\\\'4\\\')\':a(s.5))+\';\'+\'8:\'+(s.8==\'3\'?\'7(2.9.S+\\\'4\\\')\':a(s.8))+\';\'+\'d:\'+(s.d==\'3\'?\'7(2.9.v+\\\'4\\\')\':a(s.d))+\';\'+\'"/>\';f 2.T(b(){h($(\'> o.g\',2).U==0)2.V(q.X(p),2.u)})}f 2}})(Z);',62,63,'||this|auto|px|left||expression|width|parentNode||function|top|height|src|return|bgiframe|if|false|currentStyle|opacity|parseInt|fn||iframe|html|document|Number||constructor|firstChild|offsetHeight|extend|browser|borderLeftWidth||borderTopWidth|userAgent|var|navigator|bgIframe|javascript|filter|index|test|Alpha|Opacity|absolute|true|position|block|display|style|tabindex|offsetWidth|each|length|insertBefore|frameborder|createElement|class|jQuery|msie'.split('|'),0,{}))

/*_*/		
