<!--

// Footer copyright
var copyright=new Date();
var update=copyright.getFullYear();

function writeCopy() {
document.writeln("Trade Media Holdings Ltd. 及 Trade Media Ltd. "+ update +"版权所有，");
}

// popup functions
function popup(page,height,width) {
	params = "height=" + height + ",width=" + width + ",status=no,toolbar=no,directories=no,menubar=no,location=no,scrollbars=yes,resizable=yes,top=50,left=50,screenX=50,screenY=50"
	popHelp = open(page,"HelpWindow",params);
	popHelp.focus();
}

function pop(page,height,width) {
	params = "height=" + height + ",width=" + width + ",status=no,toolbar=no,directories=no,menubar=no,location=no,scrollbars=yes,resizable=yes,top=50,left=50,screenX=50,screenY=50"
	popHelp = open(page,"HelpWindow",params);
	popHelp.focus();
}

function openbig2(link) {
msg=window.open(link,"DisplayWindow2","HEIGHT=550,WIDTH=750,status=1,toolbar=1,directories=1,menubar=1,location=1,scrollbars=1,resizable=1,top=50,left=50");
if (window.focus) {msg.focus()}
}

// these 2 popups are being used by TNTLIST associations
function opencurr(curconv) {
msg=window.open(curconv,"DisplayWindow","HEIGHT=450,WIDTH=660,status=no,toolbar=1,directories=no,menubar=1,location=no,scrollbars=1,resizable=1");
}

function opencurr1(curconv) {
msg=open(curconv,"DisplayWindow1","HEIGHT=325,WIDTH=350,status=no,toolbar=no,directories=no,menubar=no,location=no,scrollbars=no,top=50,left=50,screenX=50,screenY=50");
}

// searchbox
	var inWebSearch = false;
	//var selected_point_id = "";
	var selected_prod_id = "";
	var selected_catalog_id = "2000000003844";
	var currentCatalogId = "2000000003844";
	var action_added = 0;

function submitHeaderSearch() {
		if (document.searchbox.query.value == "") {
			alert("没有输入关键字。\n请输入关键字开始搜索。");
		} else {
			if(action_added == 1) {
				makeInputElement(document.searchbox,'hidden','action','GetPoint');
				makeInputElement(document.searchbox,'hidden','action','DoFreeTextSearch');
			}
			if (document.searchbox.search_what.value == "1") {
				setSearchValues("PRODUCT",document.searchbox); 
			} else if (document.searchbox.search_what.value == "2") {
				setSearchValues("SUPPLIER",document.searchbox); 
			} else if (document.searchbox.search_what.value == "3") {
				setSearchValues("ARTICLE",document.searchbox); 
			} 
				if(document.searchbox.searchWithin != null && document.searchbox.searchWithin.checked == true && document.searchbox.searchWithin.value == "withinResults") {
					makeInputElement(document.searchbox,'hidden','prev_query',unescape('null'));
				}
			/** Removed by MR #11348
			if(selected_point_id != "" ) {
				document.searchbox.point_id.value = selected_point_id;
				document.searchbox.catalog_id.value = selected_catalog_id;
			} **/
			if((selected_prod_id != "") && (selected_prod_id != "-1")) {
				makeInputElement(document.searchbox,'hidden','prod_id',selected_prod_id);
			}
			document.searchbox.submit();
		}
	}
action_added = 1;
// end searchbox

// PREVIOUSLY SMFLash1.js  ---- start
var gsflash=new ccGs();
gsflash.init();

function ccGs()
{	this.util=new clsUtil();
	this.page=new clsPage();
	this.cookie=new clsCookie();
	this.init=startRun;
	// no closing bracket
	function startRun(){this.util.init();this.page.init();}

	function clsUtil()
	{	this.init=startRun;
		
		// no closing bracket
		function startRun(){
		String.prototype.trim=fxTrim;
		}
		
		function fxTrim(strInput)
		{	var strResult=null;if(strInput==null)strInput=this;if(strInput)
			{
			strResult=new String(strInput);strResult=strResult.replace(/^\s+/,"");
			strResult=strResult.replace(/\s+$/,"");
			}
			return(strResult);
		}
	} // closing bracket of clsUtil()

		function clsPage()
		{	this.init=startRun;
			
			function startRun(){
			}
			
		} //end closing bracket of ccGs()
		
			function clsCookie()
			{	this.set=ccSet; //rnm may6-ccSet
				this.get=ccGet; //rnm may6-ccGet
				this.remove=ccRemove;  //rnm may6-ccRemove
				this.buildMatrix=ccBuildMatrix; //rnm may6-ccBuildMatrix
	
				function ccSet(strKey,strValue,dtExpires,strPath,strDomain,blnSecure)
				{	var strCookie=strKey+"="+escape(strValue)+";";
						if(dtExpires){strCookie+="expires="+dtExpires.toUTCString()+";";}
							if((strPath)&&(strPath!="")){strCookie+="path="+strPath+";";}
								if((strDomain)&&(strDomain!="")){strCookie+="domain="+strDomain+";";}
									if(blnSecure){strCookie+="secure";}document.cookie=strCookie;
				}
	
				function ccGet(strKey)
				{	var strValue=null;
					var arrCookies=this.buildMatrix(new String(document.cookie));
					for(var intIndex=0;intIndex<arrCookies.length;intIndex++)
						{	if(arrCookies[intIndex][0]==strKey){strValue=arrCookies[intIndex][1];
							break;
						}
					}
					return strValue;
				}
		
				function ccBuildMatrix(strCookies)
				{	var arrCookie;
					var arrCookies=strCookies.split(";");
					for(var intIndex=0;intIndex<arrCookies.length;intIndex++)
					{	arrCookie=arrCookies[intIndex].trim().split("=");
						arrCookie[1]=unescape(arrCookie[1]);
						arrCookies[intIndex]=arrCookie;
					}
					return arrCookies;
				}
	
				function ccRemove(strKey,strPath,strDomain)
				{	var strCookie,dtYesterday;
					var strValue=this.get(strKey);
					if(strValue)
					{	strCookie=strKey+"=;";
						if((strPath)&&(strPath!=""))
						{	strCookie+="path="+strPath+";";
						}	if((strDomain)&&(strDomain!=""))
							{	strCookie+="domain="+strDomain+";";
							}	dtYesterday=new Date();
								dtYesterday.setDate(dtYesterday.getDate()-1);
								strCookie+="expires="+dtYesterday.toGMTString()+";";
								document.cookie=strCookie;
					}
					return strValue;
				} // end function ccRemove
		}
	}
// PREVIOUSLY SMFLash1.js  ---- end
	
// PREVIOUSLY SMFlash2.js ---- start
whatNavigator();

function whatNavigator()
{	navigator.unknown=1;
	navigator.ie=2;
	navigator.netscape=4;
	navigator.opera=8;
	navigator.type=null;
	navigator.version=null;
	navigator.os=null;
	navigator.jsVersion=1.0;
	navigator.vbScriptEnabled=false;
	navigator.hasPlugin=havPlugin;
	navigator.selectPluginDetectType=whatPluginDetectType;
	navigator.setCookie=setThisCookie; //may6 rnm setThisCookie
	navigator.hasFlash=havFlash;
	startRun();
	
function startRun()
{	var strBrowserCookie=gsflash.cookie.get("whatBrowser");
	if(strBrowserCookie)
	{eval(strBrowserCookie);navigator.selectPluginDetectType();
	}else{analyzeUsrAgnt();
	document.write("<scr"+"ipt language=\"JavaScript1.1\">navigator.jsVersion = 1.1;</s"+"cript>");
	document.write("<scr"+"ipt language=\"JavaScript1.2\">navigator.jsVersion = 1.2;</s"+"cript>");
	document.write("<scr"+"ipt language=\"JavaScript1.3\">navigator.jsVersion = 1.3;</s"+"cript>");
	document.write("<scr"+"ipt language=\"JavaScript1.4\">navigator.jsVersion = 1.4;</s"+"cript>");
	document.write("<scr"+"ipt language=\"JavaScript1.5\">navigator.jsVersion = 1.5;</s"+"cript>");
	document.write("<scr"+"ipt language=\"JavaScript1.6\">navigator.jsVersion = 1.6;</s"+"cript>");
	document.write("<scr"+"ipt language=\"JavaScript2.0\">navigator.jsVersion = 2.0;</s"+"cript>");
	document.write("<scr"+"ipt language=\"VBScript\">navigator.vbScriptEnabled = true</s"+"cript>");
	document.write("<scr"+"ipt language=\"JavaScript\">navigator.selectPluginDetectType();navigator.setCookie();</s"+"cript>");
	}
}

function analyzeUsrAgnt()
	{	var version;switch(navigator.appName)
		{	case "Microsoft Internet Explorer":navigator.type=navigator.ie;
			navigator.version=getVersionIE();
			navigator.os=getOsIE();
			break;case "Netscape":navigator.type=navigator.netscape;
			navigator.version=getVersionNets();
			navigator.os=getOsNetscape();
			break;case "Opera":navigator.type=navigator.opera;
			navigator.version=getVersionOpera();
			navigator.os=getOsOpera();
			break;
			default:navigator.type=navigator.unknown;
			navigator.version=parseFloat(navigator.appVersion);navigator.os="Unknown";
			}
		}
		function getVersionIE()
		{	var strUserAgent=new String(navigator.userAgent);
			var arrUA=strUserAgent.split("MSIE ");
			return parseFloat(arrUA[1]);
		}
		function getVersionNets()
		{	var strUserAgent=new String(navigator.userAgent);
			var version,arrUA;
			if(strUserAgent.indexOf("Gecko")<0)
				{
				version=parseFloat(navigator.appVersion);
				}
					else if(strUserAgent.indexOf("Firefox")>-1)
					{
					arrUA=strUserAgent.split("Firefox");arrUA=arrUA[1].split("/");
					version=parseFloat(arrUA[1]);
					}
					else if(strUserAgent.indexOf("Safari")>-1)
					{
					arrUA=strUserAgent.split("Safari");
					arrUA=arrUA[1].split("/");
					version=parseFloat(arrUA[1]);
					}
					else
					{
					arrUA=strUserAgent.split("Netscape");
					arrUA=arrUA[1].split("/");
					version=parseFloat(arrUA[1]);
					}
			return version;
		}
		function getVersionOpera()
		{	var strUserAgent=new String(navigator.userAgent);
			var arrUA=strUserAgent.split("Opera/");
			return parseFloat(arrUA[1]);
		}
		function getOsIE()
		{	var strUserAgent=new String(navigator.userAgent);
			var arrUA=strUserAgent.split(";");
			return arrUA[2].substr(0,arrUA[2].length);
		}
		function getOsNetscape()
		{	var strOS;
			var strUserAgent=new String(navigator.userAgent);
			var arrUA=strUserAgent.split("(");arrUA=arrUA[1].split(";");
			if(this.version<6){strOS=arrUA[0];
			}
			else
			{
				strOS=arrUA[2];
			}
			return strOS;
		}
		function getOsOpera()
		{	var strUserAgent=new String(navigator.userAgent);
			var arrUA=strUserAgent.split("(");
			arrUA=(new String(arrUA[1])).split(";");
			return arrUA[0];
		}
		function havPlugin(strPluginName,strPluginObject)
		{	var blnHasPlugin=false;
			switch(navigator.pluginDetectType)
			{	case "plugins array":for(var i=0;i<navigator.plugins.length;i++)
				{	if(navigator.plugins[i].name.indexOf(strPluginName)>=0)
					{
					blnHasPlugin=true;
					break;
					}
				}
				break;
				case "detectPlugin function":blnHasPlugin=fxDetectPlugin(strPluginObject);
				break;
			}
			return blnHasPlugin;
		}
		function whatPluginDetectType()
		{	
		if((navigator.plugins)&&(navigator.plugins.length>0))
			{	
			navigator.pluginDetectType="plugins array";
			}
			else if(navigator.type=navigator.ie)
				{	
				if(navigator.jsVersion>=1.3)
					{	
						navigator.pluginDetectType="detectPlugin function";
			
						document.write("<scr"+"ipt language=\"JavaScript1.3\">\n");
						document.write("	function fxDetectPlugin(strPluginName){\n");
						document.write("		var blnHasPlugin = false;\n");
						document.write("		try{\n");
						document.write("			var obj = new ActiveXObject(strPluginName);\n");
						document.write("			blnHasPlugin = true;\n");
						document.write("		}   // try\n");
						document.write("		catch(Exception){");
						document.write("		}\n");
						document.write("		return blnHasPlugin;\n");
						document.write("	}   // fxCheckPlugin\n");
						document.write("</s"+"cript>\n");
					}
					else if(navigator.vbScriptEnabled){navigator.pluginDetectType="detectPlugin function";
						document.write("<scr"+"ipt language=\"VBScript\">\n");
						document.write("	function fxDetectPlugin(strPluginName)\n");
						document.write("		on error resume next\n");
						document.write("		if (IsObject(CreateObject(strPluginName))) then\n");
						document.write("			fxDetectPlugin = true\n");
						document.write("		else\n");
						document.write("			fxDetectPlugin = false\n");
						document.write("		end If\n");
						document.write("	end function\n");
						document.write("</s"+"cript>\n");
				}
				else{navigator.pluginDetectType="none";
				}
			}
		}

	function setThisCookie()
	{	var strCookieValue="navigator.type="+navigator.type+";\n"+"navigator.version="+navigator.version+";\n"+"navigator.os=\""+navigator.os+"\";\n"+"navigator.jsVersion="+navigator.jsVersion+";\n"+"navigator.vbScriptEnabled="+navigator.vbScriptEnabled+";\n";
		gsflash.cookie.set("whatBrowser",strCookieValue,null,"/");
	}
	
	function havFlash(fltVersion)
	{	var blnHasFlash=false;
		var strVersion;
		if(fltVersion)
		{	switch(navigator.pluginDetectType)
			{	case "plugins array":for(var i=0;i<navigator.plugins.length;i++)
				{	if(navigator.plugins[i].name.indexOf("Shockwave Flash")>=0)
					{	strVersion=navigator.plugins[i].description.substr(16,navigator.plugins[i].description.length);
						if(parseFloat(strVersion)>=fltVersion)
						{	
							blnHasFlash=true;
							break;
						}
					}
				}	
				break;
				case "detectPlugin function":blnHasFlash=fxDetectPlugin("ShockwaveFlash.ShockwaveFlash."+parseInt(fltVersion));
				break;
			}
		}
		else{
		blnHasFlash=navigator.hasPlugin("Shockwave Flash","ShockwaveFlash.ShockwaveFlash");
		}
		return blnHasFlash;
	}
}
// PREVIOUSLY SMFlash2.js ---- end

// cookie settings
// Get browser information
nets = (navigator.appName.indexOf("Netscape") != -1);
nseven = (navigator.userAgent.indexOf("Netscape/7") != -1);
bVer=parseInt(navigator.appVersion);
var isMSIE3 = false;

if(navigator.appName == "Microsoft Internet Explorer" && bVer == 2 )  isMSIE3 = true;
function GetCookie(name) {
   if ((bVer > 2) && !isMSIE3) {
      var arg  = name + "=";
      var alen = arg.length;
      var clen = document.cookie.length;
      var i    = 0;
      while(i < clen) {
         var offset = i + alen;
         if(document.cookie.substring(i, offset) == arg) {
            var iEnd  = document.cookie.indexOf(";", offset);
            if(iEnd == -1) {
               iEnd = document.cookie.length;
            }
            return unescape(document.cookie.substring(offset, iEnd));
         }
         i = document.cookie.indexOf(" ", i) + 1;
         if(i == 0) {
            break;
         }
      }
      return null;
   }
}
function SetCookie(name, value, expires, path)
{
   if((bVer > 2) && !isMSIE3) {
      document.cookie = name + "=" + escape(value)
      + ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + ";domain=.globalsources.com"
      + ((path == null) ? "" : ("; path=" + path));
   } else {
      eval(name + " = '" + value + "'");
   }
}
function setUniqCookie() {
   if ((bVer > 2) && !isMSIE3) {
      snooky = GetCookie(name);
     // alert ("snooky : " + snooky);
	 if (snooky == null) {
	  SetCookie(name, value, exp, path);
	  }
   }
}

// Get 13 digit time stamp plus 6 digit random number
today=new Date();
timetoday=today.getTime();
randm = getRandom(100000,999999);
timenow = timetoday + "" + randm;
function getRandom(min,max)
{return (Math.round(Math.random()*(max-min)))+min;}

var name = "new_visited_us";
var path = "/";
var expDays = 365*20; // number of days the cookie should last
var exp = new Date();
exp.setTime(exp.getTime() + (expDays*24*60*60*1000)); 
var value = timenow;

setUniqCookie();


// -->
