﻿document.write("<script src='Js/ajax.js' type='text/javascript'></script>"); 
document.write("<script src='Js/axjs.js' type='text/javascript'></script>"); 

function FormatNumber(srcStr, nAfterDot) {
    var srcStr, nAfterDot;
    var resultStr, nTen;
    srcStr = "" + srcStr + "";
    strLen = srcStr.length;
    dotPos = srcStr.indexOf(".", 0);
    if (dotPos == -1) {
        resultStr = srcStr + ".";
        for (i = 0; i < nAfterDot; i++) {
            resultStr = resultStr + "0";
        }
        return resultStr;
    }
    else {
        if ((strLen - dotPos - 1) >= nAfterDot) {
            nAfter = dotPos + nAfterDot + 1;
            nTen = 1;
            for (j = 0; j < nAfterDot; j++) {
                nTen = nTen * 10;
            }
            resultStr = Math.round(parseFloat(srcStr) * nTen) / nTen;
            return resultStr;
        }
        else {
            resultStr = srcStr;
            for (i = 0; i < (nAfterDot - strLen + dotPos + 1); i++) {
                resultStr = resultStr + "0";
            }
            return resultStr;
        }
    }
}
function fucCheckNUM(NUM) {
    var i, j, strTemp;
    strTemp = "0123456789";
    if (NUM.length == 0)
        return 0
    for (i = 0; i < NUM.length; i++) {
        j = strTemp.indexOf(NUM.charAt(i));
        if (j == -1) {
            return 0;
        }
    }
    return 1;
}

function f5_code(url) {
    document.getElementById("yzms").src = url + "Action/ValidateCode.aspx?t=" + Date.parse(new Date);
}

//flash getplay
function QRFpShow(info, ww, hh, Url) {
    var a = [];
    a = info.split('|');
    var pics = "";
    var links = "";
    var texts = "";
    var Num = a.length - 1;

    var focus_width = ww
    var focus_height = hh
    var text_height = 0
    var swf_height = focus_height + text_height

    for (var i = 0; i < Num; i++) {
        pics += a[i].split('*')[2] + "|";
        links += a[i].split('*')[1] + "|";
        texts += a[i].split('*')[0] + "|";
    }
    pics = pics.substring(0, pics.length - 1);
    links = links.substring(0, links.length - 1);

    document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase=" http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="' + focus_width + '" height="' + swf_height + '">');
    document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="' + Url + 'js/focus.swf"><param name="quality" value="high"><param name="bgcolor" value="#F0F0F0">');
    document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
    document.write('<param name="FlashVars" value="pics=' + pics + '&links=' + links + '&borderwidth=' + focus_width + '&borderheight=' + focus_height + '&textheight=' + text_height + '">');
    document.write('<embed src="' + Url + 'js/focus.swf" wmode="opaque" FlashVars="pics=' + pics + '&links=' + links + '&borderwidth=' + focus_width + '&borderheight=' + focus_height + '&textheight=' + text_height + '" menu="false" bgcolor="#F0F0F0" quality="high" width="' + focus_width + '" height="' + focus_height + '" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage=" http://www.macromedia.com/go/getflashplayer" />');
    document.write('</object>');
}

//FLASH
function insertFlash(elm, url, w, h) {
    if (!document.getElementById(elm)) return;
    var str = '';
    str += '<object width="' + w + '" height="' + h + '" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0">';
    str += '<param name="movie" value="' + url + '">';
    str += '<param name="wmode" value="opaque">';
    str += '<param name="quality" value="autohigh">';
    str += '<embed width="' + w + '" height="' + h + '" src="' + url + '" quality="autohigh" wmode="opaque" type="application/x-shockwave-flash" plugspace="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>';
    str += '</object>';
    document.getElementById(elm).innerHTML = str;
}

function CPDH_Open() {
    document.getElementById("flotCpHD").style.display = 'block';
}
function CPDH_Close() {
    document.getElementById("flotCpHD").style.display = 'none';
}

function TDH_Open() {
    document.getElementById("flotHD").style.display = 'block';
}
function TDH_Close() {
    document.getElementById("flotHD").style.display = 'none';
}

function f5_code(url) {
    document.getElementById("yzms").src = url + "Action/ValidateCode.aspx?t=" + Date.parse(new Date);
}

function Dl_Xz() {
    var pg = "../Action/action.aspx?act=uslg";
    if (checkInput_ulgs() != false) {
        flogin.action = pg;
        flogin.submit();
    }
}
function checkInput_ulgs() {
    if (document.flogin.txtus.value == "") {
        alert("系统提示: 请填写登陆用户名!");
        return false;
    }
    if (document.flogin.txtpw.value == "") {
        alert("系统提示：请填写登陆密码！");
        return false;
    }
    if (document.flogin.txtCode.value == "") {
        alert("系统提示：请填写登陆验证码！");
        return false;
    }
}

function Btn_AddFavorite() {
    window.external.addFavorite('http://www.littlewoman168.com', '广州小妇人内衣有限公司');
}

function searchT() {
    var s = document.getElementById("ntxt").value;
    if (document.getElementById("ntype01").checked) {
        window.location.href = "Arc_List.aspx?tid=0&pp=wzss_tit.jpg&act=I&s=" + s;
    }
    else {
        window.location.href = "Goods_Show.aspx?nt=search&s=" + encodeURI(s);
    }
}

function scrollpicshow(pic,cname) {
    document.getElementById("scrollpicshow").innerHTML = "<img src=\"./Upfile/Goods/Pic/B/" + pic + "\" onload='DrawImage(this);' />";
    document.getElementById("mytits").innerHTML = cname;
}

function scrolldmshow(pic,cname) {
    document.getElementById("scrollpicshow").innerHTML = "<img src=\"./Upfile/Arc/big/" + pic + "\" onload='DrawImage(this);'  />";
    document.getElementById("mytits").innerHTML = cname;
}

//pic roll
function Roll2(room, m1, m2, height, width, speed, type, speed2) {
    var r = document.getElementById(room);
    var z1 = document.getElementById(m1);
    var z2 = document.getElementById(m2);
    type = (type == "") ? "u" : type; //u:向上;d:向下;l:向左;r:向右        
    speed = (speed == "") ? "50" : speed;
    speed2 = (speed2 == "") ? "10" : speed2;
    z2.innerHTML = z1.innerHTML;
    with (r) {
        noWrap = true; //这句表内容区不自动换行
        style.width = width; //于是我们可以将它的宽度设为0，因为它会被撑大
        if (height != 0) {
            style.height = height;
        }
        style.overflowX = "hidden"; //滚动条不可见			
    }
    function Marquee() {
        switch (type) {
            case "u":
                if (z2.offsetHeight - r.scrollTop <= 0) {
                    r.scrollTop -= z1.offsetHeight;
                }
                else {
                    r.scrollTop++;
                }
                break;
            case "d":
                if (r.scrollTop <= 0) {
                    r.scrollTop = z2.offsetHeight;
                }
                else {
                    r.scrollTop--;
                }
                break;
            case "l":
                if (z2.offsetWidth - r.scrollLeft <= 4) {
                    r.scrollLeft -= z1.offsetWidth
                }
                else {
                    r.scrollLeft = r.scrollLeft + speed2;
                }
                break;
            case "r":
                if (r.scrollLeft <= 4) {
                    r.scrollLeft = z2.offsetWidth
                }
                else {
                    r.scrollLeft = r.scrollLeft - 1;
                }
                break;
        }
    };
    var Time = setInterval(Marquee, speed);
    r.onmouseover = function() {
        clearInterval(Time);
    };
    r.onmouseout = function() {
        Time = setInterval(Marquee, speed);
    }
    document.getElementById("btn_Rscroll").onclick = function() {
        type = "r";
    }
    document.getElementById("btn_Lscroll").onclick = function() {
        type = "l";
    }
}

//************GdPic*************************

function pp_gfy01(tid) {
    var pp = document.getElementById("pall").value;
    var pnp = document.getElementById("pnall").value;
    var sums = pp.split('|').length
    var p01 = 0;
    var p02 = 0;
    var qq = "";
    if (tid > -1) {
        if (tid < (sums - 1)) {
            p01 = tid - 1;
            p02 = tid + 1;
            //alert(tid + "," + p01 + "," + p02);          
            qq = pp.split('|')[tid];
            scrollpicshow(qq,pnp.split('|')[tid]);
            document.getElementById("pp01").innerHTML = "<a href=\"javascript:pp_gfy01(" + p01 + ");\"><img src=\"Images/p01.png\" onload=\"loadPng(this)\" style='width:79px;height:64px;' onmouseover=\"this.style.filter='alpha(opacity=80)';\" onmouseout=\"this.style.filter='alpha(opacity=100)';\"  alt=\"上一张\"></a>";
            document.getElementById("pp02").innerHTML = "<a href=\"javascript:pp_gfy01(" + p02 + ");\"><img src=\"Images/p02.png\" onload=\"loadPng(this)\" style='width:79px;height:64px;' onmouseover=\"this.style.filter='alpha(opacity=80)';\" onmouseout=\"this.style.filter='alpha(opacity=100)';\"  alt=\"下一张\"></a>";
            document.getElementById("app01").innerHTML = "<a href=\"javascript:pp_gfy01(" + p01 + ");\"><img src=\"Images/play/p_btn_02.jpg\" onload=\"loadPng(this)\" style='width:38px;height:28px;' onmouseover=\"this.style.filter='alpha(opacity=80)';\" onmouseout=\"this.style.filter='alpha(opacity=100)';\"  alt=\"上一张\"></a>";
            document.getElementById("app02").innerHTML = "<a href=\"javascript:pp_gfy01(" + p02 + ");\"><img src=\"Images/play/p_btn_04.jpg\" onload=\"loadPng(this)\" style='width:38px;height:28px;' onmouseover=\"this.style.filter='alpha(opacity=80)';\" onmouseout=\"this.style.filter='alpha(opacity=100)';\"  alt=\"下一张\"></a>";
        }
        else {
            window.location.href = document.getElementById("gfy_02").value;
        }
    }
    pp_fycss(tid, sums);
}
function Auto_Plays() {
    var tid=parseInt(document.getElementById("tx_sj").value)*1000;
    document.getElementById("apl").innerHTML = "<a href=\"javascript:void(0);\" onclick=\"javascript:Auto_StPlays();\"><img src=\"Images/play/stop.jpg\" alt=\"停止播放\" /></a>";
    myt1=window.setInterval('Auto_cs()',tid); 
}
function Auto_cs() {
    var tid=document.getElementById("ptis").value;
    if(parseInt(tid)<6)
    {
        pp_fy01(tid);
        document.getElementById("ptis").value=(parseInt(tid)+1);
    }
    else
    {
       alert("本页播放完毕！");
    }
}
function Auto_StPlays() {
   window.clearInterval(myt1);
   document.getElementById("apl").innerHTML = "<a href=\"javascript:void(0);\" onclick=\"javascript:Auto_Plays();\"><img src=\"Images/play/play.jpg\" alt=\"播放\" /></a>";
   alert("您选择了停止播放！");
}

//************NewPic*************************

function ck_fysq() {
    var pp = document.getElementById("pall").value;
    var pnp = document.getElementById("pnall").value;
    var ckpp=document.getElementById("ckpic").value;
    var sums = pp.split('|').length
    if(ckpp!="")
    {
        for (var i = 0; i < sums; i++) {
           if(ckpp==pp.split('|')[i])
           {
             pp_fy01(i);
           }
        }      
    }
}

function pp_fy01(tid) {
    var pp = document.getElementById("pall").value;
    var pnp = document.getElementById("pnall").value;
    var sums = pp.split('|').length
    var p01 = 0;
    var p02 = 0;
    var qq = "";
    if (tid > -1) {
        if (tid < (sums - 1)) {
            p01 = tid - 1;
            p02 = tid + 1;
            //alert(tid + "," + p01 + "," + p02);
            qq = pp.split('|')[tid];
            scrolldmshow(qq,pnp.split('|')[tid]);
            document.getElementById("pp01").innerHTML = "<a href=\"javascript:pp_fy01(" + p01 + ");\"><img src=\"Images/p01.png\" onload=\"loadPng(this);\" style='width:79px;height:64px;' onmouseover=\"this.style.filter='alpha(opacity=80)';\" onmouseout=\"this.style.filter='alpha(opacity=100)';\"  alt=\"上一张\"></a>";
            document.getElementById("pp02").innerHTML = "<a href=\"javascript:pp_fy01(" + p02 + ");\"><img src=\"Images/p02.png\" onload=\"loadPng(this);\" style='width:79px;height:64px;' onmouseover=\"this.style.filter='alpha(opacity=80)';\" onmouseout=\"this.style.filter='alpha(opacity=100)';\"  alt=\"下一张\"></a>";
            document.getElementById("app01").innerHTML = "<a href=\"javascript:pp_fy01(" + p01 + ");\"><img src=\"Images/play/p_btn_02.jpg\" onload=\"loadPng(this)\" style='width:38px;height:28px;' onmouseover=\"this.style.filter='alpha(opacity=80)';\" onmouseout=\"this.style.filter='alpha(opacity=100)';\"  alt=\"上一张\"></a>";
            document.getElementById("app02").innerHTML = "<a href=\"javascript:pp_fy01(" + p02 + ");\"><img src=\"Images/play/p_btn_04.jpg\" onload=\"loadPng(this)\" style='width:38px;height:28px;' onmouseover=\"this.style.filter='alpha(opacity=80)';\" onmouseout=\"this.style.filter='alpha(opacity=100)';\"  alt=\"下一张\"></a>";
        }
        else {
            window.location.href = document.getElementById("gfy_02").value;
        }
    }
    pp_fycss(tid, sums);
}
function Auto_Plays2() {
    var tid=parseInt(document.getElementById("tx_sj").value)*1000;
    document.getElementById("apl").innerHTML = "<a href=\"javascript:void(0);\" onclick=\"javascript:Auto_StPlays2();\"><img src=\"Images/play/stop.jpg\" alt=\"停止播放\" /></a>";
    myt1=window.setInterval('Auto_cs2()',tid); 
}
function Auto_cs2() {
    var tid=document.getElementById("ptis").value;
    if(parseInt(tid)<6)
    {
        pp_gfy01(tid);
        document.getElementById("ptis").value=(parseInt(tid)+1);
    }
    else
    {
       alert("本页播放完毕！");
    }
}
function Auto_StPlays2() {
   window.clearInterval(myt1);
   document.getElementById("apl").innerHTML = "<a href=\"javascript:void(0);\" onclick=\"javascript:Auto_Plays2();\"><img src=\"Images/play/play.jpg\" alt=\"播放\" /></a>";
   alert("您选择了停止播放！");
}

function pp_fycss(tid, sums) {
    if (tid > -1) {
        for (var i = 0; i < sums - 1; i++) {
            document.getElementById("sp" + i).className = 'scrollpic';
        }
        document.getElementById("sp" + tid).className = 'scrollpic1';
    }
}

function isEntry(e) {
    if (document.all) e = event;
    if (e.keyCode == 13) {
        searchT();
    };
}

function loadPng(o) {
    try {
        var img = o;
        var imgName = o.src.toUpperCase();
        if (imgName.substring(imgName.length - 3, imgName.length) == "PNG") {
            var imgID = (img.id) ? "id='" + img.id + "' " : "";
            var imgClass = (img.className) ? "class='" + img.className + "' " : "";
            var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' ";
            var imgStyle = "display:inline-block;" + img.style.cssText;
            if (img.align == "left") imgStyle = "float:left;" + imgStyle;
            if (img.align == "right") imgStyle = "float:right;" + imgStyle;
            if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle;
            var strNewHTML = "<span " + imgID + imgClass + imgTitle + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";" + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader" + "(src=\'" + img.src + "\', sizingMethod='image');\"></span>";
            img.outerHTML = strNewHTML + "";
        }
    }
    catch (e) {

    }

}

var flag = false;
function DrawImage(ImgD) {
    var image = new Image();
    var wt = 950;
    var ht = 550;
    image.src = ImgD.src;
    if (image.width > 0 && image.height > 0) {
        flag = true;
        if (image.width / image.height >= wt / ht) {
            if (image.width > wt) {
                ImgD.width = wt;
                ImgD.height = (image.height * wt) / image.width;
            } else {
                ImgD.width = image.width;
                ImgD.height = image.height;
            }
        }
        else {
            if (image.height > ht) {
                ImgD.height = ht;
                ImgD.width = (image.width * ht) / image.height;
            } else {
                ImgD.width = image.width;
                ImgD.height = image.height;
            }
        }
    }
}
document.write("<link rel='shortcut icon' href='favicon.ico' /> ");

//************Pic Star*************************

        function getEventObject(W3CEvent) {   //事件标准化函数
            return W3CEvent || window.event;
        }
        function getPointerPosition(e) {   //兼容浏览器的鼠标x,y获得函数
            e = e || getEventObject(e);
            var x = e.pageX || (e.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft));
            var y = e.pageY || (e.clientY + (document.documentElement.scrollTop || document.body.scrollTop));
            return { 'x': x, 'y': y };
        }
        function setOpacity(elem, level) {   //兼容浏览器设置透明值
            if (elem.filters) {
                elem.style.filter = 'alpha(opacity=' + level * 100 + ')';
            } else {
                elem.style.opacity = level;
            }
        }
        function css(elem, prop) {    //css设置函数,可以方便设置css值,并且兼容设置透明值
            for (var i in prop) {
                if (i == 'opacity') {
                    setOpacity(elem, prop[i]);
                } else {
                    elem.style[i] = prop[i];
                }
            }
            return elem;
        }
        var magnifier = {
            m: null,
            init: function(magni) {
                var m = this.m = magni || {
                    cont: null,  //装载原始图像的div
                    img: null,   //放大的图像
                    mag: null,   //放大框
                    scale: 15   //比例值,设置的值越大放大越大,但是这里有个问题就是如果不可以整除时,会产生些很小的白边,目前不知道如何解决
                }
                css(m.img, {
                    'position': 'absolute',
                    'width': (m.cont.clientWidth * m.scale) + 'px',    //原始图像的宽*比例值
                    'height': (m.cont.clientHeight * m.scale) + 'px'    //原始图像的高*比例值
                })
                css(m.mag, {
                    'display': 'none',
                    'width': m.cont.clientWidth + 'px',   //m.cont为原始图像,与原始图像等宽
                    'height': m.cont.clientHeight + 'px',
                    'position': 'absolute',
                    'left': m.cont.offsetLeft + m.cont.offsetWidth + 10 + 'px',  //放大框的位置为原始图像的右方远10px
                    'top': m.cont.offsetTop + 'px'
                })
                var borderWid = m.cont.getElementsByTagName('div')[0].offsetWidth - m.cont.getElementsByTagName('div')[0].clientWidth;  //获取border的宽
                css(m.cont.getElementsByTagName('div')[0], {   //m.cont.getElementsByTagName('div')[0]为浏览框
                    'display': 'none',        //开始设置为不可见
                    'width': m.cont.clientWidth / m.scale - borderWid + 'px',   //原始图片的宽/比例值 - border的宽度
                    'height': m.cont.clientHeight / m.scale - borderWid + 'px',  //原始图片的高/比例值 - border的宽度
                    'opacity': 0.5     //设置透明度
                })
                m.img.src = m.cont.getElementsByTagName('img')[0].src;   //让原始图像的src值给予放大图像
                m.cont.style.cursor = 'crosshair';
                m.cont.onmouseover = magnifier.start;
            },
            start: function(e) {
                if (document.all) {    //只在IE下执行,主要避免IE6的select无法覆盖
                    magnifier.createIframe(magnifier.m.img);
                }
                this.onmousemove = magnifier.move;  //this指向m.cont
                this.onmouseout = magnifier.end;
            },
            move: function(e) {
                var pos = getPointerPosition(e);  //事件标准化
                this.getElementsByTagName('div')[0].style.display = '';
                css(this.getElementsByTagName('div')[0], {
                    'top': Math.min(Math.max(pos.y - this.offsetTop - parseInt(this.getElementsByTagName('div')[0].style.height) / 2, 0), this.clientHeight - this.getElementsByTagName('div')[0].offsetHeight) + 'px',
                    'left': Math.min(Math.max(pos.x - this.offsetLeft - parseInt(this.getElementsByTagName('div')[0].style.width) / 2, 0), this.clientWidth - this.getElementsByTagName('div')[0].offsetWidth) + 'px'   //left=鼠标x - this.offsetLeft - 浏览框宽/2,Math.max和Math.min让浏览框不会超出图像
                })
                magnifier.m.mag.style.display = '';
                css(magnifier.m.img, {
                    'top': -(parseInt(this.getElementsByTagName('div')[0].style.top) * magnifier.m.scale) + 'px',
                    'left': -(parseInt(this.getElementsByTagName('div')[0].style.left) * magnifier.m.scale) + 'px'
                })
            },
            end: function(e) {
                this.getElementsByTagName('div')[0].style.display = 'none';
                magnifier.removeIframe(magnifier.m.img);  //销毁iframe
                magnifier.m.mag.style.display = 'none';
            },
            createIframe: function(elem) {
                var layer = document.createElement('iframe');
                layer.tabIndex = '-1';
                layer.src = 'javascript:false;';
                elem.parentNode.appendChild(layer);
                layer.style.width = elem.offsetWidth + 'px';
                layer.style.height = elem.offsetHeight + 'px';
            },
            removeIframe: function(elem) {
                var layers = elem.parentNode.getElementsByTagName('iframe');
                while (layers.length > 0) {
                    layers[0].parentNode.removeChild(layers[0]);
                }
            }
        }
        window.onload = function() {
            magnifier.init({
                cont: document.getElementById('magnifier'),
                img: document.getElementById('magnifierImg'),
                mag: document.getElementById('mag'),
                scale: 3
            });
        }

        //************Pic End*************************

        document.write("<script src='include/qqscroll.js' type='text/javascript'></script>");
        
//**********滚动滚动滚动滚动*****************************
/* 滚动 */
function Roll(room,m1,m2,height,width,speed,type)
{
        var r=document.getElementById(room);
        var z1=document.getElementById(m1);
        var z2=document.getElementById(m2);        
        type=(type=="")?"u":type;//u:向上;d:向下;l:向左;r:向右        
        speed=(speed=="")?"50":speed;
		z2.innerHTML=z1.innerHTML;
		with(r)
		{
		    noWrap=true; //这句表内容区不自动换行
		    style.width=width; //于是我们可以将它的宽度设为0，因为它会被撑大
		    if(height!=0)
		    {
		        style.height=height;
		    }
		    style.overflowX="hidden"; //滚动条不可见			
		}
		function Marquee()
		{		
		    switch(type)
		    {
		        case "u":
			        if(z2.offsetHeight-r.scrollTop<=0)
			        {					
				        r.scrollTop-=z1.offsetHeight;
			        }
			        else
			        {					
				        r.scrollTop++;
			        }
			    break;
			    case "d":
			        if(r.scrollTop<=0)
			        {			            
				        r.scrollTop=z2.offsetHeight;				        
			        }
			        else
			        {					
				        r.scrollTop--;
			        }
			    break;
			    case "l":
			        if(z2.offsetWidth-r.scrollLeft<=4)
				    {
					    r.scrollLeft-=z1.offsetWidth
				    }
				    else
				    {
					    r.scrollLeft=r.scrollLeft+1;
				    }
			    break;
			    case "r":
			        if(z2.offsetWidth-r.scrollLeft<=4)
				    {
					    r.scrollLeft-=z1.offsetWidth
				    }
				    else
				    {
					    r.scrollLeft=r.scrollLeft+1;
				    }
			    break;			    
			}
		};
		var Time=setInterval(Marquee,speed);				
		r.onmouseover=function() 
		{		    
			clearInterval(Time);
		};
		r.onmouseout=function() 
		{
			Time=setInterval(Marquee,speed);
		}    
} 
