// JavaScript Documentvar

var clickto=null;

var clickto2=null;





$(document).ready(function(){







$('.subcat').hide();
//$('#hhh').hide();


$('.heading89').css('cursor','pointer');

$('.heading89').click(function(){
$('.subcat').hide(500);
if($(this).children('ul').is(':hidden'))
{

   $(this).children('ul').show(500);

}else{

     $(this).children('ul').hide(500);

}



});





$("body").attr("id", "index");

Cufon.replace('.pname', {fontFamily: 'LeftistMonoSerif',color:'#6e704c'});

 Cufon.replace('.pro', {fontFamily: 'LeftistMonoSerif',color:'#6e704c'});

 Cufon.replace('.press', {fontFamily: 'LeftistMonoSerif',color:'#6e704c'});

 Cufon.replace('#press', {fontFamily: 'LeftistMonoSerif',color:'#6e704c'});

 Cufon.replace('.heading', {fontFamily: 'LeftistMonoSerif'});

 Cufon.replace('#cat', {fontFamily: 'LeftistMonoSerif'});

 Cufon.replace('.heading89', {fontFamily: 'LeftistMonoSerif',color:'#303300'});

 Cufon.replace('.grower a', {fontFamily: 'LeftistMonoSerif'});



$('.shoplist').hide();

Cufon.replace('.subcatli', {fontFamily: 'LeftistMonoSerif', color:'#303300'});
Cufon.replace($("#selected_id"), {fontFamily: 'LeftistMonoSerif',color:'#94b7b3'});

$('.heading').mouseover(function(){
var ck=getCookie("active");
var id=$(this).attr('id');
if(id!=ck){
Cufon.replace(this, {fontFamily: 'LeftistMonoSerif',color:'#94b7b3'});
}      $(this).css("cursor","pointer");
    });

$('.heading').mouseout(function(){
 var ck=getCookie("active");
 var id=$(this).attr('id');
    if(ck!=id)
    Cufon.replace(this, {fontFamily: 'LeftistMonoSerif',color:'#303300'});
    });
$('.heading').click(function(){
Cufon.replace(this, {fontFamily: 'LeftistMonoSerif',color:'#94b7b3'});
var id=$(this).attr('id');


if(id=='uuu'){
     $('.shoplist').hide();
    $('.subcat').toggle('slow');

}
else if(id=='shop'){
    $('#hhh').hide();
   $('.shoplist').toggle('slow');
   $('.subcat').hide();
  }else{try{
      setCookie("active",id);
    //  alert(getCookie("active"));
  }catch(err1){alert(err1);}
  if(id!='index')

      setCookie("sucatliid",null);

      window.location=id+".php";}



});

//code for subcategories *******************************88





//*******************************

$('.subcatli').mouseover(function(){

    var id=$(this).attr('id');

    var selected_id=getCookie('sucatliid');

    if(id!=selected_id)

    Cufon.replace(this, {fontFamily: 'LeftistMonoSerif',color:'#94b7b3'});



    });

$('.subcatli').mouseout(function(){

  var id=$(this).attr('id');

    var selected_id=getCookie('sucatliid');

    if(id!=selected_id)

Cufon.replace(this, {fontFamily: 'LeftistMonoSerif',color:'#303300'});

});

//$('#stockist').click(function(){
//   window.location='http://www.localhost.com/mq2aug/cms.php?id_cms=9';
//});

$('.subcatli').click(function(){

    $(this).parent('ul').parent('li').unbind('click');

    var id=$(this).attr('id');

    setCookie("active",null);

      setCookie("sucatliid",id);

    Cufon.replace('.heading', {fontFamily: 'LeftistMonoSerif',color:'#303300'});

  Cufon.replace('.subcatli', {fontFamily: 'LeftistMonoSerif',color:'#303300'});

  $(this).fontReplace({fontFile: 'LeftistMonoSerif'},'28','#94b7b3');

  var id=$(this).attr('id');


  if(id=='shop'){

  }else{



    return false;



      window.location=id;

  }

});

var show_active=getCookie('active');





if(show_active!=""||show_active!=null)

    {



    if(show_active=='shop')$('.shoplist').show();

    show_active=$("#"+show_active);

    Cufon.replace($(show_active), {fontFamily: 'LeftistMonoSerif',color:'#94b7b3'});

    }



var ck2=getCookie("sucatliid");
var rt=$('#'+ck2);



//$(rt).css('background','red');

Cufon.replace($(rt), {fontFamily: 'LeftistMonoSerif', color:'#94b7b3'});

$(rt).parent('ul').show();





});









function setCookie(key, value) {

var expires = new Date();

expires.setTime(expires.getTime() + 31536000000); //1 year

document.cookie = key + '=' + value + ';expires=' + expires.toUTCString();

}


function getCookie(key) {

var keyValue = document.cookie.match('(^|;) ?' + key + '=([^;]*)(;|$)');

return keyValue ? keyValue[2] : null;

}


