/*** SET BUTTON'S FOLDER HERE ***/
var buttonFolder = "buttons/";

/*** SET BUTTONS' FILENAMES HERE ***/
upSources = new Array("button1up.png","button2up.png","button3up.png","button4up.png","button5up.png","button6up.png","button7up.png","button8up.png","button9up.png","button10up.png","button11up.png","button12up.png","button13up.png","button14up.png","button15up.png","button16up.png","button17up.png");

overSources = new Array("button1up.png","button2up.png","button3up.png","button4up.png","button5up.png","button6up.png","button7up.png","button8up.png","button9up.png","button10up.png","button11up.png","button12up.png","button13up.png","button14up.png","button15up.png","button16up.png","button17up.png");

// SUB MENUS DECLARATION, YOU DONT NEED TO EDIT THIS
subInfo = new Array();
subInfo[1] = new Array();
subInfo[2] = new Array();
subInfo[3] = new Array();
subInfo[4] = new Array();
subInfo[5] = new Array();
subInfo[6] = new Array();
subInfo[7] = new Array();
subInfo[8] = new Array();
subInfo[9] = new Array();
subInfo[10] = new Array();
subInfo[11] = new Array();
subInfo[12] = new Array();
subInfo[13] = new Array();
subInfo[14] = new Array();
subInfo[15] = new Array();
subInfo[16] = new Array();
subInfo[17] = new Array();


//*** SET SUB MENUS TEXT LINKS AND TARGETS HERE ***//

subInfo[2][1] = new Array("Shani Mannat","shani-mannat.htm","");
subInfo[2][2] = new Array("Shani Blessing","shani-membership.htm","");
subInfo[2][3] = new Array("All About ShaniDev","http://www.shani.co.in","");
subInfo[2][4] = new Array("E-Shani Puja","e-shani-puja.htm","");
subInfo[2][5] = new Array("Shani Sewa","shani-sewa.htm","");
subInfo[2][6] = new Array("Shani Grah Puja","shani-puja.htm","");
subInfo[2][7] = new Array("Shani Maha Yagya","shani-mahayagya.htm","");
subInfo[2][8] = new Array("Vedic Shani Puja CD","shani-mantra-cd.htm","");
subInfo[2][9] = new Array("Photo Gallery","mahayagya.htm","");
subInfo[2][10] = new Array("Shani Aarti","aarti.htm","");
subInfo[2][11] = new Array("Shani Chaubisa","shani-chaubisa.htm","");
subInfo[2][12] = new Array("Shani Chalisa","chalisa.htm","");
subInfo[2][13] = new Array("108 Names of Shani","shani-names.htm","");
subInfo[2][14] = new Array("Join Shani Maha Yagya","maha-puja-form.htm","");


subInfo[3][1] = new Array("E-Shani Puja","e-shani-puja.htm","");
subInfo[3][2] = new Array("Shani Shanti Yagya","vedic-shani-puja.htm","");
subInfo[3][3] = new Array("Rahu Shanti Yagya","vedic-rahu-puja.htm","");
subInfo[3][4] = new Array("Ketu Shanti Yagya","vedic-ketu-puja.htm","");
subInfo[3][5] = new Array("Navgrah Shanti Yagya","vedic-navgrah-puja.htm","");
subInfo[3][6] = new Array("Surya Shanti Yagya","vedic-surya-puja.htm","");
subInfo[3][7] = new Array("Chandra Shanti Yagya","vedic-chandra-puja.htm","");
subInfo[3][8] = new Array("Mangal Shanti Yagya","vedic-mangal-puja.htm","");
subInfo[3][9] = new Array("Buddh Shanti Yagya","vedic-buddh-puja.htm","");
subInfo[3][10] = new Array("Brihaspati Shanti Yagya","vedic-brihaspati-puja.htm","");
subInfo[3][11] = new Array("Shukra Shanti Yagya","vedic-shukra-puja.htm","");
subInfo[3][12] = new Array("Kal Sarp Dosh Puja","vedic-rahu-puja.htm","");
subInfo[3][13] = new Array("Mangalik Dosh Puja","vedic-mangal-puja.htm","");
subInfo[3][14] = new Array("Pitra Dosh Puja","kal-sarp-dosh.htm","");
subInfo[3][15] = new Array("Gand Mool Dosh Puja","kal-sarp-dosh.htm","");
subInfo[3][16] = new Array("Cow Dosh Puja","donations.htm","");


subInfo[4][1] = new Array("Free Guru Diksha Locket","guru-diksha-locket.htm","");
subInfo[4][2] = new Array("Free Shani Locket","shani-sade-sati-locket.htm","");
subInfo[4][3] = new Array("Free Shani Temple Gift","free-gift.htm","");
subInfo[4][4] = new Array("Free Kaal Sarp Locket","kaal-sarp-locket.htm","");
subInfo[4][5] = new Array("Join Shani Maha Yagya","maha-puja-form.htm","");
subInfo[4][6] = new Array("Free Astrological Help","free-astro-help.htm","");
subInfo[4][7] = new Array("Free Buri Nazar Kavach","nazar.htm","");
subInfo[4][8] = new Array("Guru Rajneesh Rishi","guru-rajneesh-rishi.htm","");
subInfo[4][9] = new Array("Know Your Lucky Ring","know-ring.htm","");
subInfo[4][10] = new Array("Free Love Horoscope","love-mate.htm","");
subInfo[4][11] = new Array("Free Sun Sign","sun-sign.htm","");
subInfo[4][12] = new Array("Know Who Loves You","best-lover.htm","");
subInfo[4][13] = new Array("Date of Child Birth","pregnancy.htm","");
subInfo[4][14] = new Array("Day of Your Birth","birth-day.htm","");
subInfo[4][15] = new Array("Day of Your Death","death-day.htm","");


subInfo[5][1] = new Array("Free Shani Ring","free-shani-ring.htm","");
subInfo[5][2] = new Array("Know Your Lucky Ring","know-ring.htm","");
subInfo[5][3] = new Array("Vedic Zodiac Rings","rings-rashi.htm","");
subInfo[5][4] = new Array("Rings by Name","rings-name.htm","");
subInfo[5][5] = new Array("Western Zodiac Rings","western-rings-zodiac.htm","");
subInfo[5][6] = new Array("Rings by Day","rings-day.htm","");
subInfo[5][7] = new Array("Birth Stone Rings","astro-rings.html","");
subInfo[5][8] = new Array("Rings For Planets","semi-precious.htm","");
subInfo[5][9] = new Array("Navratna Ring ","navratan.htm","");
subInfo[5][10] = new Array("Rudraksh ","rudraksha.htm","");

subInfo[6][1] = new Array("Our Guru Ji","guru-rajneesh-rishi.htm","");
subInfo[6][2] = new Array("Remedy For Arthritis","arthritis.htm","");
subInfo[6][3] = new Array("Heart Problem Remedy","heart-problems.htm","");
subInfo[6][4] = new Array("Cancer Remedies","cancer.htm","");
subInfo[6][5] = new Array("Diabetes Remedies","diabetes.htm","");
subInfo[6][6] = new Array("Liver Problems","liver-cirrhosis.htm","");
subInfo[6][7] = new Array("Skin Allergies","allergies.htm","");
subInfo[6][8] = new Array("Breast Enlargement","breast-enlargement.htm","");
subInfo[6][9] = new Array("All Major Dieases","sickness-diseases.htm","");
subInfo[6][10] = new Array("Medicines","medicines.htm","");
subInfo[6][11] = new Array("Jari-Buti","jari-buti.htm","");

subInfo[7][1] = new Array("Introduction of Guru Ji","guru-rajneesh-rishi.htm","");
subInfo[7][2] = new Array("Shani Beej Mantra","shani-beej-mantra.htm","");
subInfo[7][3] = new Array("Sade Sati Katha","shani-sade-sati-katha.htm","");
subInfo[7][4] = new Array("Shani Avahan Mantra","shani-avahan-matra.htm","");
subInfo[7][5] = new Array("Shani Vedic Mantra","shanidev-mantra.htm","");
subInfo[7][6] = new Array("Ganesh Mantra","ganesh-mantra.htm","");
subInfo[7][7] = new Array("Guru Mantra","guru-brahma-mantra.htm","");
subInfo[7][8] = new Array("Surya Mantra","mantra-surya.htm","");
subInfo[7][9] = new Array("Chandra Mantra","chandra-mantra.htm","");
subInfo[7][10] = new Array("Mangal Mantra","mantra-mangal.htm","");
subInfo[7][11] = new Array("Budh Mantra","mantra-budh.htm","");
subInfo[7][12] = new Array("Brihaspati Mantra","mantra-brihaspati.htm","");
subInfo[7][13] = new Array("Shukra Mantra","mantra-shukra.htm","");
subInfo[7][14] = new Array("Rahu Mantra","mantra-rahu.htm","");
subInfo[7][15] = new Array("Ketu Mantra","mantra-ketu.htm","");
subInfo[7][16] = new Array("Free Shani Mantra CD","free-shani-mantra.htm","");
subInfo[7][17] = new Array("Vedic Puja CDs","mantra-cd.htm","");


subInfo[8][1] = new Array("All About Guru Ji","guru-rajneesh-rishi.htm","");
subInfo[8][2] = new Array("Support to Anna Hazare","anna-hazare.htm","");
subInfo[8][3] = new Array("Hot News","social-service.htm","");
subInfo[8][4] = new Array("News","views.htm","");
subInfo[8][5] = new Array("Prediction for Sonia","prediction-congress.htm","");
subInfo[8][6] = new Array("Australian Attack","australian-attack.htm","");
subInfo[8][7] = new Array("Advani Retires ?","l-k-advani-resign.htm","");
subInfo[8][8] = new Array("Jago Sonia Gandhi","prediction-congress.htm","");
subInfo[8][9] = new Array("Post Your Comments","mailto:info@shanidev.us","");


subInfo[9][1] = new Array("Mantra Healed Rings","gems.htm","");
subInfo[9][2] = new Array("Totke","totke.htm","");
subInfo[9][3] = new Array("Vashikaran Mantras","totke.htm","");
subInfo[9][4] = new Array("Bhagwat Katha","totke.htm","");
subInfo[9][5] = new Array("Buri Nazar Remedies","totke.htm","");
subInfo[9][6] = new Array("Remedies for Wealth","totke.htm","");
subInfo[9][7] = new Array("Remedies for Grah","totke.htm","");
subInfo[9][8] = new Array("Social Evil Videos","totke.htm","");


subInfo[10][1] = new Array("Guru Rajneesh Rishi","guru-rajneesh-rishi.htm","");
subInfo[10][2] = new Array("Guru Maa Rokmani","guru-maa.htm","");
subInfo[10][3] = new Array("Swami Raj Rishi","swami-raj-rishi.htm","");
subInfo[10][4] = new Array("Invite Guruji in Delhi","invite-guruji-in-delhi.htm","");
subInfo[10][5] = new Array("Blessings By Guruji","guruji-blessings.htm","");
subInfo[10][6] = new Array("Get Guru Diksha","guru-diksha.htm","");
subInfo[10][7] = new Array("Shani Membership","shani-membership.htm","");
subInfo[10][8] = new Array("Rishi Astro Research","about.htm","");
subInfo[10][9] = new Array("Be A Shani Devotee","followers-profile.htm","");
subInfo[10][10] = new Array("View Photo Gallery","mahayagya.htm","");


subInfo[11][0] = new Array("God Idols","#","");
subInfo[11][1] = new Array("Blessings By Guruji","guruji-blessings.htm","");
subInfo[11][2] = new Array("Shani Items","shani-products.htm","");
subInfo[11][3] = new Array("Gemstones","gemstones.htm","");
subInfo[11][4] = new Array("Kaal Sarp Locket","kalsarp-dosh-pack.htm","");
subInfo[11][5] = new Array("Kuber Kunji for Wealth","kuber-kunji.htm","");
subInfo[11][0] = new Array("Astro Remedial Bags","#","");
subInfo[11][0] = new Array("Grah Shanti Potli","#","");
subInfo[11][0] = new Array("Puja Items","#","");
subInfo[11][6] = new Array("Mala-Rosaries","mala.htm","");
subInfo[11][7] = new Array("Rare Yantras","yantra-items.htm","");
subInfo[11][8] = new Array("Tantra Items","tantra-items.htm","");
subInfo[11][11] = new Array("Raksha Kavach","kavach.htm","");
subInfo[11][0] = new Array("Lucky Charms","#","");
subInfo[11][9] = new Array("Rudraksha Pendants","rudraksha.htm","");
subInfo[11][10] = new Array("Precious Gem Rings","precious-rings.htm","");
subInfo[11][11] = new Array("Semi Gem Rings","semi-precious.htm","");
subInfo[11][12] = new Array("Birth Stone Rings","astro-rings.html","");
subInfo[11][13] = new Array("How to Do Puja CDs","puja-cd.htm","");
subInfo[11][14] = new Array("Puja Clothes","puja-clothes.htm","");
subInfo[11][15] = new Array("Problems & Services","services.htm","");



subInfo[12][1] = new Array("For Shani Temple","donations.htm","");
subInfo[12][2] = new Array("For Shani Gold Crown","shani-mukut.htm","");
subInfo[12][3] = new Array("Little About Guru Ji","guru-rajneesh-rishi.htm","");
subInfo[12][4] = new Array("Donate Properties","donate-property.htm","");
subInfo[12][5] = new Array("Donate Lands","donate-land.htm","");
subInfo[12][6] = new Array("Donate for Gurukul","donate-gurukul.htm","");
subInfo[12][7] = new Array("Donate Vehicles","donate-vehicle.htm","");
subInfo[12][8] = new Array("Donate Computers","donate-computer.htm","");
subInfo[12][9] = new Array("Shani Dev Promotions","advertise.htm","");
subInfo[12][10] = new Array("Shani Dev Events","shani-mahayagya.htm","");
subInfo[12][11] = new Array("Shani Maha Yagya","shani-mahayagya.htm","");

subInfo[13][1] = new Array("Shani Mannat","shani-mannat.htm","");
subInfo[13][2] = new Array("Yagya - New Business","ganesh-yagya.htm","");
subInfo[13][3] = new Array("Yagya For Money","lakshmi-yagya.htm","");
subInfo[13][4] = new Array("Yagya for Child Boon","santaan-gopal-yagya.htm","");
subInfo[13][5] = new Array("Yagya For Death","maha-mrityunjaya-yagya.htm","");
subInfo[13][6] = new Array("Mantra Jaap CDs","mantra- cd.htm","");
subInfo[13][7] = new Array("Shani Mantra","shani-mantra.htm","");
subInfo[13][8] = new Array("Surya Mantra","surya-mantra.htm","");
subInfo[13][9] = new Array("Chandra Mantra","chandra-mantra.htm","");
subInfo[13][10] = new Array("Guru Mantra","guru-mantra.htm","");
subInfo[13][11] = new Array("Shukra Mantra","shukra-mantra.htm","");
subInfo[13][12] = new Array("Buddh Mantra","buddh-mantra.htm","");
subInfo[13][13] = new Array("Mangal Mantra","mangal-mantra.htm","");
subInfo[13][14] = new Array("Rahu Mantra","rahu-mantra.htm","");
subInfo[13][15] = new Array("Ketu Mantra","ketu-mantra.htm","");
subInfo[13][16] = new Array("Navgrah Mantra","navgrah-mantra.htm","");
subInfo[13][17] = new Array("Manas Puja","manas-puja.htm","");
subInfo[13][18] = new Array("Mritanjaya Mantra","mritanjaya-mantra.htm","");


subInfo[14][1] = new Array("Facts About Gem Stones","gems.htm","");
subInfo[14][2] = new Array("Numerology","numerology.htm","");
subInfo[14][3] = new Array("Get Annual Prediction","annual-forecast.htm","");
subInfo[14][4] = new Array("Kundli Match Making","match-making.htm","");
subInfo[14][5] = new Array("Janam Kundli","kundli.htm","");
subInfo[14][6] = new Array("Watch Husband / Wife","activity-prediction.htm","");
subInfo[14][7] = new Array("Know Zodiac Sign","know-rashi.htm",""); 
subInfo[14][8] = new Array("Learn Zodiac Astrology","zodiac-rashi.htm","");
subInfo[14][9] = new Array("Learn Name Astrology","zodiac-name.htm","");
subInfo[14][10] = new Array("Learn Month Astrology","zodiac-month.htm","");


subInfo[15][1] = new Array("Testimonials","country-stats.htm","");
subInfo[15][2] = new Array("Our Devotees","monthly-stats.htm","");
subInfo[15][3] = new Array("Countrywise Visitors","country-stats.htm","");
subInfo[15][4] = new Array("Monthly Visitors","monthly-stats.htm","");
subInfo[15][5] = new Array("Visitor Stats","visitor-stats.htm","");
subInfo[15][6] = new Array("Visitors Summary","visitors-summary.htm","");
subInfo[15][7] = new Array("Advertise With Us","advertise.htm","");
subInfo[15][8] = new Array("Religious Partners","religious-partner.htm","");
subInfo[15][9] = new Array("Become Our Yajman","shani-mahayagya.htm","");
subInfo[15][10] = new Array("Become Our Sponsors","shani-mahayagya.htm","");


subInfo[16][1] = new Array("Our Guru Ji","guru-rajneesh-rishi.htm","");
subInfo[16][2] = new Array("Janta Janardan ","janta-janardan.htm","");
subInfo[16][3] = new Array("Anti-Corruption","anti-corruption.htm","");
subInfo[16][4] = new Array("Rishi Computer Institute ","rishi-computer-institute.htm","");
subInfo[16][5] = new Array("Kanyadaan","kanyadaan.htm","");


//*** SET SUB MENU POSITION ( RELATIVE TO BUTTON ) ***//
var xSubOffset = -6;
var ySubOffset = 29;



//*** NO MORE SETTINGS BEYOND THIS POINT ***//
var overSub = false;
var delay = 1000;
totalButtons = upSources.length;

// GENERATE SUB MENUS
for ( x=0; x<totalButtons; x++) {
	// SET EMPTY DIV FOR BUTTONS WITHOUT SUBMENU
	if ( subInfo[x+1].length < 1 ) { 
		document.write('<div id="submenu' + (x+1) + '">');
	// SET DIV FOR BUTTONS WITH SUBMENU
	} else {
		document.write('<div id="submenu' + (x+1) + '" class="dropmenu" ');
		document.write('onMouseOver="overSub=true;');
		document.write('setOverImg(\'' + (x+1) + '\',\'\');"');
		document.write('onMouseOut="overSub=false;');
		document.write('setTimeout(\'hideSubMenu(\\\'submenu' + (x+1) + '\\\')\',delay);');
		document.write('setOutImg(\'' + (x+1) + '\',\'\');">');


		document.write('<ul>');
		for ( k=0; k<subInfo[x+1].length-1; k++ ) {
			document.write('<li>');
			document.write('<a href="' + subInfo[x+1][k+1][1] + '" ');
			document.write('target="' + subInfo[x+1][k+1][2] + '">');
			document.write( subInfo[x+1][k+1][0] + '</a>');
			document.write('</li>');
		}
		document.write('</ul>');
	}
	document.write('</div>');
}





//*** MAIN BUTTONS FUNCTIONS ***//
// PRELOAD MAIN MENU BUTTON IMAGES
function preload() {
	for ( x=0; x<totalButtons; x++ ) {
		buttonUp = new Image();
		buttonUp.src = buttonFolder + upSources[x];
		buttonOver = new Image();
		buttonOver.src = buttonFolder + overSources[x];
	}
}

// SET MOUSEOVER BUTTON
function setOverImg(But, ID) {
	document.getElementById('button' + But + ID).src = buttonFolder + overSources[But-1];
}

// SET MOUSEOUT BUTTON
function setOutImg(But, ID) {
	document.getElementById('button' + But + ID).src = buttonFolder + upSources[But-1];
}



//*** SUB MENU FUNCTIONS ***//
// GET ELEMENT ID MULTI BROWSER
function getElement(id) {
	return document.getElementById ? document.getElementById(id) : document.all ? document.all(id) : null; 
}

// GET X COORDINATE
function getRealLeft(id) { 
	var el = getElement(id);
	if (el) { 
		xPos = el.offsetLeft;
		tempEl = el.offsetParent;
		while (tempEl != null) {
			xPos += tempEl.offsetLeft;
			tempEl = tempEl.offsetParent;
		} 
		return xPos;
	} 
} 

// GET Y COORDINATE
function getRealTop(id) {
	var el = getElement(id);
	if (el) { 
		yPos = el.offsetTop;
		tempEl = el.offsetParent;
		while (tempEl != null) {
			yPos += tempEl.offsetTop;
			tempEl = tempEl.offsetParent;
		}
		return yPos;
	}
}

// MOVE OBJECT TO COORDINATE
function moveObjectTo(objectID,x,y) {
	var el = getElement(objectID);
	el.style.left = x;
	el.style.top = y;
}

// MOVE SUBMENU TO CORRESPONDING BUTTON
function showSubMenu(subID, buttonID) {
	hideAllSubMenus();
	butX = getRealLeft(buttonID);
	butY = getRealTop(buttonID);
	moveObjectTo(subID,butX+xSubOffset, butY+ySubOffset);
}

// HIDE ALL SUB MENUS
function hideAllSubMenus() {
	for ( x=0; x<totalButtons; x++) {
		moveObjectTo("submenu" + (x+1) + "",-500, -500 );
	}
}

// HIDE ONE SUB MENU
function hideSubMenu(subID) {
	if ( overSub == false ) {
		moveObjectTo(subID,-500, -500);
	}
}



//preload();


