// cards rotate for holidays
var today = new Date(); var y = today.getYear(); var m = today.getMonth(); var d = today.getDate();
var hi = new Array(); var hn = new Array(); var hu = new Array()
hu[0] = "1195"; hi[0] = "musiccard/missu.gif"; hn[0] = "Missing You"
hu[1] = "1124"; hi[1] = "musiccard/love_1.jpg";  hn[1] = "I Love You"
hu[2] = "1013"; hi[2] = "musiccard/x6_1.jpg";     hn[2] = "Rose"
if(m == 10 && d>=15)
{	hu[0] = "1034"; hi[0] = "holidays/Hallowmas001_1.jpg"; hn[0] = "Happy Halloween"
        hu[1] = "1035"; hi[1] = "holidays/Hallowmas002_1.jpg"; hn[1] = "Halloween"
        hu[2] = "1190"; hi[2] = "holidays/FearHalloween1.gif"; hn[2] = "Halloween Fear"
} 
//christmas
if(m == 11 && d<=25)
{	hu[0] = "1037"; hi[0] = "holidays/Xma_004_1.jpg";  hn[0] = "Happy Christmas"
	hu[1] = "1109"; hi[1] = "holidays/2001_14_1.jpg";  hn[1] = "Great Christmas"
	hu[2] = "1140"; hi[2] = "musiccard/x6_1.jpg";	   hn[2] = "Happy Holidays"
} 
// new year
if((m == 11 && d>25) || (m ==0 && d<=15))
{	hu[0] = "1134"; hi[0] = "holidays/newyear2_1.jpg"; hn[0] = "Happy New Year"
        hu[1] = "1133"; hi[1] = "holidays/newyear1_1.jpg"; hn[1] = "New Year"
        hu[2] = "1135"; hi[2] = "holidays/newyear3_1.jpg"; hn[2] = "Happy Holidays"
}
// chinese new year
if((m == 0 && d>=20) || (m ==1 && d<0) || (m ==1 && d>=16))       
{       hu[0] = "1143"; hi[0] = "holidays/new2_1.jpg"; hn[0] = "Chinese New Year"
        hu[1] = "1198"; hi[1] = "holidays/ny2.jpg"; hn[1] = "Spring Festival"
        hu[2] = "1199"; hi[2] = "holidays/ny3.jpg"; hn[2] = "Gong Hee Fot Choy"
}    
// valentine
if(m ==1 && d>=0 && d<=15)
{       hu[0] = "1124"; hi[0] = "musiccard/love_1.jpg"; hn[0] = "I Love You"
        hu[1] = "1108"; hi[1] = "love_romance/love6_02_1.jpg"; hn[1] = "My Valetine"
        hu[2] = "1060"; hi[2] = "love_romance/Love008_1.jpg"; hn[2] = "I Wish"
}
// valentine
if(m ==4 && d>=0 && d<=15)
{       hu[0] = "1165"; hi[0] = "holidays/mother4.gif"; hn[0] = "Happy Mother's Day"
        hu[1] = "1163"; hi[1] = "holidays/mother2_1.jpg"; hn[1] = "MOM"
        hu[2] = "1064"; hi[2] = "holidays/mother3.gif"; hn[2] = "Love you, Mom!"
}

document.write("<table width=100% height=100%>");
for (i = 0; i <=2; i++)
{	document.write("<td align=center>");
	document.write("<a href=/cgi-bin/detail.pl?id=" + hu[i] + ">");
	document.write("<img src='/images/cards/" + hi[i] + "' border=0 width=120 height=100>");
	document.write("<br><font size=2>" + hn[i] + "</font>");
	document.write("</a>");
	document.write("</td>");
}

// cards in 2nd row
var id = new Array(); var name = new Array(); var path =new Array(); var flag = new Array();
for (i = 1; i <= 6; i++)
{       temp = parseInt(Math.random()*10+1);
        for (j = 1; j <= i; j++)
        {       if (temp == flag[j])
                {       temp = parseInt(Math.random()*10+1);
                } else {
                        flag[i] = temp;
                }
        }
}

id[1]="1017";   name[1]="Cloth Wombat";         path[1]  ="/images/cards/friendship/Bear1_1.jpg";
id[2]="1028";   name[2]="Love is forever";      path[2]  ="/images/cards/friendship/Miss003_1.jpg";
id[3]="1043";   name[3]="Chicken";              path[3]  ="/images/cards/humor/Chicken_1.jpg";
id[4]="1131";   name[4]="Good Night";           path[4]  ="/images/cards/care_concern/gn_1.gif";
id[5]="1005";   name[5]="Happy Birthday";       path[5]  ="/images/cards/birthdays/Birthday005_1.jpg";
id[6]="1059";   name[6]="All The Thanks";       path[6]  ="/images/cards/thank_you/Thank_you4_1.jpg";
id[7] = "1117"; name[7] = "My Love";            path[7]  = "/images/cards/love_romance/love1_13_1.gif";
id[8] = "1013"; name[8] = "Rose";               path[8]  = "/images/cards/care_concern/Rose_1.jpg";
id[9] = "1021"; name[9] = "Love Wish";          path[9]  = "/images/cards/friendship/Friendship001_1.jpg";
id[10] = "1096";name[10] = "Dear Friend";       path[10] = "/images/cards/friendship/friend1_05_1.jpg";


for (i = 1; i < 2; i++)
{	document.write("<tr>");
	for (j = 1; j <= 3; j++)
	{	document.write("<td align=center>");
		document.write("<a href=/cgi-bin/detail.pl?id=" + id[flag[i * 3 + j]] + ">");
		document.write("<img src=" + path[flag[i * 3 + j]] + " border=0 width=120 height=100>");
		document.write("<br><font size=2>" + name[flag[i * 3 + j]] + "</font>");
		document.write("</a>");
		document.write("</td>");		
	}
	document.write("</tr>");
}
document.write("</table>");

