//Western & Chinese Astrological Sign Calculator- By Timothy Joko-Veltman //Email: restlessperegrine@yahoo.com URL: http://openmind.digitalrice.com //Visit JavaScript Kit (http://javascriptkit.com) for script function signs() { var start = 1901, birthyear = document.zodiac.year.value, date=document.zodiac.date.value, month=document.zodiac.month.selectedIndex; var monthValue = document.zodiac.month.value; if(birthyear == ''){ error_happened(); alert('من فضلك قم بإدخال السنة أولاً'); return; }else if(birthyear <= 0){ error_happened(); alert('السنة التى أدخلتها غير صحيحة'); return; } if(monthValue == 'x'){ error_happened(); alert('من فضلك قم بإختيار الشهر أولاً'); return; } if(monthValue == 2 && date > 29){ error_happened(); alert('شهر شباط لا يمكن ان يتجاوز 29 يوم'); return; }else if((monthValue == 1 || monthValue == 3 || monthValue == 5 || monthValue == 7 || monthValue == 8 || monthValue == 10 || monthValue == 12) && date > 31){ error_happened(); alert('اليوم الذى أدخلته غير صحيح'); return; }else if((monthValue == 4 || monthValue == 6 || monthValue == 9 || monthValue == 11) && date > 29){ error_happened(); alert('هذا الشهر فقط 30 يوم صحح اليوم او الشهر'); return; }else if(date == '' || date <= 0){ error_happened(); alert('اليوم الذى أدخلته غير صحيح'); return; } with (document.zodiac.sign){ if (month == 1 && date >=20 || month == 2 && date <=18) {value = "الدلو"; changeZodiacImg('aquarius');} if (month == 1 && date > 31) {value = "ماذا؟";} if (month == 2 && date >=19 || month == 3 && date <=20) {value = "الحوت"; changeZodiacImg('pisces');} if (month == 2 && date > 29) {value = "ماذا قلت";} if (month == 3 && date >=21 || month == 4 && date <=19) {value = "الحمل"; changeZodiacImg('aries');} if (month == 3 && date > 31) {value = "حسناً...كما تقول";} if (month == 4 && date >=20 || month == 5 && date <=20) {value = "الثور"; changeZodiacImg('taurus');} if (month == 4 && date > 30) {value = "انا اسف جداً";} if (month == 5 && date >=21 || month == 6 && date <=21) {value = "الجوزاء"; changeZodiacImg('gemini');} if (month == 5 && date > 31) {value = "مممم ... لا";} if (month == 6 && date >=22 || month == 7 && date <=22) {value = "السرطان"; changeZodiacImg('cancer');} if (month == 6 && date > 30) {value = "عذراً";} if (month == 7 && date >=23 || month == 8 && date <=22) {value = "الأسد"; changeZodiacImg('leo');} if (month == 7 && date > 31) {value = "اعذرني ؟";} if (month == 8 && date >=23 || month == 9 && date <=22) {value = "العذراء"; changeZodiacImg('vigro');} if (month == 8 && date > 31) {value = "اه.. طبعاً";} if (month == 9 && date >=23 || month == 10 && date <=22) {value = "الميزان"; changeZodiacImg('libra');} if (month == 9 && date > 30) {value = "حاول مرة اخرى";} if (month == 10 && date >=23 || month == 11 && date <=21) {value = "العقرب"; changeZodiacImg('scorpio');} if (month == 10 && date > 31) {value = "انس الامر";} if (month == 11 && date >=22 || month == 12 && date <=21) {value = "القوس"; changeZodiacImg('sagittarius');} if (month == 11 && date > 30) {value = "يوم غير صالح";} if (month == 12 && date >=22 || month == 1 && date <=19) {value = "الجدي"; changeZodiacImg('capricorn');} if (month == 12 && date > 31) {value = "غير ممكن";} } x = (start - birthyear) % 12 with (document.zodiac.csign){ if (x == 1 || x == -11) {value = "الفأر"; changeChineseZodiacImg('rat');} if (x == 0) {value = "الثور"; changeChineseZodiacImg('ox');} if (x == 11 || x == -1) {value = "النمر"; changeChineseZodiacImg('tiger');} if (x == 10 || x == -2) {value = "الأرنب "; changeChineseZodiacImg('rabbit');} if (x == 9 || x == -3) {value = "التنين"; changeChineseZodiacImg('dragon');} if (x == 8 || x == -4) {value ="الثعبان"; changeChineseZodiacImg('snake');} if (x == 7 || x == -5) {value = "الحصان"; changeChineseZodiacImg('horse');} if (x == 6 || x == -6) {value = "العنزة"; changeChineseZodiacImg('goat');} if (x == 5 || x == -7) {value = "القرد"; changeChineseZodiacImg('monkey');} if (x == 4 || x == -8) {value = "الديك"; changeChineseZodiacImg('rooster');} if (x == 3 || x == -9) {value = "الكلب"; changeChineseZodiacImg('dog');} if (x == 2 || x == -10) {value = "الخنزير"; changeChineseZodiacImg('pig');} } } function error_happened(){ document.getElementById('twelvetoolszodiacimg').style.visibility = 'hidden'; document.getElementById('twelvetoolschinesezodiacimg').style.visibility = 'hidden'; document.getElementById('twelvetoolszodiacimg').src = ''; document.getElementById('twelvetoolschinesezodiacimg').src = ''; document.zodiac.sign.value = ''; document.zodiac.csign.value = ''; } function changeZodiacImg(imgName){ var newImgSrc = twelvetools_script_get_img_src('https://www.ehseb.net/img/','horoscopes-img/wo-horoscopes/',imgName + '.png'); document.getElementById('twelvetoolszodiacimg').src = newImgSrc; document.getElementById('twelvetoolszodiacimg').style.display = 'inline-block'; document.getElementById('twelvetoolszodiacimg').style.visibility = 'visible'; } function changeChineseZodiacImg(imgName){ var newImgSrc = twelvetools_script_get_img_src('https://www.ehseb.net/img/','horoscopes-img/ch-horoscopes//',imgName + '.png'); document.getElementById('twelvetoolschinesezodiacimg').src = newImgSrc; document.getElementById('twelvetoolschinesezodiacimg').style.display = 'inline-block'; document.getElementById('twelvetoolschinesezodiacimg').style.visibility = 'visible'; } function twelvetools_script_get_img_src(plugin_path,upload_folder_thumb,newFilename){ return plugin_path + upload_folder_thumb + newFilename; }