//adTab.js
function ADTab(num)
{var a3=document.getElementById('AD3');var a1=document.getElementById('AD1');var m1=document.getElementById('a');var m3=document.getElementById('b');if(num==1)
{a1.style.display="block";a3.style.display="none";m1.className="featrued_product_div_sel";m3.className="featrued_services_div";document.getElementById('M3').className='';document.getElementById('M1').className='home_btn_right';}
if(num==3)
{a3.style.display="block";a1.style.display="none";m3.className="featrued_services_div_sel";m1.className="featrued_product_div";document.getElementById('M3').className='home_btn_right';document.getElementById('M1').className='';}}

var speed=20
var mCount=0;var curFlag=0;var bRunning=false;function MarqueeLeft()
{if(GE('demo').scrollLeft>=GE('marquePic1').scrollWidth)
{GE('demo').scrollLeft=0;curFlag=0;bRunning=false;return;}
else
{GE('demo').scrollLeft=GE('demo').scrollLeft-15}
mCount++;if(mCount<6)
{setTimeout(MarqueeLeft,speed)}
else
{bRunning=false;curFlag--;if(curFlag==0)
{GE('imgArrowL').src="images/productsImg/left1.gif";}
else
{GE('imgArrowL').src="images/productsImg/left.gif";}
GE('imgArrowR').src="images/productsImg/right.gif";}}
function MarqueeRight()
{if(GE('demo').scrollLeft>=GE('marquePic1').scrollWidth)
{GE('demo').scrollLeft=0}else
{GE('demo').scrollLeft=GE('demo').scrollLeft+15}
mCount++;if(mCount<6)
{setTimeout(MarqueeRight,speed)}
else
{bRunning=false;curFlag++;if(curFlag==3)
{GE('imgArrowR').src="images/productsImg/right1.gif";}
else
{GE('imgArrowR').src="images/productsImg/right.gif";}
GE('imgArrowL').src="images/productsImg/left.gif";}}

function MM_swapImgRestore(){var i,x,a=document.MM_sr;for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)x.src=x.oSrc;}
function MM_preloadImages(){var d=document;if(d.images){if(!d.MM_p)d.MM_p=new Array();var i,j=d.MM_p.length,a=MM_preloadImages.arguments;for(i=0;i<a.length;i++)
if(a[i].indexOf("#")!=0){d.MM_p[j]=new Image;d.MM_p[j++].src=a[i];}}}
function MM_findObj(n,d){var p,i,x;if(!d)d=document;if((p=n.indexOf("?"))>0&&parent.frames.length){d=parent.frames[n.substring(p+1)].document;n=n.substring(0,p);}
if(!(x=d[n])&&d.all)x=d.all[n];for(i=0;!x&&i<d.forms.length;i++)x=d.forms[i][n];for(i=0;!x&&d.layers&&i<d.layers.length;i++)x=MM_findObj(n,d.layers[i].document);if(!x&&d.getElementById)x=d.getElementById(n);return x;}
function MM_swapImage(){var i,j=0,x,a=MM_swapImage.arguments;document.MM_sr=new Array;for(i=0;i<(a.length-2);i+=3)
if((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x;if(!x.oSrc)x.oSrc=x.src;x.src=a[i+2];}}

//images4/commons.js

function setCheckedFlag(formObj,eleNameArr,checkedFlag){for(var i=0;i<formObj.elements.length;i++){var ele=formObj.elements[i];for(var j=0;j<eleNameArr.length;j++){if(ele.name==eleNameArr[j]){ele.checked=checkedFlag;break;}}}}
function getCheckedRecordNum(formObj,eleNameArr){var checkedNum=0;for(var i=0;i<formObj.elements.length;i++){var ele=formObj.elements[i];for(var j=0;j<eleNameArr.length;j++){if(ele.name==eleNameArr[j]&&ele.checked){checkedNum++;break;}}}
return checkedNum;}
function trim(str){return(trimExt(str,' '));}
function trimExt(str,ch){if(str==null)return(null);var start=0,end=0;var i=0;while(i<str.length){if(str.charAt(i)==ch){i++;}else{start=i;break;}}
i=str.length-1;while(i>=0){if(str.charAt(i)==ch){i--;}else{end=i+1;break;}}
return(str.substring(start,end));}
function isNumber(value){if(trim(value)!=''&&!isNaN(value)&&(value.indexOf('.')==-1)){return(true);}
return(false);}
function initSelectWithValue(selectObj,oldValue){for(var i=0;i<selectObj.length;i++){if(selectObj.options[i].value==oldValue){selectObj.options[i].selected=true;break;}}}
function encode(str){if(str==null)return'';var retStr=escape(str);if(str.indexOf('+')!=-1){retStr=retStr.replace(/\+/g,'%2B');}
return retStr;}
function XMLEncode(str){str=trim(str);str=str.replace("&","&amp;");str=str.replace("<","&lt;");str=str.replace(">","&gt;");str=str.replace("'","&apos;");str=str.replace("\"","&quot;");return str;}
function XMLDecode(str){str=trim(str);str=str.replace("&amp;","&");str=str.replace("&lt;","<");str=str.replace("&gt;",">");str=str.replace("&apos;","'");str=str.replace("&quot;","\"");return str;}
function adjustImageSize(imageObj,maxHeight,maxWidth){if(maxHeight<imageObj.height){imageObj.height=maxHeight;}
if(maxWidth<imageObj.width){imageObj.width=maxWidth;}}
function setImgSize(theURL,sImage){var imgObj;var sizeStand=200;imgObj=new Image();imgObj.src=theURL;if((imgObj.width!=0)&&(imgObj.height!=0)){if(imgObj.width>imgObj.height){var iHeight=imgObj.height*sizeStand/imgObj.width;sImage.height=iHeight;sImage.width=sizeStand;}else{var iWidth=imgObj.width*sizeStand/imgObj.height;sImage.width=iWidth;sImage.height=sizeStand;}}else{sImage.width=200;sImage.height=200;}}
function setBigImgSize(theURL,sImage){var imgObj;var sizeStand=200;imgObj=new Image();imgObj.src=theURL;if((imgObj.width!=0)&&(imgObj.height!=0)){if(imgObj.width>imgObj.height){var iHeight=imgObj.height*sizeStand/imgObj.width;sImage.height=iHeight*2;sImage.width=sizeStand*2;}else{var iWidth=imgObj.width*sizeStand/imgObj.height;sImage.width=iWidth*2;sImage.height=sizeStand*2;}}else{sImage.width=360;sImage.height=360;}}
function bbimg(o){var zoom=parseInt(o.style.zoom,10)||100;zoom+=event.wheelDelta/12;if(zoom>0)o.style.zoom=zoom+'%';return false;}

//images4/aisncommons.js

var ELE_NAME_ARRAY=new Array('chkBuyOfferIds','chkSellOfferIds','chkProductIds','chkCompanyIds');var MY_WEB_SERVER="http://my.alibaba.com";function check(checked){setCheckedFlag(document.form,ELE_NAME_ARRAY,checked);}
function inquiryNow(){var checkedNum=getCheckedNum();var basketItemNum=parseInt(document.form.basketItemNum.value);var urlString=document.location+"";if(checkedNum==0){if(basketItemNum==0){alert("No item(s) selected.")
return;}else{document.form.action=MY_WEB_SERVER+"/apps/feedback?req_page=basket.init";document.form.target="_blank";document.form.submit();}}
if(checkedNum>0){document.form.action=MY_WEB_SERVER+"/apps/feedback?req_page=feedback.init";document.form.target="_blank";document.form.submit();}}
function addBasket(){var basketItemMax=parseInt(document.form.basketItemMax.value);var basketItemNum=parseInt(document.form.basketItemNum.value);var num=getCheckedNum();var urlString=document.location+"";if(num==0){alert("No item(s) selected.")
return;}
if(basketItemMax<(basketItemNum+num)){var alertMessage="Your Inquiry Basket is full. It can store a maximum of "+basketItemMax+" inquiries.";alert(alertMessage);return;}
document.form.action=window.location.href;document.form.target="";document.form.submit();}
function getCheckedNum(){return getCheckedRecordNum(document.form,ELE_NAME_ARRAY);}
function getBuyOfferCheckedNum(){return getCheckedItemNum('chkBuyOfferIds');}
function getSellOfferCheckedNum(){return getCheckedItemNum('chkSellOfferIds');}
function getCompanyCheckedNum(){return getCheckedItemNum('chkCompanyIds');}
function getProductCheckedNum(){return getCheckedItemNum('chkProductIds');}
function getCheckedItemNum(item){return getCheckedRecordNum(document.form,new Array(item));}
function uncheckQuote(){setCheckedFlag(document.form,new Array('chkBuyOfferIds'),false);}
function uncheckRFQ(){setCheckedFlag(document.form,new Array('chkSellOfferIds','chkProductIds','chkCompanyIds'),false);}

//js/common_hot.js

function GE(id)
{return document.getElementById(id);}
function CtoH(id)
{var str=GE(id).value;var result="";for(var i=0;i<str.length;i++){if(str.charCodeAt(i)==8220||str.charCodeAt(i)==8221){result+=String.fromCharCode(34);}else if(str.charCodeAt(i)==8216||str.charCodeAt(i)==8217){result+=String.fromCharCode(39);}else if(str.charCodeAt(i)==12290){result+=String.fromCharCode(46);}else if(str.charCodeAt(i)==12289){result+=String.fromCharCode(44);}else if(str.charCodeAt(i)==12288){result+=String.fromCharCode(32);}else if(str.charCodeAt(i)>65280&&str.charCodeAt(i)<65375){result+=String.fromCharCode(str.charCodeAt(i)-65248);}else{result+=String.fromCharCode(str.charCodeAt(i));}}
GE(id).value=result.trim();}
function StringCtoH(p_source)
{var str=p_source;var result="";for(var i=0;i<str.length;i++){if(str.charCodeAt(i)==8220||str.charCodeAt(i)==8221){result+=String.fromCharCode(34);}else if(str.charCodeAt(i)==8216||str.charCodeAt(i)==8217){result+=String.fromCharCode(39);}else if(str.charCodeAt(i)==12290){result+=String.fromCharCode(46);}else if(str.charCodeAt(i)==12289){result+=String.fromCharCode(44);}else if(str.charCodeAt(i)==12288){result+=String.fromCharCode(32);}else if(str.charCodeAt(i)>65280&&str.charCodeAt(i)<65375){result+=String.fromCharCode(str.charCodeAt(i)-65248);}else{result+=String.fromCharCode(str.charCodeAt(i));}}
return result;}
var firstErrorControl="";function SetError(id,state,text)
{if(text.trim().length>0)
GE(id+"Error").innerHTML=text;if(state.toLowerCase()=="block"&&firstErrorControl!=null&&firstErrorControl=="")
{firstErrorControl=id;}
GE(id+"Error").style.display=state;}
function SetErrorFocus()
{if(firstErrorControl!=null&&firstErrorControl!="")
{try
{if(GE(firstErrorControl).type!="hidden")
{if(GE(firstErrorControl)!=null)
GE(firstErrorControl).focus();else
GE(firstErrorControl+"Error").focus();}
else
{GE(firstErrorControl+"Error").focus();}}
catch(e)
{GE(firstErrorControl+"Error").focus();}}}
function SetErrorControlFocus()
{if(firstErrorControl!=null&&firstErrorControl!="")
{try
{if(GE(firstErrorControl).type!="hidden")
{if(GE(firstErrorControl)!=null)
GE(firstErrorControl).focus();else
GE(firstErrorControl+"Error").focus();}
else
{GE(firstErrorControl+"Error").focus();}}
catch(e)
{if(GE(firstErrorControl+"Error")!=null)
{GE(firstErrorControl+"Error").style.display="block";}}}}
function isEmpty(str)
{return(str.trim()=="");}
function isInteger(str)
{if(isEmpty(str))return true;var reg=/^((\+|-)\d)?\d*$/;return reg.test(str);}
function isDouble(str)
{if(isEmpty(str))return true;var reg=/^(?:\+|-)?\d+(?:\.\d+)?$/;return reg.test(str);}
function isDate(str)
{if(isEmpty(str))return true;var reg=/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/;var r=str.match(reg);if(r==null)return false;var d=new Date(r[1],r[3]-1,r[4]);var newStr=d.getFullYear()+r[2]+(d.getMonth()+1)+r[2]+d.getDate();return newStr==str;}
function isEmail(str)
{if(isEmpty(str))return true;var reg=/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/i;return reg.test(str);}
function isEmailA(str)
{var reg=/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/i;return reg.test(str);}
function isBetween(val,lo,hi){if((val<lo)||(val>hi)){return(false);}
else{return(true);}}
function isDateTime(str)
{if(str=="")return true;var strDate=str;if(strDate.length==0)return false;var reg=/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})/;var r=strDate.match(reg);if(r!=null)
strDate=strDate+" 00:00:00";reg=/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})/;r=strDate.match(reg);if(r==null)
{return false;}
var d=new Date(r[1],r[3]-1,r[4],r[5],r[6],r[7]);if(d.getFullYear()==r[1]&&(d.getMonth()+1)==r[3]&&d.getDate()==r[4]&&d.getHours()==r[5]&&d.getMinutes()==r[6]&&d.getSeconds()==r[7])
{return d;}
else
{return false;}}
function isChineseChar(str)
{if(isEmpty(str))return true;var reg=/^([\u4E00-\u9FA5]|[\uFE30-\uFFA0])*$/gi;return reg.test(str);}
function includeChineseChar(str)
{if(isEmpty(str))return true;var reg=/^[\x00-\x7F]*$/;return reg.test(str);}
function isEngCharAll(str)
{if(isEmpty(str))return true;var reg=/^[a-zA-Z]{1,20}$/;return reg.test(str);}
function isCountryCode(str)
{if(isEmpty(str))return true;var reg=/^([0-9\+]){1,10}$/;return reg.test(str);}
function isDigitOrEngChar(str)
{if(isEmpty(str))return true;var reg=/^([a-zA-Z0-9]){1,100}$/;return reg.test(str);}
function isEngCharUpper(str)
{if(isEmpty(str))return true;var reg=/^[A-Z]{1,20}$/;return reg.test(str);}
function isEngCharLower(str)
{if(isEmpty(str))return true;var reg=/^[a-z]{1,20}$/;return reg.test(str);}
function isPostCode(str)
{if(isEmpty(str))return true;var reg=/^[A-Za-z0-9]{1,12}$/;return reg.test(str);}
function isYear(str)
{if(isEmpty(str))return true;var reg=/^[0-9]{4}$/;return reg.test(str);}
function isUrl(str)
{return true;if(isEmpty(str)||str.toLowerCase()=="http://")return true;var reg=/^http:\/\/[A-Za-z0-9]+\.[A-Za-z0-9]+[\/=\?%\-&_~`@[\]\':+!]*([^<>\"\"])*$/;return reg.test(str);}
function isDigit(str)
{if(isEmpty(str))return true;var reg=/^[0-9]{1,20}$/;return reg.test(str);}
function isDigitDot(str)
{if(isEmpty(str))return true;var reg=/^[0-9.]{1,20}$/;return reg.test(str);}
function isRegisterUserName(str)
{if(isEmpty(str))return true;var reg=/^[a-zA-Z]{1}([a-zA-Z0-9]|[._]){2,19}$/;return reg.test(str);}
function isTrueName(str)
{if(isEmpty(str))return true;var reg=/^[a-zA-Z]{1,30}$/;return reg.test(str);}
function isEngDigitEmpty(str)
{if(isEmpty(str))return true;var reg=/^([a-zA-Z0-9]|[ ]){1,100}$/;return reg.test(str);}
function isEngEmpty(str)
{if(isEmpty(str))return true;var reg=/^([a-zA-Z]|[ ]){1,100}$/;return reg.test(str);}
function isKeyWord(str)
{if(isEmpty(str))return true;var reg=/^([a-zA-Z]|[0-9]|[ ]|[-]|[/]|[_]){1,100}$/;return reg.test(str);}
function isPasswd(str)
{if(isEmpty(str))return true;var reg=/^(\w){6,20}$/;return reg.test(str);}
function isTel(str)
{if(isEmpty(str))return true;var reg=/^[+]{0,1}(\d){1,3}[ ]?([-]?((\d)|[ ]){1,12})+$/;return reg.test(str);}
function isMobil(str)
{if(isEmpty(str))return true;var reg=/^[0-9]{1,16}$/;return reg.test(str);}
function isIP(str)
{if(isEmpty(str))return true;var reg=/^((1??\d{1,2}|2[0-4]\d|25[0-5])\.){3}(1??\d{1,2}|2[0-4]\d|25[0-5])$/;return reg.test(str);}
function isReal(theStr,decLen){var dot1st=theStr.indexOf('.');var dot2nd=theStr.lastIndexOf('.');var OK=true;if(isEmpty(theStr))return false;if(dot1st==-1){if(!isInt(theStr))return(false);else return(true);}
else if(dot1st!=dot2nd)return(false);else if(dot1st==0)return(false);else{var intPart=theStr.substring(0,dot1st);var decPart=theStr.substring(dot2nd+1);if(decPart.length>decLen)return(false);else if(!isInt(intPart)||!isInt(decPart))return(false);else if(isEmpty(decPart))return(false);else return(true);}}
function isComdateMsg(lessDate1,startstr,moreDate1,endstr){var re=/\./g;var lessDate=lessDate1.replace(re,"-");var moreDate=moreDate1.replace(re,"-");var re1=/\\/g;var lessDate=lessDate.replace(re1,"-");var moreDate=moreDate.replace(re1,"-");if(!isComdate(lessDate,moreDate)){var err=endstr+"";err=err+startstr;alert(err);}
return isComdate(lessDate,moreDate);}
function need_input(sForm)
{for(i=0;i<sForm.length;i++)
{if(sForm[i].tagName.toUpperCase()=="TEXTAREA")
{if(sForm[i].value.realLength()>sForm[i].title)
{sWarn=sForm[i].title+"'";alert(sWarn);sForm[i].focus();return false;}}
if(sForm[i].tagName.toUpperCase()=="INPUT"&&sForm[i].type.toUpperCase()=="TEXT")
{sForm[i].value=sForm[i].value.trim();if(sForm[i].value.indexOf('\'')>=0)
{sWarn="!";alert(sWarn);sForm[i].focus();return false;}
if(sForm[i].value.realLength()>sForm[i].maxLength)
{sWarn=sForm[i].maxLength+"'";alert(sWarn);sForm[i].focus();return false;}}
if(sForm[i].tagName.toUpperCase()=="INPUT"&&sForm[i].type.toUpperCase()=="TEXT"&&(sForm[i].title!=""))
if(sForm[i].value=="")
{sWarn=sForm[i].title+"";alert(sWarn);sForm[i].focus();return false;}}
return true;}
function Check_IsEmail(name,error,message)
{if(includeChineseChar(GE(name).value)==false){SetError(error,"block","Please enter English.");return false;}
else if(isEmailA(GE(name).value.trim())==false){SetError(error,"block",message);return false;}
else{SetError(error,"none","");return true;}}
function Check_NotNull(name,error,errorM)
{CtoH(name);if(isEmpty(GE(name).value.trim())==true){SetError(error,"block",errorM);return false;}
else{SetError(error,"none","");return true;}}
function Check_NotNull_EnName(name,error,errorM){CtoH(name);if(isEmpty(GE(name).value.trim())==true){SetError(error,"block",errorM);return false;}
if(isEngEmpty(GE(name).value)==false){SetError(error,"block","Please enter English.");return false;}
else{SetError(error,"none","");return true;}}
function Check_NotCN(name,error){CtoH(name);if(includeChineseChar(GE(name).value.trim())==false){SetError(error,"block","Please enter English.");return false;}
else{SetError(error,"none","");return true;}}
function Check_NotNull_NotCN(name,error,errorM){CtoH(name);if(isEmpty(GE(name).value.trim())==true){SetError(error,"block",errorM);return false;}
else if(includeChineseChar(GE(name).value)==false){SetError(error,"block","Please enter English.");return false;}
else{SetError(error,"none","");return true;}}
function Check_NotNull_IsInteger(name,error,errorM)
{CtoH(name);if(isEmpty(GE(name).value.trim())==true){SetError(error,"block",errorM);return false;}
else if(isInteger(GE(name).value)==false){SetError(error,"block","Please enter Number.");return false;}
else{SetError(error,"none","");return true;}}
function Check_IsInteger(name,error,errorM){CtoH(name);if(isInteger(GE(name).value.trim())==false){SetError(error,"block","Please enter Number.");return false;}
else{SetError(error,"none","");return true;}}
function Check_NotNull_Length(name,error,maxLength,errorEM,errorLM){CtoH(name);if(isEmpty(GE(name).value.trim())==true){SetError(error,"block",errorEM);return false;}
else if(GE(name).value.length>maxLength){SetError(error,"block",errorLM);return false;}
else{SetError(error,"none","");return true;}}
function Check_NotNull_NotCN_Length(name,error,maxLength,errorEM,errorLM){CtoH(name);if(isEmpty(GE(name).value.trim())==true){SetError(error,"block",errorEM);return false;}
else if(includeChineseChar(GE(name).value)==false){SetError(error,"block","Please enter English.");return false;}
else if(GE(name).value.length>maxLength){SetError(error,"block",errorLM);return false;}
else{SetError(error,"none","");return true;}}
function Check_SelectNotFirstItem(name,error,errorMessage){if(GE(name).selectedIndex==0){SetError(error,"block",errorMessage);return false;}
else{SetError(error,"none","");return true;}}
function UrlEncode(p_source)
{return((p_source.split("&").join("ll_ll")).split(",").join("dd_dd")).split(" ").join("_");}
function UrlDEcode(p_source)
{return((temp.split("ll_ll").join("&")).split("dd_dd").join(",")).split("_").join(" ");}
function ClearUrlString(p_source)
{return p_source.replace(/[^0-9A-Za-z_]/ig,"")}
String.prototype.trim=function()
{return this.replace(/(^[\s]*)|([\s]*$)/g,"");}
String.prototype.lTrim=function()
{return this.replace(/(^[\s]*)/g,"");}
String.prototype.rTrim=function()
{return this.replace(/([\s]*$)/g,"");}
String.prototype.realLength=function()
{return this.replace(/[^\x00-\xff]/g,"**").length;}
function addToFavorite(title){window.external.AddFavorite(document.location,title)}
function ResizeImage(img,mWidth,mHeight){var image=new Image();image.src=img.src;var oldW=image.width;var oldH=image.height;if(image.width>0&&image.height>0){if(image.width/image.height>=mWidth/mHeight){if(image.width>mWidth){img.style.width=mWidth+"px";img.style.height=(image.height*mWidth)/image.width+"px";}else{img.style.width=image.width+"px";img.style.height=image.height+"px";}}else{if(image.height>mHeight){img.style.height=mHeight+"px";img.style.width=(image.width*mHeight)/image.height+"px";}else{img.style.width=image.width+"px";img.style.height=image.height+"px";}}}}
