jQuery.noConflict();
var ChenMed = this.ChenMed || {};
var DEV = this.DEV || {};
jQuery(function ($) {
	'use strict';
	ChenMed = {
		debug: function (debug) {
			switch (debug) {
			case "on":
				window.console.log('jQuery ver.' + $.fn.jquery + ' \/ jQuery UI ver.' + $.ui.version);
				$('div').each(function () {
					var z = $(this).css('zIndex');
					if (z !== 'auto') {
						//						var DEVinfo = $(this).attr("class") + " " + z;
						//						DEV.push(DEVinfo);
					}
				});
				$('*').live('click', function (e) {
					//				window.console.log($(this));
				});
				break;
			case "off":
				//				window.console.log('debug off');
				break;
			default:
				break;
			}
		},
		browserDetector: function () {
					// JS detection
					$('body').addClass('JS');
					// Browser detection
					if ($.browser.msie) {
						$('body').addClass('msie');
						$('body').addClass('msie' + $.browser.version.charAt(0));
					} else if ($.browser.mozilla) {
						$('body').addClass('mozilla');
					} else if ($.browser.webkit) {
						$('body').addClass('webkit');
					} else if ($.browser.opera) {
						$('body').addClass('opera');
					}
		
					// OS Detection
					var OSName = "Unknown OS";
					if (navigator.appVersion.indexOf("Win") !== -1) {
						OSName = "windows";
					}
					if (navigator.appVersion.indexOf("Mac") !== -1) {
						OSName = "osx";
					}
					if (navigator.appVersion.indexOf("X11") !== -1) {
						OSName = "unix";
					}
					if (navigator.appVersion.indexOf("Linux") !== -1) {
						OSName = "linux";
					}
		
					$('body').addClass(OSName);
				},
		config: {
			local: false
		},
		error: function () {
			window.alert('there was an error');
		},
		video: function (e) {},
		init: function () {
			jQuery.fx.interval = 10;
			ChenMed.debug("off");
//			ChenMed.autofill($(".homeSearch"), "Keyword Search", "#a6a799");
			
			ChenMed.browserDetector();
			$('#rotator').cycle({ 
			    fx:    'fade', 
			    speed:  300,
		        timeout: 7000,
		        pager: '#rotatorPager'
			});
			
			$('.home').find('#quotes').cycle({ 
			    fx:    'fade', 
			    speed:  300,
			    timeout: 10000,
			    pager: '#quotesPager'
			   
			});
			$('input, textarea, select').uniform();
		}
	};
	// Initialize Boltforge application
	ChenMed.init();

});

