function MM_preloadImages() { var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} }
function GetDidUKnowText(){
var randomnumber=Math.floor(Math.random()*13);
var arrDidUknow=new Array();
arrDidUknow[0]="Goji berries are one of the most nutrient dense fruits with powerful antioxidants";
arrDidUknow[1]="Goji berries have 18 Amino Acids (six times higher than bee pollen to boost metabolism), including 8 essentials";
arrDidUknow[2]="By weight, goji berries have more beta carotene than carrots (to fight heart disease)";
arrDidUknow[3]="By weight, goji berries have more iron than spinach or steak";
arrDidUknow[4]="Goji berries naturally have 21 essential minerals, including germanium, an anti-cancer substance rarely found in foods ";
arrDidUknow[5]="Goji berries have 500 times more vitamin C by weight than oranges";
arrDidUknow[6]="Goji berries are loaded with vitamins A, C, B1, B2, and B6!";
arrDidUknow[7]="Goji berries display an insulin-like action that is effective in fat decomposition";
arrDidUknow[8]="Goji berries are a rich source of potassium";
arrDidUknow[9]="Goji berries are high in magnesium";
arrDidUknow[10]="Goji berries are native to the Himalayan Mountains of Tibet";
arrDidUknow[11]="Goji berries are known in Eastern medicine for energizing, longevity, fertility, and aphrodisiacal benefits";
arrDidUknow[12]="Goji berries have 10x more antioxidants than blueberries (per 100 grams)";
document.getElementById("divDidUKnow").innerHTML=arrDidUknow[randomnumber];
moveImg();}
function GetTestimonial() {
var rannum=Math.floor(Math.random()*3);
var arrTestmonial=new Array();
arrTestmonial[0]='<b>TESTIMONIALS:</b> They are not kidding when they say "packed with superfoods"! - Goji Fanatic from Minnesota';
arrTestmonial[1]='<b>TESTIMONIALS:</b> Good to know that there is something healthy that still tastes good out there - especially for kids! - NYC mom';
arrTestmonial[2]='<b>TESTIMONIALS:</b> I love these healthy little cookies and they satisfy my sweet tooth! - Des Moines mom';
document.getElementById("divTestimonial").innerHTML=arrTestmonial[rannum];}
function moveImg(){
var rannum=Math.floor(Math.random()*5);
var arrImg=new Array();
arrImg[0]="Images/Home/cherrycacao.jpg"
arrImg[1]="Images/Home/GingerWallnut.jpg"
arrImg[2]="Images/Home/mintchip.jpg"
arrImg[3]="Images/Home/Almondoat.jpg"
arrImg[4]="Images/Home/ChocoChip.jpg"
document.getElementById("imgCookeiMain").src=arrImg[rannum];
var altAttribute='';
    if(rannum==0) { altAttribute="Goji Cherry Cacao"; }
    else if(rannum==1) { altAttribute="Goji Ginger Walnut"; }
    else if(rannum==2) { altAttribute="Goji Orange MintChip"; }
    else if(rannum==3) { altAttribute="Goji Almond Oat"; }
     else if(rannum==4) { altAttribute="Goji Chocolate Chip"; }
    document.getElementById("imgCookeiMain").alt=altAttribute;   
    document.getElementById("imgCookeiMain").title=altAttribute; }
function AddtoBasket(ItemId,TypeId, Qty){
if(Qty>0) { window.location.href='ShoppingBasket.aspx?ID='+ItemId+'&TID='+TypeId+'&Qty='+Qty; }}
function PopulateShippingAddress(chkbox)
{
var chkBox = document.getElementById("chkSame");
var same = chkBox.checked;
if(same)
{
document.getElementById("txtAddressShipping").value=document.getElementById("txtAddress").value;
document.getElementById("TxtCityShipping").value=document.getElementById("txtCity").value;
document.getElementById("txtZipShipping").value=document.getElementById("txtZip").value;
document.getElementById("txtStateShipping").value=document.getElementById("txtState").value;
}
else
{
document.getElementById("txtAddressShipping").value='';
document.getElementById("TxtCityShipping").value='';
document.getElementById("txtZipShipping").value='';
document.getElementById("txtStateShipping").value='';
}
}
function QuantityValidator(txtId){    
if (document.getElementById(txtId)) { var qty; qty = document.getElementById(txtId).value;
if (qty == 0){ alert("Please enter quantity greater than zero."); document.getElementById(txtId).value = 1;return;}
else if (qty == "") { alert("Please enter quantity greater than zero."); document.getElementById(txtId).value = 1;return;}
else if (qty < 0) { alert("Please enter quantity greater than zero."); document.getElementById(txtId).value = 1;return;} } 
if(parseInt(qty)>0){document.getElementById(txtId).value=parseInt(qty);}
else{alert('Please enter quantity in digits.');document.getElementById(txtId).value=1;}}

