﻿
/************************************************************************************/
//页头方法
/************************************************************************************/
function SetSize(obj, width, height)
{
    myImage = new Image();
    myImage.src = obj.src;
    if (myImage.width>0 && myImage.height>0)
    {
        var rate = 1;
        if (myImage.width>width || myImage.height>height)
        {
            if (width/myImage.width<height/myImage.height)
            {
                rate = width/myImage.width;
            }
            else
            {
                rate = height/myImage.height;
            }
        }
        if (window.navigator.appName == "Microsoft Internet Explorer")
        {
          obj.style.zoom = rate;
        }
        else
        {
          obj.width = myImage.width*rate;
          obj.height = myImage.height*rate;
        }
    }
}

/************************************************************************************/
//搜索设置
/************************************************************************************/
function ToSearch(){			
	document.location.href="http://www.accesscontrolchina.com/search.html?"+document.getElementById("IDSearchContent").value
}
function ToSearchProduct()
{
	var Key = document.getElementById("IDSearchContent").value;
	if (document.getElementById("radAll").checked) {
	    document.location.href = "http://www.accesscontrolchina.com/search.html?" + Key;
	}

	if (document.getElementById("radProduct").checked) {
	    var Product = document.getElementById("radProduct").value;	   
	    if (Product == "door") {
	        document.location.href = "http://door.accesscontrolchina.com/searchdoor.html?" + Key;
	    }
	    if (Product == "barrier") {
	        document.location.href = "http://barriergate.accesscontrolchina.com/searchbarrier.html?" + Key;
	    }
	}	
}

function DoMenu(emid) {
    var obj = document.getElementById(emid);
    if (obj.style.display == "") {        
        obj.style.display = "none";
    }
    else {
    obj.style.display = "";
    }
}
