//- Effect::CaseStudy -//
Effect.CaseStudy = Class.create();
Object.extend(Object.extend(Effect.CaseStudy.prototype, Effect.Base.prototype), {
	//- initialize -//
	initialize: function(element) {
		this.element = element;
		if (!this.element) {
			throw(Effect._elementDoesNotExistError);
		}
		var options = Object.extend({ amount: 100, isOpening: false, size: null, toSize: null }, arguments[1] || {});
		//+
		if (options.isOpening == true) {
			options.toSize = options.size;
		} else {
			options.toSize = 0;
		}
		this.originalSize = options.originalSize || parseInt(this.element.style.height);
		if (options.toSize != null) {
			options.amount = options.toSize - this.originalSize;
		}
		this.start(options);
	//- setup -//
	}, setup: function() {
		//+ prevent executing on elements not in the layout flow
		if (this.element.getStyle('display') == 'none') {
			this.cancel();
			return;
		}
		if (this.options.isOpening == true) {
			this.element.setStyle({borderTop: '1px dotted #cccccc'});
		}
	//- update -//
	}, update: function(position) {
		this.element.setStyle({height: this.originalSize + (this.options.amount * position) + 'px'});
	//- finish -//
	}, finish: function() {	
		this.element.setStyle({height: this.originalSize + this.options.amount + 'px'});
		if (this.options.isOpening == false) {
			this.element.setStyle({borderTop: ''});
		}
	}
});

if ((window.location.pathname == '/') || (window.location.pathname == '/Index_') || (window.location.pathname == '/Index.htm')) {
	Event.observe(window, 'load', function() {
		var rssLink = $$('#body2 div.header a').first();;
		if (rssLink) { rssLink.setAttribute('href', 'http://feeds.feedburner.com/DEGblog'); }
		var blogLink = $$('#body2 div.item a').first();
		if (blogLink) { blogLink.setAttribute('href', 'http://blog.digitalev.com/'); }
	});
}
Kernel.DetectBrowserFlash = function(minVersion) {
	if (document.IsDetectBrowserFlash == true) {
		return;
	}
	document.IsDetectBrowserFlash = true;
	if ((Kernel.BrowserType == 'IEx') && (Kernel.BrowserPlatform = 'Windows')) {
		document.write('<script type="text/vbscript">\n');
		document.write('on error resume next\n');
		document.write('Kernel.IsBrowserFlash = IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & ' + minVersion + '))\n'); 
		document.write('<' + '/script\>\n');
	}
	if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] && navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin) {
		var description = (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]).description;
		//+
		var matches = description.match(/\d+\.\d/g);
		var version = 0;
		if (matches && (matches.length > 0)) {
			version = parseInt(matches[0]);
		}
		Kernel.IsBrowserFlash = (version >= minVersion);
	}
}
