﻿document.write('<table id="vista-buttons_com_idnpam3" width="0" cellpadding="0" cellspacing="0" border="0"><tr><td style="padding-bottom:1px" title ="Youth fishing - kids fishing - children fishing"><a href="http://www.youthoutdoorsusa.com/kids_children_youth_fishing.htm" target="_self" onmouseover=\'xpe("npam3o");xpshow("npam3",1,this);xpsmover(this);\' onmouseout=\'xpsmout(this);\' onmousedown=\'xpe("npam3c");\'><img id="xpi_npam3" src="'+vbImgPath+'/btnpam3_0.png" name="vbnpam3" width="158" height="35" border="0" alt="Fishing" /></a><div><ul id="vbUL_npam3" class="vbULnpam3"><li><a href="http://www.youthoutdoorsusa.com/kids_fishing_articles.htm" title="Fishing articles for kids - Fishing articles for children - Fishing articles for youth" target="_self">Fishing&nbsp;articles</a></li><li><a href="http://www.youthoutdoorsusa.com/kids_fishing_photos.htm" title="Fishing photos for kids - Fishing photos for children - Fishing photos for youth" target="_self">Fishing&nbsp;photos</a></li><li><a href="http://www.youthoutdoorsusa.com/kids_fishing_stories.htm" title="Fishing Stories for kids, children, youth" target="_self">Fishing&nbsp;Stories</a></li><li><a href="http://www.youthoutdoorsusa.com/kids_fishing_websites.htm" title="Fishing websites for kids, children, youth" target="_self">Fishing&nbsp;websites</a></li></ul></div></td></tr><tr><td style="padding-bottom:1px" title ="Youth Hunting - kids hunting - children hunting"><a href="http://www.youthoutdoorsusa.com/youth_kids_children_hunting.htm" target="_self" onmouseover=\'xpe("hpam3o");xpshow("hpam3",1,this);xpsmover(this);\' onmouseout=\'xpsmout(this);\' onmousedown=\'xpe("hpam3c");\'><img id="xpi_hpam3" src="'+vbImgPath+'/bthpam3_0.png" name="vbhpam3" width="158" height="35" border="0" alt="Hunting" /></a><div><ul id="vbUL_hpam3" class="vbULnpam3"><li><a href="http://www.youthoutdoorsusa.com/kids_hunting_articles.htm" title="Hunting articles for kids, children, youth" target="_self">Hunting&nbsp;articles</a></li><li><a href="http://www.youthoutdoorsusa.com/kids_hunting_photos.htm" title="Hunting photos for kids, children, youth" target="_self">Hunting&nbsp;photos</a></li><li><a href="http://www.youthoutdoorsusa.com/kids_hunting_stories.htm" title="Hunting stories for kids, children, youth" target="_self">Hunting&nbsp;stories</a></li><li><a href="http://www.youthoutdoorsusa.com/kids_hunting_websites.htm" title="Hunting websites for kids, children, youth" target="_self">Hunting&nbsp;websites</a></li></ul></div></td></tr><tr><td style="padding-bottom:1px" title ="Youth hiking - Kids hiking - Children hiking"><a href="http://www.youthoutdoorsusa.com/youth_kids_children_hiking.htm" target="_self" onmouseover=\'xpe("jpam3o");xpshow("jpam3",1,this);xpsmover(this);\' onmouseout=\'xpsmout(this);\' onmousedown=\'xpe("jpam3c");\'><img id="xpi_jpam3" src="'+vbImgPath+'/btjpam3_0.png" name="vbjpam3" width="158" height="35" border="0" alt="Hiking" /></a><div><ul id="vbUL_jpam3" class="vbULnpam3"><li><a href="http://www.youthoutdoorsusa.com/kids_hiking_articles.htm" title="Hiking articles for kids, children, youth" target="_self">Hiking&nbsp;articles</a></li><li><a href="http://www.youthoutdoorsusa.com/scenic_photos_for_kids.htm" title="Hiking photos for kids, children, youth" target="_self">Hiking&nbsp;photos</a></li><li><a href="http://www.youthoutdoorsusa.com/kids_hiking_stories.htm" title="Hiking stories for kids, children, youth" target="_self">Hiking&nbsp;stories</a></li><li><a href="http://www.youthoutdoorsusa.com/kids_hiking_websites.htm" title="Hiking websites for kids, children, youth" target="_self">Hiking&nbsp;websites</a></li></ul></div></td></tr><tr><td style="padding-bottom:1px" title ="Youth camping - kids camping - children camping"><a href="http://www.youthoutdoorsusa.com/kids_camping.htm" target="_self" onmouseover=\'xpe("kpam3o");xpshow("kpam3",1,this);xpsmover(this);\' onmouseout=\'xpsmout(this);\' onmousedown=\'xpe("kpam3c");\'><img id="xpi_kpam3" src="'+vbImgPath+'/btkpam3_0.png" name="vbkpam3" width="158" height="35" border="0" alt="Camping" /></a><div><ul id="vbUL_kpam3" class="vbULnpam3"><li><a href="http://www.youthoutdoorsusa.com/kids_camping_articles.htm" title="Camping articles for kids, children, youth" target="_self">Camping&nbsp;articles</a></li><li><a href="http://www.youthoutdoorsusa.com/kids_camping_photos.htm" title="Camping photos for kids, children, youth" target="_self">Camping&nbsp;photos</a></li><li><a href="http://www.youthoutdoorsusa.com/kids_camping_stories.htm" title="Camping stories for kids, children, youth" target="_self">Camping&nbsp;stories</a></li><li><a href="http://www.youthoutdoorsusa.com/kids_camping_websites.htm" title="Camping websites for kids, children, youth" target="_self">Camping&nbsp;websites</a></li></ul></div></td></tr><tr><td style="padding-bottom:1px" title ="Mammals for kids - mammals for children - mammals for youth"><a href="http://www.youthoutdoorsusa.com/mammals-for-kids.htm" target="_self" onmouseover=\'xpe("gpam3o");xpshow("gpam3",1,this);xpsmover(this);\' onmouseout=\'xpsmout(this);\' onmousedown=\'xpe("gpam3c");\'><img id="xpi_gpam3" src="'+vbImgPath+'/btgpam3_0.png" name="vbgpam3" width="158" height="35" border="0" alt="Mammals" /></a><div><ul id="vbUL_gpam3" class="vbULnpam3"><li><a href="http://www.youthoutdoorsusa.com/mammal_articles_for_kids.htm" title="Mammal articles for kids, children, youth" target="_self">Mammal&nbsp;articles</a></li><li><a href="http://www.youthoutdoorsusa.com/mammal_photos_for_kids.htm" title="Mammal photos for kids, children, youth" target="_self">Mammal&nbsp;photos</a></li><li><a href="http://www.youthoutdoorsusa.com/mammal_stories_for_kids.htm" title="Mammal stories for kids, children, youth" target="_self">Mammal&nbsp;stories</a></li><li><a href="http://www.youthoutdoorsusa.com/mammal_websites_for_kids.htm" title="Mammal websites for kids, children, youth" target="_self">Mammal&nbsp;websites</a></li></ul></div></td></tr><tr><td style="padding-bottom:1px" title ="Butterflies and moths for kids - butterflies and moths for children - butterflies and moths for youth"><a href="http://www.youthoutdoorsusa.com/butterflies_moths_for_kids.htm" target="_self" onmouseover=\'xpe("ioam3o");xpshow("ioam3",1,this);xpsmover(this);\' onmouseout=\'xpsmout(this);\' onmousedown=\'xpe("ioam3c");\'><img id="xpi_ioam3" src="'+vbImgPath+'/btioam3_0.png" name="vbioam3" width="158" height="35" border="0" alt="Butterflies/Moths" /></a><div><ul id="vbUL_ioam3" class="vbULnpam3"><li><a href="http://www.youthoutdoorsusa.com/butterflies_moths_articles_for_kids.htm" title="Buttlerfly and moth articles for kids, children, youth" target="_self">Buttlerfly/Moth&nbsp;articles</a></li><li><a href="http://www.youthoutdoorsusa.com/butterflies_moths_photos_for_kids.htm" title="Butterfly and moth photos for kids, children, youth" target="_self">Butterfly/Moth&nbsp;photos</a></li><li><a href="http://www.youthoutdoorsusa.com/butterfly_moth_stories_for_kids.htm" title="Butterfly and Moth stories for kids, children, youth" target="_self">Butterfly/Moth&nbsp;stories</a></li><li><a href="http://www.youthoutdoorsusa.com/butterflies_moths_websites_for_kids.htm" title="Butterfly and Moth websites for kids, children, youth" target="_self">Butterfly/Moth&nbsp;websites</a></li></ul></div></td></tr><tr><td style="padding-bottom:1px" title ="Bugs and spiders for kids - bugs and spiders for children - bugs and spiders for youth"><a href="http://www.youthoutdoorsusa.com/bugs_spiders_for_kids.htm" target="_self" onmouseover=\'xpe("1oam3o");xpshow("1oam3",1,this);xpsmover(this);\' onmouseout=\'xpsmout(this);\' onmousedown=\'xpe("1oam3c");\'><img id="xpi_1oam3" src="'+vbImgPath+'/bt1oam3_0.png" name="vb1oam3" width="158" height="35" border="0" alt="Bugs/Spiders" /></a><div><ul id="vbUL_1oam3" class="vbULnpam3"><li><a href="http://www.youthoutdoorsusa.com/bugs_spiders_articles_for_kids.htm" title="Bugs and spiders articles for kids, children, youth" target="_self">Bugs/Spiders&nbsp;articles</a></li><li><a href="http://www.youthoutdoorsusa.com/bug_spider_photos_for_kids.htm" title="Bugs and spiders photos for kids, children, youth" target="_self">Bugs/Spiders&nbsp;photos</a></li><li><a href="http://www.youthoutdoorsusa.com/bug_spider_stories_for_kids.htm" title="Bugs and spiders stories for kids, children, youth" target="_self">Bugs/Spiders&nbsp;stories</a></li><li><a href="http://www.youthoutdoorsusa.com/bug_spider_websites_for_kids.htm" title="Bugs and spiders websites for kids, children, youth" target="_self">Bugs/Spiders&nbsp;websites</a></li></ul></div></td></tr><tr><td style="padding-bottom:1px" title ="Reptiles and amphibians for kids - reptiles and amphibians for children - reptiles and amphibians for youth"><a href="http://www.youthoutdoorsusa.com/reptiles_amphibians_for_kids.htm" target="_self" onmouseover=\'xpe("coam3o");xpshow("coam3",1,this);xpsmover(this);\' onmouseout=\'xpsmout(this);\' onmousedown=\'xpe("coam3c");\'><img id="xpi_coam3" src="'+vbImgPath+'/btcoam3_0.png" name="vbcoam3" width="158" height="35" border="0" alt="Reptiles/Amphibians" /></a><div><ul id="vbUL_coam3" class="vbULnpam3"><li><a href="http://www.youthoutdoorsusa.com/reptiles_amphibians_articles_for_kids.htm" title="Reptiles and amphibians articles for kids, children, youth" target="_self">Reptiles/Amphibians&nbsp;articles</a></li><li><a href="http://www.youthoutdoorsusa.com/reptile_amphibian_photos_for_kids.htm" title="Reptiles and amphibians photos for kids, children, youth" target="_self">Reptiles/Amphibians&nbsp;photos</a></li><li><a href="http://www.youthoutdoorsusa.com/reptile_amphibian_stories_for_kids.htm" title="Reptiles and amphibians stories for kids, children, youth" target="_self">Reptiles/Amphibians&nbsp;stories</a></li><li><a href="http://www.youthoutdoorsusa.com/reptiles_amphibians.htm" title="Reptilesand amphibians websites for kids, children, youth" target="_self">Reptiles/Amphibians&nbsp;websites</a></li></ul></div></td></tr><tr><td style="padding-bottom:1px" title ="Birds for kids - birds for children - birds for youth"><a href="http://www.youthoutdoorsusa.com/birds_birdwatching_for_kids.htm" target="_self" onmouseover=\'xpe("doam3o");xpshow("doam3",1,this);xpsmover(this);\' onmouseout=\'xpsmout(this);\' onmousedown=\'xpe("doam3c");\'><img id="xpi_doam3" src="'+vbImgPath+'/btdoam3_0.png" name="vbdoam3" width="158" height="35" border="0" alt="Birds" /></a><div><ul id="vbUL_doam3" class="vbULnpam3"><li><a href="http://www.youthoutdoorsusa.com/bird_articles_for_kids.htm" title="Bird articles for kids, children, youth" target="_self">Bird&nbsp;articles</a></li><li><a href="http://www.youthoutdoorsusa.com/bird_photos_for_kids.htm" title="Bird photos for kids, children, youth" target="_self">Bird&nbsp;photos</a></li><li><a href="http://www.youthoutdoorsusa.com/bird_stories_for_kids.htm" title="Bird stories for kids, children, youth" target="_self">Bird&nbsp;stories</a></li><li><a href="http://www.youthoutdoorsusa.com/bird_websites_for_kids.htm" title="Bird websites for kids, children, youth" target="_self">Bird&nbsp;websites</a></li></ul></div></td></tr><tr><td style="padding-bottom:1px" title ="Wildflowers for kids - wildflowers for children - wildflowers for youth"><a href="http://www.youthoutdoorsusa.com/flowers_for_kids.htm" target="_self" onmouseover=\'xpe("7oam3o");xpshow("7oam3",1,this);xpsmover(this);\' onmouseout=\'xpsmout(this);\' onmousedown=\'xpe("7oam3c");\'><img id="xpi_7oam3" src="'+vbImgPath+'/bt7oam3_0.png" name="vb7oam3" width="158" height="35" border="0" alt="Wildflowers" /></a><div><ul id="vbUL_7oam3" class="vbULnpam3"><li><a href="http://www.youthoutdoorsusa.com/wildflower_articles_for_kids.htm" title="Wildflower articles for kids, children, youth" target="_self">Wildflower&nbsp;articles</a></li><li><a href="http://www.youthoutdoorsusa.com/wildflower_photos_for_kids.htm" title="Wildflower photos for kids, children, youth" target="_self">Wildflower&nbsp;photos</a></li><li><a href="http://www.youthoutdoorsusa.com/wildflower_stories_for_kids.htm" title="Wildflower stories for kids, children, youth" target="_self">Wildflower&nbsp;stories</a></li><li><a href="http://www.youthoutdoorsusa.com/wildflower_websites_for_kids.htm" title="Wildflower websites for kids, children, youth" target="_self">Wildflower&nbsp;websites</a></li></ul></div></td></tr><tr><td style="padding-bottom:1px" title ="Plants for kids - plants for children - plants for youth"><a href="http://www.youthoutdoorsusa.com/plants_for_kids.htm" target="_self" onmouseover=\'xpe("qoam3o");xpshow("qoam3",1,this);xpsmover(this);\' onmouseout=\'xpsmout(this);\' onmousedown=\'xpe("qoam3c");\'><img id="xpi_qoam3" src="'+vbImgPath+'/btqoam3_0.png" name="vbqoam3" width="158" height="35" border="0" alt="Other Plant Life" /></a><div><ul id="vbUL_qoam3" class="vbULnpam3"><li><a href="http://www.youthoutdoorsusa.com/plant_articles_for_kids.htm" title="Plant articles for kids, children, youth" target="_self">Plant&nbsp;articles</a></li><li><a href="http://www.youthoutdoorsusa.com/plant_photos_for_kids.htm" title="Plant photos for kids, children, youth" target="_self">Plant&nbsp;photos</a></li><li><a href="http://www.youthoutdoorsusa.com/plant_stories_for_kids.htm" title="Plant stories for kids, children, youth" target="_self">Plant&nbsp;stories</a></li><li><a href="http://www.youthoutdoorsusa.com/plant_websites_for_kids.htm" title="Plant websites for kids, children, youth" target="_self">Plant&nbsp;websites</a></li></ul></div></td></tr><tr><td style="padding-bottom:1px" title ="Dangerous plants and animals for kids - dangerous plants and animals for children - dangerous plants and animals for youth"><a href="http://www.youthoutdoorsusa.com/dangerous_plants_animals_for_kids.htm" target="_self" onmouseover=\'xpe("moam3o");xpshow("moam3",1,this);xpsmover(this);\' onmouseout=\'xpsmout(this);\' onmousedown=\'xpe("moam3c");\'><img id="xpi_moam3" src="'+vbImgPath+'/btmoam3_0.png" name="vbmoam3" width="158" height="35" border="0" alt="Dangerous Plants/Animals" /></a><div><ul id="vbUL_moam3" class="vbULnpam3"><li><a href="http://www.youthoutdoorsusa.com/dangerous_plant_articles_for_kids.htm" title="Dangerous plants articles for kids, children, youth" target="_self">Dangerous&nbsp;plants&nbsp;articles</a></li><li><a href="http://www.youthoutdoorsusa.com/dangerous_plant_photos.htm" title="Dangerous plants photos for kids, children, youth" target="_self">Dangerous&nbsp;plants&nbsp;photos</a></li><li><a href="http://www.youthoutdoorsusa.com/dangerous_plant_stories_for_kids.htm" title="Dangerous plants stories for kids, children, youth" target="_self">Dangerous&nbsp;plants&nbsp;stories</a></li><li><a href="http://www.youthoutdoorsusa.com/dangerous_plants_websites_for_kids.htm" title="Dangerous plants websites for kids, children, youth" target="_self">Dangerous&nbsp;plants&nbsp;websites</a></li><li><a href="http://www.youthoutdoorsusa.com/dangerous_animal_articles_for_kids.htm" title="Dangerous animals articles for kids, children, youth" target="_self">Dangerous&nbsp;animals&nbsp;articles</a></li><li><a href="http://www.youthoutdoorsusa.com/dangerous_animal_photos_for_kids.htm" title="Dangerous animals stories for kids, children, youth" target="_self">Dangerous&nbsp;animals&nbsp;photos</a></li><li><a href="http://www.youthoutdoorsusa.com/dangerous_animal_stories_for_kids.htm" title="Dangerous animals stories for kids, children, youth" target="_self">Dangerous&nbsp;animals&nbsp;stories</a></li><li><a href="http://www.youthoutdoorsusa.com/dangerous_animal_websites_for_kids.htm" title="Dangerous animals websites for kids, children, youth" target="_self">Dangerous&nbsp;animals&nbsp;websites</a></li></ul></div></td></tr><tr><td style="padding-bottom:1px" title ="Team sports for kids - team sports for children - team sports for youth"><a href="http://www.youthoutdoorsusa.com/youth_kids_children_sports_team.htm" target="_self" onmouseover=\'xpe("5oam3o");xpshow("5oam3",1,this);xpsmover(this);\' onmouseout=\'xpsmout(this);\' onmousedown=\'xpe("5oam3c");\'><img id="xpi_5oam3" src="'+vbImgPath+'/bt5oam3_0.png" name="vb5oam3" width="158" height="35" border="0" alt="Team Sports" /></a><div><ul id="vbUL_5oam3" class="vbULnpam3"><li><a href="http://www.youthoutdoorsusa.com/kids_team_sports_articles.htm" title="Team sports articles for kids, children, youth" target="_self">Team&nbsp;sports&nbsp;articles</a></li><li><a href="http://www.youthoutdoorsusa.com/kids_team_sports_photos.htm" title="Team sports photos for kids, children, youth" target="_self">Team&nbsp;sports&nbsp;photos</a></li><li><a href="http://www.youthoutdoorsusa.com/team_sports_stories_for_kids.htm" title="Team sports stories for kids, children, youth" target="_self">Team&nbsp;sports&nbsp;stories</a></li><li><a href="http://www.youthoutdoorsusa.com/kids_team_sports_websites.htm" title="Team sports websites for kids, children, youth" target="_self">Team&nbsp;sports&nbsp;websites</a></li></ul></div></td></tr><tr><td style="padding-bottom:1px" title ="Individual sports for kids - individual sports for children - individual sports for youth"><a href="http://www.youthoutdoorsusa.com/youth_kids_children_sports_individual.htm" target="_self" onmouseover=\'xpe("aoam3o");xpshow("aoam3",1,this);xpsmover(this);\' onmouseout=\'xpsmout(this);\' onmousedown=\'xpe("aoam3c");\'><img id="xpi_aoam3" src="'+vbImgPath+'/btaoam3_0.png" name="vbaoam3" width="158" height="35" border="0" alt="Individual Sports" /></a><div><ul id="vbUL_aoam3" class="vbULnpam3"><li><a href="http://www.youthoutdoorsusa.com/kids_individual_sports_articles.htm" title="Individual sports articles for kids, children, youth" target="_self">Individual&nbsp;sports&nbsp;articles</a></li><li><a href="http://www.youthoutdoorsusa.com/kids_individual_sports_photos.htm" title="Individual sports photos for kids, children, youth" target="_self">Individual&nbsp;sports&nbsp;photos</a></li><li><a href="http://www.youthoutdoorsusa.com/individual_sports_stories_for_kids.htm" title="Individual sports stories for kids, children, youth" target="_self">Individual&nbsp;sports&nbsp;stories</a></li><li><a href="http://www.youthoutdoorsusa.com/kids_individual_sports_websites.htm" title="Individual sports websites for kids, children, youth" target="_self">Individual&nbsp;sports&nbsp;websites</a></li></ul></div></td></tr><tr><td style="padding-bottom:1px" title ="Youth outdoors organizations - kids outdoors organization - childrens outdoor organizations"><a href="http://www.youthoutdoorsusa.com/kids_youth_children_outdoors_organizations.htm" target="_parent" onmouseover=\'xpe("soam3o");\' onmouseout=\'xpe("soam3n");\' onmousedown=\'xpe("soam3c");\'><img id="xpi_soam3" src="'+vbImgPath+'/btsoam3_0.png" name="vbsoam3" width="158" height="35" border="0" alt="Youth OutdoorsOrganizations" /></a></td></tr></table>');
vbnpam3n=xppr('npam3_0.png');vbnpam3o=xppr('npam3_1.png');vbnpam3c=xppr('npam3_2.png');vbhpam3n=xppr('hpam3_0.png');vbhpam3o=xppr('hpam3_1.png');vbhpam3c=xppr('hpam3_2.png');vbjpam3n=xppr('jpam3_0.png');vbjpam3o=xppr('jpam3_1.png');vbjpam3c=xppr('jpam3_2.png');vbkpam3n=xppr('kpam3_0.png');vbkpam3o=xppr('kpam3_1.png');vbkpam3c=xppr('kpam3_2.png');vbgpam3n=xppr('gpam3_0.png');vbgpam3o=xppr('gpam3_1.png');vbgpam3c=xppr('gpam3_2.png');vbioam3n=xppr('ioam3_0.png');vbioam3o=xppr('ioam3_1.png');vbioam3c=xppr('ioam3_2.png');vb1oam3n=xppr('1oam3_0.png');vb1oam3o=xppr('1oam3_1.png');vb1oam3c=xppr('1oam3_2.png');vbcoam3n=xppr('coam3_0.png');vbcoam3o=xppr('coam3_1.png');vbcoam3c=xppr('coam3_2.png');vbdoam3n=xppr('doam3_0.png');vbdoam3o=xppr('doam3_1.png');vbdoam3c=xppr('doam3_2.png');vb7oam3n=xppr('7oam3_0.png');vb7oam3o=xppr('7oam3_1.png');vb7oam3c=xppr('7oam3_2.png');vbqoam3n=xppr('qoam3_0.png');vbqoam3o=xppr('qoam3_1.png');vbqoam3c=xppr('qoam3_2.png');vbmoam3n=xppr('moam3_0.png');vbmoam3o=xppr('moam3_1.png');vbmoam3c=xppr('moam3_2.png');vb5oam3n=xppr('5oam3_0.png');vb5oam3o=xppr('5oam3_1.png');vb5oam3c=xppr('5oam3_2.png');vbaoam3n=xppr('aoam3_0.png');vbaoam3o=xppr('aoam3_1.png');vbaoam3c=xppr('aoam3_2.png');vbsoam3n=xppr('soam3_0.png');vbsoam3o=xppr('soam3_1.png');vbsoam3c=xppr('soam3_2.png');var arrowChar='&raquo;';/*
 *==============================================================================
 *
 *     Copyright (c) 2007-2009, by Vista-buttons.com
 *     Version 2.1.2i
 *     http://vista-buttons.com
 *
 *==============================================================================
 * 
 * todo:
 * - item move into anchor
 * - item over using css
 * - item base on li structure
 *
 * variables:
 *   @btIdPref
 *   @pItem
 *   @ulIdPref
 *   @frameSubmenu
 *
 */
 
 
var btIdPref='vb';

function xppr(im) {
	var i=new Image();
	i.src=vbImgPath+'bt'+im;
	return i;
};

function xpe(id) {
	x=id.substring(0,id.length-1);
	if(document[btIdPref+x])document[btIdPref+x].src=eval(btIdPref+id+'.src');
};


/*
*	Vista buttons engine functions
*/ 
function vistaButtons(params){
	// init global vars
	var xobtn = null; // curent element text identifier curent
	var menuContId = 'xpMenuCont';
	var ulIdPref='vbUL_';
	
	
	//Detect browser
	var isDOM=document.getElementById; //DOM1 browser (MSIE 5+, Netscape 6, Opera 5+)
	var isOp=isO5=window.opera && isDOM; //Opera 5+
	var isOp7=isOp && document.readyState; //Opera 7+
	var isIE=document.all && document.all.item && !isOp; //Microsoft Internet Explorer 4+
	var isMz=isDOM && navigator.appName=="Netscape"; //Mozilla or Netscape 6.*


	
	/*
	 *  vistabuttons engine and global object
	 */
	
	/* create new menu and insert it to page */
	document.write('<div id="' + menuContId + '" ></div>');
	var menuCont = document.getElementById(menuContId);
		
	var ULs = document.getElementsByTagName('UL');
	for (var i=0, cnt=ULs.length; i<cnt; i++)
		if (ULs[i].id
		&& (ULs[i].id.substring(0, ulIdPref.length)==ulIdPref) // if is xp UL
		&& !(
			(ULs[i].parentNode)
			&& (ULs[i].parentNode.parentNode)
			&& (ULs[i].parentNode.parentNode.id.substring(0, ulIdPref.length)==ulIdPref)
			)
		)
		{
			// hide vista-buttons link
			var A=document.getElementById(ULs[i].id+'a');
			if (A) A.style.display='none';
		
			createMenu(ULs[i], 0, 0, params, menuCont);
			ULs[i].style.display = 'none';
		};
		
	

	/*
	 * create menu
	 * structure:	<div - menu >
	 *			<table>
	 *				<tr - item>
	 *					<td - for icon><img></td>
	 *					<td - for label><a></a></td>
	 *					<td - for arrow><img></td>
	 *				</tr>
		 *				...
	 *			</table>
	 *		</div>
	 * @ulParent - main parent of menu UL
	 * @iParent - parent item
	 * @level - level
	 */
	function createMenu(ulParent, iParent, level, params, owner){
	
		// create menu obj
		var oMenu = document.createElement((params.subFrame?'table':'div'));
		owner.appendChild(oMenu);
		if (oMenu.tagName == 'TABLE') oMenu.cellSpacing = 0; // set even if don't need in concert
		
		
		// assign menu content and crate a frame if need
		var oMenuCont;
		if (params.subFrame)
			for (var i=0; i<3; i++){
				var row = oMenu.insertRow(-1);
				for (var j=0; j<3; j++){
					var cell = row.insertCell(-1);
					if (i==1 && j==1) oMenuCont = cell
					else cell.className = 'imgFrame'+i+j;
				}
			}
		else
			oMenuCont = (oMenu.tagName == 'DIV')? oMenu: oMenu.insertRow(-1).insertCell(-1);
		
		oMenuCont.className = 'subContent';
		
		
		var oTable = document.createElement('table');
		oMenuCont.appendChild(oTable);

		oMenu.id = ulParent.id + 'tbl';
		oMenu.className = ulParent.className; // inherite style from menu definition with ul
		//oTable.style.visibility = 'hidden';
		oMenu.style.position = 'absolute'; // set here without fail
		oMenu.xpItems = [];		/* submenu items list */
		oMenu.iParent = iParent;
		oMenu.level = level;
		
		oMenu.style.zIndex = 9 + oMenu.level;
		oTable.cellSpacing = 0;

		// set menu events and metods
		oMenu.onmouseover = function (){
			xpStopTimeOut(this);
		};
		oMenu.onmouseout = function (){
			xpStartTimeOut(xpShownMenu)
		};
		oMenu.xpClearMenuMark = function(){
			for (var j = 0; j < this.xpItems.length; j++){
				p = this.xpItems[j];
				if (p.tagName == 'TR') {
					p.className = p.className.replace('over','');
					if (p.className.indexOf('popup')<0)	p.clrOverImg();
				}
			};
		};
		
		oMenu.smShown = 0;
		
		/* create items  - organizing circle for LI */
		for (var i=0, cntLI=ulParent.childNodes.length; i<cntLI; i++){
			var oLI = ulParent.childNodes[i];
			if (oLI.tagName != 'LI') continue;
			
			
			/* 
			*	create menu item
			*/
			
			// create item base
			var oItem = oTable.insertRow(-1);
			
					
			// parse LI content 
			// <img src="icon">     <a> Item Label </a>     <img src="arrow">     <ul></ul>
			var InnerAnchor = 0;
			oItem.Img = null;
			oItem.ImgOver = null;
			var InnerUl = 0;
			oItem.ImgArrow = null;
			oItem.ImgArrowOver = null;

			// parse LI content
			for (var j=0; j < oLI.childNodes.length; j++)
				if (oLI.childNodes[j].tagName == 'A') InnerAnchor = oLI.childNodes[j];
				else if (oLI.childNodes[j].tagName == 'IMG'){
					if (!InnerAnchor){
						if (!oItem.Img) oItem.Img = oLI.childNodes[j];
						else oItem.ImgOver = oLI.childNodes[j]
					}
					else {
						if(!oItem.ImgArrow) oItem.ImgArrow = oLI.childNodes[j];
						else oItem.ImgArrowOver = oLI.childNodes[j]
					}
				}
				else if (oLI.childNodes[j].tagName == 'UL') InnerUl = oLI.childNodes[j];
				else if (oLI.childNodes[j].tagName == 'DIV'){
					for (var k=0; k<oLI.childNodes[j].childNodes.length; k++)
						if (oLI.childNodes[j].childNodes[k].tagName=='UL') InnerUl = oLI.childNodes[j].childNodes[k];
				}


			if (InnerAnchor || InnerUl || oItem.ImgArrow){ // it is not a separator

				var oItemCont = oItem;
				oItem.className = oLI.className;
				oItem.menu = oMenu;		
				oItem.setPopup = function(){
					this.className +=  ' popup';
				};
				oItem.clrPopup = function(){
					this.className = this.className.replace('popup','');
					if (this.className.indexOf('over')<0) this.clrOverImg();
				};
				oItem.clrOverImg = function(){
					if (this.Img) this.Img.style.display = 'inline';
					if (this.ImgOver) this.ImgOver.style.display = 'none';
					if (this.ImgArrow) this.ImgArrow.style.display = 'inline';
					if (this.ImgArrowOver) this.ImgArrowOver.style.display = 'none'
				};
			
				// create item content
				var oTDIMG = oItemCont.insertCell(-1);
				var oTDLabel = oItemCont.insertCell(-1);
				var oTDArrow = oItemCont.insertCell(-1);
				
				oTDIMG.style.borderRightWidth = '0px';
				oTDLabel.style.borderRightWidth = '0px';
				oTDLabel.style.borderLeftWidth = '0px';
				oTDArrow.style.borderLeftWidth = '0px';
				oTDIMG.style.paddingRight = '4px';
				oTDLabel.style.paddingRight = '4px';
				oTDLabel.style.paddingLeft = '4px';
				oTDArrow.style.paddingLeft = '4px';

				if (oItem.Img) oTDIMG.appendChild(oItem.Img);
				else oTDIMG.innerHTML = '&nbsp;';
				if (oItem.ImgOver) {
					oItem.ImgOver.style.display = 'none';
					oTDIMG.appendChild(oItem.ImgOver);
				};

				// create anchor with link execution
				if (InnerAnchor){
					var newText = document.createElement('SPAN');
					newText.innerHTML = InnerAnchor.innerHTML;

					if (InnerAnchor.href.indexOf('.pdf')>=0 && document.all)
						oTDLabel.appendChild(newText)
					else{
						oTDLabel.appendChild(InnerAnchor);
						
						// off standart click 
						InnerAnchor.onclick = function(){
							return false;
						};
					};
					
					oItem.linkHref = InnerAnchor.href;
					oItem.linkTarget = InnerAnchor.target;
					
					/* add item to menu info */
					with(oMenu) xpItems[xpItems.length] = oItem;
					
					// define my click handle event
					oItem.onclick = function(){
						if (this.linkHref)
							open(this.linkHref, (this.linkTarget? this.linkTarget :"_self"));
					}
				}
				else oTDLabel.innerHTML = '&nbsp;';

				// set item events
				oItem.onmouseover = function (){
					// clear other mark
					this.menu.xpClearMenuMark();
					this.className += ' over';// mark this item
					if (this.ImgOver){
						this.Img.style.display = 'none';
						this.ImgOver.style.display = 'inline';
					};
					if (this.ImgArrowOver){
						this.ImgArrow.style.display = 'none';
						this.ImgArrowOver.style.display = 'inline';
					};

					if (this.smPopup) xpshowmenu(this.smPopup, 1, this); // show new menu
					else xpStartTimeOut(this.menu.smShown); // hide bug
				};
				oItem.onmouseout = function (){
					this.menu.xpClearMenuMark();
				};

				// define submenu
				if (InnerUl){
					// set event for over
					oTDArrow.className = 'arrow';
					if (oItem.ImgArrow){ 
						oTDArrow.appendChild(oItem.ImgArrow);
						if (oItem.ImgArrowOver){
							oItem.ImgArrowOver.style.display = 'none';
							oTDArrow.appendChild(oItem.ImgArrowOver)
						}
					}
					else {
						if (typeof(arrowChar)!='undefined' && arrowChar){
							oTDArrow.appendChild(document.createElement('a'));
							oTDArrow.lastChild.innerHTML = arrowChar;
						}
						else oTDArrow.innerHTML = '&nbsp;';
					};

					oItem.smPopup = createMenu(InnerUl, oItem, level + 1, params, owner);
				}
				else oTDArrow.innerHTML = '&nbsp;';
			}
			else{ // add a separator
				oItem.className = 'separator';
				var oTD = oItem.insertCell(-1);
				oTD.colSpan = 3;
				
				oTD.innerHTML = '<div></div>';
			}

		}

		return oMenu;
	};



	function xpDef(){
	  for(var i=0; i<arguments.length; ++i){if(typeof(arguments[i])=='undefined') return false;}
	  return true;
	};


	function xpClientSize(){
	
		var x=0,y=0,w=0,h=0,doc=document,win=window;

		var cond = (!doc.compatMode || doc.compatMode == 'CSS1Compat') /*&& !win.opera */&& doc.documentElement;
		// height
		if(cond && doc.documentElement.clientHeight) h=doc.documentElement.clientHeight;
		else if(doc.body && doc.body.clientHeight) h=doc.body.clientHeight;
		else if(xpDef(win.innerWidth,win.innerHeight,doc.width)) {
			h=win.innerHeight;
			if(doc.width>win.innerWidth) h-=16;
		};
		//width
		if(cond && doc.documentElement.clientWidth) w=doc.documentElement.clientWidth;
		else if(doc.body && doc.body.clientWidth) w=doc.body.clientWidth;
		else if(xDef(win.innerWidth,win.innerHeight,doc.height)) {
			w=win.innerWidth;
			if(doc.height>win.innerHeight) w-=16;
		}

		if(doc.documentElement && doc.documentElement.scrollLeft) x=doc.documentElement.scrollLeft;
		else if(doc.body && xpDef(doc.body.scrollLeft)) x=doc.body.scrollLeft;

		if(doc.documentElement && doc.documentElement.scrollTop) y=doc.documentElement.scrollTop;
		else if(doc.body && xpDef(doc.body.scrollTop)) y=doc.body.scrollTop;
		
		return {x:x,y:y,w:w,h:h};
	};



	function xpObjectSize(o){
		var w = (isOp&&!isOp7) ? o.style.pixelWidth  : document.layers ? o.clip.width /* Netscape 4.*/ : o.offsetWidth;
		var h = (isOp&&!isOp7) ? o.style.pixelHeight : document.layers ? o.clip.height/* Netscape 4.*/ : o.offsetHeight;
		return {x:w, y:h};
	};



	/*
	 * calc absolute coordinates of specified object
	 */
	function xppos(obj){
		var l=0, t=0;
		while (obj) //  && obj.tagName!='BODY'
		{
			l += obj.offsetLeft;
			t += obj.offsetTop;
		
			// some browser not right set offsetParent
			//		if (obj.style && obj.style.position=='absolute') break;// this is a fix but not constant
			
			obj = obj.offsetParent;
		};	

		// fix special for opera
		if (document.body) with (document){
			if (body.leftMargin) l -= body.leftMargin;
			if (body.topMargin) t -= body.topMargin
		}

		return {x: l, y: t};
	};



	/* show menu item
	 * ind - part of object identifier
	 * @isVertical - previous menu is vertical
	 * @iParent - object created events identifier - this is about a anchor or previous menu item
	 */
	var xpshow = window.xpshow = function(ind, isVertical, iParent){
		xpshowmenu(ulIdPref+ind+'tbl', isVertical, iParent);
	}

	function xpshowmenu(menu, isVertical, iParent)
	{
		menu = get(menu);
		if (!menu) return;
		
		// already showing?
		if (menu.style.visibility == 'visible'){
			xpStopTimeOut(menu);
			return;
		};
		
		// hide previous menu in this level
		if (iParent && iParent.menu)
			xphide(iParent.menu.smShown);
		if (!menu.level && (xpShownMenu != menu))
			xphide(xpShownMenu);

		// it saves button main menu
		if (!menu.level) xobtn = menu.id.replace(ulIdPref,'').replace('tbl','');

		// Parent - parent menu item
		var parentObj =  (iParent.tagName == 'A')? iParent.parentNode: iParent;

		var pos = xppos(parentObj); // parent coordinate
		if (iParent && iParent.menu){
			pos.x -= iParent.menu['scrollLeft'] || 0;
			pos.y -= iParent.menu['scrollTop'] || 0;
		};
		var size = xpObjectSize(parentObj);

		menu.xpMenuX = 1; // menu open direction
		menu.xpMenuDx = 1; // menu open  offset
		if (menu.level > 0){
			// inherit direction from previous level
			menu.xpMenuX = menu.iParent.menu.xpMenuX;
			menu.xpMenuDx = menu.iParent.menu.xpMenuDx;
		};
		
		// initialize property
		menu.style.overflow = 'visible';
		menu.style.height = 'auto';
		menu.style.width = 'auto';

		// fix bug position for some document structure
		menu.style.left = '0px';
		menu.style.top = '0px';
		var parentAbs = xppos(menu);

		// detect window size
		var WinSize = xpClientSize();
		var menuSize = xpObjectSize(menu);

		// calc and init Y coordinate
		var CalcedPos = xpCalcMenuPos(WinSize.y, WinSize.h, pos.y, size.y, menuSize.y, menu.xpMenuDx, isVertical);

		menu.xpMenuDx = CalcedPos.align;

		// fix scrollbar bug for opera
		if (isOp && !menu.OrigWidth) menu.OrigWidth = menu.clientWidth;//menu.clientWidth;


		// size was changed - resize height, open scroll, correct width for scrollbar
		if (CalcedPos.size < menuSize.y){
			//xpsm.style.overflowY = 'auto';
			menu.style.overflow = 'auto';
			//menu.style.overflow = 'visible';
			if (isIE) menu.style.overflowX = 'visible';
			if (isIE) menu.style.width = menu.offsetWidth + 17 + 'px';
			else if (isMz) menu.style.magrinRight = 20;

			menu.style.height = CalcedPos.size + 'px';
			menu.scrollTop  = 0;
			menu.scrollLeft = 0;

			// fix scrollbar bug for opera
			if (isOp) menu.style.width = menu.OrigWidth + 'px';
		};

		menu.style.top = CalcedPos.xy - parentAbs.y + 'px';

		// calc and init X coorinate
		menuSize = xpObjectSize(menu);
		CalcedPos = xpCalcMenuPos(WinSize.x, WinSize.w, pos.x, size.x, menuSize.x, menu.xpMenuX, !isVertical);
		menu.xpMenuX = CalcedPos.align;
		if (CalcedPos.size < menuSize.x)// size was changed
			if (menu.xpMenuX > 0)
				CalcedPos.xy -= (menuSize.x - CalcedPos.size); // covered
		menu.style.left = CalcedPos.xy - parentAbs.x + 'px';

		menu.style.visibility = 'visible';

		if (!menu.level) xpShownMenu = menu
		else {
			iParent.menu.smShown = menu;
			iParent.setPopup();
		}
		
	};

	
	

	/*
	 calc menu pos for one coordinate 
	 use size of menu, parent object and screen, menu direction and parent menu orientation
	 screenSize - size of screen
	 parentXY, parentSize - position and size of parent menu
	 size - size of selected menu
	 align = +1(right, bottom), 0(center), -1(left, top)  - direction of menu
	 oHoriz  = 0(vertical), 1(horizontal) - orientation of parent menu
	*/
	function xpCalcMenuPos(screenXY, screenSize, parentXY, parentSize, size, align, oHoriz){
		var xy = parentXY;
		var newSize = size;
		var newAlign = align;
		var space = 5; // space to document borders
		
		if ((align == 0) && (!oHoriz)) align = 1; //center may be only for horizontal orientation
		
		if (!oHoriz) {// VERTICAL
			// |------<--------->)<---parent--->(<---------->---------|
			// check the place for the future menu and correct orientation
			if	(((newAlign >= 0) && (parentXY + parentSize + size > screenSize + screenXY - space)) // don't go in screen from the algin
								|| ((newAlign < 0) && (parentXY - size < space))){
				// correct direction about most of place
				if (parentXY - screenXY > screenSize + screenXY - (parentXY + parentSize)) newAlign = -1; else newAlign = 1;
			};
			// set coordinate and size
			if (newAlign >= 0){
				xy = parentXY + parentSize;
				if (screenSize + screenXY - space - xy < newSize) newSize = screenSize + screenXY  - space - xy;
			}
			else {
				xy = parentXY - newSize;
				if (xy - screenXY < space){
					xy = space + screenXY;
					newSize = parentXY - space - screenXY;
				}
			}
		}
		else {
			// --------------- <---parent---> -------------------
			//                      (<------------------------>--------|
			//   |-----<--------------------->)
			// if menu not go in screen
			if (newSize > screenSize - 2*space) {
				xy = space + screenXY;
				newSize = screenSize - 2*space;
			}
			else{
				// calc
				xy = parentXY + parentSize/2 - newSize/2 + newAlign * (newSize/2 - parentSize/2);

				// correct
				if (xy < space + screenXY){
					newAlign = 1;
					xy = space + screenXY;
				}
				if (xy + size > screenSize  + screenXY - space){
					newAlign = -1;
					xy -= xy + newSize - (screenSize  + screenXY - space);
				}
			}
		};

		return {xy: xy, size: newSize, align: newAlign};
	};
	
	
	function get(o){
		return (typeof o == 'string')? document.getElementById(o): o
	}
	

	/*
	 * hide submenu
	 * @menu
	 */
	function xphide(menu){
		menu = get(menu);
		if (!menu || menu.style.visibility != 'visible') return;

		// hide child
		xphide(menu.smShown);
		
		// off cursor selection
		menu.xpClearMenuMark();

		// hide the menu
		menu.style.visibility = 'hidden';

		// if all submenu close, then change button icon
		if (menu.level == 0){
			xpe(xobtn + 'n');//???????????
		}

		menu.smShown = 0;
		if (menu.iParent) menu.iParent.clrPopup();

		// clear to hide timeout
		if (menu.hideTimer){
			clearTimeout(menu.hideTimer);
			menu.hideTimer = null;
		}
	};
	window.xphide = xphide;
	
	

	// on mouse out from menu
	window.xpsmout = function(sender){
		if (!sender) return;
		// set time out
		xpStartTimeOut(xpShownMenu)
	};
	

	// on mouse over menu
	window.xpsmover = function(menu)
	{
		xpStopTimeOut(menu);
	};


	/*
	*	clear Time out for all parent and this menu 
	*	run in submenu engine context
	*/
	function xpStopTimeOut(menu){
		for( var o = menu; o; o = o.iParent? o.iParent.menu: 0)
			if (o.hideTimer)
				o.hideTimer = clearTimeout(o.hideTimer);
	};

	
	/*
	 * 	 start hide timer for this menu and all its submenu 
	 */
	function xpStartTimeOut(menu){
		if (menu) {
			if (!menu.hideTimer) 
				menu.hideTimer = setTimeout( function (){ xphide(menu) } , 300);
			xpStartTimeOut(menu.smShown)
		}
	}


};// end of menu component

var xpShownMenu = 0; // curent open menu tread

new vistaButtons({
	subFrame: 0
});



