var _page = new Object();

_page.email = function(posturl) {
		// if(posturl!=""){
			// Go to next page where user can add details
			// doc_title = escape(document.title);
			// doc_url = encodeURI(document.location);
			// window.open(posturl + '?doc_title='+doc_title+'&doc_url='+doc_url, '_self');
		// }
		// else{
			// Open email client
			window.location='mailto:?subject='+document.title+'&body=Please see '+encodeURI(document.location);
			//window.location='mailto:?subject='+escape(document.title)+'&body="Please see '+escape(document.title)+' on: '+document.location+'"';
		//}
	}




_page.printVersion = function(print_type) {
		var popup_height=500;
		var popup_width=700;
		var w=window.open('','','height='+popup_height+',width='+popup_width+',toolbar=yes,scrollbars=yes')
		//Center popup window
		var intwidt;
		var intheight;
		intwidth=screen.availWidth;
		intheight=screen.availHeight;
		intwidth=parseInt(intwidth);
		intheight=parseInt(intheight);
		if(intwidth>0&&intheight>0){
			w.moveTo(((intwidth-popup_width) / 2), ((intheight - popup_height) / 2));
			w.focus();
		}
		
		
    	
		var printarea = document.getElementById("printarea")
		if (printarea == null) {
			alert("no print area defined")
		} 
		else {
			var button='<table class="p-button" cellspacing="0"><tr><td onclick="window.print()"><div>Print</div></td></tr></table>'
	
			w.document.open()
			w.document.write('<html>\n')
			w.document.write('<head>\n')
			w.document.write('  <link href="stuff/style1.css" type="text/css" rel="stylesheet">\n')
			w.document.write('  <link href="stuff/print.css" type="text/css" rel="stylesheet">\n')
			w.document.write('	<title>'+document.title+'</title>')
			w.document.write('</head>\n')
			
			w.document.write('<body onload="window.print();setTimeout(\'window.close()\', 10000);">\n')
			w.document.write('	<div class="t-center3">\n')
			w.document.write('  	<div><Gnesin Academy of music></div>\n')
			w.document.write('  	<div><img src="/picts/logo.jpg"></div>\n')
		         w.document.write('  	<div id="t-center">'+printarea.innerHTML+'</div>\n')
			//w.document.write('  	<img class="p-line" src="'+_page.crsc_server + '/crsc/images/solidline.gif">\n')
			
			
			//w.document.write('		</div>\n')
			w.document.write('	</div>\n')
			w.document.write('</body></html>\n')
			w.document.close()
		} 	
	}
