jQuery.noConflict();
jQuery(document).ready(function(){
    jQuery.fn.exists = function(){
        return jQuery(this).length > 0;
    }
        
    jQuery('a.singleview').fancybox({
        'autoScale': true,
        'transitionIn': 'none',
        'transitionOut': 'none',
        'overlayOpacity': '0.6',
        'titleShow': true,
        'titlePosition': 'inside',
        'padding': 15,
        'overlayColor': '#000',
    });
	
	check1024CSS();
});

check1024CSS = function(){
	
	var browserWidth = 0, browserHeight = 0;
 
    if( typeof( window.innerWidth ) == 'number' ) {
        //Non-IE
        browserWidth = window.innerWidth;
        browserHeight = window.innerHeight;
    } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
        //IE 6+ in 'standards compliant mode'
        browserWidth = document.documentElement.clientWidth;
        browserHeight = document.documentElement.clientHeight;
    } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
        //IE 4 compatible
        browserWidth = document.body.clientWidth;
        browserHeight = document.body.clientHeight;
    }

    if (browserWidth <= 1024 || browserHeight <= 650) {
        if (!jQuery('#1024css').exists()) {
            var addtourl = "";
            if (jQuery.browser.msie) 
                addtourl = 'http://' + document.location.host + '/';
            jQuery('head').append('<link id="1024css" rel="stylesheet" href="' + addtourl + 'fileadmin/template/karate-seligenstadt/js/1024.css" type="text/css" />');
        }
    }
    
    if (browserWidth > 1024 && browserHeight > 650) {
        jQuery("#1024css").remove();
    }
}

window.onresize = check1024CSS;

