function fn_addToBasket(strSKU, strOrigin, intQuantity,attName,cPrice,cLevel,cQty,catID){
	var strOrigin = strOrigin;
	strOrigin = strOrigin.replace("&", "*")
	//var strProductQTY = "QTY-" + intId;
	var arrAttName        =new Array();
	var arrVari        =new Array();
	var totalPriceHtml    =document.getElementById("totalPrice"); 
	var currentPrice = cPrice;
	arrAttName = attName.split(",");
	stringVari ="0";
	//alert(cQty); 
	if (arrAttName.length>1){
				for(p=1;p<=arrAttName.length-1;p++){
					//alert(arrAttName[p]);
						
					elementAtt = document.getElementById(arrAttName[p]);
					stringVari = stringVari+','+elementAtt.value;
					
						 
						
					}
			}
			
	//alert(attName+oPrice);
	var intQTY = document.getElementById(intQuantity).value;

	if(intQTY <= 0 || intQTY != parseInt(intQTY)){
		alert('Please add a valid quantity');
		return false;
	}else{
		//alert(parseInt(intQTY)+parseInt(cQty));
	if (parseInt(intQTY)+parseInt(cQty)>parseInt(cLevel)){
		alert('Only '+cLevel+' items in stock!') ;
		if(parseInt(cQty)>parseInt(cLevel)){
			intQTY = 0;
			return false;}
			else{
		//intQTY = parseInt(cLevel)-parseInt(cQty);
		intQTY = parseInt(cLevel);}
		// alert(intQTY);
		}	}
	
		var strURL = "processing/addToBasketProcessing.asp?strProductSKU=" + strSKU;
		strURL += "&intQTY=" + intQTY;
		strURL += "&strOrigin=" + strOrigin;
		strURL += "&strVariations=" + stringVari;
		strURL += "&cPrice=" + currentPrice;
		strURL += "&catID=" + catID;
		window.location= strURL ;
	
}
function fn_addToBasketC(strSKU, strOrigin, intQuantity,attName,cPrice,cLevel){
	var strOrigin = strOrigin;
	strOrigin = strOrigin.replace("&", "*")
	//var strProductQTY = "QTY-" + intId;
	
	
	var currentPrice = cPrice;
	
	//alert(attName+oPrice);
	var intQTY = document.getElementById(intQuantity).value;

	if(intQTY <= 0 || intQTY != parseInt(intQTY)){
		alert('Please add a valid quantity');
		return false;  
	}else{
		//alert(parseInt(intQTY)+parseInt(cQty));
	if (intQTY>cLevel){
		alert('Only '+cLevel+' items in stock!') ;
		intQTY = cLevel;
		}	
		}
	
		var strURL = "processing/addToBasketProcessing.asp?strProductSKU=" + strSKU;
		strURL += "&intQTY=" + intQTY;
		strURL += "&strOrigin=" + strOrigin;
		strURL += "&strVariations=" + attName;
		strURL += "&cPrice=" + currentPrice;
		window.location= strURL ;
	
	
}
function removeItem(strSKU,strVari){
	strURL = "processing/removeFrombasket.asp?strSKU=" + strSKU+"&strVariations="+strVari;
	window.location = strURL;
}
function fn_showChange(id, class1, class2){
//get the id of the element you wish to change
	identity=document.getElementById(id);
	
	//alert(identity);
	//check what the current class is and swap it for the alternate class
	if(identity.className==class1){
		className=class2;
	}else{
		className=class1;
	};

	identity.className=className;
}

function imageFadeIn(img){
  img.opacity = 0;
    setOpacity(img, 30, 5);  
}
function setOpacity (imgName, step, delay){

  var img = document.images[imgName];
  img.opacity += step;
  if (document.all) img.style.filter = 'alpha(opacity = ' + img.opacity + ')'; 
  if (step > 0 && img.opacity < 100 || step < 0 && img.opacity > 0)
    setTimeout('setOpacity("' + img.name + '",' + step + ', ' + delay + ')', delay);
} 
function getDetails(strSKU,cat){
	var strURL = "details.asp?strSKU=" + strSKU+"&intCat="+cat;	
	window.location = strURL;
}
function setPageValues(strName, strToName){

		var strFullImagePath = 'images/btn_' + strToName+".jpg";	
			if (strName=='Decor')
			{
				//alert(document.Decor.src.search(strFullImagePath));
		//	if (document.Decor.src.search(strFullImagePath)<0){
			document.Decor.src = 'images/dummy.jpg';
		    
				if(document.all){
					
					document.Decor.src = strFullImagePath;				
					document.Decor.opacity=0;
					imageFadeIn(strName);	
				}
				else{
					blendimage(strName, strName, strFullImagePath, 100);
					
			 }
			}		
			if (strName=='Menu')
			{
			document.Menu.src = 'images/dummy.jpg';
		
				if(document.all){
					
					document.Menu.src = strFullImagePath;				
					document.Menu.opacity=0;
					imageFadeIn(strName);	
				}
				else{
					blendimage(strName, strName, strFullImagePath, 100);
				}	
			}	
			if (strName=='Recipe')
			{
			document.Recipe.src = 'images/dummy.jpg';
		
				if(document.all){
					
					document.Recipe.src = strFullImagePath;				
					document.Recipe.opacity=0;
					imageFadeIn(strName);	
				}
				else{
					blendimage(strName, strName, strFullImagePath, 100);
				}	
			}	
			if (strName=='About')
			{
			document.About.src = 'images/dummy.jpg';
		
				if(document.all){
					
					document.About.src = strFullImagePath;				
					document.About.opacity=0;
					imageFadeIn(strName);	
				}
				else{
					blendimage(strName, strName, strFullImagePath, 100);
				}	
			}
			if (strName=='Contact')
			{
			document.Contact.src = 'images/dummy.jpg';
		
				if(document.all){
					
					document.Contact.src = strFullImagePath;				
					document.Contact.opacity=0;
					imageFadeIn(strName);	
				}
				else{
					blendimage(strName, strName, strFullImagePath, 100);
				}	
			}
			if (strName=='Home')
			{
			document.Home.src = 'images/dummy.jpg';
		
				if(document.all){
					
					document.Home.src = strFullImagePath;				
					document.Home.opacity=0;
					imageFadeIn(strName);	
				}
				else{
					blendimage(strName, strName, strFullImagePath, 100);
				}	
			}
	}
	function blendimage(strName, imageid, imagefile, millisec) {
	if (strName=='Decor')
			{
	document.Decor.opacity = 0;
	}
    var speed = Math.round(millisec / 1000);
    var timer = 0;
    //set the current image as background
    //document.getElementById(divid).style.backgroundImage = "url(" + document.getElementById(imageid).src + ")";
    //make image transparent
    changeOpac(0, imageid);
    //make new image
    document.getElementById(imageid).src = imagefile;
    //fade in image
    for(i = 0; i <= 100; i++) {
        setTimeout("changeOpac(" + i + ",'" + imageid + "')",(timer * speed));
        timer++;
    }
	}
	
	function blendimage1( imageid, imagefile, millisec) {
	
    var speed = Math.round(millisec / 1000);
    var timer = 0;
	///alert(document.getElementById(imageid).src+'='+imagefile);
    //set the current image as background
    //document.getElementById(divid).style.backgroundImage = "url(" + document.getElementById(imageid).src + ")";
    //make image transparent
    changeOpac(0, imageid);
    //make new image
    document.getElementById(imageid).src = imagefile;
    //fade in image
    for(i = 0; i <= 100; i++) {
        setTimeout("changeOpac(" + i + ",'" + imageid + "')",(timer * speed));
        timer++;
    }
	}
	
function changeOpac(opacity, id) {
//alert(opacity+ ',' +id)
var id = id+'1'
    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
}

function showFullImage(arg){
	var strImagePath = arg;
	//alert(strImagePath);
	window.open(strImagePath,'','')
} 
function getAttributValue(attName,oPrice,strSku){
	var arrAttName        =new Array();
	var arrVari        =new Array();
	var totalPriceHtml    =document.getElementById("totalPrice"); 
	var currentPrice = oPrice;
	
	arrAttName = attName.split(",");
	mainImage = document.getElementById('mainLargeImage');
  var 	shVstock = document.getElementById('hiddenVstock');
    var 	shVQty = document.getElementById('hiddenVQty');
			if (arrAttName.length>1){
					
					for(p=1;p<=arrAttName.length-1;p++){
					elementAtt = document.getElementById(arrAttName[p]);
					
					//alert(arrAttName[p]);
					arrVari = elementAtt.value.split(",");
					//alert(currentPrice);
						if (arrVari[1]==1){//1 operation
						currentPrice = (parseFloat(currentPrice)+parseFloat(arrVari[2])).toFixed(2);
						totalPriceHtml.innerHTML = currentPrice;
						imgHidden = document.getElementById(strSku+'_'+arrVari[4]);
							imgPath = imgHidden.value;
							vstock   = document.getElementById('vstock'+strSku+'_'+arrVari[4]);
							 shVstock.value = vstock.value;
							 
							 vQty   = document.getElementById('vQty'+strSku+'_'+arrVari[4]);
							 shVQty.value = vQty.value;
							mainImage.src=imgPath;
							
						}else if(arrVari[1]==2){//2 operation
						currentPrice = (parseFloat(currentPrice)-parseFloat(arrVari[2])).toFixed(2);
							totalPriceHtml.innerHTML = currentPrice;
							imgHidden = document.getElementById(strSku+'_'+arrVari[4]);
							imgPath = imgHidden.value;
							vstock   = document.getElementById('vstock'+strSku+'_'+arrVari[4]);
							 shVstock.value = vstock.value;
							  vQty   = document.getElementById('vQty'+strSku+'_'+arrVari[4]);
							 shVQty.value = vQty.value;
							mainImage.src=imgPath;
							

							//mainImage.src='images/1/100001_14_l.jpg';
							}
							else if(arrVari[1]==0){//0 operation
							
						     currentPrice = (parseFloat(arrVari[2])).toFixed(2);
							 //alert(currentPrice);
							totalPriceHtml.innerHTML = currentPrice;
							imgHidden = document.getElementById(strSku+'_'+arrVari[4]);
							//alert(currentPrice);
							imgPath = imgHidden.value;
							vstock   = document.getElementById('vstock'+strSku+'_'+arrVari[4]);
							 shVstock.value = vstock.value;
							  vQty   = document.getElementById('vQty'+strSku+'_'+arrVari[4]);
							 shVQty.value = vQty.value;
							mainImage.src=imgPath;
							
							//mainImage.src='images/1/100001_14_l.jpg';
							}
					}
			}
		
	}
function setDecor(strName){
	
		var strFullImagePath = 'images/decor/' + strName;	
		//
	
		if(document.all){	
		//alert(document.fullImage.src.search(strFullImagePath));
		if (document.fullImage.src.search(strFullImagePath)<0){
			document.fullImage.src = 'images/dummy.jpg';
			document.fullImage.src = strFullImagePath;				
			document.fullImage.opacity=0;
			
			imageFadeIn('fullImage');	}
			//
		}
		else{
			
			blendimage1('fullImage', strFullImagePath, 100);
			//alert('test');
		}			
	}
	
function fn_emptyBasket(){
	if(confirm('Do you really want to delete all items from your shopping basket?'))
			   { 
			   window.location.href='../processing/emptyBasket.asp';
    }else{
			   return false;}
	}
	
	function subEmail(f)

{  //var sendToEmail = decodeEmail(encodedEmail);
   
	if(f.email.value==''){alert('Please add your email');return false;} 
	var re = /^\w+([\.]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/
 	if(!(re.test(f.email.value))){alert('Please enter a valid email');return false;}
 
  
}

function showExtraRows(){
	
	document.getElementById("cvExtraRow1").style.display="block";
	document.getElementById("cvExtraRow2").style.display="block";
	document.getElementById("cvExtraRow3").style.display="block";	
	
}

function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		 //  alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		 //  alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		   // alert("Invalid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		 //   alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    //alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    //alert("Invalid E-mail ID")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		  //  alert("Invalid E-mail ID")
		    return false
		 }

 		 return true					
	}

function checkForm(){  

	//alert('<%=UCase(Session("CAPTCHA"))%>');
	
var strErr='';

	if (document.formC.clientName.value=='')	{strErr +='*please add your name \r';}				//name
	if (document.formC.address.value=='')		{strErr +='*please add your contact number \r';}	//contact number
	if (document.formC.email.value=='')			{strErr +='*please add your email address \r';}		//email
	if (document.formC.query.value=='')			{strErr +='*please add your query \r';}				//query	
	if (document.formC.CaptchaBox.value=='')	{strErr +='*please add your captcha \r';}			//captcha
	
	if (strErr !=''){
		alert('Please complete the form\r\r' + strErr);
		return;
		}
	
	//check for an email value
	var re = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/
 	if (!(echeck(document.formC.email.value)) && (document.formC.email.value != '')){
		alert('*please enter a valid email address');
		return;
		} 
    //check for notes

  previewImage();
  //alert( decodeEmail(encodedEmail));
}



function previewImage() {
var filename = "";
//create the path to your local file

filename = "file:///" + document.formC.strFile.value;

//check if there is a value


document.formC.hFileName.value = filename;
document.formC.submit();


}

	function fn_changeClass(id, class1, class2){
	
   		identity=document.getElementById(id);
		
		if(identity.className==class1){
			className=class2;
		}
		else{
			className=class1;				
		}	
		
		identity.className=className;
	}
	

/************************************************************************************************************ 
   (C) www.dhtmlgoodies.com, October 2005 
    
   This is a script from www.dhtmlgoodies.com. You will find this and a lot of other scripts at our website.    
    
   Terms of use: 
   You are free to use this script as long as the copyright message is kept intact. However, you may not 
   redistribute, sell or repost it without our permission. 
    
   Thank you! 
    
   www.dhtmlgoodies.com 
   Alf Magne Kalleland 
    
   ************************************************************************************************************/    
        
   var dhtmlgoodies_menuObj;   // Reference to the menu div 
   var currentZIndex = 1000; 
   var liIndex = 0; 
   var visibleMenus = new Array(); 
   var activeMenuItem = false; 
   var timeBeforeAutoHide = 1200; // Microseconds from mouse leaves menu to auto hide. 
   var dhtmlgoodies_menu_arrow = 'http://www.dhtmlgoodies.com/scripts/dhtmlgoodies-menu2/images/arrow.gif'; 
    
   var MSIE = navigator.userAgent.indexOf('MSIE')>=0?true:false; 
   var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox')>=0?true:false; 
   var navigatorVersion = navigator.appVersion.replace(/.*?MSIE ([0-9]\.[0-9]).*/g,'$1')/1; 
   var menuBlockArray = new Array(); 
   var menuParentOffsetLeft = false;    


    // {{{ getStyle() 
   /** 
   * Return specific style attribute for an element 
   * 
   * @param Object el = Reference to HTML element 
   * @param String property = Css property 
   * @private 
   */        
   function getStyle(el,property) 
   {        

      if (document.defaultView && document.defaultView.getComputedStyle) { 

         var retVal = null;              
         var comp = document.defaultView.getComputedStyle(el, ''); 
         if (comp){ 
            retVal = comp[property]; 
              
            if(!retVal){ 
               var comp = document.defaultView.getComputedStyle(el, null); 
               retVal = comp.getPropertyCSSValue(property); 
            }          
         }    

         if(retVal==null)retVal=''; 
          
         return el.style[property] || retVal; 
      } 
      if (document.documentElement.currentStyle && MSIE){    
         var value = el.currentStyle ? el.currentStyle[property] : null; 
         return ( el.style[property] || value ); 
                                              
      } 
      return el.style[property];              
   } 
      
   function getTopPos(inputObj) 
   { 
   	var origInputObj = inputObj;
 
     var returnValue = inputObj.offsetTop; 
     if(inputObj.tagName=='LI' && inputObj.parentNode.className=='menuBlock1'){    
        var aTag = inputObj.getElementsByTagName('A')[0]; 
        if(aTag)returnValue += aTag.parentNode.offsetHeight; 
     } 
     var topOfMenuReached = false; 
     while((inputObj = inputObj.offsetParent) != null){ 
        if(inputObj.parentNode.id=='dhtmlgoodies_menu')topOfMenuReached=true; 
        if(topOfMenuReached && !inputObj.className.match(/menuBlock/gi) || (!MSIE && origInputObj.parentNode.className=='menuBlock1')){ 
           var style = getStyle(inputObj,'position'); 
           if(style=='absolute' || style=='relative'){                
              return returnValue;            
           } 
        } 
          
        returnValue += inputObj.offsetTop;          
     } 

     return returnValue; 
   } 
    
   function getLeftPos(inputObj) 
   { 
     var returnValue = inputObj.offsetLeft; 
      
     var topOfMenuReached = false; 
     while((inputObj = inputObj.offsetParent) != null){ 
       if(inputObj.parentNode.id=='dhtmlgoodies_menu')topOfMenuReached=true; 
        if(topOfMenuReached && !inputObj.className.match(/menuBlock/gi)){ 
           var style = getStyle(inputObj,'position'); 
           if(style=='absolute' || style=='relative')return returnValue; 
        } 
      
        returnValue += inputObj.offsetLeft; 
     } 
     return returnValue; 
   } 


    
   function showHideSub() 
   { 

      var attr = this.parentNode.getAttribute('currentDepth'); 
      if(navigator.userAgent.indexOf('Opera')>=0){ 
         attr = this.parentNode.currentDepth; 
      } 
        
      this.className = 'currentDepth' + attr + 'over'; 
        
      if(activeMenuItem && activeMenuItem!=this){ 
         activeMenuItem.className=activeMenuItem.className.replace(/over/,''); 
      } 
      activeMenuItem = this; 
    
      var numericIdThis = this.id.replace(/[^0-9]/g,''); 
      var exceptionArray = new Array(); 
      // Showing sub item of this LI 
      var sub = document.getElementById('subOf' + numericIdThis); 
      if(sub){ 
         visibleMenus.push(sub); 
         sub.style.display=''; 
         sub.parentNode.className = sub.parentNode.className + 'over'; 
         exceptionArray[sub.id] = true; 
      }    
        
      // Showing parent items of this one 
        
      var parent = this.parentNode; 
      while(parent && parent.id && parent.tagName=='UL'){ 
         visibleMenus.push(parent); 
         exceptionArray[parent.id] = true; 
         parent.style.display=''; 
          
         var li = document.getElementById('dhtmlgoodies_listItem' + parent.id.replace(/[^0-9]/g,'')); 
         if(li.className.indexOf('over')<0)li.className = li.className + 'over'; 
         parent = li.parentNode; 
          
      } 

          
      hideMenuItems(exceptionArray); 



   } 

   function hideMenuItems(exceptionArray) 
   { 
      /* 
      Hiding visible menu items 
      */ 
      var newVisibleMenuArray = new Array(); 
      for(var no=0;no<visibleMenus.length;no++){ 
         if(visibleMenus[no].className!='menuBlock1' && visibleMenus[no].id){ 
            if(!exceptionArray[visibleMenus[no].id]){ 
               var el = visibleMenus[no].getElementsByTagName('A')[0]; 
               visibleMenus[no].style.display = 'none'; 
               var li = document.getElementById('dhtmlgoodies_listItem' + visibleMenus[no].id.replace(/[^0-9]/g,'')); 
               if(li.className.indexOf('over')>0)li.className = li.className.replace(/over/,''); 
            }else{              
               newVisibleMenuArray.push(visibleMenus[no]); 
            } 
         } 
      }        
      visibleMenus = newVisibleMenuArray;        
   } 
    
    
    
   var menuActive = true; 
   var hideTimer = 0; 
   function mouseOverMenu() 
   { 
      menuActive = true;        
   } 
    
   function mouseOutMenu() 
   { 
      menuActive = false; 
      timerAutoHide();    
   } 
    
   function timerAutoHide() 
   { 
      if(menuActive){ 
         hideTimer = 0; 
         return; 
      } 
        
      if(hideTimer<timeBeforeAutoHide){ 
         hideTimer+=100; 
         setTimeout('timerAutoHide()',99); 
      }else{ 
         hideTimer = 0; 
         autohideMenuItems();    
      } 
   } 
    
   function autohideMenuItems() 
   { 
      if(!menuActive){ 
         hideMenuItems(new Array());    
         if(activeMenuItem)activeMenuItem.className=activeMenuItem.className.replace(/over/,'');        
      } 
   } 
    
    
   function initSubMenus(inputObj,initOffsetLeft,currentDepth) 
   {    
      var subUl = inputObj.getElementsByTagName('UL'); 
      if(subUl.length>0){ 
         var ul = subUl[0]; 
          
         ul.id = 'subOf' + inputObj.id.replace(/[^0-9]/g,''); 
         ul.setAttribute('currentDepth' ,currentDepth); 
         ul.currentDepth = currentDepth; 
         ul.className='menuBlock' + currentDepth; 
         ul.onmouseover = mouseOverMenu; 
         ul.onmouseout = mouseOutMenu; 
         currentZIndex+=1; 
         ul.style.zIndex = currentZIndex; 
         menuBlockArray.push(ul); 
         ul = dhtmlgoodies_menuObj.appendChild(ul); 
         var topPos = getTopPos(inputObj); 
         var leftPos = getLeftPos(inputObj)/1 + initOffsetLeft/1;          
         
         ul.style.position = 'absolute'; 
         ul.style.left = leftPos + 'px'; 
         ul.style.top = topPos + 'px'; 
         var li = ul.getElementsByTagName('LI')[0]; 
         while(li){ 
            if(li.tagName=='LI'){    
               li.className='currentDepth' + currentDepth;                
               li.id = 'dhtmlgoodies_listItem' + liIndex; 
               liIndex++;              
               var uls = li.getElementsByTagName('UL'); 
               li.onmouseover = showHideSub; 

               if(uls.length>0){ 
                  var offsetToFunction = li.getElementsByTagName('A')[0].offsetWidth+2; 
                  if(navigatorVersion<6 && MSIE)offsetToFunction+=15;   // MSIE 5.x fix 
                  initSubMenus(li,offsetToFunction,(currentDepth+1)); 
               }    
               if(MSIE){ 
                  var a = li.getElementsByTagName('A')[0]; 
                  a.style.width=li.offsetWidth+'px'; 
                  a.style.display='block'; 
               }                
            } 
            li = li.nextSibling; 
         } 
         ul.style.display = 'none';    
         if(!document.all){ 
            //dhtmlgoodies_menuObj.appendChild(ul); 
         } 
      }    
   } 


   function resizeMenu() 
   { 
      var offsetParent = getLeftPos(dhtmlgoodies_menuObj); 
        
      for(var no=0;no<menuBlockArray.length;no++){ 
         var leftPos = menuBlockArray[no].style.left.replace('px','')/1; 
         menuBlockArray[no].style.left = leftPos + offsetParent - menuParentOffsetLeft + 'px'; 
      } 
      menuParentOffsetLeft = offsetParent; 
   } 
    
   /* 
   Initializing menu 
   */ 
   function initDhtmlGoodiesMenu() 
   { 
      dhtmlgoodies_menuObj = document.getElementById('dhtmlgoodies_menu'); 
        
        
      var aTags = dhtmlgoodies_menuObj.getElementsByTagName('A'); 
      for(var no=0;no<aTags.length;no++){          

         var subUl = aTags[no].parentNode.getElementsByTagName('UL'); 
         if(subUl.length>0 && aTags[no].parentNode.parentNode.parentNode.id != 'dhtmlgoodies_menu'){ 
            var img = document.createElement('IMG'); 
            img.src = dhtmlgoodies_menu_arrow; 
            aTags[no].appendChild(img);              

         } 

      } 
              
      var mainMenu = dhtmlgoodies_menuObj.getElementsByTagName('UL')[0]; 
      mainMenu.className='menuBlock1'; 
      mainMenu.style.zIndex = currentZIndex; 
      mainMenu.setAttribute('currentDepth' ,1); 
      mainMenu.currentDepth = '1'; 
      mainMenu.onmouseover = mouseOverMenu; 
      mainMenu.onmouseout = mouseOutMenu;        

      var mainMenuItemsArray = new Array(); 
      var mainMenuItem = mainMenu.getElementsByTagName('LI')[0]; 
      mainMenu.style.height = mainMenuItem.offsetHeight + 2 + 'px'; 
      while(mainMenuItem){ 
          
         mainMenuItem.className='currentDepth1'; 
         mainMenuItem.id = 'dhtmlgoodies_listItem' + liIndex; 
         mainMenuItem.onmouseover = showHideSub; 
         liIndex++;              
         if(mainMenuItem.tagName=='LI'){ 
            mainMenuItem.style.cssText = 'float:left;';    
            mainMenuItem.style.styleFloat = 'left'; 
            mainMenuItemsArray[mainMenuItemsArray.length] = mainMenuItem; 
            initSubMenus(mainMenuItem,0,2); 
         }          
          
         mainMenuItem = mainMenuItem.nextSibling; 
          
      } 

      for(var no=0;no<mainMenuItemsArray.length;no++){ 
         initSubMenus(mainMenuItemsArray[no],0,2);          
      } 
        
      menuParentOffsetLeft = getLeftPos(dhtmlgoodies_menuObj);    
      window.onresize = resizeMenu;    
      dhtmlgoodies_menuObj.style.visibility = 'visible';    
   } 
