function emailThisPage(){
    var target = document.location;
  var win = window.open('http://english.stonebuy.com/sendmail.html?sendurl=' + target,
                        'notice',
                        'width=600,height=450,location=no,toolbar=no,status=no,resizable=no,scrollbars=yes');
  win.focus();
}
 
function addToFavorite(title){
  window.external.AddFavorite(document.location,title)
}
function printThisPage(){
  window.print();
}


function SetHome(obj,vrl)
    {
        try
        {
                obj.style.behavior='url(#default#homepage)';obj.setHomePage(vrl);
        }
        catch(e){
                if(window.netscape) {
                        try {
                                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); 
                        } 
                        catch (e) { 
                                alert("此操作被浏览器拒绝！\n请在浏览器地址栏输入“about:config”并回车\n然后将[signed.applets.codebase_principal_support]设置为'true'"); 
                        }
                        var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
                        prefs.setCharPref('browser.startup.homepage',vrl);
                 }
        }
    }

function printThisPage(){
  window.print();
}

function SelectPerPageItem()
{
document.formItem.submit();
return true;
}

function SelectProudctPageItem()
{
document.formItem.submit();
return true;
}
function SelectRegionid()
{
document.formRegion.submit();
return true;
}
function SelectYearMonth()
{
document.formYearMonth.submit();
return true;
}
function formAddBasket(typeid)
{
	var flag = false;
if(document.formList.chkID != null){
	var Listlen=document.formList.chkID.length;
    for(i=0;i<Listlen;i++){
      if(document.formList.chkID[i].checked==true){
        flag = true;
      }
    }	
}
if (flag == false)
{
    alert("No item(s) Select!")
    return false;	
}
document.formList.action="http://english.stonebuy.com/Add-Basket.html?typeid="+typeid+"&url="+document.location+"";
document.formList.submit();
return true;
}
function ContactNow(Strid)
{
document.formList.action+="&chkID="+Strid+"";
document.formList.submit()
//alert(Strid);
return true;
}


function CheckformList(){
var flag = false;
if(document.formList.chkID != null){
	var Listlen=document.formList.chkID.length;
    for(i=0;i<Listlen;i++){
      if(document.formList.chkID[i].checked==true){
        flag = true;
      }
    }	
}
if (flag == false)
{
    alert("No item(s) Select!")
    return false;	
}
document.formList.submit();
return true;
}

function CheckformListcontact(){
document.formList.action="http://english.stonebuy.com/Inquiry-Basket.html";
document.formList.submit();

return true;
}


function BasketformDelList(){
document.formList.action="http://english.stonebuy.com/del-Basket.html";
document.formList.submit();
return true;
}




function DrawImage(ImgD){ 
var flag=false; 
var image=new Image(); 
image.src=ImgD.src; 
if(image.width>0 && image.height>0){ 
flag=true; 
if(image.width/image.height>= 500/500){ 
if(image.width>500){
ImgD.width=500; 
ImgD.height=(image.height*500)/image.width; 
}else{ 
ImgD.width=image.width;
ImgD.height=image.height; 
} 
/*ImgD.alt="bigpic" */
} 
else{ 
if(image.height>500){
ImgD.height=500; 
ImgD.width=(image.width*500)/image.height; 
}else{ 
ImgD.width=image.width;
ImgD.height=image.height; 
} 
/*ImgD.alt="bigpic" */ 
} 
}
}

function setImgSizeWH(theURL,sImage,imgW,imgH){var imgObj;imgObj=new Image();imgObj.src=theURL;if((imgObj.width!=0)&&(imgObj.height!=0)){if(imgObj.width>imgW||imgObj.height>imgH){var iHeight=imgObj.height*imgW/imgObj.width;if(iHeight<=imgH){sImage.width=imgW;sImage.height=iHeight;}else{var iWidth=imgObj.width*imgH/imgObj.height;sImage.width=iWidth;sImage.height=imgH;}}else{sImage.width=imgObj.width;sImage.height=imgObj.height;}}else{sImage.width=imgW;sImage.height=imgH;}}