//  Diego.Cadogan@teracode.com
//  Teracode.com
//  2007
//  Generate Wikipedia REF data	


function WPCITE(doc, dom) {
	// LIMPIEZA
	var txt = "";
	_newwin = window.open('', '_new', 'width=380, height=240');
	var _url = doc
	var _tit = document.title;
	var _tld = dom.replace("www.","");

	var date = new Date();
	var ano = date.getFullYear();
	var mes = date.getMonth() + 1;
	var dia = date.getDate();
	if (mes < 10) { mes = "0" + mes;}
	if (dia < 10) { dia = "0" + dia;}
	var _date = ano + "-" + mes + "-" + dia;
	
	txt = "&#13;&#13;";
	txt = txt + "&lt;ref&gt;&#13;";
	txt = txt + "{{cite web&#13;" ; 
	txt = txt + "&#124;url=" + _url + "&#13;";
	txt = txt + "&#124;title=" + _tit + "&#13;";
	txt = txt + "&#124;publisher=" + _tld + "&#13;";
	txt = txt + "&#124;accessdate=" + _date + "&#13;";
	txt = txt + "}}&#13;";
	txt = txt + "&lt;/ref&gt;";
	txt = txt + "&#13;&#13;";
		
function clos() {
	document.write("diego");
	_newwin.close();
}

// IMPRIME
	_newwin.document.write( "<head>" );
	_newwin.document.write( "</head>" );
	_newwin.document.write( "<html>" );
	_newwin.document.write( "<body padding='0'>" );
	_newwin.document.write( "<p align='left'>" );
	_newwin.document.write( "<textarea name='ref_cite' rows='12' cols='62' readonly='true' style='font: normal 12px/normal Arial, Helvetica, sans-serif;; color: #0022AA; overflow:auto' onClick='javascript:this.focus();this.select()' >" );
	_newwin.document.write(txt);
	_newwin.document.write( "</textarea></p>" );	
	_newwin.document.write( "<br>" );
	_newwin.document.write( "Click and press CTRL+C to copy");
	_newwin.document.write( "<a href='#' onClick='window.close();'><button text='Close'>Close</button></a>");
	_newwin.document.write( "</center>" );
	_newwin.document.write( "</body>" );
	_newwin.document.write( "</html>" );
	}
	


