// JavaScript Document
function makeArray() {
					     for (i = 0; i<makeArray.arguments.length; i++)
					          this[i + 1] = makeArray.arguments[i];
					}
					 
					var months = new makeArray('January','February','March',
					    'April','May','June','July','August','September',
					    'October','November','December');
					var date = new Date();
					var day  = date.getDate();
					var month = date.getMonth() + 1;
					var yy = date.getYear();
					var year = (yy < 1000) ? yy + 1900 : yy;
					
function callChat()
	{
		this.newWindow = window.open('http://chat.boldchat.com/chat/visitor.jsp?cdid=3731629197&url=' + document.location, 'Chat', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=640,height=480'); 
		this.newWindow.focus(); 
		this.newWindow.opener = window;
		return false;
	}					
	
var panes = new Array();

function setupPanes(containerId, defaultTabId) {
    // go through the DOM, find each tab-container
    // set up the panes array with named panes
    // find the max height, set tab-panes to that height
    panes[containerId] = new Array();
    var maxHeight = 0; var maxWidth = 0;
    var container = document.getElementById(containerId);
    var paneContainer = container.getElementsByTagName("div")[0];
    var paneList = paneContainer.childNodes;
    for (var i=0; i < paneList.length; i++ ) {
        var pane = paneList[i];
        if (pane.nodeType != 1) continue;
        if (pane.offsetHeight > maxHeight) maxHeight = pane.offsetHeight;
        if (pane.offsetWidth  > maxWidth ) maxWidth  = pane.offsetWidth;
        panes[containerId][pane.id] = pane;
        pane.style.display = "none";
    }
    paneContainer.style.height = maxHeight + "px";
    paneContainer.style.width  = maxWidth + "px";
    document.getElementById(defaultTabId).onclick();
}

function showPane(paneId, activeTab) {
    // make tab active class
    // hide other panes (siblings)
    // make pane visible
    
    // work out which container this tab is part of. could also bounce on parent node
    for (var con in panes) {
        activeTab.blur();
        activeTab.className = "tab-active";
        if (panes[con][paneId] != null) { // tab and pane are members of this container
            var pane = document.getElementById(paneId);
            pane.style.display = "block";
            var container = document.getElementById(con);
            var tabs = container.getElementsByTagName("ul")[0];
            var tabList = tabs.getElementsByTagName("a")
            for (var i=0; i<tabList.length; i++ ) {
                var tab = tabList[i];
                if (tab != activeTab) tab.className = "tab-disabled";
            }
            for (var i in panes[con]) {
                var pane = panes[con][i];
                if (pane == undefined) continue;
                if (pane.id == paneId) continue;
                pane.style.display = "none"
            }
        }
    }
    return false;    
}

		function call_dept(dept_id)
	{
		document.form1.dept_id.value = dept_id;
		document.form1.parent_id.value = '';
		document.form1.action = "products1.asp?dept_id="+dept_id;
		document.form1.submit();
	}
	function call_listProduct(dept_id,parent_id)
	{
		document.form1.dept_id.value = dept_id;
		document.form1.parent_id.value = parent_id;
		document.form1.All.value = '';
		document.form1.action = "listproducts.asp?dept_id="+dept_id+"&parent_id="+parent_id;
		document.form1.submit();
	}
	function call_listProductAll(dept_id,parent_id,All)
	{
		document.form1.dept_id.value = dept_id;
		document.form1.parent_id.value = parent_id;
		document.form1.All.value = All;
		document.form1.action = "listproducts.asp?dept_id="+dept_id+"&parent_id="+parent_id+"&All="+All;
		document.form1.submit();
	}
	function call_ShowProduct(dept_id,parent_id,pf_id)
	{
		document.form1.dept_id.value = dept_id;
		document.form1.parent_id.value = parent_id;
		document.form1.pf_id.value = pf_id;
		document.form1.action = "showproduct.asp?dept_id="+dept_id+"&parent_id="+parent_id+"&pf_id="+pf_id;
		document.form1.submit();
	}
	function call_ShowProduct1(dept_id,pf_id)
	{
		document.form1.dept_id.value = dept_id;
		//document.form1.parent_id.value = parent_id;
		document.form1.pf_id.value = pf_id;
		document.form1.action = "showproduct.asp?dept_id="+dept_id+"&pf_id="+pf_id;
		document.form1.submit();
	}
	function call_ValidatePage(dept_id,parent_id,pageno)
	{
		document.form1.dept_id.value = dept_id;
		document.form1.parent_id.value = parent_id;
		document.form1.iPageNo.value = pageno;
		document.form1.action = "listproducts.asp?dept_id="+dept_id+"&parent_id="+parent_id+"&iPageNo="+iPageNo;
		document.form1.submit();
	}
	function call_instock(dept_id)
	{
		document.form1.dept_id.value = dept_id;
		document.form1.parent_id.value = '';
		document.form1.action = "instock_Products.asp?dept_id="+dept_id;
		document.form1.submit();
	}
	function call_deptid_Pfid_page(dept_id,pf_id,page)
	{
		document.form1.dept_id.value = dept_id;
		document.form1.pf_id.value = pf_id;
		document.form1.action = page
		document.form1.submit();
	}
	function call_vendorDisplay(vendor_code)
	{
		document.form1.VendorCode.value = vendor_code;
		document.form1.action = "vendor_display.asp?VendorCode="+vendor_code;
		document.form1.submit();
	}
	function call_questions(dept_id,pf_id,title,desc,image)
	{
		document.form1.dept_id.value = dept_id;
		document.form1.pf_id.value = pf_id;
		document.form1.title.value = title;
		document.form1.image.value = image;
		document.form1.desc.value = desc;
		document.form1.action = "productquestion.asp";
		document.form1.submit();
	}
	function call_email(dept_id,pf_id,title,desc)
	{
		document.form1.dept_id.value = dept_id;
		document.form1.pf_id.value = pf_id;
		document.form1.title.value = title;
		document.form1.desc.value = desc;
		document.form1.action = "sendemail.asp";
		document.form1.submit();
	}
	function call_order(order_id)
	{
		document.form1.order_id.value = order_id;

		document.form1.action = "orderview.asp";
		document.form1.submit();
	}
	function call_DesignerProduct(designer_id)
	{
		document.form1.designer_id.value = designer_id;
		document.form1.action = "designer_product.asp?designer_id="+designer_id;
		document.form1.submit();
	}