
$(document).ready(function(){

	articleCycle.init();

});

var articleCycle = {

	init:function(){
	
		if($('#articleCycle').length < 1 || $('#articleCycle .slideshow div').length < 2) return;
		
		//this.buildControls();
		this.setCycle();

	},
	buildControls:function() {
	
		var controls = '';
		
		controls += '<div id="controls">';
		controls +=	'<a href="" id="back">Back</a><a href="" id="next">Next</a>';
		controls += '</div>';
	
		$('#articleCycle').append(controls);
	
	},
	setCycle:function(){
	
		$('#articleCycle .slideshow').cycle({ 
			fx:     'fade', 
			speed:  'slow', 
			timeout: 5000
		});
		
		//extra params for above may be needed later
		//next:   '#articleCycle #next', 
		//prev:   '#articleCycle #back' 

	}

}

function isHandheld(){// Return boolean TRUE/FALSE
	var userAgentList = "_h797|160x|471x|480x|848b|a615|ahong|android|avantgo|b832|blackberry|blazer|c7100|c-810|compal|d615|d763|e860|el370|elaine|fennec|g83|hiptop|i250|iemobile|ipad|iphone|ipod|jasmine|lg210|lg370|lg380|lg47|lg840|lg920|lge |lgku|lgu900|m5252|m800|m881|mg50|mini 9.5|minimo|mk99|mob-x|mot-|mowser|mp500|mt12|n210|opera mini|operamobi|palm|palm|palm os|plucker|r800|rim8|s55|s580|s700|s920|sam-r|samu3|samu4|samu5|samu6|samu7|samu9|sk16d|sl900|sprint|symbian|t503|t66|u940|ux840|v120|vx10|vx1000|vx400|w398samr810|w839|webos|windows ce|windows phone|wireless|x160|x640|xda_|xiino|googlebot-mobile";
	var uAgent = navigator.userAgent.toLowerCase();
	var returnValue = false;
	var temp = $.each(userAgentList.split('|'),function (index,agent){
		if(uAgent.search(agent) > -1){
			returnValue = true;
			return;
		};
	});
	return returnValue;
};
