var is_opera =  navigator.userAgent.indexOf('Opera') > -1;
var is_safari = navigator.userAgent.indexOf('AppleWebKit/') > -1;
var is_chrome = navigator.userAgent.indexOf('Chrome') > -1;
var is_firefox = navigator.userAgent.indexOf('Firefox') > -1;
var is_mac = navigator.platform.toLowerCase().indexOf('mac') > -1;
var is_linux = navigator.platform.toLowerCase().indexOf('linux') > -1;
var browser_ie6 = false;
var browser_ie7 = false;
var browser_ie8 = false;


var access_code = {
    container: null,
    
    setup: function() {
	this.container = jQuery('#booking-code');
	
	jQuery(this.container).bind('focus', function() {
	    if(this.value == 'pristupni code (opcija)') {
		this.value = '';
	    }
	});

	jQuery(this.container).bind('blur', function() {
	    if(this.value == '') {
		this.value = 'pristupni code (opcija)';
	    }
	});
   }
}

var tools = {
    setup: function() {
	
	var font_size_links = jQuery('#tools ul a');
	
	jQuery(font_size_links).bind('click', function(event) {
	     event.preventDefault();
	     var parent_li = jQuery(event.target).parent('li');
	     setActiveStyleSheet(jQuery(parent_li).attr('class') + '-fonts');
	});
	
	var print_link = jQuery('#print-link a')[0];
	jQuery(print_link).bind('click', function(event) {
	     event.preventDefault();
	     window.print();
	});	
    }    
}


jQuery(document).ready(function() {
    if(typeof access_code == 'object') {
        access_code.setup();
    }

    if(typeof tools == 'object') {
        tools.setup();
    }
        
    phobsSetupForm();
});
