/*!
 * JS by Unkown
 * Copyright Unkown
 * License Unkown, maybe GPL
 * http://www.zenithcrusher.com/parameter/mail/zenith.js
 * Includes nothing then
 * Copyright 2011, Unkown
 * Released under the MIT, BSD, and GPL Licenses.
 * Date 2011-12-12 10:36:07
 */

function get_url(){
 zyj = document.getElementById("yue_href");
zyj.value= window.location.href;
}
var yue_cache = setTimeout("get_url()",0);

	document.write('<form method="post" name="mailbyue" id="mailbyue" class="form_form" action="http://www.ironorecrusher.net/mail/zsend/sender.php" onSubmit="return CheckInput();">');
	document.write('<p>You can get instant information by click here : <a href="javascript:void(0);" onclick="openZoosUrl();">Market dept.(Online)</a>, <a href="javascript:void(0);" onclick="openZoosUrl();">Technology dept.(Online)</a>, <a href="javascript:void(0);" onclick="openZoosUrl();"">Agent service(Online)</a>, <a href="javascript:void(0);" onclick="openZoosUrl();">Advice(Online)</a></p>');
	document.write('<p>Or you can send some basic contact information to us by the form below, our experts will contact you asap.</p>');
	document.write('<table>');
	document.write('<tr><td align="right">Name:</td><td><input type="text" name="From_Name" id="From_Name" class="form_input" onfocus="if(value==\'As: Mr. Smith\'){value=\'\';this.style.color=\'#000\';};" onblur="if(value==\'\'){value=\'As: Mr. Smith\';this.style.color=\'#999\';};checkname();" style="color:#999;width:350px;height:20px;" value="As: Mr. Smith"/><img src="http://www.zenithcrusher.com/parameter/mail/blank.gif" id="Nameimg" style="vertical-align:top;margin-left:5px;"/></td></tr>');
	document.write('<tr><td align="right">Email:</td><td><input type="text" name="From_Email" id="From_Email" class="form_input" onfocus="if(value==\'As: sample@isp.com\'){value=\'\';this.style.color=\'#000\';};" onblur="if(value==\'\'){value=\'As: sample@isp.com\';this.style.color=\'#999\';};checkemail();" style="color:#999;width:350px;height:20px;" value="As: sample@isp.com"/><img src="http://www.zenithcrusher.com/parameter/mail/blank.gif" id="Emailimg" style="vertical-align:top;margin-left:5px;"/></td></tr>');
	document.write('<tr><td align="right">Phone:</td><td><input type="text" name="Phone" id="Phone" class="form_input" onfocus="if(value==\'As: 0086-21-58383008\'){value=\'\';this.style.color=\'#000\';};" onblur="if(value==\'\'){value=\'As: 0086-21-58383008\';this.style.color=\'#999\';};checkphone();"  style="color:#999;width:350px;height:20px;" value="As: 0086-21-58383008"/><img src="http://www.zenithcrusher.com/parameter/mail/blank.gif" id="Phoneimg" style="vertical-align:top;margin-left:5px;" /></td></tr>');
	document.write('<tr><td align="right">Message:</td><td><textarea type="text" name="Message" id="Message"  class="form_textarea" onfocus="if(value==\'Inquiry here , no links please !\'){value=\'\';this.style.color=\'#000\';};" onblur="if(value==\'\'){value=\'Inquiry here , no links please !\';this.style.color=\'#999\';};checkmessage();" style="color:#999;width:350px;height:100px;">Inquiry here , no links please !</textarea><img src="http://www.zenithcrusher.com/parameter/mail/blank.gif" id="Messageimg" style="vertical-align:top;margin-left:5px;"/></td></tr>');
	document.write('<tr><td colspan="2"><input type="submit" value="submit" id="submit" class="form_button" style="margin-left:100px;width:100px;padding:5px;"/><input type="button" value="Instant Help" id="instant" class="form_button" onclick="openZoosUrl();" style="padding:5px;width:100px;margin-left:20px;"/>');
	document.write('<input type="hidden" name="yue_href" id="yue_href" value=""/></td></tr>');
	document.write('</table>');
	document.write('</form>');
	
function is_number(str){	exp=/[^0-9()+-]/g;	if(str.search(exp) != -1)	{		return false;	}	return true;}

function is_email(str){ 	if((str.indexOf("@")==-1)||(str.indexOf(".")==-1))		{			return false;			}			return true;		}

function CheckInput(){

	if(document.getElementById("From_Name").value == "" | document.getElementById("From_Name").value == "As: Mr. Smith"){
		alert("please write your name");
		document.getElementById("From_Name").focus();
		return false;
	}
	
	if( document.getElementById("Phone").value =="" | document.getElementById("Phone").value =="As: 0086-21-58383008") {
        alert("please write your telephone number !")
		document.getElementById("Phone").focus();
        return false;
	}

	if( document.getElementById("From_Email").value =="" | document.getElementById("From_Email").value =="As: sample@isp.com") {
        alert("please write your E-mail !")
		document.getElementById("From_Email").focus();
        return false;
    }

	if(!is_email(document.getElementById("From_Email").value))
	{ 	alert("Your EMail address is wrong");
		document.getElementById("From_Email").focus();
		return false;
	}
	/*
   if(document.getElementById("country").value==""){
		alert("please write your country!");
		document.getElementById("country").focus();
		return false;
	}
	*/
	if(document.getElementById("Message").value=="" | document.getElementById("Message").value=="Inquiry here , no links please !"){
		alert("you not write message");
		document.getElementById("Message").focus();
		return false;
	}
	return true;
}

var baseurl = 'http://www.zenithcrusher.com/parameter/mail/';

function checkname(){
if(document.getElementById("From_Name").value == "" | document.getElementById("From_Name").value == "As: Mr. Smith"){
		document.getElementById('Nameimg').src = baseurl + 'no.gif';
	}
	else{document.getElementById('Nameimg').src = baseurl + 'yes.gif';
	}
}

function checkemail(){
	if( document.getElementById("From_Email").value =="" | document.getElementById("From_Email").value =="As: sample@isp.com" | !is_email(document.getElementById("From_Email").value)) {
        document.getElementById('Emailimg').src = baseurl + 'no.gif';
    }else{
	document.getElementById('Emailimg').src = baseurl + 'yes.gif';
	}
}

function checkphone(){
	if( document.getElementById("Phone").value =="" | document.getElementById("Phone").value =="As: 0086-21-58383008" | !is_number(document.getElementById("Phone").value)) {
 document.getElementById('Phoneimg').src = baseurl + 'no.gif';
}else{document.getElementById('Phoneimg').src = baseurl + 'yes.gif';}
}

function checkmessage(){
	if( document.getElementById("Message").value =="" | document.getElementById("Message").value =="Inquiry here , no links please !") {
 document.getElementById('Messageimg').src = baseurl + 'no.gif';
}else{document.getElementById('Messageimg').src = baseurl + 'yes.gif';}
}
