var icoTab = new Array();

function InitAll() {
                   var menuIcon = document.getElementById('menuIcon');
                   if (menuIcon.hasChildNodes()) {
                                                     eleTab = menuIcon.childNodes;
                                                     var a=0;
                                                     for (var i=0; i<eleTab.length; i++) {
                                                                                         if (eleTab[i].className) {
                                                                                         if (eleTab[i].childNodes[0]) {
                                                                                         //alert("nunu");
                                                                                                                      }

                                                                                                           NewEvent(eleTab[i],'click', icoLink, false);
                                                                                                           icoTab[eleTab[i].className] = eleTab[i].childNodes[0];
                                                                                                           /*
                                                                                                           var photoId = parseInt(eleTab[i].id);
                                                                                                           photosTab[a] = photoId;
                                                                                                           */
                                                                                                           a++;
                                                                                                           }
                                                                                         }
                                                     }

                   }
function icoLink (evnt) {
                        evnt = evnt ? evnt : window.event;
                        var icoCn;
                        if (evnt.target) icoCn = evnt.target.className;
                        else icoCn = evnt.srcElement.className;
                        window.location.href = icoTab[icoCn];
                        }

function NewEvent (Elem, EventType, Fct, Capt) {
	                                           return document.addEventListener?Elem.addEventListener(EventType, Fct, Capt):Elem.attachEvent ? Elem.attachEvent('on' + EventType, Fct):false;
	                                           }
function DelEvent (Elem, EventType, Fct, Capt) {
                                               return document.removeEventListener?Elem.removeEventListener(EventType, Fct, Capt):Elem.detachEvent ? Elem.detachEvent('on' + EventType, Fct):false;
                                               }
function StopPropag(evnt) {
	                      if(evnt && evnt.stopPropagation && evnt.preventDefault) {
		                                                                          evnt.stopPropagation();
		                                                                          evnt.preventDefault();
	                                                                              }
                          else if(evnt && window.event) {
		                                                window.event.cancelBubble = true;
		                                                window.event.returnValue = false;
                                                        }
                          return false;
                          }
window.onload = InitAll;