var NS4=(navigator.appName.indexOf("Netscape")>=0&&!document.getElementById)?true:false;var IE4=(document.all&&!document.getElementById)?true:false;var IE5=(document.getElementById&&document.all)?true:false;var NS6=(document.getElementById&&navigator.appName.indexOf("Netscape")>=0)?true:false;var W3C=(document.getElementById)?true:false;var IE=(navigator.appName=="Microsoft Internet Explorer")?true:false;var ieop=0;var op_id=0;var isMouseOndiv=true;function showInnerContent(b,a){b=arguments[0];document.getElementById(b).style.display="block"}function hideOuterContent(a){isMouseOndiv=false;$('#' + a).hide();$('#subpromoswf').css('visibility','visible');}function hideContentWithoutFade(b){b=arguments[0];var a=document.getElementById(b).style;a.display="none"}function hideDHTMLContent(a){setTimeout('decrOpacity("'+a+'")',10)}function incrOpacity(b){var a=document.getElementById(b).style;if(ieop<100){ieop+=7;setOpacity(a,ieop);op_id=setTimeout('incrOpacity("'+b+'")',10)}}function decrOpacity(b){var a=document.getElementById(b).style;if(ieop>1){if(!isMouseOndiv){ieop-=10;setOpacity(a,ieop)}op_id=setTimeout('decrOpacity("'+b+'")',10)}else{if(!isMouseOndiv){a.display="none"}isMouseOndiv=true}}function mouseOutInnerDiv(a){isMouseOndiv=false;$('#' + a).hide();$('#subpromoswf').css('visibility','visible');}function mouseOnInnerDiv(a){isMouseOndiv=true;$('#' + a).show();if(a=='innerdivision1')$('#subpromoswf').css('visibility','hidden');}function setOpacity(a,b){if(IE4||IE5){a.filter="alpha(opacity="+b+")"}if(NS6){a.MozOpacity=b/100}}function showInnerDiv(b,a){document.getElementById(b).style.display="block";document.getElementById(a).style.display="none"}function hideOuterDiv(b,a){isMouseOndiv=false;document.getElementById(b).style.display="none";document.getElementById(a).style.display="block"}function settingzindex(){if(IE){if(document.getElementById("BillingAddress")!="undefined"){document.getElementById("whatiscvvcontent").style.zIndex="1";document.getElementById("BillingAddress").style.zIndex="-1";document.getElementById("billinggreybg").style.zIndex="-1";document.getElementById("billinggreybg").style.border="1px hidden transparent"}}}function resettingzindex(){if(IE){if(document.getElementById("BillingAddress")!="undefined"){document.getElementById("whatiscvvcontent").style.display="none";document.getElementById("BillingAddress").style.zIndex="1";document.getElementById("billinggreybg").style.zIndex="1";document.getElementById("billinggreybg").style.border="none"}}}function editCategory(a,c,b){categoryNameId=c+"CategoryName"+a;editCategoryButton=c+"Edit"+a+"Category";categoryNameTextId=c+"categoyNameValue"+a;if(document.getElementById(categoryNameTextId)==null){document.getElementById(categoryNameId).innerHTML="<input type='text' name='"+c+"_categoryName' id='"+c+"categoyNameValue"+a+"' value='"+b+"' size='14' />";document.getElementById(editCategoryButton).innerHTML='<input type="button"  class="smallSubmit" value="Update Category" onClick="updateCategory(\''+a+"', '"+c+"')\" />"}}function editParentCategory(b,a){categoryNameId=b+"parentCategoryNameId";editCategoryButton=b+"Edit";categoryNameTextId=b+"_parentCategoryName";if(document.getElementById(categoryNameTextId)==null){document.getElementById(categoryNameId).innerHTML='<input type="text" name="'+b+'_categoryName" id="'+b+'categoyNameValue" value="'+a+'"  />';document.getElementById(editCategoryButton).innerHTML='<input type="button"  class="smallSubmit" value="Update" onClick="updateParentCategory(\''+b+"')\" />"}}function updateCategory(c,d){product_category_type_id=d+"ProductCategoryTypeId"+c;categoryName=document.getElementById(d+"categoyNameValue"+c).value;productCategoryTypeId=document.getElementById(product_category_type_id).value;var b=getAjaxRequest();var a="/catalog/control/updateProductCategory";b.open("POST",a,true);b.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");b.send("productCategoryId="+d+"&categoryName="+categoryName+"&productCategoryTypeId="+productCategoryTypeId);b.onreadystatechange=function(){if(b.readyState==3){}else{if(b.readyState==4){if(b.status==200){if(b.responseText){var e=b.responseText;if(e.indexOf("errorMessage")!=-1){document.getElementById("resultMessage").setAttribute("class","errorMessage");document.getElementById("resultMessage").innerHTML=getResultMessage(e,'<div id="content-messages" class="errorMessage">')}else{categoryNameTextId=d+"categoyNameValue"+c;if(document.getElementById(categoryNameTextId)){categoryNameId=d+"CategoryName"+c;editCategoryButton=d+"Edit"+c+"Category";document.getElementById(categoryNameId).innerHTML=categoryName;document.getElementById(editCategoryButton).innerHTML='<input type="button"  class="smallSubmit" value="Edit Category" onClick="editCategory(\''+c+"', '"+d+"', '"+categoryName+"')\" />"}}}}}}}}function updateParentCategory(c){product_category_type_id=c+"_parentCategoryName";categoryName=document.getElementById(c+"categoyNameValue").value;productCategoryTypeId=document.getElementById(c+"parentCategoryTypeId").value;var b=getAjaxRequest();var a="/catalog/control/updateProductCategory";b.open("POST",a,true);b.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");b.send("productCategoryId="+c+"&categoryName="+categoryName+"&productCategoryTypeId="+productCategoryTypeId);b.onreadystatechange=function(){if(b.readyState==3){}else{if(b.readyState==4){if(b.status==200){if(b.responseText){var e=b.responseText;if(e.indexOf("errorMessage")!=-1){document.getElementById("resultMessage").setAttribute("class","errorMessage");document.getElementById("resultMessage").innerHTML=getResultMessage(e,'<div id="content-messages" class="errorMessage">')}else{categoryNameTextId=c+"categoyNameValue";if(document.getElementById(categoryNameTextId)){categoryNameId=c+"parentCategoryNameId";editCategoryButton=c+"Edit";document.getElementById(categoryNameId).innerHTML="<h2>"+categoryName+"</h2>";var d=categoryName.replace("'","&#39;");document.getElementById(editCategoryButton).innerHTML="<input type='button'  class='smallSubmit' value='Edit' onClick='editParentCategory(\""+c+'", "'+d+"\")' />"}}}}}}}}function getAjaxRequest(){var a;try{a=new XMLHttpRequest();return a}catch(b){try{a=new ActiveXObject("Microsoft.XMLHTTP");return a}catch(b){if(isDebugOn){displayDebugError("Error creating AJAX request:\n",b)}return null}}}function createCategoryWRTProduct(f,g,c,e){categoryNameId=e+"_categoryName";var d=document.getElementById(categoryNameId).value;if(d==""||d==null){alert("categoryName should not be empty");return false}productCategoryId=d.toLowerCase().replace(" ","-")+"_"+g;prodCatalogCategoryTypeId="PCCT_QUICK_ADD";productCategoryTypeId="CATALOG_CATEGORY";var b=getAjaxRequest();var a="/ezoz/control/createCategoryFromProdCatalog";b.open("POST",a,true);b.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");b.send("productCategoryId="+productCategoryId+"&categoryName="+d+"&productCategoryTypeId="+productCategoryTypeId+"&parentProductCategoryId="+e+"&productId="+c+"&prodCatalogId="+g+"&prodCatalogCategoryTypeId="+prodCatalogCategoryTypeId);b.onreadystatechange=function(){if(b.readyState==3){}else{if(b.readyState==4){if(b.status==200){if(b.responseText){var m=b.responseText;if(m.indexOf("errorMessage")!=-1){document.getElementById("resultMessage").setAttribute("class","errorMessage");document.getElementById("resultMessage").innerHTML=getResultMessage(m,'<div id="content-messages" class="errorMessage">')}else{document.getElementById("resultMessage").setAttribute("class","eventMessage");document.getElementById("resultMessage").innerHTML=getResultMessage(m,'<div id="content-messages" class="eventMessage">');start_index=m.indexOf('<div id="fromDate">');length_string='<div id="fromDate">'.length;end_index=m.indexOf("</div>",start_index);fromDate_value=m.substring(start_index+length_string,end_index);document.getElementById(categoryNameId).value="";var l=document.getElementById(e+"table");var p=l.rows.length;var i=p;var o=l.insertRow(p);var n=i-1;var q=o.insertCell(0);var j=document.createTextNode(n);q.appendChild(j);q.setAttribute("id",productCategoryId+"td1");document.getElementById(productCategoryId+"td1").innerHTML=document.getElementById(productCategoryId+"td1").innerHTML+'<input type="hidden" name="'+productCategoryId+'_productCategoryTypeId" id="'+productCategoryId+"ProductCategoryTypeId"+n+'" value="'+productCategoryTypeId+'" />';var q=o.insertCell(1);var h=document.createElement("input");h.type="checkbox";h.name=productCategoryId+n;h.id=productCategoryId;q.appendChild(h);q.setAttribute("id",productCategoryId+"td2");document.getElementById(productCategoryId+"td2").innerHTML='<input name="'+productCategoryId+'" id="'+productCategoryId+n+'" type="checkbox"  checked="checked" onclick = "handleClick(\''+productCategoryId+n+"')\"/>"+productCategoryId;var q=o.insertCell(2);var j=document.createTextNode(d);q.appendChild(j);q.setAttribute("id",productCategoryId+"CategoryName"+n);var q=o.insertCell(3);var h=document.createElement("input");h.type="text";h.name=productCategoryId+"_fromDate";h.id=productCategoryId+"FromDate"+n;h.title="Format: yyyy-MM-dd HH:mm:ss.SSS";h.size=20;q.appendChild(h);q.setAttribute("id",productCategoryId+"td4");document.getElementById(productCategoryId+"td4").innerHTML=document.getElementById(productCategoryId+"td4").innerHTML+'<a href="javascript:call_cal(document.productAssociationDetails.'+productCategoryId+"FromDate"+n+",'"+fromDate_value+'\'); "><img src="/images/cal.gif" alt="View Calendar" title="View Calendar" border="0" height="16" width="16"></a>';var q=o.insertCell(4);var h=document.createElement("input");h.type="text";h.name=productCategoryId+"_thruDate";h.id=productCategoryId+"ThruDate"+n;h.title="Format: yyyy-MM-dd HH:mm:ss.SSS";h.size=20;q.appendChild(h);q.setAttribute("id",productCategoryId+"td5");document.getElementById(productCategoryId+"td5").innerHTML=document.getElementById(productCategoryId+"td5").innerHTML+'<a href="javascript:call_cal(document.productAssociationDetails.'+productCategoryId+"ThruDate"+n+",'"+fromDate_value+'\'); "><img src="/images/cal.gif" alt="View Calendar" title="View Calendar" border="0" height="16" width="16"></a>';var q=o.insertCell(5);var h=document.createElement("input");h.type="button";h.value="Edit Category";q.appendChild(h);var k=productCategoryId+"Edit"+n+"Category";q.setAttribute("id",k);q.setAttribute("align","center");document.getElementById(k).innerHTML='<input type="button"  class="smallSubmit" value="Edit Category" onClick=editCategory(\''+n+"','"+productCategoryId+"','"+d+"') />";document.getElementById(productCategoryId+"FromDate"+n).value=fromDate_value}}}}}}}function createParentCategory(e,c){var d=document.getElementById("newParentCategoryName").value;if(d==""||d==null){alert("categoryName should not be empty");return false}d=d.toLowerCase();productCategoryId="browse"+d.replace(" ","-")+"_"+e;prodCatalogCategoryTypeId="PCCT_BROWSE_"+d.toUpperCase();var b=getAjaxRequest();var a="/ezoz/control/createProdCatalogCategoryType";b.open("POST",a,true);b.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");b.send("productCategoryId="+productCategoryId+"&categoryName="+d+"&productCategoryTypeId=CATALOG_CATEGORY&productId="+c+"&prodCatalogId="+e+"&prodCatalogCategoryTypeId="+prodCatalogCategoryTypeId+"&description="+d);b.onreadystatechange=function(){if(b.readyState==3){}else{if(b.readyState==4){if(b.status==200){if(b.responseText){var g=b.responseText;if(g.indexOf("errorMessage")!=-1){document.getElementById("resultMessage").setAttribute("class","errorMessage");document.getElementById("resultMessage").innerHTML=getResultMessage(g,'<div id="content-messages" class="errorMessage">')}else{document.getElementById("resultMessage").setAttribute("class","eventMessage");document.getElementById("resultMessage").innerHTML=getResultMessage(g,'<div id="content-messages" class="eventMessage">');tab=document.createElement("table");tab.setAttribute("class","productdetail");tab.setAttribute("id",productCategoryId+"table");tab.setAttribute("style","margin-top:20px;");tab.border=1;tab.width="100%";tab.cellspacing=0;tab.cellpadding=0;tbo=document.createElement("tbody");tr_el=document.createElement("tr");var f=document.createElement("input");f.type="hidden";f.name=productCategoryId+"parentCategoryTypeId";f.id=productCategoryId+"parentCategoryTypeId";f.value="CATALOG_CATEGORY";tr_el.appendChild(f);td_el=document.createElement("td");td_el.setAttribute("colspan","5");td_el.setAttribute("id",productCategoryId+"parentCategoryNameId");var h=document.createTextNode(d);td_el.appendChild(h);tr_el.appendChild(td_el);td_el=document.createElement("td");td_el.setAttribute("id",productCategoryId+"Edit");td_el.setAttribute("align","center");td_el.appendChild(h);tr_el.appendChild(td_el);tbo.appendChild(tr_el);tr_el=document.createElement("tr");tr_el.setAttribute("class","fontweightbold height25");td_el=document.createElement("td");td_el.setAttribute("width","3%");var h=document.createTextNode("S.No");td_el.appendChild(h);tr_el.appendChild(td_el);td_el=document.createElement("td");td_el.setAttribute("width","25%");var h=document.createTextNode("Category");td_el.appendChild(h);tr_el.appendChild(td_el);td_el=document.createElement("td");td_el.setAttribute("width","14%");var h=document.createTextNode("CategoryName");td_el.appendChild(h);tr_el.appendChild(td_el);td_el=document.createElement("td");td_el.setAttribute("width","22%");var h=document.createTextNode("From Date");td_el.appendChild(h);tr_el.appendChild(td_el);td_el=document.createElement("td");td_el.setAttribute("width","22%");var h=document.createTextNode("Thru Date");td_el.appendChild(h);tr_el.appendChild(td_el);td_el=document.createElement("td");td_el.setAttribute("width","14%");var h=document.createTextNode(" ");td_el.appendChild(h);tr_el.appendChild(td_el);tbo.appendChild(tr_el);tab.appendChild(tbo);document.getElementById("divHolder").appendChild(tab);document.getElementById(productCategoryId+"Edit").innerHTML='<input type="button"  class="smallSubmit" value="Edit" onClick="editParentCategory(\''+productCategoryId+"', '"+d+"')\" />";document.getElementById(productCategoryId+"parentCategoryNameId").innerHTML="<h2>"+d+":</h2>";tab=document.createElement("table");tab.setAttribute("class","productdetail");tab.border=1;tab.width="100%";tab.cellspacing=0;tab.cellpadding=0;tbo=document.createElement("tbody");tr_el=document.createElement("tr");td_el=document.createElement("td");td_el.setAttribute("colspan","2");var f=document.createElement("input");f.type="text";f.name=productCategoryId+"_categoryName";f.id=productCategoryId+"_categoryName";td_el.appendChild(f);tr_el.appendChild(td_el);td_el=document.createElement("td");td_el.setAttribute("id",productCategoryId+"_createCategories");var h=document.createTextNode(" ");td_el.appendChild(h);tr_el.appendChild(td_el);tbo.appendChild(tr_el);tab.appendChild(tbo);document.getElementById("divHolder").appendChild(tab);document.getElementById(productCategoryId+"_createCategories").innerHTML='<input type="button"  class="smallSubmit" value="Create Category" onClick="return createCategoryWRTProduct(\'occasion\',\''+e+"','"+c+"','"+productCategoryId+"')\" />"}}}}}}}function getResultMessage(d,c){var a=d.indexOf(c);var f=c.length;var b=d.indexOf("</div>",a);var e=d.substring(a+f,b);return e};function setSearchCategoryId(searchForm){searchForm.category_id.value = "featured_" + searchForm.SEARCH_CATALOG_ID.value;searchForm.CURRENT_CATALOG_ID.value = searchForm.SEARCH_CATALOG_ID.value;}
