<?php
/**
 * The Header for our theme.
 *
 * Displays all of the <head> section and everything up till <div id="main">
 *

 */
?><!DOCTYPE html>
<html <?php language_attributes(); ?>>


<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
 <title><?php bloginfo('name'); ?> <?php wp_title(); ?></title>
 <link href="<?php bloginfo('template_directory'); ?>/images/favicon.png" rel="shortcut icon" type="image/x-icon" />
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<script type="text/javascript" language="javascript" src="<?php bloginfo('template_directory'); ?>/js/jquery.js"></script>
<script type="text/javascript" language="javascript" src="<?php bloginfo('template_directory'); ?>/js/jquery.cycle.all.js"></script>

<link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,300,400' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Marcellus' rel='stylesheet' type='text/css'>

<script type="text/javascript">

$(document).ready(function() {
	$('#slider').cycle({ 
    fx: 'fade', 
    delay: -2000 ,
    timeout: 4000, 
	next:   '#next',
    prev:   '#prev',
	vertical: true,
	pager:  '#nav1' ,
    pause:   1 
});

});
	
</script>

<?php
	/* We add some JavaScript to pages with the comment form
	 * to support sites with threaded comments (when in use).
	 */
	if ( is_singular() && get_option( 'thread_comments' ) )
		wp_enqueue_script( 'comment-reply' );
		global $options;global $logo;global $copyrite;
		$options = get_option('cOptn');
		$logo = $options['logo'];
		$copyrite = $options['copyrite'];
		$size = 300;
		$options['logo'] = wp_get_attachment_image($logo, array($size, $size), false);
		$att_img = wp_get_attachment_image($logo, array($size, $size), false); 
		$logoSrc = wp_get_attachment_url($logo);
		$att_src_thumb = wp_get_attachment_image_src($logo, array($size, $size), false);

	/* Always have wp_head() just before the closing </head>
	 * tag of your theme, or you will break many plugins, which
	 * generally use this hook to add elements to <head> such
	 * as styles, scripts, and meta tags.
	 */
	wp_head();
?>

</head>

<body <?php body_class(); ?>>

<div class="maincontainer">
	<div class="wrap">
    	
        <div class="topbar">
    		<div class="leftarea">
            	<?php echo $options['welcome']; ?>
            </div>        
            <div class="rightarea">
            	<?php wp_nav_menu( array( 'menu'=>'topmenu' ) ); ?>
            </div>        
        </div>

		<div class="header">
        	<div class="logo">
            	<a href="/"><img src="<?php echo $logoSrc; ?>" width="143" height="78"></a>
            </div>
            <div class="nav">
            	<?php wp_nav_menu( array( 'menu' ) ); ?>
            </div>
        </div>

        <?php if(is_home()){ ?>
        <div style="position:relative;" class="head-slider">
          <div id="slider"> 
        
              <?php $slider = new WP_Query(array( 'post_type' => 'Slider', 'posts_per_page' => -1 )); ?>
              <?php while ($slider->have_posts()) : $slider->the_post(); ?>
        
                  <div>
                       
                      <div class="caption">
                        <div class="text">
                            <?php $title = get_the_title(); ?>
                            <h2><?php multiColor($title,1); ?></h2>
                    		<p>
								<?php   
								  $newcontent= get_the_content();
								  $newcontent=substr($newcontent, 0, 150); 
								  $newcontent=strip_tags($newcontent);
								  echo $newcontent."";
                                ?>                            	
                            </p>
                            <a href="<?php the_permalink(); ?>">read more about this project  >></a>
                        </div>
                      </div>
                      
                      <?php the_post_thumbnail(); ?>
                  </div>
                
              <?php endwhile; wp_reset_query(); ?>    
              
          </div>
          
        </div>
         <br class="clear">
        <?php }elseif(is_page()){ ?>
        <div style="position:relative;" class="head-slider">
          <div id="slider"> 
        
			<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
        
                  <div>
                       
                      <div class="caption">
                        <div class="text">
                            <?php $title = get_the_title(); ?>
                            <h2><?php multiColor($title,1); ?></h2>                    		
                        </div>
                      </div>
                      
                      <?php if ( has_post_thumbnail() ){ the_post_thumbnail(); }else{ ?>
                      	<img src="<?php bloginfo('template_directory'); ?>/images/slide.jpg">
                      <?php } ?>
                      
                  </div>
                
              <?php endwhile; wp_reset_query(); ?>    
              
          </div>
          
        </div>
        <?php } ?>

       

		


