<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category    design
 * @package     default_modern
 * @copyright   Copyright (c) 2013 Magento Inc. (http://www.magentocommerce.com)
 * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
/**
 * @var Mage_Page_Block_Html_Header $this
 */
$checkout_link = Mage::helper('checkout/url')->getCheckoutUrl();

?>
<script type="text/javascript">
        jQuery(document).ready(function($) {
			
		  $('.menu ul li').mouseover(function(){
			 // alert($('.menu_sub ul').length);
			 var hildHtml= $(this).find('.menu_sub').html();
			 var hildHtmlUl= $(this).find('.menu_sub ul').html();

		//	 alert(hildHtml);
		 	 if(hildHtml!=null && hildHtmlUl != null){
				 $(".menu_data").html(hildHtml);				 
				 $(".menu_data").slideDown(2000);	
			 }else{
				 $(".menu_data").html('');				 
				 $(".menu_data").slideUp(2000);	 
			 }
		 });
		 
		 $(".menu_data,.menu").mouseleave(function(){
			$(".menu_data").slideUp(2000);  
			//alert("hi");
		  });
		 		 
          $('#banner-fade').bjqs({
            height      : 375,
            width       : 1000,
            responsive  : true
          });

         $("#submit-form-img").click(function(){
		
             if($('#search').val()!="Search..."){
				//$('#js-error').remove();
        	 	$("#search_mini_form").trigger('submit');
             }
             else
             {
				//$('#js-error').remove();
               // $('#search').after( "<span id='js-error'>Please enter any keyword</span>" );
				$('#search').css({"color":"red","margin-left":"-10px","width":"228","height":"36px","border":"solid 1px red","padding-left":"10px"});
			//	$('#search').val('Please enter some keyword');
             }
             })
        });
      </script>

<!--<div class="header-container">-->
<div class="header">
	<div class="header_top_belt">
        <div class="top_belt_left fleft"><?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('head-tag-line')->toHtml() ?></div>
        <div class="top_belt_right fright">
        <?php if (Mage::getSingleton('customer/session')->isLoggedIn()){ ?><a style="background:none;" href="<?php echo Mage::helper('customer')->getLogoutUrl();?>" title="Log Out"><img src="<?php echo $this->getSkinUrl('images/logout-icon.jpg'); ?>" /></a><?php }else{?><a style="background:none;" href="<?php echo Mage::helper('customer')->getLoginUrl();?>" title="Log In"><img src="<?php echo $this->getSkinUrl('images/singin-icon.jpg'); ?>" /></a><?php }?>
        <a href="<?php echo $this->getUrl('customer/account')?>" title="My account"><img src="<?php echo $this->getSkinUrl('images/myacount-icon.jpg'); ?>" /></a><a href="<?php echo $this->getUrl('checkout/cart')?> " title="Shopping basket"><img src="<?php echo $this->getSkinUrl('images/shopingcart-icon.jpg'); ?>" /></a><a href="<?php echo $checkout_link; ?>" title="Checkout"><img src="<?php echo $this->getSkinUrl('images/checkout-icon.jpg'); ?>" /></a><a href="<?php echo $this->helper('wishlist')->getListUrl()?> " title="Wish list"><img src="<?php echo $this->getSkinUrl('images/wishlist-icon.jpg'); ?>" /></a> 
        </div>
        <div class="clear"></div>
    </div>
    
    <?php /*?><?php if ($this->getIsHomePage()):?>
    <h1 class="logo"><strong><?php echo $this->getLogoAlt() ?></strong><a href="<?php echo $this->getUrl('') ?>" title="<?php echo $this->getLogoAlt() ?>" class="logo"><img src="<?php echo $this->getLogoSrc() ?>" alt="<?php echo $this->getLogoAlt() ?>" /></a></h1>
    <?php else:?>
    <a href="<?php echo $this->getUrl('') ?>" title="<?php echo $this->getLogoAlt() ?>" class="logo"><strong><?php echo $this->getLogoAlt() ?></strong><img src="<?php echo $this->getLogoSrc() ?>" alt="<?php echo $this->getLogoAlt() ?>" /></a>
    <?php endif?><?php */?>
    <div class="header-logo">
        <div class="header_left fleft">
<!--        <a href="<?php echo $this->getUrl('') ?>" title="<?php echo $this->getLogoAlt() ?>" class="logo"><img src="<?php echo $this->getLogoSrc() ?>" alt="<?php echo $this->getLogoAlt() ?>" /></a>-->
        <a href="<?php echo Mage::getBaseUrl();?>"><img src="<?php echo  Mage::getDesign()->getSkinUrl() ?>images/logos.png" id="search-img"/></a>
        </div>
        <div class="header_callus fleft"><?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('head-phone-number')->toHtml() ?></div>
        <div class="header_right_search fright">
    <?php   
        $catalogSearchHelper =  $this->helper('catalogsearch');
?>
<form name="search_mini_form" id="search_mini_form" action="<?php echo $catalogSearchHelper->getResultUrl() ?>" method="get">
    <div class="search fleft">
        <?php
//         if($catalogSearchHelper->getEscapedQueryText()=="")
//        {
//            $searchval = "Search...";
//        }else
//        {
//            $searchval = $catalogSearchHelper->getEscapedQueryText();
//        }
            ?>
        <input id="search" type="text" name="<?php echo $catalogSearchHelper->getQueryParamName() ?>" value="<?php echo $catalogSearchHelper->getEscapedQueryText() ?>" onfocus="if(this.value=='<?php echo $searchval ?>') this.value=''" onblur="if(this.value=='') this.value='<?php echo $searchval ?>'" class="input-text" maxlength="<?php echo $catalogSearchHelper->getMaxQueryLength();?>" />
                </div>
        <div class="search_ico fleft"><!--
            
            <button type="submit" title="<?php echo $this->__('Go') ?>" class="button"><span><span><?php echo $this->__('Go') ?></span></span></button>
-->
            <a href="#"><img src="<?php echo  Mage::getDesign()->getSkinUrl() ?>images/search_ico.png" id="submit-form-img"/></a>
        
        </div>
    <script type="text/javascript">
        //<![CDATA[
            var searchForm = new Varien.searchForm('search_mini_form', 'search', '<?php echo $this->__('Search...') ?>');
            searchForm.initAutocomplete('<?php echo $catalogSearchHelper->getSuggestUrl() ?>', 'search_autocomplete');
        //]]>
        </script>
</form>
        <?php //echo $this->getChildHtml('topBar') ?>
                <!--<div class="search fleft">
                        <input type="text" onblur="if(this.value=='')this.value='Search..';" 
                        onfocus=	"if(this.value=='Search..')this.value='';" value="Search..">
                </div>
                <div class="search_ico fleft"><a href="#"><img src="images/search_ico.png" /></a></div>-->
        </div>
        <div class="clear"></div>
    </div>
    <!--<p class="top-promo" title="<?php //echo $this->__('Free Shipping on orders over 50$'); ?>"><?php //echo $this->__('Free Shipping on orders over 50$'); ?></p>-->
    <?php //echo $this->getChildHtml('topMenu') ?>
</div>
<div class="menu">
      	<ul>
            	<li style="border-left:none;"><a href="<?php echo Mage::getBaseUrl();?>" title="Home">Home&nbsp;&nbsp;</a></li>
				<li>
                	<a href="<?php echo Mage::getBaseUrl();?>rings-5.html" title="rings">Rings&nbsp;&nbsp;<img src="<?php echo  Mage::getDesign()->getSkinUrl() ?>images/menu_drop_ico.png" /></a>
                    <div class="menu_sub">
                    
                    	
                    	<?php 
						$allCats = Mage::getModel('catalog/category')->getCollection()
			                ->addAttributeToSelect('*')
			                ->addAttributeToFilter('is_active','1')
			                ->addAttributeToFilter('include_in_menu','1')
			                ->addAttributeToFilter('parent_id',array('eq' => 10))
			                ->addAttributeToSort('position', 'asc');
			            if(count($allCats)>0):?> 
			            <ul>
			            <?php  
			            $rowcount = 0;   
			                foreach ($allCats as $cats):
			                	
			              $rowcount +=1; 
			                //echo "<br>". $cats->getRequestPath();
			                	$_categories = Mage::getModel('catalog/category')->load($cats->getId());
			                	 $_subcategories = $_categories->getChildrenCategories();
			                	 ?>
			                	 <li <?php if($rowcount==count($allCats)):?>class="sub_last_child" <?php endif;?>>
		                            	<h3><a href="<?php echo Mage::getBaseUrl().$cats->getRequestPath()?>"><?php echo $cats->getName()?></a></h3>
		                            	<?php 
			                	 if (count($_subcategories) > 0):
			                	 	foreach($_subcategories as $_subcategory):?>
			                	 		
			                	 		<a href="<?php echo $_subcategory->getUrl()?>"><?php echo $_subcategory->getName()?></a>
			                	 		
			                	 		<?php 
			                	 	endforeach;
			                	 endif;?>
		                            </li>
			                	 <?php  endforeach;?>  
                        </ul>
                        <?php endif;?>
                    </div>
                </li>
				<li>
				<?php 
						$allCats = Mage::getModel('catalog/category')->getCollection()
			                ->addAttributeToSelect('*')
			                ->addAttributeToFilter('is_active','1')
			                ->addAttributeToFilter('include_in_menu','1')
			                ->addAttributeToFilter('parent_id',array('eq' => 4))
			                ->addAttributeToSort('position', 'asc');?>
                	<a href="<?php echo Mage::getBaseUrl();?>earrings.html" title="earrings">Earrings&nbsp;&nbsp;<?php if(count($allCats)>0):?><img src="<?php echo  Mage::getDesign()->getSkinUrl() ?>images/menu_drop_ico.png" /><?php endif;?></a>
                    <div class="menu_sub">
                    	
                        <?php 	
			             if(count($allCats)>0):?> 
			            <ul>
			            <?php   
			                foreach ($allCats as $cats1):
			                	//echo "<br>". $cats->getRequestPath();
			                	$_categories = Mage::getModel('catalog/category')->load($cats1->getId());
			                	 $_subcategories = $_categories->getChildrenCategories();
			                	 ?>
			                	 <li>
		                            	<h3><a href="<?php echo Mage::getBaseUrl().$cats1->getRequestPath()?>"><?php echo $cats1->getName()?></a></h3>
		                            	<?php 
			                	 if (count($_subcategories) > 0):
			                	 	foreach($_subcategories as $_subcategory):?>
			                	 		
			                	 		<a href="<?php echo $_subcategory->getUrl()?>"><?php echo $_subcategory->getName()?></a>
			                	 		
			                	 		<?php 
			                	 	endforeach;
			                	 endif;?>
		                            </li>
			                	 <?php  endforeach;?> 
			            </ul>
                        <?php endif;?>
                    </div>
                </li>
				<li>
				<?php 
						$allCats = Mage::getModel('catalog/category')->getCollection()
			                ->addAttributeToSelect('*')
			                ->addAttributeToFilter('is_active','1')
			                ->addAttributeToFilter('include_in_menu','1')
			                ->addAttributeToFilter('parent_id',array('eq' => 5))
			                ->addAttributeToSort('position', 'asc');?>
                	<a href="<?php echo Mage::getBaseUrl();?>necklaces.html" title="necklaces">Necklaces&nbsp;&nbsp;<?php if(count($allCats)>0):?><img src="<?php echo  Mage::getDesign()->getSkinUrl() ?>images/menu_drop_ico.png" /><?php endif;?></a>
                    <div class="menu_sub">
                    	<?php if(count($allCats)>0):?> 
                    	<ul>
                    	<?php    
			                foreach ($allCats as $cats2):
			                	//echo "<br>". $cats->getRequestPath();
			                	$_categories = Mage::getModel('catalog/category')->load($cats2->getId());
			                	 $_subcategories = $_categories->getChildrenCategories();
			                	 ?>
			                	 <li>
		                            	<h3><a href="<?php echo Mage::getBaseUrl().$cats2->getRequestPath()?>"><?php echo $cats2->getName()?></a></h3>
		                            	<?php 
			                	 if (count($_subcategories) > 0):
			                	 	foreach($_subcategories as $_subcategory):?>
			                	 		
			                	 		<a href="<?php echo $_subcategory->getUrl()?>"><?php echo $_subcategory->getName()?></a>
			                	 		
			                	 		<?php 
			                	 	endforeach;
			                	 endif;?>
		                            </li>
			                	 <?php  endforeach;?>
			                	 
                        </ul>
                        <?php endif;?>
                    </div>
                </li>
				<li>
				<?php 
						$allCats = Mage::getModel('catalog/category')->getCollection()
			                ->addAttributeToSelect('*')
			                ->addAttributeToFilter('is_active','1')
			                ->addAttributeToFilter('include_in_menu','1')
			                ->addAttributeToFilter('parent_id',array('eq' => 6))
			                ->addAttributeToSort('position', 'asc');?>
                	<a href="<?php echo Mage::getBaseUrl();?>bracelets.html" title="bracelets">Bracelets&nbsp;&nbsp;<?php if(count($allCats)>0):?><img src="<?php echo  Mage::getDesign()->getSkinUrl() ?>images/menu_drop_ico.png" /><?php endif;?></a>
                    <div class="menu_sub">
                    <?php if(count($allCats)>0):?> 
                    	<ul>
                    	<?php   
			                foreach ($allCats as $cats3):
			                	//echo "<br>". $cats->getRequestPath();
			                	$_categories = Mage::getModel('catalog/category')->load($cats3->getId());
			                	 $_subcategories = $_categories->getChildrenCategories();
			                	 ?>
			                	 <li>
		                            	<h3><a href="<?php echo Mage::getBaseUrl().$cats3->getRequestPath()?>"><?php echo $cats3->getName()?></a></h3>
		                            	<?php 
			                	 if (count($_subcategories) > 0):
			                	 	foreach($_subcategories as $_subcategory):?>
			                	 		
			                	 		<a href="<?php echo $_subcategory->getUrl()?>"><?php echo $_subcategory->getName()?></a>
			                	 		
			                	 		<?php 
			                	 	endforeach;
			                	 endif;?>
		                            </li>
			                	 <?php  endforeach;?>
			                	 
                        </ul>
                        <?php endif;?>
                    </div>
                </li>
				<li style="border-right:none;">
				<?php 
						$allCats = Mage::getModel('catalog/category')->getCollection()
			                ->addAttributeToSelect('*')
			                ->addAttributeToFilter('is_active','1')
			                ->addAttributeToFilter('include_in_menu','1')
			                ->addAttributeToFilter('parent_id',array('eq' => 7))
			                ->addAttributeToSort('position', 'asc');?>
			                
                	<a href="<?php echo Mage::getBaseUrl();?>diamonds.html" title="diamonds">Diamonds&nbsp;&nbsp;<?php if(count($allCats)>0):?><img src="<?php echo  Mage::getDesign()->getSkinUrl() ?>images/menu_drop_ico.png" /><?php endif;?></a>
                    <div class="menu_sub">
                    	
                        	
			         <?php if(count($allCats)>0):?> 
                    	<ul>
                    	<?php        
			                foreach ($allCats as $cats4):
			                	//echo "<br>". $cats->getRequestPath();
			                	$_categories = Mage::getModel('catalog/category')->load($cats4->getId());
			                	 $_subcategories = $_categories->getChildrenCategories();
			                	 ?>
			                	 <li>
		                            	<h3><a href="<?php echo Mage::getBaseUrl().$cats4->getRequestPath();?>"><?php echo $cats4->getName();?></a></h3>
		                            	<?php 
			                	 if (count($_subcategories) > 0):
			                	 	foreach($_subcategories as $_subcategory):?>
			                	 		
			                	 		<a href="<?php echo $_subcategory->getUrl()?>"><?php echo $_subcategory->getName()?></a>
			                	 		
			                	 		<?php 
			                	 	endforeach;
			                	 endif;?>
		                            </li>
			                	 <?php  endforeach;?>
			                	 
                        </ul>
                     <?php endif;?>   
                    </div>
                </li>
           </ul>
            <div class="clear"></div>      
           <div class="menu_data" style="position:relative">
           		menu data
           </div>
           <div class="clear"></div>           
		</div>
			<div class="key-message with-content">
			    <a href="http://preciousjewelsuk.com/megento/special-offers-and-news" class="arrowed">Limited Time. 15% off Select Platinum Jewelry</a>
			</div>