﻿var HHX=jQuery.noConflict();
//var VarColor=document.getElementById("DIVcolorName2").innerHTML;
//VarColor = VarColor.replace(/^\s+|\s+$/g,""); 
//VarSize = VarSize.replace(/^\s+|\s+$/g,""); 

 
function ClickAddSizeName(OO)
{  
    document.all.DIVsizeName.innerHTML=OO.value; 
    document.all.DIVsizeName2.value=OO.value;  
    AddOption(OO.name);  
    ProSumsOnchange(); 
}

function ChexkProductSpecSumBuy()
{
    var Proid = document.getElementById("Proid").value;
    var VarSize = document.getElementById("DIVsizeName2").value;
    var VarColor = document.getElementById("DIVcolorName2").value;
    var strValue = document.getElementById("SelectSums").options[document.getElementById("SelectSums").selectedIndex].text; 
    if(VarSize=="未选择")
    {   
         alert("请先选择尺码。");  
    }
    else if(strValue=="0")
    {
        alert("库存为零，不能下单，请重新选择尺码。");  
    }
    else
    {  
        window.open ("../web/addorderZG.aspx?kuweb="+ Proid+"$"+VarSize+"$"+VarColor+"$"+strValue);

//        window.location ='../web/addorderZG.aspx?Proid="+ Proid+"="+VarSize+"&ProColor="+VarColor+"&ProOum="+strValue;
    }
}

function ChexkProductSpecSum()
{         
    var VarSize=document.getElementById("DIVsizeName2").value;
    var strValue = document.getElementById("SelectSums").options[document.getElementById("SelectSums").selectedIndex].text; 
    if(VarSize=="未选择")
    {   
         alert("请先选择尺码!"); 
         return false;  
    }
    else if(strValue=="0")
    {
        alert("库存为零,不能下单!"); 
        return false;  
    }
    else
    {  
        openDivMM("productDataGetOrderInfoMM");
        return true;
    }
    
//    HHX(document).ready(function(){ 
//    HHX("#OrderSum").html(VarProductPrice); 
//    }); 
    
}

function ProSumsOnchange()
{ 
    var VarProductPrice = document.getElementById("productPriceA1").innerHTML;
    var strValue = document.getElementById("SelectSums").options[document.getElementById("SelectSums").selectedIndex].text; 
    var VartPrice = "￥"+(VarProductPrice * strValue)+".00";
    
    HHX(document).ready(function(){  
    HHX("#OrderSum").html(VartPrice); 
    });

// alert(VarProductPrice);         
    
}


//添加新项
function AddOption(lists)
{    
    HHX("#SelectSums").empty(); 
  
     if(lists<1)
    {
        var option = new Option(0); 
        var item = document.getElementById("SelectSums").options.length;
        document.getElementById("SelectSums").options[item] = option;
        document.getElementById("SelectSums").selectedIndex = item;        
    }
    else
    {    
        if(lists>10)
        {
            lists=10;
        }

        var i=1
        for (i=lists;i>0;i--)
        {
            var option = new Option(i); 
            var item = document.getElementById("SelectSums").options.length;
            document.getElementById("SelectSums").options[item] = option;
            document.getElementById("SelectSums").selectedIndex = item;
        }
    }

}

function closeDivMM(obj)
{     
    HHX(document).ready(function(){  
    HHX("#"+obj).hide(); 
    });
//document.getElementById(obj).style.display="none"; show();

} 

function openDivMM(obj)
{     
    HHX(document).ready(function(){  
    HHX("#"+obj).show(); 
    }); 

}



function loadimg(obj)
{         
    HHX(document).ready(function(){   
    HHX(obj).attr("src","../companyPic/ProIndexPic.jpg");  
    });
}

 
 

// HHX("img").src="../companyPic/ProIndexPic.jpg";
//  <input id="txtQuestion2" type="text" value="您有什么疑问请教专家!" onblur="res()" onfocus="cls()" />

//function cls() {
//    //捕获触发事件的对象，并设置为以下语句的默认对象 
//    with (event.srcElement)
//    //如果当前值为默认值，则清空 
//        if (value == defaultValue) value = ""
//}
//function res() {
//    //捕获触发事件的对象，并设置为以下语句的默认对象 
//    with (event.srcElement)
//    //如果当前值为空，则重置为默认值 
//        if (value == "") value = defaultValue
//} 



