var ts=1;
var box = document.getElementById('printBoxs');
var checkcl = document.getElementById('printBoxsEnd');
var boxform = document.createElement("form");
var line0 = document.createElement("div");
var px = document.createElement("img");
var line1 = document.createElement("div");
var line2 = document.createElement("div");
var line3 = document.createElement("div");
var line4 = document.createElement("div");
var line5 = document.createElement("div");
var line6 = document.createElement("div");
var line7 = document.createElement("div");
var line8 = document.createElement("div");
var line9 = document.createElement("div");
var line10 = document.createElement("div");
var line11 = document.createElement("div");
var line12 = document.createElement("div");
var line13 = document.createElement("div");
var line14 = document.createElement("div");
var line15 = document.createElement("div");
var line16 = document.createElement("div");
var bold1 = document.createElement("b");
var bold2 = document.createElement("b");
var bold3 = document.createElement("b");
var in2 = document.createElement("input");
var in5 = document.createElement("input");
var in7 = document.createElement("input");
var in9 = document.createElement("textarea");
var in10 = document.createElement("input");
var in11 = document.createElement("input");
var btn = document.createElement("input");

//lineClass();
px.setAttribute("src","/assets/px.gif");
px.setAttribute("width","1");
px.setAttribute("height","4");

in2.setAttribute("class","emailforminput");
in2.setAttribute("id","email_to");
in2.setAttribute("name","Email_to_req");
in2.setAttribute("type","text");

in5.setAttribute("class","emailforminput");
in5.setAttribute("id","email_from_name");
in5.setAttribute("name","Your_name_req");
in5.setAttribute("type","text");


in7.setAttribute("class","emailforminput");
in7.setAttribute("id","email_from");
in7.setAttribute("name","Your_email_req");
in7.setAttribute("type","text");

in9.setAttribute("class","emailforminput");
in9.setAttribute("id","text");
in9.setAttribute("name","text");
in9.setAttribute("cols","13");
in9.setAttribute("rows","3");
in9.setAttribute("wrap","VIRTUAL");

in10.setAttribute("name","submission");
in10.setAttribute("type","hidden");
in10.setAttribute("value","emaillink");

in11.setAttribute("name","from_page");
in11.setAttribute("type","hidden");
in11.setAttribute("value",document.title);

//.setAttribute("class","");
btn.setAttribute("class","btnMail");
btn.setAttribute("name","submit");
btn.setAttribute("type","submit");
btn.setAttribute("value","send");
line10.setAttribute("align","right");

in2.setAttribute("class","h3");
in5.setAttribute("class","h3");
in7.setAttribute("class","h3");
in2.setAttribute("type","text");
in5.setAttribute("type","text");
in7.setAttribute("type","text");
//in2.setAttribute("name","to");
//in5.setAttribute("name","fromName");
//in7.setAttribute("name","fromEmail");
//in9.setAttribute("name","message");
in9.setAttribute("wrap","virtual");
in9.setAttribute("class","h3");

bold1.appendChild(document.createTextNode("To: "));
line1.appendChild(bold1);
line1.appendChild(document.createTextNode("Email address"));
line2.appendChild(in2);
line2.appendChild(document.createElement("br"));
line2.appendChild(document.createTextNode("Separate multiple addresses with a comma(,)"));
bold2.appendChild(document.createTextNode("Your details: "));
line15.appendChild(document.createElement("br"));
line3.appendChild(line15);
line3.appendChild(line16);
line3.appendChild(bold2);
line4.appendChild(document.createTextNode("Name"));
line5.appendChild(in5);
line6.appendChild(document.createTextNode("Email address"));
line7.appendChild(in7);
line13.appendChild(document.createElement("br"));
line7.appendChild(line13);
line7.appendChild(line14);
bold3.appendChild(document.createTextNode("Message: "));
line8.appendChild(bold3);
line9.appendChild(in9);
line9.appendChild(in10);
line9.appendChild(in11);
line10.appendChild(document.createElement("br"));
line10.appendChild(btn);
line0.appendChild(px);
//alert(line2.getAttribute("class"));
line10.setAttribute("class","margingrightbtn");

var lines = 12;
var speed = 30;
box.innerHTML = '&nbsp;';
checkcl.innerHTML = '&nbsp;';

function scrollPageY(y){
	window.scrollBy(0,y);
}

function lineClass(){
	for(var i=1;i<17;i++){
		var l = eval("line"+i);
		l.setAttribute("class","emailform");
	}
}

function emailBox(f){
	if(f){
		showEmailBox(1);
		ts=0;
	}else{
		hideEmailBox();
		//box.innerHTML = '&nbsp;';
		ts=1;
	}
}
function showEmailBox(cl){
	var intId = window.setInterval(playt,speed);
	function playt(){
		if (cl==lines){
			window.clearInterval(intId);
			return;
		}
		l = eval("line"+cl);
		box.appendChild(l);
		cl++;
	}
}

function hideEmailBox22(){
	var n = box.childNodes.length;
	for(var i=n; i>0; i--){
		box.removeChild(box.childNodes[i]);
	}
}

function hideEmailBox(){
	var n = box.childNodes.length-1;
	var intId = window.setInterval(playt,speed);
	function playt(){
		if (!n){
			window.clearInterval(intId);
			return;
		}
		l = eval("line"+n);
		box.removeChild(l);
		n--;
	}
}