startList = function() {
if (document.all && document.getElementById)
    {
		navRoot = document.getElementById("nav");
		for (i = 0; i < navRoot.childNodes.length; i++)
		{
			node = navRoot.childNodes[i];
			if (node.nodeName == "LI")
			{
			    node.onmouseover = function()
				{
					this.className+=" over";
				}
				node.onmouseout = function()
				{
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}

function PagePerList()
{
        var PerPage = '';
        if (document.getElementById('PerPage').length > 0)
         {
             PerPage = document.getElementById('PerPage').options[document.getElementById('PerPage').selectedIndex].value;

            var FromUrl = document.location.href;
            var qPos = document.location.href.indexOf('?');
            if (qPos > 0)
            {
                var rVal = document.location.href.substring(0, qPos);
                window.location = rVal + "?pgsize=" + PerPage;
                document.getElementById('PerPage').value = PerPage.value;
            }
            else
            {
                 var rVal = document.location.href.substring(0, qPos);
                 window.location = rVal + "?pgsize=" + PerPage;
                 document.getElementById('PerPage').value = PerPage.value;
            }
        }
        else {

            PerPage = document.getElementById('PerPage').value;
        }

     }

     /*function PrintImage()
     {
         a = window.open('', '', 'width=550,height=500');
         //a.document.write('<link rel="stylesheet" href="skins/Skin_7/style.css" type="text/css">');
         a.document.write('<link rel="stylesheet" href="skins/Skin_1/style.css" type="text/css">');
         document.getElementById('PrintButton').style.display = 'none';
         document.getElementById('SaveButton').style.display = 'none';
         document.getElementById('div_back_history').style.display = 'none';
         document.getElementById('div_Email').style.display = 'none';
	 document.getElementById('div_login').style.display = 'none';
	 document.getElementById('div_popimg').style.display = 'none';
	 document.getElementById('div_lframer').style.display = 'none';
         document.getElementById('BodyShowDetails').style.display = 'block';
         a.document.write(document.getElementById('BodyShowDetails').innerHTML);
         a.print();
         a.document.close();
         document.getElementById('PrintButton').style.display = 'block';
         document.getElementById('SaveButton').style.display = 'block';
         document.getElementById('div_back_history').style.display = 'block';
         document.getElementById('div_Email').style.display = 'block';
         document.getElementById('div_login').style.display = 'block';
         document.getElementById('div_popimg').style.display = 'block';
         document.getElementById('div_lframer').style.display = 'block';
     }*/
     function PrintImage(curImg)
          {
          
             	    a = window.open('', '', 'width=550,height=600');
	            a.document.write('<link rel="stylesheet" href="skins/Skin_1/style.css" type="text/css">');
	            document.getElementById('PrintButton').style.display = 'none';
	            document.getElementById('DetailLinks').style.display = 'none';
	            document.getElementById('div_back_history').style.display = 'none';
	            if (document.getElementById('div_popimg') != null) {
	                document.getElementById('div_popimg').style.display = 'none';
	            }
	            if(document.getElementById('ProductWebmoList') !=null)
	            {
	            document.getElementById('ProductWebmoList').style.display='none'
	            }
	            /* document.getElementById('SaveButton').style.display = 'none';
	            document.getElementById('div_back_history').style.display = 'none';
	            document.getElementById('div_Email').style.display = 'none';
	            document.getElementById('div_login').style.display = 'none';
	            document.getElementById('div_popimg').style.display = 'none';
	            document.getElementById('div_lframer').style.display = 'none';
	            document.getElementById('BodyShowDetails').style.display = 'block';*/
	            a.document.write(document.getElementById('BodyShowDetails').innerHTML);
	            a.print();
	            a.document.close();
	            document.getElementById('PrintButton').style.display = 'block';
	            document.getElementById('DetailLinks').style.display = 'block';
	            document.getElementById('div_back_history').style.display = 'block';
	            if (document.getElementById('div_popimg') != null) {
	                document.getElementById('div_popimg').style.display = 'block';
	                
        		}
                    if(document.getElementById('ProductWebmoList') !=null)
	            {
		        document.getElementById('ProductWebmoList').style.display='block'
	            }
          }



	function saveImageAs(x)
	{
		 
	 	window.open("save.aspx?src="+x+"", '', 'left=500,top=300,width=1px, height=1px');
		//window.open("save.aspx?src="+x+"",'left=500,top=300,width=0px ,height=0px,resizable=no,maxbutton=no,scrollbars=yes');
	}


	function callflashOLD(itemid,width)
	{
	 	// window.open("http://bdl-guru:8081/ljframer.htm?frameid=" + itemid+ "", '', 'width=900px, height=675px');
	 	//window.open("http://205.214.49.69/ljframing/ljframer.htm?frameid=" + itemid + "&fwidth="+ width +"", '', 'width=900px, height=675px');
	 	//window.open("ljframing/ljframer.htm?frameid=" + itemid + "&fwidth="+ width +"", '', 'width=900px, height=675px');
	 	//window.open("http://www.larsonjuhl.com/ljframing/ljframer.htm?frameid=" + itemid + "&fwidth="+ width +"", '', 'width=900px, height=675px');
		if(screen.width>=900)
		{
		 if(screen.height>=801)
			window.open("/ljframing/ljframer.htm?frameid="+itemid+"&fwidth="+width,"blank","toolbar=no,location=no,width=900,height=675,top=100,left=100,scrollbars=no,resizable=no");
		 else
			window.open("/ljframing/ljframer.htm?frameid="+itemid+"&fwidth="+width,"blank","toolbar=no,location=no,width=900,height=675,top=100,left=100,scrollbars=yes,resizable=yes");
		}
		else
			window.open("/ljframing/ljframer.htm?frameid="+itemid+"&fwidth="+width,"blank","toolbar=no,location=no,width=900,height=675,top=100,left=100,scrollbars=yes,resizable=yes");
	}

	function callflash(itemid, width, site) {
	    // window.open("http://bdl-guru:8081/ljframer.htm?frameid=" + itemid+ "", '', 'width=900px, height=675px');
	    //window.open("http://205.214.49.69/ljframing/ljframer.htm?frameid=" + itemid + "&fwidth="+ width +"", '', 'width=900px, height=675px');
	    //window.open("ljframing/ljframer.htm?frameid=" + itemid + "&fwidth="+ width +"", '', 'width=900px, height=675px');
	    //window.open("http://www.larsonjuhl.com/ljframing/ljframer.htm?frameid=" + itemid + "&fwidth="+ width +"", '', 'width=900px, height=675px');
	    if (screen.width >= 900) {
		if (screen.height >= 801)
		    window.open("http://www.larsonjuhl.com/ljframing/ljframer.htm?frameid=" + itemid + "&fwidth=" + width + "&site=" + site, "blank", "toolbar=no,location=no,width=900,height=675,top=100,left=100,scrollbars=no,resizable=no");
		else
		    window.open("http://www.larsonjuhl.com/ljframing/ljframer.htm?frameid=" + itemid + "&fwidth=" + width + "&site=" + site, "blank", "toolbar=no,location=no,width=900,height=675,top=100,left=100,scrollbars=yes,resizable=yes");
	    }
	    else
		window.open("http://www.larsonjuhl.com/ljframing/ljframer.htm?frameid=" + itemid + "&fwidth=" + width + "&site=" + site, "blank", "toolbar=no,location=no,width=900,height=675,top=100,left=100,scrollbars=yes,resizable=yes");
	}
	
	function Imgsearch() 
	{
		var Itemno = document.getElementById('TxtKWrd').value;
		if (Itemno != "")
		{
			window.location = "SearchItem.aspx?Itno=" + Itemno;
		}
		else 
		{
			alert("Enter item number or collection name");
		}
	}
     

    

    
    			function ChangeHeight()
    			{
    				var Itemcnt=document.getElementById('ctl00_ContentPlaceHolder1_cnt');
    				var ContName;
    				var DivName;
    				var Imght ;
    				var i;
    				var DescHt;
    				var hgt;
    				for(i=0;i<Itemcnt.value;i=i+1)
    				{
    				ContName='ctl00_ContentPlaceHolder1_ListWithDesc_ctrl';
    
    				DivName='ctl00_ContentPlaceHolder1_ListWithDesc_ctrl'+i+'_ImgContainer';
    
    				ContName=ContName+i+'_SmallImg';
    				DescHt = document.getElementById('descBox');
    				Imght = document.getElementById(ContName);
    				if(Imght.offsetHeight > DescHt.clientHeight)
    					{
    						hgt = Imght.offsetHeight;
    
    					}
    					else
    					{
    
    						hgt = DescHt.clientHeight;
    					}
    
    					hgt = parseInt(hgt) + 20;
    
    					document.getElementById(DivName).style.height = hgt.toString()+'px';
    
    				}
    
    
    			}
    			function AssignHeight()
    			{
    				var lft=document.getElementById('LeftPnl').clientHeight ;
    				var rgt=document.getElementById('RightPnl').clientHeight;
    
    				if(parseInt(lft)>parseInt(rgt))
    					document.getElementById('RightPnl').style.height=(parseInt(lft)+30).toString()+"px";
    				else
    					document.getElementById('LeftPnl').style.height=(parseInt(rgt)+30).toString()+"px";
    			}
    
    
    		
    		
    		
    		
   function advancesearchVisibleNew() {
        var qPos = document.location.href.indexOf('AdvancedSearch');
        if (qPos > 0) {
            var FromUrl = document.location.href;
            var urlSplit = FromUrl.split('&');
            for (var i = 0; i < urlSplit.length; i++) {
                var valsplit = urlSplit[i].split('=');                
                if (valsplit.length > 1) {
                    if (i == 0)
                        document.getElementById('SelRFinish1').value = valsplit[1];
                    else if (i == 1)
                        document.getElementById('SelRStyle1').value = valsplit[1];
                    else if (i == 2)
                        document.getElementById('SelRWidth1').value = valsplit[1];
                    else if (i == 3)
                        document.getElementById('SelRFrame1').value = valsplit[1];
                    else if (i == 4)
                        document.getElementById('SelRPrice1').value = valsplit[1];
                    else if (i == 5)
                        document.getElementById('SelRPrice11').value = valsplit[1];
                }
            }
        }
        document.getElementById('AdSearch').style.display = "block";
 }
     
     function CloseSearch() {
         document.getElementById('AdSearch').style.display = "none";
     }
     function ClearSearch() {
         document.getElementById('SelRFinish1').value = "";
         document.getElementById('SelRStyle1').value = "";
         document.getElementById('SelRWidth1').value = ""
         document.getElementById('SelRFrame1').value = "";
         document.getElementById('SelRPrice1').value = "";
         document.getElementById('SelRPrice11').value = "";
     }
    
     function Advancedsearch() {
         var finish = document.getElementById('SelRFinish1').value;
         var style = document.getElementById('SelRStyle1').value;
         var width = document.getElementById('SelRWidth1').value;
         var frame = document.getElementById('SelRFrame1').value;
         var lenprice = document.getElementById('SelRPrice1').value;
         var chopprice = document.getElementById('SelRPrice11').value;
         window.location = "AdvancedSearch.aspx?finish=" + finish + "&style=" + style + "&width=" + width + "&frame=" + frame + "&lenprice=" + lenprice + "&chopprice=" + chopprice;
     }
    
    
function AdvanceSearchPagePerList() {
     var PerPage = '';
     if (document.getElementById('PerPage').length > 0) {
         PerPage = document.getElementById('PerPage').options[document.getElementById('PerPage').selectedIndex].value;
         var FromUrl = document.location.href;
         var urlSplit = FromUrl.split('&');
         window.location = urlSplit[0] + '&' + urlSplit[1] + '&' + urlSplit[2] + '&' + urlSplit[3] + '&' + urlSplit[4] + '&' + urlSplit[5] + "&pgsize=" + PerPage;
     }
     else {
         PerPage = document.getElementById('PerPage').value;
     }
 }
