function objShow(o) {
   var s = "";
   for(var name in o) {
      if(o[name]) s += name + '=' + o[name] + "\n";
   }
   alert(s);
}

function getOS(){
	
	var os, ua = navigator.userAgent;
	if (ua.match(/Win(dows )?NT 6\.0/)) {
		os = "Windows Vista";            // Windows Vista ???
	}
	else if (ua.match(/Win(dows )?NT 5\.2/)) {
		os = "Windows Server 2003";         // Windows Server 2003 ???
	}
	else if (ua.match(/Win(dows )?(NT 5\.1|XP)/)) {
		os = "Windows XP";            // Windows XP ???
	}
	else if (ua.match(/Win(dows)? (9x 4\.90|ME)/)) {
		os = "Windows ME";            // Windows ME ???
	}
	else if (ua.match(/Win(dows )?(NT 5\.0|2000)/)) {
		os = "Windows 2000";            // Windows 2000 ???
	}
	else if (ua.match(/Win(dows )?98/)) {
		os = "Windows 98";            // Windows 98 ???
	}
	else if (ua.match(/Win(dows )?NT( 4\.0)?/)) {
		os = "Windows NT";            // Windows NT ???
	}
	else if (ua.match(/Win(dows )?95/)) {
		os = "Windows 95";            // Windows 95 ???
	}
	else if (ua.match(/Mac|PPC/)) {
		os = "Mac OS";               // Macintosh ???
	}
	else if (ua.match(/Linux/)) {
		os = "Linux";               // Linux ???
	}
	else if (ua.match(/(Free|Net|Open)BSD/)) {
		os = RegExp.$1 + "BSD";            // BSD ????
	}
	else if (ua.match(/SunOS/)) {
		os = "Solaris";               // Solaris ???
	}
	else {
		os = "N/A";               // ???? OS ???
	}
	
	return os;
}

//2009-12-03:
function getBrowserInfo(){

	var java = navigator.javaEnabled();
	var cookie = navigator.cookieEnabled;

	var browser, version;
	
	var userAgent = navigator.userAgent.toLowerCase();
	$.browser.chrome = /chrome/.test(navigator.userAgent.toLowerCase()); 
	 
	if($.browser.msie){
		browser = "IE";
		version = $.browser.version.substring(0,3);
	}
	else if($.browser.chrome){
		browser = "Chrome";
		userAgent = userAgent.substring(userAgent.indexOf('chrome/') +7);
		version = userAgent.substring(0,3);
		$.browser.safari = false;
	}
	 
	else if($.browser.safari){
		browser = "Safari";
		userAgent = userAgent.substring(userAgent.indexOf('version/') +8);
		version = userAgent.substring(0,3);
	}
	 
	else if($.browser.mozilla){
		if(navigator.userAgent.toLowerCase().indexOf('firefox') != -1){
			browser = "FireFox";
			userAgent = userAgent.substring(userAgent.indexOf('firefox/') +8);
			version = userAgent.substring(0,3);
		}
		else{
			browser = "Mozilla";
			version = "";
		}
	}
	 
	 // Is this a version of Opera?
	else if($.browser.opera){
		browser = "Opera";
		version = "";
	}   
	
	//This java is not javascript
	return {
				"java":  java,
				"cookie": cookie,
				"browser": browser,
				"version": version
			};
	
}


function showSystem($o)
{
   var os       = getOS();
   var browser  = getBrowserInfo();
   $o.text('Your are running ' + os + ', ' + browser['browser']+' '+browser['version'] + ', cookie: ' + (browser['cookie'] ? 'on' : 'off') );
}

function showNow($o){
   var now = new Date();   
   $o.text(now.format());
   setInterval(function(){now   = new Date(); $o.text(now.format());},1000);
}

/*
   Simplest jQuery Image Cycler;
   Made by Kevin Luo from http://www.fotosteps.com.
   on Feb 2nd, 2010      
*/
(function($){
   $.fn.simpleCycle = function(){                           
      return this.each(function(){
         var imgCount = -1;
         $sc = $(this)
         function showImg(){
            imgCount++;
            var imgs = $sc.children('img');
            if(imgCount >= imgs.length ) imgCount = 0;
            
            imgs.eq(imgCount).siblings().hide();
            imgs.eq(imgCount).fadeIn(2000, showImg);
            $sc.css('background-image','url('+ this.src +')');
          };
          showImg();
      });
    };
   
})(jQuery);      

