﻿function $(obj){return document.getElementById(obj);}

function setSrc(){
	$("kFrame").width="596";
	$("kFrame").height="420";
	$("kFrame").src="http://www.kefid.com/Inquiry-vn.html?w="+document.URL;
}

function openW(uSrc){window.open(uSrc);}

function oCopy(obj){obj.select();js=obj.createTextRange();js.execCommand("Copy");}

function showImg(imgS,obj){$(imgS).src=obj.src.replace("_s","");}

function IsCheck(oID){
	var isChk=false;
	var oL=document.getElementsByName(oID);
	if(oL!=null){if(oL.length>0){for(var i=0;i<oL.length;i++){if(oL[i].checked==true){isChk=true;break;}}}}
	return isChk;
}

function isEmail(strEmail) {
    if (strEmail.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
        return true;
    else
        return false;
}

var flag=false;
function DrawImage(ImgD,ImgW,ImgH){
	var image=new Image();
	var iwidth = ImgW;
	var iheight = ImgH;
	image.src=ImgD.src;
	if(image.width>0 && image.height>0){
	flag=true;
	if(image.width/image.height>= iwidth/iheight){
		if(image.width>iwidth){  
		ImgD.width=iwidth;
		ImgD.height=(image.height*iwidth)/image.width;
		}else{
		ImgD.width=image.width;  
		ImgD.height=image.height;
		}
		}
	else{
		if(image.height>iheight){  
		ImgD.height=iheight;
		ImgD.width=(image.width*iheight)/image.height;		
		}else{
		ImgD.width=image.width;  
		ImgD.height=image.height;
		}
		}
	}
}
//if(document.documentElement.clientWidth>900){
//document.write('<div id="MAC_Fair" style="position:absolute;left:0;z-index:1000;"><a href="/CMF-2010/" title="Please contact Kevin at 0086-18737139831"><img src="/i/The-8th-China-MAC-Fair.gif" width="100" height="144" alt="Please contact Kevin at 0086-18737139831" border="0"></a></div><script language="javascript">function rightBottomAd(){var abc = document.getElementById("MAC_Fair");abc.style.top = document.documentElement.scrollTop+150+"px";setTimeout(function(){rightBottomAd();},10);}rightBottomAd();</scr ipt>');
//}
