<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>

    <head profile="http://gmpg.org/xfn/11">

        <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
        <meta name="title" content="Kronikoen Sarea, la red vasca de pacientes" />
        <meta name="description" content="Kronikoen Sarea, la red vasca de pacientes para las personas que conviven con una enfermedad crónica y quienes les acompañan. Gaixotasun kroniko bat duten pertsonen eta haiekin batera dauden lagunen sarea." />
        <meta name="keywords" content="Kronikoen Sarea, Kronet, enfermedad crónica, dolor crónico, asociaciones de pacientes, gaixotasun kronikoa, busco ayuda, conocer gente, País Vasco, gratis, salud, red social, Euskadi, con ánimo, gogotsu, paciente, cuidador, familiar, hijo enfermo, discapacidad, dudas, medicamentos, cuidados, estoy enferma, auto cuidado, cronicidad, crónico, crónica, sistema público salud, Osakidetza, fibromialgia, sida, tiroides, diabetes, vih, hipotiroidismo, epilepsia, esclerosis múltiple, artritis reumatoide"/>
        <meta name="author" content="Kronikoen Sarea" />
        
        <title><?php echo bp_get_page_title();?></title>

        <?php do_action( 'bp_head' ) ?>

        <meta name="generator" content="WordPress <?php bloginfo('version'); ?>" /> <!-- leave this for stats -->

        <link href="http://fonts.googleapis.com/css?family=Lato:100,300,400,700,900,100italic,300italic,400italic,700italic,900italic" rel="stylesheet" type="text/css">
        
        <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />

        <!--[if IE 8]>
            <link rel="stylesheet" type="text/css" media="screen, projection" href="<?php echo str_replace("style.css", "ie8.css", get_bloginfo( "stylesheet_url", 'display' )); ?>" />
        <![endif]-->

        <!--[if IE 7]>
            <link rel="stylesheet" type="text/css" media="screen, projection" href="<?php echo str_replace("style.css", "ie7.css", get_bloginfo( "stylesheet_url", 'display' )); ?>" />
        <![endif]-->

        <!--[if IE 6]>
            <link rel="stylesheet" type="text/css" media="screen, projection" href="<?php echo str_replace("style.css", "ie6.css", get_bloginfo( "stylesheet_url", 'display' )); ?>" />
        <![endif]-->

        <?php if ( function_exists( 'bp_sitewide_activity_feed_link' ) ) : ?>
            <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> | <?php _e('Site Wide Activity RSS Feed', 'buddypress' ) ?>" href="<?php bp_sitewide_activity_feed_link() ?>" />
        <?php endif; ?>

        <?php if ( function_exists( 'bp_member_activity_feed_link' ) && bp_is_member() ) : ?>
            <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> | <?php bp_displayed_user_fullname() ?> | <?php _e( 'Activity RSS Feed', 'buddypress' ) ?>" href="<?php bp_member_activity_feed_link() ?>" />
        <?php endif; ?>

        <?php if ( function_exists( 'bp_group_activity_feed_link' ) && bp_is_group() ) : ?>
            <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> | <?php bp_current_group_name() ?> | <?php _e( 'Group Activity RSS Feed', 'buddypress' ) ?>" href="<?php bp_group_activity_feed_link() ?>" />
        <?php endif; ?>

        <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> <?php _e( 'Blog Posts RSS Feed', 'buddypress' ) ?>" href="<?php bloginfo('rss2_url'); ?>" />
        <link rel="alternate" type="application/atom+xml" title="<?php bloginfo('name'); ?> <?php _e( 'Blog Posts Atom Feed', 'buddypress' ) ?>" href="<?php bloginfo('atom_url'); ?>" />

        <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
        <link rel="shortcut icon" href="<?php echo site_url() . '/favicon.ico'; ?>" type="image/x-icon" />

        <?php
        // Esto carga los plugins y lo basico de wordpress
        // En realidad es una mierda que cargue cosas que no vas a usar
        wp_head();
        ?>
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js"></script>
        <?php
        // FANCYBOX
        wp_deregister_script( 'fancybox' );
        wp_register_script( 'fancybox', get_stylesheet_directory_uri() .'/_inc/fancybox/jquery.fancybox-1.3.4.js' );
        wp_print_scripts( 'fancybox' );
        wp_deregister_style('fancybox-css');
        wp_enqueue_style('fancybox-css', get_stylesheet_directory_uri() .'/_inc/fancybox/jquery.fancybox-1.3.4.css');
        wp_print_styles('fancybox-css');

        // CUSTOM IRONTEC (Init fancybox, custom tabs and custom js code)
        wp_deregister_script( 'custom-irontec' );
        wp_register_script( 'custom-irontec', get_stylesheet_directory_uri() .'/_inc/custom-irontec/custom-irontec.js' );
        wp_print_scripts( 'custom-irontec' );

        // SLIDER-TUNNEL
        wp_deregister_script( 'sliderTunnel' );
        wp_register_script( 'sliderTunnel', get_stylesheet_directory_uri() .'/_inc/sliderTunnel/tunnel.js', '' );
        wp_print_scripts( 'sliderTunnel' );
        ?>

        <style>
        
        .entry-download a{
            width: 500px;
            text-decoration: none;
            width: 500px;
            background: url('<?php echo get_stylesheet_directory_uri() ?>/_inc/images/Home/ico-down.png') no-repeat 11px #F7F7FB;
            padding: 7px 15px 8px 28px;
            color: #A2A1AF;
            border-radius: 5px;
        }
        </style>
        
        <link rel="stylesheet" type="text/css" media="screen, projection" href="<?php echo get_stylesheet_directory_uri(); ?>/_inc/css/new-style.css" />        
        
        
<!--[if lt IE 9]>
<style>
body {
    font-weight: 400;
}
</style>
<![endif]-->    
        
    </head>

    <body <?php body_class() ?> id="bp-default">
    <base href="<?php  echo home_url(); ?>" />



    <div id="intro-login-box">
        <?php login_with_ajax(); ?>
        <div class="connect-bits">
            <?php
            //do_action('fbc_display_login_button')
            global $wpdb;
            
            $i = 0;
            
            foreach($_COOKIE as $key => $value) {
                if (preg_match("/kc[0-9*]/", $key)) {
                    
                    $key = str_replace("kc","",$key);
                    
                    if (!is_numeric($key)) {
                        continue;
                    }
                    
                    if ($i == 0) {
                        $i++;
                        echo '<br style="clear:both;" />';
                    }
                    
                    $query = "Select * from `".$wpdb->prefix."kconnect_satellites` where id = ".$key;
                    $site  = array_shift($wpdb->get_results($query));
                    
                    if (isset($site->siteName) and isset($site->logo) and ! empty($site->logo)) {
                        echo '<a href="'.home_url().'?kc='.$key.'" style="float:right;">
                        <img src="'.home_url().'/wp-content/plugins/irontec-kronet-connect/images/'.$site->logo.'" alt="'.$site->siteName.'"
                        title="'.$site->siteName.'" style="float: right; height: 18px; margin-right: 3px;" /></a>';
                    } else if (isset($site->siteName)) {
                        echo '<a href="'.home_url().'?kc='.$key.'" style="float: right; display:block;height: 18px; margin-right: 3px;">'.$site->siteName.'</a>';
                    }
                }
            }
            ?>
        </div>
    </div>