/* Author: 

*/

jQuery(document).ready(function($) {

var viewport = $('meta[name="viewport"]');
var nua = navigator.userAgent;
    if ((nua.match(/iPad/i)) || (nua.match(/iPhone/i)) || (nua.match(/iPod/i))) {
        viewport.attr('content', 'width=device-width, minimum-scale=1.0, maximum-scale=1.0');
    $('body')[0].addEventListener("gesturestart", gestureStart, false);
    }
    function gestureStart() {
        viewport.attr('content', 'width=device-width, minimum-scale=0.25, maximum-scale=1.6');
    }
    window.addEventListener("load",function() {
  // Set a timeout...
  setTimeout(function(){
    // Hide the address bar!
    window.scrollTo(0, 1);
  }, 0);
});

var tab = self.document.location.hash.substring(1);
if(tab =='')
{
	tab = 'tjanster';
}
//console.log(tab);
var settings = { start:tab, change:true }; 
  $("#sidebar-nav ul").idTabs(settings,true); 

$('img').ready(function(){
	var width = parseInt($(this).width());
	var parentWidth = parseInt($(this).parent().width());
	var percentage = Math.floor((width/parentWidth) * 100);
	$(this).removeAttr("style").css('width', percentage+'%');
});

});
