var msgId="";
var ServerURL="";
var EmailBody=[{
			   "title":"China Sourcing",
			   "body":"%0d%0d%0a Note:Your email is sent to a primary and a backup address to ensure reliable delivery.  We will reply you within 24 hours."
			   }];
var isCreateIfmane=false;
function SetEmail(Email,ccEmail,num,str)
{
	if(str=="")str=Email;
	 document.write("<a href=\"mailto:"+Email+"?cc="+ccEmail+"&subject="+EmailBody[num].title+"&body="+EmailBody[num].body+"\" onclick=\"doCountEmail('"+Email+"')\">"+str+"<\/a>");
	 CreateIfrmane();
}
function CreateIfrmane()
{
	if(isCreateIfmane==false)
	{
	 document.write("<iframe width=\"0\" height=\"0\" style=\"display:none\" id=\"Google\" name=\"Google\"></iframe>");
	  document.write("<iframe width=\"0\" height=\"0\" style=\"display:none\" id=\"EmailCountIframe\" name=\"EmailCountIframe\"></iframe>");
	  isCreateIfmane=true;
	}
}
function doCountEmail(strmail)
{
	//document.getElementById("Google").src=ServerURL+"\/js\/google.html";
	//document.getElementById("EmailCountIframe").src=ServerURL+"\/Count\/Count.asp?t=email&id="+msgId+"&WebName="+CountWebName+"&u="+window.location.href+"&e=Email:"+strmail;
}
function doCountButtion(str)
{
	document.getElementById("EmailCountIframe").src=ServerURL+"\/Count\/Count.asp?t=email&id="+msgId+"&WebName="+CountWebName+"&u="+window.location.href+"&e=Button:"+str;
}
function InquiryDialog(id,FormId)
{
	this.id=id;
	this.height=200;
	this.width=300;
	this.bgcolor="#333333";
	this.form="DialogForm";
	var isCreate=false;
	this.createDialog=function(){
			var bs = $('<div name="' + this.id + '" id="' + this.id + '"></div>');	
			$(bs).css('position', 'absolute');
			$(bs).css('display', 'none');
			$(bs).css('z-index', '10');
			$(bs).css('background-color', this.bgcolor);
			$(bs).addClass("DialogBs"); 
			var DialogForm=$('<div name="' + this.form + '" id="' + this.form + '"></div>');
			$(DialogForm).css('position', 'absolute');
			$(DialogForm).css('z-index', '11');
			$(DialogForm).css('display', 'none');
			if(FormId.indexOf(".")>0)
			{
				$.get(FormId, function(data){ // grab content from another page
					$(DialogForm).html(data);
				});
				
			}
			else
			{
				$(DialogForm).html($(FormId).html());
				$(FormId).html("");
			}
			$(DialogForm).appendTo('body');	
			$(bs).appendTo('body');	
			isCreate=true;
		};
		this.resize=resize;
		function resize()
		{
			var h,w;
			h=($("#"+this.form).height()==0)?this.height:$("#"+this.form).height();
			w=($("#"+this.form).width()==0)?this.width:$("#"+this.form).width();			
			$("#"+this.id).css('top', $(document).scrollTop()+"px");
			$("#"+this.id).css('left', $(document).scrollLeft()+"px");
			$("#"+this.id).css('top', $(document).scrollTop()+"px");
			$("#"+this.id).css('height', $(window).height() +"px");
			$("#"+this.id).css('width', $(window).width() +"px");
			$("#"+this.form).css('top', ($(document).scrollTop()+($(window).height()-h)/2)+"px");
			$("#"+this.form).css('left', ($(document).scrollLeft()+($(window).width()-w)/2)+"px");
		}
		
	this.show=function()
	{
		if(isCreate==false)this.createDialog();
		this.resize();
		$("#"+this.id).show();
		$("#"+this.form).show();

	};
	this.hide=function(){
		$("#"+this.id).hide();
		$("#"+this.form).hide();
		};
	$(window).resize(function(){
			resize();
		}); 
	
}
function doSubmitInquiry(obj)
{
	obj.WebName.value=CountWebName;
	obj.url.value=window.location.href;
	obj.pageid.value=msgId;
}
var CountVisiterURL="";
window.onblur=function()
{
	getIshasCountVisiter();
	if(CountVisiterURL!="")document.getElementById("CountVisiter").src=CountVisiterURL+"#stop";
	
}
window.onfocus=function()
{
	getIshasCountVisiter();
	if(CountVisiterURL!="")document.getElementById("CountVisiter").src=CountVisiterURL+"#start";
	
}

window.onload=function()
{
	
	getIshasCountVisiter();
}
function getIshasCountVisiter()
{
	if(document.getElementById("CountVisiter") && CountVisiterURL=="")
	{CountVisiterURL=document.getElementById("CountVisiter").src;}

}
function wirteDivBody(str)
{
	document.writeln("<a href=\"javascript:void(0)\" class=\"ex_1\" onClick=\"ShowDialog()\">" + str + "<\/a>");
	
document.writeln("<link href=\"\/js\/sub_apple.css\" rel=\"stylesheet\" type=\"text\/css\" \/>");
document.writeln("<div id=\"EmailDialog\" style=\"display:none\">");
document.writeln("	    <form id=\"SendEmailForm\" name=\"SendEmailForm\" method=\"post\" action=\"http:\/\/www.sourcing-cn.com\/processing\/inputprocessing_cast.asp\">");
document.writeln("       ");
document.writeln("        <div id=\"sub_all\">");
document.writeln("          <div id=\"title\" class=\"sub14\">Please let us know your manufacturing needs<\/div>");
document.writeln("          <div id=\"sbig\">");
document.writeln("            <div id=\"s_left\">");
document.writeln("              <div class=\"sub2\">Send us an Online Inquiry<\/div>");
document.writeln("              ");
document.writeln("              <textarea name=\"content\" class=\"sendbiaodan\" >Describe your needs:");
document.writeln("&gt;&gt;");
document.writeln("");
document.writeln("Your email or phone?");
document.writeln("&gt;&gt;");
document.writeln("");
document.writeln("Other comments:");
document.writeln("&gt;&gt;");
document.writeln("");
document.writeln("                <\/textarea>");
document.writeln("              <input type=\"submit\" name=\"Submit\" value=\"submit\" \/>");
document.writeln("            <\/div>");
document.writeln("            <div id=\"s_right\">");
document.writeln("              <div class=\"sub5\" id=\"send_aone\" style=\"display:\"> <span class=\"sub3\">Or, send us an email:<\/span><br \/>");
document.writeln("                <br \/>");
document.writeln("                Email: <script language=\"javascript\">SetEmail(\"contact@sourcing-cn.com\",\"contact@made-china.org\",0,\"\");<\/script>");
document.writeln("				<span class=\"sub8\"><a href=\"javascript:CloseSend_a()\"><br \/>");
document.writeln("				<br \/><br \/>");
document.writeln("                >> Discussion by Phone<\/a><\/span>              <\/div>");
document.writeln("			  ");
document.writeln("			  <div class=\"sss\" id=\"send_atwo\" style=\"display:none\"><span class=\"sub3\">Phone conference option:<\/span><br \/>");
document.writeln("			    <br \/>");
document.writeln("                  <span class=\"two2\">If you prefer to speak on the phone, please simply send us your phone number and company name, and a senior member of our team will call you. We can call between 8AM and 12PM EST.<\/span><a href=\"javascript:CloseSend_a()\" > BACK<\/a> <\/div>");
document.writeln("            <\/div>");
document.writeln("          <\/div>");
document.writeln("		  ");
document.writeln("		  <div id=\"dibu\">");
document.writeln("          <div id=\"bleft\"> We\'ll reply<span class=\"t24\"> within 24 hours ");
document.writeln("            by email.<\/span><\/div>");
document.writeln("          <div id=\"bright\" ><a href=\"javascript:void(0)\" onClick=\"CloseDialog()\">(X)Close<\/a><\/div>");
document.writeln("		  <\/div>");
document.writeln("        <\/div> <\/form>");
document.writeln("      <\/div>");

}
 function ShowDialog()
{

 var obj=document.getElementById("EmailDialog");
obj.style.display=(obj.style.display=="none")?"":"none";
obj.style.position="absolute";

centralize(obj);
}
function CloseDialog()
{
var obj=document.getElementById("EmailDialog");
obj.style.display="none";
}
function CloseSend_a()//
{
	
	var obj=document.getElementById("send_aone");
		obj.style.display=(obj.style.display=="")?"none":"";
	var obj2=document.getElementById("send_atwo");
	obj2.style.display=(obj2.style.display=="")?"none":"";
	
}

function CheckForm()
{
	//SendEmailForm.content.value=+SendEmailForm.content.value
}
function winScroll(){
 var t, l, w, h;
 if (document.documentElement && document.documentElement.scrollTop) {
  t = document.documentElement.scrollTop;
  l = document.documentElement.scrollLeft;
  w = document.documentElement.scrollWidth;
  h = document.documentElement.scrollHeight;
  } else if (document.body) {
   t = document.body.scrollTop;
   l = document.body.scrollLeft;
   w = document.body.scrollWidth;
   h = document.body.scrollHeight; 
  } 
   return { t: t, l: l, w: w, h: h }; 
}
function centralize(obj){
 var windowScroll = new winScroll;

 
 var top = (windowScroll.t+windowScroll.h-500)/2;
 if(top <= 0){
     top = 100;
 }
 
 obj.style.top = top+"px";
 obj.style.left = (windowScroll.l+windowScroll.w-480)/2+"px";
  
}
function CloseSend_a()//
{
	
	var obj=document.getElementById("send_aone");
		obj.style.display=(obj.style.display=="")?"none":"";
	var obj2=document.getElementById("send_atwo");
	obj2.style.display=(obj2.style.display=="")?"none":"";
	
}
// JavaScript Document