

function test()	{
	newWin = window.open('http://www.naturaltexture.com', '', 'toolbar=0,location=0,menubar=0,status=0,left=50,scrollbars=1,resizable=1,width=640,height=480');
}

function rollout(objMenuitem)
{
    if (objMenuitem.nextSibling.style.display == 'block')
        objMenuitem.nextSibling.style.display = 'none';
    else
        objMenuitem.nextSibling.style.display = 'block';

    // Stop the browser requesting the link
    return false;
}

function rollup()
{
    var objNode, objAnchor, objHeading;

    // Check we're working with a DOM compliant browser
    if (document.getElementById && document.createElement)
    {
        var objMenu = document.getElementById('mainnav_tl');
        var objNested = objMenu.getElementsByTagName('ul');
		// Hide each of the nested unordered list
        for (var i=0; i<objNested.length; i++)
        {
			
            objNested[i].style.display = 'none';
				 
            // Place the top-level text in an anchor tag
            objNode = objNested[i].parentNode;
            strContent = objNode.firstChild.data;

            //objAnchor = document.createElement('a');
            //objAnchor.href = '#';
			objHeading = document.createElement('span');
			//alert(strContent);
          
			objHeading.onclick = function(){return rollout(this);};
			
            objHeading.appendChild(document.createTextNode(strContent));

            objNode.replaceChild(objHeading, objNode.firstChild);
        }
		
    }
	rollup_tr();
}

function rollup_tr()
{
    var objNode, objAnchor, objHeading;

    // Check we're working with a DOM compliant browser
    if (document.getElementById && document.createElement)
    {
        var objMenu = document.getElementById('mainnav_tr');

        var objNested = objMenu.getElementsByTagName('ul');
		//alert(objNested.length);
        // Hide each of the nested unordered list
        for (var i=0; i<objNested.length; i++)
        {
            objNested[i].style.display = 'none';
				 
            // Place the top-level text in an anchor tag
            objNode = objNested[i].parentNode;
            strContent = objNode.firstChild.data;

            //objAnchor = document.createElement('a');
            //objAnchor.href = '#';
			objHeading = document.createElement('span');
			//alert(strContent);
          
			objHeading.onclick = function(){return rollout(this);};
			
            objHeading.appendChild(document.createTextNode(strContent));

            objNode.replaceChild(objHeading, objNode.firstChild);
        }
		
    }
}

//////////////////////////////////// resize page all with spec w & h /////////////////////////////////////////

function resizePage(width, height)	{ 
  
browserVersion = parseInt(navigator.appVersion);
 
	if((navigator.appName.indexOf('Netscape') != -1) && (browserVersion == 4))  {///checks for n4 by using var from above	
	window.resizeTo((width-15), (height-15));	
      			// do nothing
    } 
    else 	{ // later netscape &safari  mozilla...
    	if (navigator.appName  == 'Netscape')	{
    		var str = navigator.appVersion; 
			var reg = new RegExp('Safari');
			if (reg.test(str))	{ //////////////////////////////if Safari//////////////
 				window.resizeTo(width,(height+91));	
 			} else	{ //// if netscape 6=, mozilla....///////////////////////
    			window.innerWidth= width;
    			window.innerHeight = height; 
    		}
    	} else	{  // IE, ......?  	 	
    			window.resizeTo((width+21), (height+109));	
    	}
 	}
}
