	/**
	  * @category    Interface
	  * @package	ICONnet
	  * @author		Bilal Cinarli
	  * @copyright	2005 - 2010 ICON Perception Management Co.
	  * @license
	  * @version
	  * @filesource
	  * @link		http://www.iconpm.com
	  * @see
	  * @since
	  **/


jQuery.cookie = function(name, value, options) {
    if (typeof value != 'undefined') { // name and value given, set cookie
        options = options || {};
        if (value === null) {
            value = '';
            options.expires = -1;
        }
        var expires = '';
        if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
            var date;
            if (typeof options.expires == 'number') {
                date = new Date();
                date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
            } else {
                date = options.expires;
            }
            expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
        }
        // CAUTION: Needed to parenthesize options.path and options.domain
        // in the following expressions, otherwise they evaluate to undefined
        // in the packed version for some reason...
        var path = options.path ? '; path=' + (options.path) : '';
        var domain = options.domain ? '; domain=' + (options.domain) : '';
        var secure = options.secure ? '; secure' : '';
        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
    } else { // only name given, get cookie
        var cookieValue = null;
        if (document.cookie && document.cookie != '') {
            var cookies = document.cookie.split(';');
            for (var i = 0; i < cookies.length; i++) {
                var cookie = jQuery.trim(cookies[i]);
                // Does this cookie string begin with the name we want?
                if (cookie.substring(0, name.length + 1) == (name + '=')) {
                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                    break;
                }
            }
        }
        return cookieValue;
    }
};




  (function($){$(document).ready(function(){
        $(".slide").iconuiClickable();
        $("#q").iconuiFocus();
        
        $('a#resize').toggle(function(){
            $("*").css({'font-size':'100%'});
            $("h1,h2,h3,h4,h5,h6").css({'font-size':'140%'});
            $(".slide-content *").css({'font-size':'100%'});
            $("#slogan *").css({'font-size':'115%'});
            $.cookie('fontsize','big',{path: '/'})
        },function(){
            $("*").css({'font-size':''});
            $.cookie('fontsize','normal',{path: '/'})
        })

        if($.cookie('fontsize')=='big'){
            $('a#resize').trigger('click')
        }
        
        
        $("#ticker").iconuiMediaRotator({navigation: '#ticker-nav', transition: 'vslide'});
        $("#pslider").iconuiMediaRotator({navigation: '#pslider-nav', transition: 'fade'});
        $("#labslider").iconuiMediaRotator({navigation: '#labslider-nav', transition: 'fade', slideShowDelay : '3000'});
        $("#tipslider").iconuiMediaRotator({navigation: '#tipslider-nav', transition: 'fade', slideShowDelay : '3000'});
        $(".bulten-liste a:not(.right-icon)").colorbox({opacity: '0.5',width:900, onLoad: function() {$('#cboxClose').css({position:'absolute',top:0})}});
        $(".next-link-trigger").click(function(){$(this).next().trigger('click');})
        
        $('.newspaper-right h4 a').click(function(){
            
            var theurl = $(this).attr('href');
            
            $.ajax({url:theurl, success:function(r){
                    var content = $(r).find('#main.article').html();
                    content = '<div class="article" style="padding:0 10px">'+content.replace('/<a href="javasci" .* <\/a>/','')+'</div>'
                    $.colorbox({ html:content, width:900, maxHeight:'90%', onLoad: function() {$('#cboxClose').css({position:'absolute',top:0,'float':'right'})}});
            }})
            
            
            return false;
        })
        

    })
})(jQuery);
