

function displayresult(year, month, day, name) {

var date1 = new Date();

var date2 = new Date();

date1.setFullYear(1901,0,1);

date2.setFullYear(year,month-1,day);

var daymaster = new Array(10);

var astrology = new Array(12)

daymaster[0] = "6.gif"

daymaster[1] = "7.gif"

daymaster[2] = "8.gif"

daymaster[3] = "9.gif"

daymaster[4] = "10.gif"

daymaster[5] = "1.gif"

daymaster[6] = "2.gif"

daymaster[7] = "3.gif"

daymaster[8] = "4.gif"

daymaster[9] = "5.gif"





astrology[0] = "ox"

astrology[1] = "tiger"

astrology[2] = "rabbit"

astrology[3] = "dragon"

astrology[4] = "snake"

astrology[5] = "horse"

astrology[6] = "goat"

astrology[7] = "monkey"

astrology[8] = "rooster"

astrology[9] = "dog"

astrology[10] = "boar"

astrology[11] = "rat"



createCookie('daymaster',daymaster[days_between(date1, date2)% 10],1)

createCookie('animalresult',astrology[getanimalsign(year, month, day)],1)

createCookie('name',name,1)



document.location.href='http://www.baziforlove.com/daymaster_result.htm'



//document.getElementById('title1').innerHTML = 'Your Day Master is'

//document.getElementById('daymaster').src = 'images/' +daymaster[days_between(date1, date2)% 10]

//document.getElementById('animalresult').innerHTML = 'Your Animal Year is ' + astrology[getanimalsign(year, month, day)]

}







function displayresult2() {

var desc



if (readCookie('daymaster')== '1.gif') {

desc = 'Jia Wood is akin to the soaring California redwood, the solid oak tree, the strong cherry tree. Jia Wood people are upright, dependable types whose greatest weakness is a lack of tact. Jia Wood people call a spade, a spade, every time. They are frequently progressive-minded and keen on self-cultivation, but like the slow-growing tree, they take a long time to achieve their goals of self-improvement. Jia Woods are often single-minded, and not adaptive by nature. They usually only have one way of doing anything in life, and unless forced to do so, rarely never change their ways.<br><br>';

desc = desc + 'The Jia Wood man is a dependable sort, a shoulder to cry on and someone you can always rely on for support. You can talk, and he\'ll listen. Think Keanu Reeves (also a Jia Wood!). The Jia Wood man is always there for you, although you shouldn\'t expect him to be terribly useful in getting things done. They are always much better at just listening. The Jia Wood man is rarely a romantic, and you should certainly not expect him to understand subtlety in matters of courtship. In short, if you want flowers, ASK for them! Of all the 10 Day Masters, Jia Wood men are the least amenable to any sort of change so ladies, forget about changing him if he\'s a Jia Wood.<br><br>';

desc = desc +  'The Jia Wood lady is typically stubborn and hard-headed, and like her male counterpart, not great with the nuances of romance. This is not to say they don\'t like being wined and dined, but rather, they prefer it if you were outright about your intentions, please. Persistence is integral towards successfully winning the heart of a Jia Wood lady. She\'s not deliberately playing hard to get or being coy - it just takes a lot to get through to her that you\'re really serious. You\'ve got to show a lot of passion, decisiveness and never-say-die attitude. Unlike Jia Wood men, the Jia Wood lady is not entirely beyond changing for her man. But don\'t expect it to be an easy process!';

}

else if  (readCookie('daymaster')== '2.gif') {

desc = 'Yi Wood brings forth the visual image of ivy, creepers, flowers, twines, small plants and ferns. Yi Wood people are consummate networkers and manipulators numero uno. Like twines that wrap themselves around trees to reach the sunlight, Yi Wood people are not above using those around them, to get what they want. Sometimes, they go for a win-win scenario, other times, its not so win-win. Yi Woods come with an in-born understanding of the concept of leverage, and first-rate survival instincts.  Dirt rarely sticks to them, thanks to their inherent charm and their penchant for ensuring they have \'wriggle room\'. Before you know it, they\'ve got you wrapped around their little finger and eating out of their hand!<br><br>';

desc = desc + 'The Venus fly-trap best describes the Yi Wood woman because once she has you in her clutches, escape is indeed a challenge. The Yi Wood lady ensnares her man through a combination of charm, wit, sensuality, and just the right dose of intellectual challenge to keep things interesting. With their chameleonic nature - the Yi Wood lady is courtesan one minute, girlish coquette the next - they are consummately skilled at keeping their man interested. Most of the time, the Yi Wood lady has her man firmly wrapped around her little finger, and he doesn\'t even know it. She has a way of making him feel good about decisions that SHE has made for him! Courting the Yi Wood lady demands regular professions of your great affection, and endless displays of loyalty. Make her feel like a damsel in distress, and you are her knight in shining armour and she\'ll swoon!.<br><br>';

desc = desc + 'The Yi Wood man is charming, smooth, suave and the gift of the gab. Think Bill Clinton ladies, and you\'re not far off the mark - he\'s a Yi Wood. The problem with Yi Wood men is that they\'re fickle and with so many choices, have difficulty settling for one lady. Being a playa is almost second nature to the Yi Wood man. That is not to say that they can\'t commit but don\'t expect it to be easy to get him to agree to take the relationship to a more committed level. The Yi Wood man is the consummate believer in wriggle room and will always look to make sure he has not over-committed himself - alas, reasoned methods don\'t work with the Yi Wood man and a little good old fashioned histronics might just be the thing if you want something bad!';

}

else if  (readCookie('daymaster')== '3.gif') {

desc = 'Bing Fire is the fire of the sun - it is warming, radiant, and essential to the growth of all living things. Bing Fire people are magnanimous, generous, giving, and every single one of them will have a cause at heart that they support or contribute generously towards - they\'re particularly fond of education and environmental issues. Like the sun that rises in the East and sets in the West, Bing Fire people are very routine-driven until they hit a plateau, usually every 4 years or so, wherein seeking a new challenge (like suddenly deciding to do charity work, or taking a year off to travel) becomes paramount. Life is never dull with a Bing Fire person, but they are fiercely independent and the key to dealing with them is to give them their own space to shine, literally and figuratively.<br><br>';

desc = desc + 'The Bing Fire woman is the epitome of the modern independent woman. She is frequently ill-suited to early marriage, and typically those who marry early eventually grow to resent the perceived constraints of marriage. The Bing Fire woman should settle down once she has fulfilled all her dreams in life, and lived it up. Until then, its best that they play the field, or cohabit with their partners. The Bing Fire woman loves excitement, thrill and new experiences so little surprises are essential, along with keeping things fresh and interesting for them - a good dose of travel on an annual basis is essential if you are dating a Bing Fire lady. Whilst they will settle into a routine within the relationship, four years is about the maximum they can tolerate before the relationship starts hearing death knells. So always keep it interesting for them. The Bing Fire lady needs her space so do not attempt to control her or crowd her too much.<br><br>';

desc = desc + 'The Bing Fire man is fun to be with, warm and generous. He too needs his own space and independence, which sometimes makes the Bing Fire man reluctant to commit. There is a tendency to be a bit round and pudgy, but that just adds to their loveable, jolly temperament really. A relationship with a Bing Fire man is a very sensual one, and often the connection is at both an emotional, physical and intellectual level. The Bing Fire man rarely favours the older woman, and is usually inclined towards the young woman, rather than a woman his own age. Again, it\'s integral to keep things exotic, spicy, and interesting (especially in the bedroom), with as much travel as possible when you need some quality time together.';

}

else if  (readCookie('daymaster')== '4.gif') {

desc = 'Ding Fire is represented by the tall elegant candle, twinkling stars in the sky and flaming torches that illuminate the darkness of the night. Ding Fire people are natural motivators and cheerleaders - they lead the way, show people the path forward, inspire and illuminate. Like the flame that can flare up into a great fire, or burn as embers, Ding Fire people can rise to the occasion, or downplay themselves and lurk in the shadows, waiting for the right opportunity to shine again. Ding Fire people can be temperamental, fickle, sensitive and prickly sorts, but they are always thinking about others first, and themselves second and often need to be reminded that they must sometimes come first in their own lives. The most outstanding characteristic of the Ding Fire person is their filial nature - be it female or male, the number one person in any Ding Fire person\'s life, is their mother.<br><br>';

desc = desc + 'Ding Fire ladies come with a catch and that catch is mom. Whatever you do, make sure that her mother likes you,';

desc = desc + ' and all will be fine when it comes to dating and being in a relationship with a Ding Fire woman. If you\'re married to a Ding Fire woman, do not question her weekly, if not daily phone calls to mom. That\'s a non-negotiable part of her life so just accept it. The Ding Fire lady is usually a nightbird, so nocturnal activities usually appeal to them (think late night movies, or stargazing). They\'re strongly attracted to self-cultivation, alternative ideas and education so make cultural and intellectual activities part of the dating strategy - she might not find paintballing that fun, but an eclectic art gallery, a theatre show, or a wine-tasting might just be what it takes. A Neanderthal is not what a Ding Fire lady is keen on. Always be a gentleman (open doors, pull out chairs, don\'t swear) and never put too much pressure on her - this is the key to winning the Ding Fire lady\'s heart.<br><br>';

desc = desc + 'The Ding Fire man comes to you married - to his mother. Like the Ding Fire lady, momma is a non-negotiable factor in his life so get used to it from day one. If momma doesn\'t like you, then find a way for momma to like you or he\'ll soon be telling you \'he\'s just not that into you\'. Pride is something that is important to the Ding Fire man so it\'s integral that you don\'t show him up in public. Self-cultivation is also important to a Ding Fire man so it\'s important that you keep up with him intellectually and mentally because Mr Ding loves to read, and loves to garner knowledge and the last thing he wants is to be married to a dumb blonde. Remember, he\'ll date a pretty airhead and want to be seen with the female equivalent of bling on his arm, but he\'ll walk down the aisle with the woman who reminds him the most of his mother.';

}

else if  (readCookie('daymaster')== '5.gif') {

desc = 'Wu Earth is represented by mountains, rocks, pebbles and boulders. The typical Wu Earth is a solid character, who doesn\'t talk much, and is often slow to take action. They are ponderous, quiet types who often need to be \'shocked\' into taking action. Procrastination is a typical problem with Wu Earth people. Great at keeping secrets, they have quite a few of their own as well. The Wu Earth person is the soul of discretion (definitely not the one to kiss and tell!), but also, usually not big on spouting their feelings to all and sundry. But when they are chatty, they are jolly, fun souls to be around and can be bawdy and rancorous.<br><br>';

desc = desc + 'Except in certain manifestations, the Wu Earth woman is usually on the stocky side, although they can also be very curvy. An air of mystery always surrounds the Wu Earth lady, and that is her inherent enduring appeal. Ms Wu Earth is not one to be trifled with - whilst she\'s slow to take action, when she\'s on a roll, nothing can stop her. So whilst it takes a lot to provoke a Wu Earth woman, if she finds out you\'ve been two-timing, prepare to be squashed. Literally and figuratively. Getting through to the Wu Earth lady can be a real challenge - she is supremely stubborn and impossible to budge, in every sense of the word, once she has made a decision. So if she\'s said no to you, don\'t expect her to change her mind easily. Outdoorsy type activities with an element of thrill usually appeal to the Wu Earth lady and you may have to force her hand, but she\'ll soon see the fun in some whitewater rafting, or canyoneering.<br><br>';

desc = desc + 'The Wu Earth man usually has a rotund or round appearance, or a highly chiselled face. The strong silent type perfectly personifies Mr Wu Earth and there\'s often a great deal of mystery that surrounds him - from his past, to his deepest thoughts, to the way he thinks. Needless to say, like his female counter, Mr Wu is can be an extremely stubborn man. He can be a procrastinator, and doesn\'t usually like to move around a lot so don\'t suggest activities that involve a lot of running around  as he\'s probably not keen on it. Mr Wu Earth would love nothing more than a day at the beach spent reading a book. The Wu Earth man is not one for writing romantic letters - it takes him far too long to assemble his thoughts, much less pen them down and put the letter into the post. So take your cues from actions, rather than words. The Wu Earth man usually has a penchant for cars, or collecting miniatures.';

}

else if  (readCookie('daymaster')== '6.gif') {

desc = 'Ji Earth is represented by mallable, pliant earth, soft nurturing soil and rich, nourishing volcanic earth. The inherent instinct of Ji Earth people is to protect, nurture and develop. Ji Earth are the most tolerant of the 10 Day Masters. They are sometimes guilty of being too giving. Ji Earth people often have many hidden talents and abilities, which often come to fore gradually, like a seed grows into a plant. Whilst Ji Earth people commonly have an inherent instinct for money, and strong entrepreneurial leanings, they are also the most easily corrupted by money, and the most prone to problems with their finances.<br><br>';

desc = desc + 'The Ji Earth woman is the epitome of the serial monogamist. The Ji Earth woman would generally hesitate to wholeheartedly agree with the view that a woman needs a man like a fish needs a bicycle. No, the Ji Earth lady needs a man ';

desc = desc + ' - with a man in her life, comes direction, focus, certainty and discipline. Ji Earth ladies are generally very keen on matrimony and commitment, and for good reason. For most Ji Earth ladies, life generally changes for the better when they have a man in their life. Indeed, for the Ji Earth lady, upon becoming attached, will typically see improvements in her life - from career advancement to being a more \'together\' person, losing their typical scattiness and disorganised ways. The Ji Earth lady always has her secrets and it is best not to conduct an archaeological dig on her life. Respect that she has a private side to her, and know that those will emerge, when she is well and ready to tell you about them. The Ji Earth lady loves nothing else than a good project that she can pour her nurturing tendencies into - be it reforming your clothes sense, turning you into a better man or cleaning out your house.<br><br>';

desc = desc + 'The Ji Earth man is usually quiet and unassuming, but there is often a great talent within them that is waiting to come to the fore and blossom. They are often highly attractive to women, because they emit vibes that make women feel they are trustworthy and comforting. Whilst the Ji Earth man is always supportive of you and your goals, don\'t expect him to show you too much leadership. The Ji Earth man will never tell you what to do - instead, he\'ll endeavour to guide you to a solution. When dating a Ji Earth man, don\'t pile on the pressure and don\'t be too strong because the Ji Earth man can crumble under the pressure of a woman who is too intense for him. Be a gentle presence, flit and out of his life, and listen when he talks.';

}

else if  (readCookie('daymaster')== '7.gif') {

desc = 'Geng Metal is represented by unforged iron ore, raw metal, the sharp and powerful sword, and the battle axe. Geng Metal people come into this world imperfect, flawed and frequently lazy. But through discipline, focus and hardship, they eventually emerge as solid, tough characters, imbued with a sense of responsibility and a drive for perfection. Not all Geng Metals turn out this way  Not every Geng Metal can be forged from raw metal into Excalibur. Some will remain unfinished works all their lives. But be it a shiny sword, or raw metal, Geng Metal people place a high premium on justice, fairplay, and comradeship. Though they may often procrastinate about a decision or whine about a situation, ultimately, their inner toughness shows.<br><br>';

desc = desc + 'The Geng Metal woman is a tough nut to crack. Chasing after the Geng Metal woman is a bit gladiatorial and you need to be able to go the distance with her. The Geng Metal woman can probably outdrink, outrun and possibly outslug you, if it came down to that. This is not to say she cannot be elegant and feminine (think Eva Longoria,who is Geng Metal) but don\'t be fooled by a pretty exterior. Underneath, she\'s all steel - a tough cookie by any other name. The Geng Metal lady does not like unpredictability in her man, and expects total loyalty in the relationship. And whilst she will prove to probably be the most stubborn woman you have ever dated, she is also endearingly loyal to you, and will defend you to the death. The going is always tough at first with the Geng Metal lady, but once she warms to you, there is no turning back!<br><br>';

desc = desc + 'The trick to winning the heart of a Geng Metal man is to play the damsel in distress to the hilt. The Geng Metal man is inherently imbued with hero complex so whatever you do, make him feel like he is your hero. He wants nothing more than to feel useful to you and able to do things for you so never over-do the strong, independent woman part. It is essential to remember that once the Geng Metal man has fallen under your spell, you can get him to do what you want, as long as you make it seem like you can\'t do it without his help. Let him manage your life (or at least think he\'s managing things) and always make him feel like he\'s THE MAN. The Geng Metal man can be prone to laziness and procrastination but of all the ten Day Masters, the Geng Man responds best to a little \'training\' so get him used to the way you like things running in your relationship (set out the rules) and he\'ll soon come around to things your way.';

}

else if  (readCookie('daymaster')== '8.gif') {

desc = 'Xin Metal is represented by fine jewellery, small knives, diamonds and glittering gold. Think Cartier, Bulgari and Swiss Army knife and you\'re not far off. Xin Metal people are inherently talkative and attention seeking. Wallflower is the consummate opposite of the Xin Metal person - indeed, if you\'re dating a quiet Xin Metal, then something\'s wrong with them! All Xin Metal\'s exhibit some measure of vanity, be it intellectual,or physical. The Xin Metal person is always thinking and their mind needs constant stimulation and occupation. They come in-born with a superiority complex, and can be quite bourgeois in their ways, loving the fine things in life.<br><br>';

desc = desc + 'The Xin Metal woman can be a challenge to handle - ice princess, snobbish, and egalitarian, these are some of the words that describe the Xin Metal woman. The Xin Metal woman has absolutely no tolerance for fools, ';

desc = desc + 'and an even lower tolerance for a lack of class. She demands intellectual stimulation and places a high premium on her man being her equal, if not better than her. She will not get off her high-horse on this matter so either catch up, or don\'t even bother to put yourself in contention for her affections. The Xin Metal woman can talk dirty with the best of them, but at the same time, presents the image of purity and propriety. Romance is integral to succeeding with the Xin Metal woman - wine and dine her, put a little glamour and spectacle in your courtship, display some intelligence in your romance strategy, and most importantly, show a little old-fashioned gentlemanliness. If you get all this together,  she\'ll deign to descend from her ivory tower. Until then, begone unworthy one. Be forewarned if you should cross the Xin Metal woman - prepare for death by a thousand cuts for the Xin Metal woman is the consummate plotter-schemer.<br><br>';

desc = desc + 'The Xin metal man is the consummate vainpot - indeed, many Xin Metal men are often accidentally assumed to be gay, because they tend to exhibit metrosexual tendencies.';

desc = desc + ' They are fussy about small things, typically have lots of opinions, can be petty, are highly animated, and are talkative. They also love being the center of attention. If you are dating a Xin Metal man, make sure you have a his and hers closet and separate mirror, or his and hers bookshelves for Xin Metal men are either physically vain or intellectually vain. Nuances, subtlety and good taste are extremely important to the Xin Metal man, and they loath ostentatiousness and vulgarity of any sort. This doesn\'t mean they are puritanical - it just means whilst everyone else does bawdy, they do sexyback. The Xin Metal man likes to be intellectually challenged and they like nothing more than a good debate. So the silent type of woman really doesn\'t work with a Xin Metal man, who can talk the hind legs of a donkey. But remember at the end of the day, Mr Xin Metal hates to be wrong. So challenge, excite and debate with him, but always make him feel like he comes out tops.';

}

else if  (readCookie('daymaster')== '9.gif') {

desc = 'Ren Water is the great lakes, the deep ocean, the ever-flowing river. Ren Water people are always on the move, and are not the type to sit still. Still waters run deep and it is often difficult to know what is on the mind of a Ren Water person. They are often dynamic individuals, who can be intensely single-minded. When they have set their mind on something, they will usually stop at nothing to achieve their goals. There is a tendency for Ren Water people to be moody and temperamental, like the ebb and flow of the tide and often, understanding them is a matter of appreciating their dynamic personality and what is driving them at any point in time.<br><br>';

desc = desc + 'The Ren Water lady is perhaps the most challenging type of female, of all the 10 Day Masters. The Ren Water lady is inherently difficult to please, with almost zero tolerance for fools and f*** wittage. She is demanding, capable of being petulant, disdainful of weakness, yet expects all the conventions of romance and passion from her man. To borrow an analogy from Grey\'s Anatomy, her man needs to know when to alternate between being Preston Burke, and when to be McDreamy. Love is always a toss up for the Ren Water woman - should she chose the powerful, charismatic, strong man who refuses to obey her beck and call, or the romantic, sweet but spineless wonder who adores the ground she walks on? The Ren Water lady may be a serial monogamist, but trust us, she can date like a man. And hell hath no fury like a Ren Water lady scorned so always try to break-up nicely with them.<br><br>';

desc = desc + 'The Ren Water man is the strong, silent sort - not much of a talker, and more of a do-er, he won\'t profess his affections overtly, but he might just oh, buy you a car, and give you the key. But whilst the Ren Water man can be rather businesslike in his manner of expressing his affections, passion and romance are not unimportant in his life. So he does enjoy the little gestures and romantic things YOU do and he is sentimental about the relationship. He\'s just not the sort to advertise it on his sleeve. Date a Ren Water man and chances are, he\'ll be married to his job and you. So accept his career as part of him, and all will be well. Mr Ren Water is the goal-setting type so keep him \'informed\' on the milestones of your relationship - here\'s where we are, here\'s where we need to get to - to ensure progress. But do remember he\'s a manager at heart, so don\'t be surprised if he comes back with a 5 year relationship roadmap done in Powerpoint!';

}

else if  (readCookie('daymaster')== '10.gif') {

desc = 'Gui Water is the rain, the mist, fine droplets of water and gentle showers. Gui Water people are nurturing, inherently soft-hearted, naive and child-like. They are very innocent and can be gullible about the realities of life, no matter how mature they are. The Gui Water person is inherently fickle-minded, never able to stay in one place for too long, and they flit from interest to interest, seeking that which they can pour over, nurture and bring to fruition, like the rain nurtures the acorn into a tree.<br><br>';

desc = desc + 'Gui Water women are temperamental. In a relationship, they expect their man to provide them with clarity and certainty about the relationship. In short, she might not be able to make up her mind, but she expects YOU to know where its all going. The Gui Water man can be a bit of a player, indeed, they enjoy a preponderance of female attention. However, this is more for ego purposes, and to make them feel good about themselves.<br><br>';

desc = desc + 'The Gui Water man can be hard to pin-down as they\'re forever on the go so if you\'re dating a Gui Water man, be prepared to keep up with his ever-changing interests. When the time comes, wholeheartedly support (or at least appear to support) his preferred hobby horse and never come between a Gui Water man and his friends.';

}



document.getElementById('daymasterdesc').innerHTML = desc;





document.getElementById('title1').innerHTML = readCookie('name') + ', Your Day Master is';

//document.getElementById('daymaster').src = 'images/' +readCookie('daymaster');
document.getElementById('daymaster').innerHTML = '<img src="images/' +readCookie('daymaster')+'">';

document.getElementById('animalresult').innerHTML = 'Your Animal Year is ' + readCookie('animalresult');

document.getElementById('animalpic').src = 'images/ico_' +readCookie('animalresult') + '.gif';

}





function monthlyoutlook(){

document.location.href='http://www.baziforlove.com/monthlyoutlook.htm#'+readCookie('daymaster').replace('.gif','')

}







function getanimalsign(year, month, day){

var selected

selected = (year -1901)%12;

if (month == 2) {

	if (day <= 4 ){

		return selected-1;	

	}

	else

	{

	return selected;

	}

}

else{

	return selected;

}

}









function days_between(date1, date2) {



    // The number of milliseconds in one day

    var ONE_DAY = 1000 * 60 * 60 * 24



    // Convert both dates to milliseconds

    var date1_ms = date1.getTime()

    var date2_ms = date2.getTime()



    // Calculate the difference in milliseconds

    var difference_ms = Math.abs(date1_ms - date2_ms)

    

    // Convert back to days and return

    return Math.round(difference_ms/ONE_DAY)

}









function createCookie(name,value,days) {

	if (days) {

		var date = new Date();

		date.setTime(date.getTime()+(days*24*60*60*1000));

		var expires = "; expires="+date.toGMTString();

	}

	else var expires = "";

	document.cookie = name+"="+value+expires+"; path=/";

}



function readCookie(name) {

	var nameEQ = name + "=";

	var ca = document.cookie.split(';');

	for(var i=0;i < ca.length;i++) {

		var c = ca[i];

		while (c.charAt(0)==' ') c = c.substring(1,c.length);

		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);

	}

	return null;

}



function eraseCookie(name) {

	createCookie(name,"",-1);

}