jQuery(document).ready(function() {
 // hides the slickbox as soon as the DOM is ready
  jQuery('.faq_a1').hide();
  jQuery('.faq_a2').hide();
  jQuery('.faq_a3').hide();
  jQuery('.faq_a4').hide();
  jQuery('.faq_a5').hide();
  jQuery('.faq_a6').hide();
  jQuery('.faq_a7').hide();
  jQuery('.faq_a8').hide();
  jQuery('.faq_a9').hide();
  jQuery('.faq_a10').hide();
  jQuery('.faq_a11').hide();
  jQuery('.faq_a12').hide();
  jQuery('.morecards').hide();
  jQuery('.buydrop').hide();
  jQuery('.chartdrop1').hide();
  jQuery('.chartdrop1b').hide();
  jQuery('.chartdrop2').hide();
  jQuery('.chartdrop2b').hide();
  jQuery('.chartdrop3').hide();
  jQuery('.chartdrop3b').hide();
  jQuery('.chartdrop4').hide();
  jQuery('.chartdrop4b').hide();
  jQuery('.chartdrop5').hide();
  jQuery('.chartdrop6').hide();
  jQuery('.chartdrop7').hide();

 // toggles the slickbox on clicking the noted link
  jQuery('a.faq_1').click(function() {
	jQuery('.faq_a1').slideToggle(200);
	return false;
  });
  jQuery('a.faq_2').click(function() {
	jQuery('.faq_a2').slideToggle(200);
	return false;
  });
  jQuery('a.faq_3').click(function() {
	jQuery('.faq_a3').slideToggle(200);
	return false;
  });
  jQuery('a.faq_4').click(function() {
	jQuery('.faq_a4').slideToggle(200);
	return false;
  });
  jQuery('a.faq_5').click(function() {
	jQuery('.faq_a5').slideToggle(200);
	return false;
  });
  jQuery('a.faq_6').click(function() {
	jQuery('.faq_a6').slideToggle(200);
	return false;
  });
  jQuery('a.faq_7').click(function() {
	jQuery('.faq_a7').slideToggle(200);
	return false;
  });
   jQuery('a.faq_8').click(function() {
	jQuery('.faq_a8').slideToggle(200);
	return false;
  });
    jQuery('a.faq_9').click(function() {
	jQuery('.faq_a9').slideToggle(200);
	return false;
  });
	 jQuery('a.faq_10').click(function() {
	jQuery('.faq_a10').slideToggle(200);
	return false;
  });
	  jQuery('a.faq_11').click(function() {
	jQuery('.faq_a11').slideToggle(200);
	return false;
  });
	   jQuery('a.faq_12').click(function() {
	jQuery('.faq_a12').slideToggle(200);
	return false;
  });
  jQuery('a.showall').click(function() {
	jQuery('.morecards').slideToggle(200);
	return false;
  });
  jQuery('a.hideall').click(function() {
	jQuery('.morecards').slideToggle(200);
	return false;
  });
  jQuery('a.showall').click(function () {
      jQuery(this).hide();
	  jQuery('a.hideall').show();
	  jQuery('#content-sand').css('min-height', '720px');
	  jQuery.cookie('allproducts', 'show');
	  return true;
    });
  jQuery('a.hideall').click(function () {
      jQuery(this).hide();
	  jQuery('a.showall').show();
 	  jQuery('#content-sand').css('min-height', '370px');
	  jQuery.cookie('allproducts', 'hide');
	  return true;
    });
	jQuery('a.buylink').click(function() {
	jQuery('.buydrop').slideToggle(200);
	return false;
  });
  jQuery('body').click(function() {
  jQuery('.buydrop').fadeOut('slow');
  jQuery('.chartdrop1').fadeOut('fast');
  jQuery('.chartdrop2').fadeOut('fast');
  jQuery('.chartdrop3').fadeOut('fast');
  jQuery('.chartdrop4').fadeOut('fast');
  jQuery('.chartdrop1b').fadeOut('fast');
  jQuery('.chartdrop2b').fadeOut('fast');
  jQuery('.chartdrop3b').fadeOut('fast');
  jQuery('.chartdrop4b').fadeOut('fast');
  jQuery('.chartdrop5').fadeOut('fast');
  jQuery('.chartdrop6').fadeOut('fast');
  jQuery('.chartdrop7').fadeOut('fast');
  jQuery('.buylink_active').removeClass('buylink_active').addClass('buylink');
});

jQuery('.buynow1').click(function() {
  jQuery('.chartdrop2').fadeOut('fast');
  jQuery('.chartdrop2b').fadeOut('fast');
  jQuery('.chartdrop3').fadeOut('fast');
  jQuery('.chartdrop3b').fadeOut('fast');
  jQuery('.chartdrop4').fadeOut('fast');
  jQuery('.chartdrop4b').fadeOut('fast');
  jQuery('.chartdrop5').fadeOut('fast');
  jQuery('.chartdrop6').fadeOut('fast');
  jQuery('.chartdrop7').fadeOut('fast');
});
jQuery('.buynow2').click(function() {
  jQuery('.chartdrop1').fadeOut('fast');
  jQuery('.chartdrop1b').fadeOut('fast');
  jQuery('.chartdrop3').fadeOut('fast');
  jQuery('.chartdrop3b').fadeOut('fast');
  jQuery('.chartdrop4').fadeOut('fast');
  jQuery('.chartdrop4b').fadeOut('fast');
  jQuery('.chartdrop5').fadeOut('fast');
  jQuery('.chartdrop6').fadeOut('fast');
  jQuery('.chartdrop7').fadeOut('fast');
});
jQuery('.buynow3').click(function() {
  jQuery('.chartdrop1').fadeOut('fast');
  jQuery('.chartdrop1b').fadeOut('fast');
  jQuery('.chartdrop2').fadeOut('fast');
  jQuery('.chartdrop2b').fadeOut('fast');
  jQuery('.chartdrop4').fadeOut('fast');
  jQuery('.chartdrop4b').fadeOut('fast');
  jQuery('.chartdrop5').fadeOut('fast');
  jQuery('.chartdrop6').fadeOut('fast');
  jQuery('.chartdrop7').fadeOut('fast');
});
jQuery('.buynow4').click(function() {
  jQuery('.chartdrop1').fadeOut('fast');
  jQuery('.chartdrop1b').fadeOut('fast');
  jQuery('.chartdrop2').fadeOut('fast');
  jQuery('.chartdrop2b').fadeOut('fast');
  jQuery('.chartdrop3').fadeOut('fast');
  jQuery('.chartdrop3b').fadeOut('fast');
  jQuery('.chartdrop5').fadeOut('fast');
  jQuery('.chartdrop6').fadeOut('fast');
  jQuery('.chartdrop7').fadeOut('fast');
});
jQuery('.buynow5').click(function() {
  jQuery('.chartdrop1b').fadeOut('fast');
  jQuery('.chartdrop2b').fadeOut('fast');
  jQuery('.chartdrop3b').fadeOut('fast');
  jQuery('.chartdrop4b').fadeOut('fast');
  jQuery('.chartdrop6').fadeOut('fast');
  jQuery('.chartdrop7').fadeOut('fast');
});
jQuery('.buynow6').click(function() {
  jQuery('.chartdrop1b').fadeOut('fast');
  jQuery('.chartdrop2b').fadeOut('fast');
  jQuery('.chartdrop3b').fadeOut('fast');
  jQuery('.chartdrop4b').fadeOut('fast');
  jQuery('.chartdrop5').fadeOut('fast');
  jQuery('.chartdrop7').fadeOut('fast');
});
jQuery('.buynow7').click(function() {
  jQuery('.chartdrop1b').fadeOut('fast');
  jQuery('.chartdrop2b').fadeOut('fast');
  jQuery('.chartdrop3b').fadeOut('fast');
  jQuery('.chartdrop4b').fadeOut('fast');
  jQuery('.chartdrop5').fadeOut('fast');
  jQuery('.chartdrop6').fadeOut('fast');
});

function mouseClick(elm)
{
	if (elm)
	{
		if (navigator.appName == 'Microsoft Internet Explorer')
		{ // IE
			elm.click();
		} else { // Everyone else
			var evt = document.createEvent("MouseEvents");
			evt.initMouseEvent('click', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
			elm.dispatchEvent(evt);
		}
	}
}

if (jQuery.cookie('allproducts') == 'show') {
	mouseClick(document.getElementById('allproducts'));
} else {
	jQuery('#content-sand').css('min-height', '370px');
}

jQuery('.buylink').click(function() {
    jQuery(this).toggleClass('buylink_active', 200);
	return false;
  }); 
  jQuery('a.buynow1').click(function() {
	jQuery('.chartdrop1').slideToggle(200);
	return false;
  });
  jQuery('a.buynow1').click(function() {
	jQuery('.chartdrop1b').slideToggle(200);
	return false;
  });
  jQuery('a.buynow2').click(function() {
	jQuery('.chartdrop2').slideToggle(200);
	return false;
  });
  jQuery('a.buynow2').click(function() {
	jQuery('.chartdrop2b').slideToggle(200);
	return false;
  });
  jQuery('a.buynow3').click(function() {
	jQuery('.chartdrop3').slideToggle(200);
	return false;
  });
  jQuery('a.buynow3').click(function() {
	jQuery('.chartdrop3b').slideToggle(200);
	return false;
  });
  jQuery('a.buynow4').click(function() {
	jQuery('.chartdrop4').slideToggle(200);
	return false;
  });
   jQuery('a.buynow4').click(function() {
	jQuery('.chartdrop4b').slideToggle(200);
	return false;
  });
   jQuery('a.buynow5').click(function() {
	jQuery('.chartdrop5').slideToggle(200);
	return false;
  });
   jQuery('a.buynow6').click(function() {
	jQuery('.chartdrop6').slideToggle(200);
	return false;
  });
   jQuery('a.buynow7').click(function() {
	jQuery('.chartdrop7').slideToggle(200);
	return false;
  });

});