var randimg = function() {
	a = 0 + 2*(Math.random());
	a = Math.round(a);
	imgs = ['backround_c4c.png','backround_c4c.png','backround_c4c.png'];
	return imgs[a];
}

var jQT = new $.jQTouch({
	icon: 'fileadmin/layout/mobile/images/c4cbtn.png',
        addGlossToIcon: false,
        startupScreen: 'fileadmin/layout/mobile/images/'+randimg(),
        statusBar: 'black',
        preloadImages: [
	        'fileadmin/layout/mobile/images/logo.png',
	        'fileadmin/layout/mobile/images/linkstylestyle_consulting_l.png',
	        'fileadmin/layout/mobile/images/linkstylestyle_consulting_r.png',
	        'fileadmin/layout/mobile/images/linkstylestyle_contact_r.png',
	        'fileadmin/layout/mobile/images/linkstylestyle_contact_l.png',
	        'fileadmin/layout/mobile/images/linkstylestyle_creative_l.png',
	        'fileadmin/layout/mobile/images/linkstylestyle_creative_r.png',
	        'fileadmin/layout/mobile/images/linkstylestyle_impress_l.png',
	        'fileadmin/layout/mobile/images/linkstylestyle_impress_r.png',
	        'fileadmin/layout/mobile/images/linkstylestyle_routing_l.png',
	        'fileadmin/layout/mobile/images/linkstylestyle_routing_r.png',
	        'fileadmin/layout/mobile/images/linkstylestyle_systems_l.png',
	        'fileadmin/layout/mobile/images/linkstylestyle_systems_r.png',
	        'http://c4c.com/uploads/pics/acc1d16b39.png',
	        'http://c4c.com/uploads/pics/2cc7732d3a.png',
	        'http://c4c.com/uploads/pics/af59443f41.png',
	        'iPhone_bg.jpg'
	]
});

// Some sample Javascript functions:
            $(function(){
                // Show a swipe event on swipe test
                $('#swipeme').swipe(function(evt, data) {                
                    $(this).html('You swiped <strong>' + data.direction + '</strong>!');
                });
                $('a[target="_blank"]').click(function() {
                    if (confirm('This link opens in a new window.')) {
                        return true;
                    } else {
                        $(this).removeClass('active');
                        return false;
                    }
                });
                // Page animation callback events
                $('#pageevents').
                    bind('pageAnimationStart', function(e, info){ 
                        $(this).find('.info').append('Started animating ' + info.direction + '&hellip; ');
                    }).
                    bind('pageAnimationEnd', function(e, info){
                        $(this).find('.info').append(' finished animating ' + info.direction + '.<br /><br />');
                    });
                // Page animations end with AJAX callback event, example 1 (load remote HTML only first time)
                $('#callback').bind('pageAnimationEnd', function(e, info){
                    if (!$(this).data('loaded')) {                      // Make sure the data hasn't already been loaded (we'll set 'loaded' to true a couple lines further down)
                        $(this).append($('<div>Loading</div>').         // Append a placeholder in case the remote HTML takes its sweet time making it back
                            load('ajax.html .info', function() {        // Overwrite the "Loading" placeholder text with the remote HTML
                                $(this).parent().data('loaded', true);  // Set the 'loaded' var to true so we know not to re-load the HTML next time the #callback div animation ends
                            }));
                    }
                });
                // Orientation callback event
                $('body').bind('turn', function(e, data){
                    $('#orient').html('Orientation: ' + data.orientation);
                });
            });

