// JavaScript Document
function show_product_detail(id){
for (var i=0;i<10;i++){
$("#p_d_"+i).hide();
$("#p_"+i).show();
}
$("#p_"+id).hide();
$("#p_d_"+id).show();
}
function show_category(parent,level){
$("#category_"+level).empty();
if (parent==1){
$("#category_"+level).append("");
}else{
$("#category_"+level).append("");
}
if (level == 2){
show_brand(parent);
}
if (parent == 0){
for (var i=level;i<=3;i++){
$("#category_"+i).attr("disabled",true);
}
}else{
for (var i=0;i< category.length;i++){
if (category[i].parent == parent){
if (category[i].id == category_1 || category[i].id == category_2){
$("#category_"+level).append("");
}else{
$("#category_"+level).append("");
}
}
}
$("#category_"+level).attr("disabled",false);
}
}
function show_brand(id){
$("#category_3").empty();
$("#category_3").append("");
$("#category_3").attr("disabled",true);
$.get("//production.xitek.com/ajax.php", {t:"load_brand",id:id},
function(data){
if (data){
eval("var brand = "+data+";");
for (var i=0;i < brand.length;i++){
if (brand[i].id == category_3){
$("#category_3").append("");
}else{
$("#category_3").append("");
}
}
$("#category_3").attr("disabled",false);
}
});
}
function SetCwinHeight(obj){
var cwin=obj;
if (document.getElementById){
if (cwin && !window.opera){
if (cwin.contentDocument && cwin.contentDocument.body.offsetHeight)
cwin.height = cwin.contentDocument.body.offsetHeight;
else if(cwin.Document && cwin.Document.body.scrollHeight)
cwin.height = cwin.Document.body.scrollHeight;
}
}
}