//function to open new window with contents
function Clickheretoprint()
{ 
  var disp_setting="toolbar=yes,location=no,directories=yes,menubar=yes,scrollbars=yes,resizable=yes,width=778, height=400, left=100, top=10"; 
  var content_vlue = document.getElementById("print_content").innerHTML; 
  //var head_val=document.getElementById("phead").innerHTML;
  var docprint=window.open("","",disp_setting); 
  docprint.document.open(); 
  docprint.document.write('<html><head><title>Matrix Fixture</title>'); 
  //docprint.document.write('<link href="styles/mama.css" rel="stylesheet" type="text/css">');
  docprint.document.write('</head><body onLoad="" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">'); 
  docprint.document.write('<table ><tr><td width="100%" height="46" align="left" background="http://www.matrixfixtures/images/Top_bg.jpg"><table width="678" border="0" align="left" cellpadding="0" cellspacing="1"><tr><td width="254" height="46"><img src="images/matrix_Logo_01.jpg" width="177" height="35" /></td><td width="513">&nbsp;</td></tr></table></td> ');
  docprint.document.write('<tr ><height="1" align="left"></td></tr>');     
  docprint.document.write('<tr ><td width="770" background="images/matrix_hrd_01.jpg">&nbsp;</td></tr>');   
  
  docprint.document.write('<td align="right" valign="bottom"><a href="javascript:self.print()"><img src="http://www.matrixfixtures/images/Print_01.jpg" width="21" height="17"  border="0" title="Print"/>&nbsp;Print</a>');
  docprint.document.write('&nbsp;&nbsp;|&nbsp;');    
  docprint.document.write('<a href="javascript:window.close()"><img src="http://www.matrixfixtures/images/w_close.gif" width="21" height="17" border="0" title="Close"/>&nbsp;Close</a>');            
  // docprint.document.write('<font color="#000000" size="3">' + content_vlue + content_vlue1 + '</font>');
  docprint.document.write('</td></tr></table >');
  //docprint.document.write('<table ><tr><td align="left">' + head_val + '</td> </tr></table>');
  docprint.document.write('<table ><tr><td align="left">' + content_vlue + '</td> </tr>');
	 
  docprint.document.write('<table align="center" width="60%" ><tr><td ></td> <td align="right">');       
  docprint.document.write('<a href="javascript:self.print()"><img src="http://www.matrixfixtures/images/Print_01.jpg" width="21" height="17" border="0" title="Print"/>Print</a>');
  docprint.document.write('&nbsp;&nbsp;|&nbsp;');    
  docprint.document.write('<a href="javascript:window.close()"><img src="http://www.matrixfixtures/images/w_close.gif" width="21" height="17" border="0" title="Close"/>&nbsp;Close</a>'); 
  docprint.document.write('</td></tr></table >')
	   
  docprint.document.write('</body></html>'); 
  docprint.document.close(); 
  docprint.focus(); 
}

//storing the page url in hidden page and submiting the page
function emailfriend()
{
	document.getElementById("hurl").value="";
	document.getElementById("hurl").value=window.location.href;
	document.frmdesigner.action="designeremail.php"
	document.frmdesigner.submit();
}

//validating the email a friend page
function validate_mail()
{
	var obj,objname;
	//Your Name
	obj = document.getElementById("txtyname");
	objname = "your name and email address";
	if(mandatory(obj,objname) == false)
	{
		return false;
	}
	//your email
	obj = document.getElementById("txtymail");
	objname = "your email address";
	if(mandatory(obj,objname) == false)
	{
		return false;
	}
	if(validEmail(obj,objname) == false)
	{
		alert("Please enter valid email address");
		obj.focus();
		return false;
	}
	
	//Friend Name
	obj = document.getElementById("txtf1name");
	objname = "the name and email of at least one friend or colleague";
	if(mandatory(obj,objname) == false)
	{
		return false;
	}
	
	//Friend email
	obj = document.getElementById("txtf1mail");
	objname = "their email address";
	if(mandatory(obj,objname) == false)
	{
		return false;
	}
	if(validEmail(obj,objname) == false)
	{
		alert("Please enter valid email address");
		obj.focus();
		return false;
	}
	document.frmdesigner.action="designerconfirm.php"
	document.frmdesigner.submit();
	return true;	
}