var xmlhttp;
var url="";
var SendEmail="contact@china-synergy.org";
var isWriteHtml=false;
function SendDate(Email)
{

	var QueryString="http:\/\/www.china-factories.org\/count\/count.asp?iswrite=yes&Email="+Email+"&url="+window.location;
	 document.getElementById("CountonClick").src=QueryString+"&st="+new Date().getTime();
}
function SetEmial(Email)
{
	SetEmialCC(Email,"contact@sourcing-cn.com");
}
function SetEmial_POP(Email)
{
	SetEmialCC(Email,"contact@china-synergy.org");
}
function SetEmialCC(Email,ccEmail)
{	
 document.write("<a href=\"mailto:"+Email+"?cc="+ccEmail+"&subject=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.\" onclick=\"onclick_email(\'"+Email+"\')\" class=\"indexemail\">"+Email+"<\/a>");
 	
if(isWriteHtml==false)writeifrmane();
}
function SetEmialCCStr(Email,ccEmail,str)
{	
 document.write("<a href=\"mailto:"+Email+"?cc="+ccEmail+"&subject=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.\" onclick=\"onclick_email(\'"+Email+"\')\" class=\"indexemail\">"+str+"<\/a>");
 	
if(isWriteHtml==false)writeifrmane();
}

function onclick_email(Email)
{
 document.getElementById("Google").src="\/js\/google.html";
 SendDate(Email);
}
function SetEmial2(str)
{
	SetEmialCCStr("contact@china-synergy.org","contact@sourcing-cn.com",str);
}
function SetEmial_white(str)
{	SetEmialCCStr("contact@china-synergy.org","contact@sourcing-cn.com",str);
}

function writeifrmane()
{
	isWriteHtml=true;
 document.write("<iframe width=\"0\" height=\"0\" id=\"Google\" name=\"Google\"></iframe>");
  document.write("<iframe width=\"0\" height=\"0\" id=\"CountonClick\" name=\"CountonClick\"></iframe>");
}
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\">SetEmial2(\"contact@china-synergy.org\")<\/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";


/*var scrollY,scrollX;    
    if (typeof(window.pageYOffset) != 'undefined') {
        scrollY = window.pageYOffset;
		scrollX = window.pageXOffset;
        }
    else if (typeof(document.compatMode) != 'undefined' && document.compatMode != 'BackCompat') { 
        scrollY = document.documentElement.scrollTop; 
		scrollX = document.documentElement.scrollLeft; 
    } else if (typeof(document.body)!= 'undefined') { 
        scrollY = document.body.scrollTop;  
		scrollX = document.body.scrollLeft;    
    }     
//alert(scrollX+"/n"+scrollY);
obj.style.left=scrollX+200;
obj.style.top=scrollY+150;*/
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";
  
}
// JavaScript Document

