


// Code written by Natalie V. Zubar (kopilka@infocom.kharkov.ua)
 
 
function mod(x, x_div){
    for (var i=x; i>=x_div; i -= x_div);
    return i;
}
 
function checkNum(str, min, max) {
    if (str == "") {
        alert("Don't leave it blank!");
        return false;    }
 
    for (var i = 0; i < str.length; i++) {
        var ch = str.substring(i, i + 1);
        if (ch < "0" || ch > "9") {
            alert("Number, please!");
            return false;
        }
    }
 
    var val = parseInt(str, 10);
    if ((val < min) || (val > max)) {
        alert("Type in a number from 1 to "+max+".");
        return false;
    }
 
    return true;
}
 
 
 
function pastlife(form){
	var sex; 
 
//Check for a valid date			
 
     if ((checkNum(form.day.value,1,31)) && (checkNum(form.month.value,1,12)) &&
        (checkNum(form.year.value,0,99)))  {	
	var day = parseInt(form.day.value,10);
	var cur_month = parseInt(form.month.value,10);
	var cur_year = parseInt(form.year.value,10);
 
// define past life sex
 
	if (cur_month-2*(parseInt(cur_month/2)) == 0){
		if (cur_year - 4*(parseInt(cur_year/4)) == 0)
			sex = 1; else sex = 2} 
  	      else if (cur_year - 4*(parseInt(cur_year/4)) == 0)
			sex = 0; else sex = 1};
 
 
 
	msgWindow=window.open("","msgWindow","toolbar=0 status=0,width=400,height=400,scrollbars=1");
	msgWindow.document.open(); 
	msgWindow.document.bgColor="white"; 
	msgWindow.document.writeln("<FONT Color=black Face=Arial><B><I><BIG>Your Birthdate -- Its Meaning for Past Life and Present:</I></B></BIG></FONT><br><HR color=red height=3><br>");	
	msgWindow.document.write("<FONT Color=black Face=Arial size=2><b>"); 
	msgWindow.document.write("This life's birthdate reveals that you were ");
	

 
 
	var yearString = "ZYXWOTZYQVUTSXWVNZYXPQTZRWVUMYXWOTZYQVUTSXWVNZYXPUTZRWVUMYXWOTZYQVUTSXWVNZYXPUTZRWVUMYXWOTZYQVUTSXWV";
 
	var ys; ys = yearString.charAt(cur_year);
 
	var p1; var p2; var place;
	if (sex == 1){
 
		msgWindow.document.write("<FONT color=navy;>male</FONT>");
 
 
 
	//for males	
 
 
 
	var indexString = "VTWZXYURPSOMNQYWZVTUXOMPSQRNWUXTYZVMRNQOPSUZVYWXTRPSOMNQTYUXVWZPNQMRSOYWZVTUXNSORPQM";
 
	
 
	var profString = "CDBADCABBACD";
 
		
 
	p1 = profString.charAt(cur_month-1);
 
	
 
	for (i=0;i<=6;i++){
 
		if (ys == indexString.charAt((cur_month-1)*7+i)) break}
 
 
 
	p2 = i+1;
 
 
 
 
	//PLACE OF BIRTH Male
 
 
 
 
	if (p2 == 1){
 
		if (day < 3) place=5;
 
		else if (day < 10) place=46;
 
		else if (day < 17) place=37;
 
		else if (day < 24) place=48;
 
		else if (day < 31) place=65;
 
		else place=6};
 
 
 
	if (p2 == 2){
 
		if (day < 8) place=28;
 
		else if (day < 15) place=58;
 
		else if (day < 22) place=10;
 
		else if (day < 29) place=38;
 
		else place=11};
 
 
 
	if (p2 == 3){
 
		if (day < 4) place=29;
 
		else if (day < 11) place=53;
 
		else if (day < 18) place=30;
 
		else if (day < 25) place=69;
 
		else place=1};
 
 
 
	if (p2 == 4){
 
		if (day < 7) place=74;
 
		else if (day < 14) place=4;
 
		else if (day < 21) place=47;
 
		else if (day < 28) place=20;
 
		else place=26};
 
 
 
	if (p2 == 5){
 
		if (day < 5) place=23;
 
		else if (day < 12) place=21;
 
		else if (day < 19) place=44;
 
		else if (day < 26) place=16;
 
		else place=43};
 
 
 
	if (p2 == 6){
 
		if (day < 6) place=34;
 
		else if (day < 13) place=27;
 
		else if (day < 20) place=14;
 
		else if (day < 27) place=41;
 
		else place=50};
 
 
 
	if (p2 == 7){
 
		if (day < 2) place=73;
 
		else if (day < 9) place=63;
 
		else if (day < 16) place=66;
 
		else if (day < 23) place=54;
 
		else if (day < 30) place=61;
 
		else place=72}
 
}
 
	else {
 
	//for females
 
 
 
   		msgWindow.document.write("<FONT color=navy><b>female</FONT>");
 
 
 
	var indexString = "OMPSQRNYWZVTUXSQMPNORUZVYWXTQORNSMPZXTWUVYOMPSQRNXVYUZTWNSORPQMVTWZXYUSQMPNORTYUXVWZ";
 
	
 
	var profString = "ACDBCABDDBCA";
 
		
 
	p1 = profString.charAt(cur_month-1);
 
	
 
	for (i=0;i<=6;i++){
 
		if (ys == indexString.charAt((cur_month-1)*7+i)) break}
 
 
 
	p2 = i+1;
 
 
		//PLACE OF BIRTH Female
 
 
 
	if (p2 == 1){
 
		if (day < 3) place=22;
 
		else if (day < 10) place=17;
 
		else if (day < 17) place=36;
 
		else if (day < 24) place=59;
 
		else if (day < 31) place=51;
 
		else place=9};
 
 
 
	if (p2 == 2){
 
		if (day < 8) place=40;
 
		else if (day < 15) place=2;
 
		else if (day < 22) place=64;
 
		else if (day < 29) place=56;
 
		else place=35};
 
 
 
	if (p2 == 3){
 
		if (day < 4) place=19;
 
		else if (day < 11) place=67;
 
		else if (day < 18) place=13;
 
		else if (day < 25) place=32;
 
		else place=31};
 
 
 
	if (p2 == 4){
 
		if (day < 7) place=15;
 
		else if (day < 14) place=49;
 
		else if (day < 21) place=12;
 
		else if (day < 28) place=39;
 
		else place=33};
 
 
 
	if (p2 == 5){
 
		if (day < 5) place=42;
 
		else if (day < 12) place=60;
 
		else if (day < 19) place=24;
 
		else if (day < 26) place=3;
 
		else place=52};
 
 
 
	if (p2 == 6){
 
		if (day < 6) place=18;
 
		else if (day < 13) place=25;
 
		else if (day < 20) place=57;
 
		else if (day < 27) place=45;
 
		else place=62};
 
 
 
	if (p2 == 7){
 
		if (day < 2) place=8;
 
		else if (day < 9) place=55;
 
		else if (day < 16) place=70;
 
 
		else if (day < 23) place=68;
 
		else if (day < 30) place=71;
 
		else place=7}
 
}
 
	
 
	var pro; pro=p1+p2;
 
 
 
	msgWindow.document.write(" in your last earthly incarnation." + "<BR>");
 
	
 
	//msgWindow.document.write("month=" + cur_month + " place=" + place + " ys=" + ys + " pro=" + pro + "<BR>");
 
 
 
	
 
	//countries data
 
	var countryString="";
 
	if (place == 1) countryString="Alaska"; 
 
	else if (place == 2) countryString="Yukon"; 
 
	else if (place == 3) countryString="North Canada"; 
 
	else if (place == 4) countryString="Ontario"; 
 
	else if (place == 5) countryString="Quebeck";
 
	else if (place == 6) countryString="Labrador"; 
 
	else if (place == 7) countryString="Newfoundland"; 
 
	else if (place == 8) countryString="Greenland"; 
 
	else if (place == 9) countryString="USA North-West"; 
 
	else if (place == 10) countryString="USA South-West";
 
	else if (place == 11) countryString="USA North-Center"; 
 
	else if (place == 12) countryString="USA South-Center"; 
 
	else if (place == 13) countryString="USA North-East"; 
 
	else if (place == 14) countryString="USA South-East"; 
 
	else if (place == 15) countryString="Arktik"; 
 
	else if (place == 16) countryString="Scotland"; 
 
	else if (place == 17) countryString="Northern England"; 
 
	else if (place == 18) countryString="Central England"; 
 
	else if (place == 19) countryString="Southern England";
 
	else if (place == 20) countryString="Wales"; 
 
	else if (place == 21) countryString="Ireland"; 
 
	else if (place == 22) countryString="North Europe"; 
 
	else if (place == 23) countryString="France"; 
 
	else if (place == 24) countryString="Spain"; 
 
	else if (place == 25) countryString="Portugal"; 
 
	else if (place == 26) countryString="Austria"; 
 
	else if (place == 27) countryString="Germany"; 
 
	else if (place == 28) countryString="Ukraine"; 
 
	else if (place == 29) countryString="Italy"; 
 
	else if (place == 30) countryString="Turkey"; 
 
	else if (place == 31) countryString="West Russia"; 
 
	else if (place == 32) countryString="Siberia"; 
 
	else if (place == 33) countryString="Central Russia"; 
 
	else if (place == 34) countryString="Greece"; 
 
	else if (place == 35) countryString="Iran"; 
 
	else if (place == 36) countryString="Saudi Arabia"; 
 
	else if (place == 37) countryString="Poland"; 
 
	else if (place == 38) countryString="Hungary"; 
 
	else if (place == 39) countryString="Yugoslavia"; 
 
	else if (place == 40) countryString="Romania"; 
 
	else if (place == 41) countryString="Bulgaria"; 
 
	else if (place == 42) countryString="Izrael"; 
 
	else if (place == 43) countryString="Tibet"; 
 
	else if (place == 44) countryString="Burma"; 
 
	else if (place == 45) countryString="Thailand"; 
 
	else if (place == 46) countryString="South China"; 
 
	else if (place == 47) countryString="Mongolia"; 
 
	else if (place == 48) countryString="North China"; 
 
	else if (place == 49) countryString="Korea"; 
 
	else if (place == 50) countryString="North Japan"; 
 
	else if (place == 51) countryString="South Japan"; 
 
	else if (place == 52) countryString="Sumatra"; 
 
	else if (place == 53) countryString="Borneo"; 
 
	else if (place == 54) countryString="Philippines"; 
 
	else if (place == 55) countryString="New Guinea"; 
 
	else if (place == 56) countryString="North Australia"; 
 
	else if (place == 57) countryString="West Australia"; 
 
	else if (place == 58) countryString="East Australia";
 
	else if (place == 59) countryString="South Australia"; 
 
	else if (place == 60) countryString="North New Zealand"; 
 
	else if (place == 61) countryString="South New Zealand"; 
 
	else if (place == 62) countryString="Oceania";
 
	else if (place == 63) countryString="North India"; 
 
	else if (place == 64) countryString="Central India"; 
 
	else if (place == 65) countryString="South India"; 
 
	else if (place == 66) countryString="Egypt"; 
 
	else if (place == 67) countryString="North Africa"; 
 
	else if (place == 68) countryString="West Africa"; 
 
	else if (place == 69) countryString="Central Africa"; 
 
	else if (place == 70) countryString="South Africa"; 
 
	else if (place == 71) countryString="Mexico"; 
 
	else if (place == 72) countryString="Cyprus";
 
	else if (place == 73) countryString="South America"; 
 
	else countryString="Central America";
 
 
 
	//year of past life calculation
 
	
 
	var ys1;
 
 
 
	     if (ys == "M") var mString = "185014001125102507000700180014751800130011751100";
 
	else if (ys == "N") var mString = "092518750425185017501350080006750825182515250875";
 
	else if (ys == "O") var mString = "172516750875070013251825177508001075165009001625";
 
	else if (ys == "P") var mString = "145005001800100008000550165017001325072511001550";
 
	else if (ys == "Q") var mString = "100014500950042517001525135011001625122517251025";
 
	else if (ys == "R") var mString = "097513751200127504500825137513500700092509250725";
 
	else if (ys == "S") var mString = "122506251250142509251150147507501300157506001125";
 
	else if (ys == "T") var mString = "117514001825127517500975185011501600187515251850";
 
	else if (ys == "U") var mString = "090009000775105013751675107515000825072510251500";
 
	else if (ys == "V") var mString = "122507501825140011501325167512751475160009501200";
 
	else if (ys == "W") var mString = "057516750775047517001450085017251775102517750400";
 
	else if (ys == "X") var mString = "180015751425157515501200160012001300037507751250";
 
	else if (ys == "Y") var mString = "107512501000165009501825155014250800175010750875";
 
	else                    var mString = "097505251175085015751125177513500700065013501050";
 
	
 
	ys1 = mString.charAt((cur_month-1)*4); 
 
	if (ys1 == "0") ys1 = ""; {
 
	ys1 += mString.charAt((cur_month-1)*4+1);
 
		ys1 += mString.charAt((cur_month-1)*4+2); ys1 += mString.charAt((cur_month-1)*4+3)} ;
 
		
 
	//past life profession
 
 
 
           if (pro == "A1") var proString = "digger, undertaker, medicine man";
 
	else if (pro == "A2") var proString = "philosopher, thinker, writer";
 
	else if (pro == "A3") var proString = "designer, engineering, craftsman";
 
	else if (pro == "A4") var proString = "chemist, alchemist, poison manufacturer";
 
	else if (pro == "A5") var proString = "seaman, cook, carpenter";
 
	else if (pro == "A6") var proString = "jeweler, watch-maker, artist";
 
	else if (pro == "A7") var proString = "medic, surgeon, herbalist";
 
	else if (pro == "C1") var proString = "shepherd, horseman, forester";
 
	else if (pro == "C2") var proString = "leader, major, captain";
 
	else if (pro == "C3") var proString = "librarian, priest, keeper of tribal relics";
 
	else if (pro == "C4") var proString = "entertainer, musician, poet, temple-dancer";
 
	else if (pro == "C5") var proString = "seaman, dealer, businessman, broker";
 
	else if (pro == "C6") var proString = "monk, bee-keeper, warrior";
 
 
 
	else if (pro == "C7") var proString = "writer, dramatist, organizer of rituals";
 
	else if (pro == "B1") var proString = "builder of roads, bridges, docks";
 
	else if (pro == "B2") var proString = "map maker, astrologer, astronomer";
 
	else if (pro == "B3") var proString = "handicraftsman, mechanic";
 
	else if (pro == "B4") var proString = "warrior, hunter, fisherman, executor of sacrifices";
 
	else if (pro == "B5") var proString = "artist, magician, fortune teller";
 
	else if (pro == "B6") var proString = "sailor, shoemaker, messenger";
 
	else if (pro == "B7") var proString = "builder of houses, temples, cathedrals";
 
	else if (pro == "D1") var proString = "trainer, holder of fine animals, birds, horses";
 
	else if (pro == "D2") var proString = "preacher, publisher, scribe of ancient writings";
 
	else if (pro == "D3") var proString = "farmer, weaver, tailor";
 
	else if (pro == "D4") var proString = "dramatist, director, musician, bard";
 
	else if (pro == "D5") var proString = "banker, usurer, moneylender, judge";
 
	else if (pro == "D6") var proString = "teacher, mathematician, geologist";
 
	else var proString = "dancer, singer, actor";
 
	 
 
	//characteristics
 
 
 
	if (p2 == 1) {
 
		if (place-2*(parseInt(place/2)) > 0) var charString = "Dynamic with huge energy, you excelled in planning and supervising. If you were a trash collector, you were chief trash collector.";
 
		else var charString = "Revolutionary type. You inspired changes in any sphere - politics, business, religion, housekeeping. A leader or rebel in any situation."
 
		};
 
	else if (p2 == 2) {
 
		if (place-2*(parseInt(place/2)) > 0) var charString = "Artistic personality, consistently transforming the unkempt, disorganized or unsightly into the beautiful, grays into bright colors. You found an opportunity of creative self-expression in any situation.";
 
		else var charString = "Timid, constrained, quiet person. You had creative talents, but were waiting until the next life to be liberated. Sometimes those surrounding you considered you odd, but you knew you would be cherished in your next life."
 
		};
 
 
 
	else if (p2 == 3) {
 
		if (place-2*(parseInt(place/2)) > 0) var charString = "Seeker of truth and wisdom. You could have seen your future lives. Others perceived you as an idealist illuminating paths to the future.  You knew this was true and awaited this incarnation for fulfillment.";
 
		else var charString = "You always liked to travel, to investigate, your incredible curiosity and analytical skills made you a superior detective or spy."
 
		};
 
 
 
	else if (p2 == 4) {
 
		if (place-2*(parseInt(place/2)) > 0) var charString = "You were the sane practical person, materialistic with no spiritual consciousness. Your simple wisdom helped weaker and poor. You awaited your next incarnation to combine your practicality with spirituality and great humanism.";
 
		else var charString = "You were geographically impaired, found it difficult to travel, but had the ability to understand others deeply.  You were a great humanitarian and investigator of the human condition.  May have been a spiritual leader who traveled in a group and aided others."
 
		};
 
 
 
	else if (p2 == 5) {
 
		if (place-2*(parseInt(place/2)) > 0) var charString = "Bohemian personality, mysterious, highly gifted, capable of understanding ancient books. With magical abilities, foretold your current life and served as a charismatic and devoted humanitarian.";
 
		else var charString = "With the natural talent of a psychologist, you knew how take advantage of any situation. Calm in any situation, your strength was relied upon by many during difficult and perilous times."
 
		};
 
 
 
	else if (p2 == 6) {
 
		if (place-2*(parseInt(place/2)) > 0) var charString = "Inquisitive, inventive, liked to get to the very bottom of things and to rummage through historical data, remnants of ancient civilizations. Talent for drama, natural born actor."	
 
		else var charString = "Modernistic and advanced -- always involved with whatever was fresh and new as you invisioned the future. You loved changes, especially in art, music, architecture, decor and cooking."
 
		};
 
 
 
	else if (p2 == 7) {
 
		if (place-2*(parseInt(place/2)) > 0) var charString = "With an advanced, scientific mind you were always seeking new explanations. Those surrounding you often had difficulty understanding your ideas, thought of you as eccentric but lovable and respected your knowledge.";
 
		else var charString = "A calculating character, you carefully weighed decisions in critical situations and possessed excellent self-control and a strong will. You were well-liked and looked to for advice and your practicality helped build civilizations."
 
		};
 
 
 
	// past life lesson
 
 
 
	if (p2 == 1){
 
 		     if (day < 12) var lesString = "You are destined to solve problems of pollution, participate in environmental control, rasie issues concerning misuse of raw materials, awareness of the earth's destruction with your powers of persuastion and your understanding of the human psyche.";
 
		else if (day < 22) var lesString = "Your lesson -- to learn humility and faith in spiritual principles. You will evolve into a higher sense of understanding of the structure of life and use this insight to come to the aid of others.";
 
		             else  var lesString = "You are destined to learn to understand other people deeply and to meet all of life's difficulties with a joyful heart. You will aid others in their journeys by articulating your philosophy and bringing them the spirit of joy."};
 
	else if (p2 == 2) {
 
		     if (day < 12) var lesString = "It always seemed to you that your perceptions of the world were somewhat different. Your lesson -- to look deep within and trust your intuition as your best guide in the present life.";
 
		else if (day < 22) var lesString = "Your main task -- to make the world more beautiful. Physical and spiritual deserts await your touch. Others once again look to you for direction and guidance -- your optimism and enthusiasm inspire them.";
 
		              else var lesString = "Your main lesson in the present -- to develop magnanimity and feelings of brotherhood. You will become less attached to material goods than in previous lives and will inspire others with your generosity and sharing of the bounty that you are destined to receive during this life."};
 
	else if (p2 == 3) {
 
		     if (day < 12) var lesString = "Your lesson -- to develop a kinder attitude toward all than you held in previous lives.  You will develop a gift of understanding and compassion that allows you to aid thousands, directly and indirectly, during this lifetime and for generations to come.";
 
		else if (day < 22) var lesString = "Your lesson -- development and expansion of your mental consciousness. You will eventually become an excellent teacher and impart your understanding, based in logic and compassion, to large numbers of people throughout the world.";
 
		              else var lesString = "You fulfill this life's lesson by helping old folks and children. You came to this life to learn to care about the weak and helpless. Your growth during this lifetime is astounding, as your compassion and generosity flourish, so will you be greatly rewarded."};
 
	else if (p2 == 4) {
 
		     if (day < 12) var lesString = "Strive to develop your talent for love, happiness and enthusiasm and to share these feelings among all people. You will encounter many obstacles and are destined to overcome them with grace and amazing internal strength that is admired by all who surround you and learn of your accomplishments.";
 
		else if (day < 22) var lesString = "This time, develop self-love and the ability to implant hope into hearts of people. Ambition -- is not everything. True wealth is buried in your soul. You will learn this lesson, impart it to thousands and be rewarded with great love in your life.";
 
		              else var lesString = "Your lesson -- to conquer jealousy and anger in yourself and then in those who will select you as their guide. Understand that any tendency toward weakness is caused by fear and self-regret. You will incoporate this lesson, find great love and lead many onto the same rewarding path."};
 
	else if (p2 == 5) {
 
		     if (day < 12) var lesString = "Your task -- to learn to love and to trust the Universe. You are bound to think, study, reflect, develop inner wisdom.  Sharing this insight will facilitate a spiritual generosity that is admired by all and serves to inspire a large part of humanity within your lifetime.";
 
		else if (day < 22) var lesString = "Your task -- to learn determination and persistence. Misfortunes will shatter against your strength as you grow.  You will inspire all around you and all who will follow you with your courage.";
 
		              else var lesString = "Timid, lonely and self-conscious people are everywhere -- your task is to eradicate these tendencies in yourself and then help other people.  You will lead large numbers into self-understanding and become a sheltering-strength during difficult times."};
 
	else if (p2 == 6) {
 
		     if (day < 12) var lesString = "The world is full of ill and lonely people. You should help those, who are less fortunate than you are.  You will develop an unsurpassed compassion that inspires others to perform good throughout the world.";
 
		else if (day < 22) var lesString = "There is the invisible connection between material and spiritual world. Your lesson -- to search, find and use this bridge.  Your practicality combined with your deep understanding of the esoteric provides yourself and all who surround you with bountiful lives.";
 
		              else var lesString = "Your lesson -- to learn discretion  and reason and then teach others to do that. Your life will be happier, when you help those who lack reasoning.  Your rationality and ability to  negotiate will lead to great benefits for you and large groups of people."};
 
	else if (p2 == 7) {
 
		     if (day < 12) var lesString = "Your lesson -- to study, to practice and to use wisdom, embedded in psychological sciences and in ancient manuscripts. With strong faith and hard work you will reach your real destiny your present life.  Your analysis and discoveries about human nature will be of tremendous benefit to all.";
 
		else if (day < 22) var lesString = "Your lesson -- to combat violence and disharmony in our world, to understand its roots and origins. All global problems have similar origins.  Your ability to clarify the crux of problems and articulate this to large numbers of people will lead to greater peace in vast areas of the world.";
 
		              else var lesString = "Magic is everywhere around you, in most usual, most ordinary incidents. Your lesson -- to learn magic and to help people to see it clearly. You are seen as a magician of sorts because of your ability to encompass your spirituality in each moment.  You will be well-loved by many."};	
 
				
 
	//message composition
 
 
 
	msgWindow.document.write("<FONT FACE=arial, Arial Color=black><B>" + "<br>You were born somewhere near the territory of modern " + countryString.fontcolor("navy"));
 
	msgWindow.document.write(" in approximately  " + ys1.fontcolor("navy") + ".<BR>");
 
	msgWindow.document.write("Your profession was " + proString.fontcolor("navy") + ".<HR><br>");
 
	msgWindow.document.write("Your brief psychological profile from your past life:<BR><br>" + charString.fontcolor("navy") + "<HR><br>");
 
	msgWindow.document.write("The lesson, that your last past life brings to the present and how you will use it:<BR><br>" + lesString.fontcolor("navy") + "<HR><br></FONT> ");
 
	msgWindow.document.write("<FONT FACE=Arial Color=gray>" + "            Use your lessons well ... and you will be greeted with uncommon success in an uncommon hour..." + "</I></B><HR><BR></FONT>");
	
//
      
}
 
 

