"
document.getElementById("tempdiv").innerHTML=Oword;
document.getElementById("allbody").style.display="";
if (Mpar!="Sizes"){document.getElementById("pslist").style.display="none"}
initFloatTips();
}
/*
**=============================浮动购物车增加框=============================**
要求: 有ID为floatTips,allbody的DIV两个, allbody滤镜层DIV, floatTips为浮动层DIV
**--------------------------------------------------------------------------**
*/
var tips;
var theTop = 196 /*这是默认高度*/;
var old = theTop;
var fid="floatTips";
var star=0;
function initFloatTips() {
tips = document.getElementById(fid);
moveTips();
}
function moveTips() {
if (document.getElementById(fid).style.display=="none"){return false;} //输入框隐藏时跳出函数
if (currentMoveObj==null){ //输入框存在时执行函数
var tt=300;
if (window.innerHeight) {
pos = window.pageYOffset
}
else if (document.documentElement && document.documentElement.scrollTop) {
pos = document.documentElement.scrollTop
}
else if (document.body) {
pos = document.body.scrollTop;
}
pos=pos-tips.offsetTop+theTop;
pos=tips.offsetTop+Math.ceil(pos/5);
if (pos < theTop){pos=theTop};
if (pos != old) {
tips.style.top = pos+"px";
tt=15;
}
else{
if (star==0){
if (document.getElementById('Qty').value.length==0){document.getElementById('Qty').focus();}
else{if (document.getElementById("pslist").style.display!="none") document.getElementById('Slist').focus();}
star=1;
}
}
old = pos;
}
setTimeout(moveTips,tt);
}
//拖动部分------------------------------------------------------------------------
var currentMoveObj=null; //当前拖动对象
var relLeft; //鼠标按下位置相对对象位置
var relTop;
function mdown(obj){ //obj为当做拖动的DIV的ID
currentMoveObj=document.getElementById(fid); //当对象被按下时,记录该对象
obj.style.backgroundColor="#66CCCC";
if(document.all){ //IE
obj.onselectstart = function() {return(false);};
relLeft=event.x-currentMoveObj.style.pixelLeft;
relTop=event.y-currentMoveObj.style.pixelTop;
document.onmousemove = function(){
currentMoveObj.style.pixelLeft=event.x-relLeft;
currentMoveObj.style.pixelTop=event.y-relTop;
}
document.onmouseup=function(){
document.onmousemove=null;
currentMoveObj=null;
obj.style.backgroundColor="#CCFFFF";
}
}
else{ //Firefox
currentMoveObj.onmousedown = function(e){
e = e||window.event;
var x=e.layerX||e.offsetX;
var y=e.layerY||e.offsetY;
document.onmousemove = function(e){
e=e||window.event;
currentMoveObj.style.left=(e.pageX-x)+"px";
currentMoveObj.style.top=(e.pageY-y)+"px";
};
document.onmouseup=function(){
currentMoveObj=null;
document.onmousemove=null;
obj.style.backgroundColor="#CCFFFF";
}
}
}
}
function mover(obj){
obj.style.backgroundColor="#66FFFF";
document.onmouseout=function(){
obj.style.backgroundColor="#CCFFFF";
}
}
//=============================浮动购物车增加框=============================**
function PutOrder() { //通过网址打开输入框
var s=location.hash
if(s==""){return false ;}
var signstr=s.substr(1,s.length).split("#");
if (signstr=="clicktop"){ToClick("addtocart");}
}
function cclose(){ //关闭输入框
document.getElementById('allbody').style.display='none';
document.getElementById('floatTips').style.display='none';
}
/*IE和Firefox下面的onclick事件*/
function ToClick(ButtonId){
if(document.all){ //IE
document.getElementById(ButtonId).click();
}
else{ //Firefox
var evt=document.createEvent("MouseEvents");
evt.initEvent("click",true,true);
document.getElementById(ButtonId).dispatchEvent(evt);
}
}
function AddToCart(){
var Qty=document.getElementById("Qty").value;
var Slist=document.getElementById("Slist").value;
if (Qty==''){
alert("------------------------------\n\nPlease Fill in the Quantity,\n\nThe field request a Digit !\n\n------------------------------");
document.getElementById("Qty").focus();
return false;
}
else{
if (!isNumeric(Qty)) {
alert("------------------------------\n\nQuantity field must full in a Digit !\n\n------------------------------");
document.getElementById("Qty").focus();
return false;
}
if ((document.getElementById("pslist").style.display!="none")&&(Slist=='')){ //需要填写号码
alert("------------------------------\n\nPlease Fill in the Sizes List !\n\n------------------------------");
document.getElementById("Slist").focus();
return false;
}
document.getElementById("AddContent").value=document.getElementById("OldContent").value+"[2]"+Qty+"[2]"+Slist;
//alert(document.getElementById("Opinfo").value)
ToClick("SubmitAdd");
}
return false;
}
function isNumeric(strNumber){
return (strNumber.search(/^(|\+)?\d+$/) != -1);
}
function externalLinks() { //新窗口打开外部链接
if (!document.getElementsByTagName) return;
var anchors = document.getElementsByTagName("a");
for (var i=0; i < anchors.length; i++) {
var anchor = anchors[i];
if (anchor.getAttribute("href") &&
anchor.getAttribute("rel") == "external")
anchor.target = "_blank";
}
}
function DoInEveryPage() { //执行必须的函数
var Cword='';
//购物车框
Cword+="
"
Cword+=" "
Cword+="
"
Cword+=" "
Cword+=" SHOPPING"
Cword+=" CART: "
Cword+=" Total Item: "
Cword+=" 0 Items "
Cword+=" Total Price: "
Cword+=" 0 USD"
Cword+=" [ View My Shopping Cart ]
"
Cword+=" "
Cword+="
"
//欢迎词框
Cword+="
"
Cword+=" "
Cword+="
"
Cword+=" "
Cword+=" CONTACT"
Cword+=" US: "
Cword+=" Hi, This is "
Cword+=" Cindy service for you,"
Cword+=" you can contact us by following ways, "
Cword+=" "
var Email="offergoods";
Cword+=" Email: customer@"+Email+".org "
Cword+=" Phone #: 0086-595-28l6-5Oll "
Cword+=" "
Cword+=" "
Cword+=" "
Cword+=" MSN: "
Cword+=" "+Email+"inc@hotmail.com"
Cword+=" "
Cword+="