//Perform browser detection
function css_browser_selector(u){var ua=u.toLowerCase(),is=function(t){return ua.indexOf(t)>-1},g='gecko',w='webkit',s='safari',o='opera',m='mobile',h=document.documentElement,b=[(!(/opera|webtv/i.test(ua))&&/msie\s(\d)/.test(ua))?('ie ie'+RegExp.$1):is('firefox/2')?g+' ff2':is('firefox/3.5')?g+' ff3 ff3_5':is('firefox/3.6')?g+' ff3 ff3_6':is('firefox/3')?g+' ff3':is('gecko/')?g:is('opera')?o+(/version\/(\d+)/.test(ua)?' '+o+RegExp.$1:(/opera(\s|\/)(\d+)/.test(ua)?' '+o+RegExp.$2:'')):is('konqueror')?'konqueror':is('blackberry')?m+' blackberry':is('android')?m+' android':is('chrome')?w+' chrome':is('iron')?w+' iron':is('applewebkit/')?w+' '+s+(/version\/(\d+)/.test(ua)?' '+s+RegExp.$1:''):is('mozilla/')?g:'',is('j2me')?m+' j2me':is('iphone')?m+' iphone':is('ipod')?m+' ipod':is('ipad')?m+' ipad':is('mac')?'mac':is('darwin')?'mac':is('webtv')?'webtv':is('win')?'win'+(is('windows nt 6.0')?' vista':''):is('freebsd')?'freebsd':(is('x11')||is('linux'))?'linux':'','js']; c = b.join(' '); h.className += ' '+c; return c;}; css_browser_selector(navigator.userAgent);


// Initialize Site
$(document).ready(function() {
	var current_page_title = document.title;
	var current_page_url = window.location;
//	$('#main').hide();


//topnav.js"
$('#container').prepend(''
		+'<ul id="nav_social">'
			+'<li><a href="mailto:info@bisok.com?subject=Information%20request%20from%20www.bisok.com"><img src="http://www.bisok.com/Images/master_topnav_email.jpg" /></a></li>'
			+'<li><a target="_blank" href="http://www.facebook.com/pages/Business-Imaging-Systems/92565616692"><img src="http://www.bisok.com/Images/master_topnav_facebook.jpg" /></a></li>'
			+'<li><a target="_blank" href="http://www.twitter.com/BIS_Tweets"><img src="http://www.bisok.com/Images/master_topnav_twitter.jpg" /></a></li>'
		+'</ul>'

		+'<ul id="nav_links">'
			+'<li><a href="http://www.bisok.com/index.html"><img src="http://www.bisok.com/Images/master_topnav_home.jpg" /></a></li>'
			+'<li><a href="http://www.bisok.com/about-us.html"><img src="http://www.bisok.com/Images/master_topnav_about_us.jpg" /></a></li>'
			+'<li><a href="http://www.bisok.com/careers.html"><img src="http://www.bisok.com/Images/master_topnav_careers.jpg" /></a></li>'
			+'<li><a href="http://www.bisok.com/contact.html"><img src="http://www.bisok.com/Images/master_topnav_contact.jpg" /></a></li>'
			+'<li><a href="http://www.bisok.com/newsletters.html"><img src="http://www.bisok.com/Images/master_topnav_newsletters.jpg" /></a></li>'
		+'</ul>'

		+'<div id="header_spacer">'
			+'<a href="http://www.bisok.com"><span>Business Imaging Systems</span></a>'
		+'</div>'

		+'<center>'
			+'<ul id="nav">'
				+'<li><a href="http://www.bisok.com/content-management.html">Content Management</a></li>'
				+'<li><a href="http://www.bisok.com/infrastructure-solutions.html">Infrastructure Solutions</a></li>'
				+'<li><a href="http://www.bisok.com/records-services.html">Records Services</a></li>'
				+'<li><a href="http://www.bisok.com/support.html">Maintenance & Support</a></li>'
			+'</ul>'
		+'</center>'
		);


//Footer
$('#main').after(''
			+'<center>'
				+'<div id="footer">'
					+'<ul id="partners">'
						+'<li id="a"><a target="_blank" href="http://www.canonusa.com"><span>Canon</span></a></li>'
						+'<li id="b"><a target="_blank" href="http://www.dell.com"><span>Dell</span></a></span></li>'
						+'<li id="c"><a target="_blank" href="http://www.emc.com"><span>EMC</span></a></span></li>'
						+'<li id="d"><a target="_blank" href="http://www.fujitsu.com"><span>Fujitsu</span></a></span></li>'
						+'<li id="e"><a target="_blank" href="http://www.kodak.com"><span>Kodak</span></a></span></li>'
						+'<li id="f"><a target="_blank" href="http://www.kofax.com"><span>Kofax</span></a></span></li>'
						+'<li id="g"><a target="_blank" href="http://www.prostorsystems.com"><span>ProStor</span></a></span></li>'
						+'<li id="h"><a target="_blank" href="http://www.rimage.com"><span>Rimage</span></a></span></li>'
						+'<li id="i"><a target="_blank" href="http://www.vmware.com"><span>VMware</span></a></span></li>'
					+'</ul>'

					+'<p style="text-align:center; color:#999; ">'
						+'Copyright © 2011 Business Imaging Systems, Inc.  All rights reserved.'
						+'<br />'
						+'<a href="http://www.bisok.com/careers.html">Careers</a> | <a href="http://www.bisok.com/privacy-policy.html">Privacy Policy</a> | <a href="http://www.bisok.com/terms-of-use.html">Terms of Use</a>'
					+'</p>'
				+'</div>'
			+'</center>'
	);


//Page Title - Business Imaging Systems, Inc. - prepend
//$('title').prepend("Business Imaging Systems, Inc. - ");


/*This fades in the main content of pages when they initially load*/
/*$('#main').hide();*/
$('#main').fadeIn(500);
//$('div#breadcrumb ul.left').hide().slideDown(1500);



//Newsticker Controls
	var first = 0;
	var speed = 700;
	var pause = 3000;
	var news_1 = $('ul#news_ticker li:nth-child(1)')
	var news_2 = $('ul#news_ticker li:nth-child(2)')
	var news_3 = $('ul#news_ticker li:nth-child(3)')
	var news_4 = $('ul#news_ticker li:nth-child(4)')
	
	$(news_2).hide();
	$(news_3).hide();
	$(news_4).hide();

	function removeFirst(){
		first_html = $(news_1).html();
		$(news_1)
			.animate({opacity: 0}, speed)
			.fadeOut(speed, function(){
				second = $('ul#news_ticker li:nth-child(2)').fadeIn('slow');
				$(first_html).remove();	
			});
		addLast(first_html);
	}
	function addLast(first_html){
		last = first_html+'';
		$('ul#news_ticker').append('<li style="display:none">'+last+'</li>');
	}
	
	interval = setInterval(removeFirst, pause);

});
