function createFlash(Id, Url, Width, Height, Img, ImgW, ImgH, Alt, Param) {
	obj = document.getElementById(Id);
	if (!obj || !Url || !Width || !Height) return;

	if (Img) {
		ImgW = ImgW || Width;
		ImgH = ImgH || Height;
		Alt = Alt || '';
		imgtag = '<img src="' + Img + '" width="' + ImgW + '" height="' + ImgH + '" alt="' + Alt + '" />';
	} else {
		imgtag = '';
	}

	if(!Param) Param = '';

	obj.innerHTML ='<object type="application/x-shockwave-flash" data="' + Url + '" width="' + Width + '" height="' + Height + '">' +
		'<param name="movie" value="' + Url + '" />' + imgtag + Param +
		'</object>';
}
/*STRIPES*/
 function stripe(id) {
    var table = document.getElementById(id);
    if (! table) { return; }
    var trs = table.getElementsByTagName("tr");
    for (var i = 1; i < trs.length; i += 2) {
      trs[i].className += " even";
    }
  }

/*Running onLoad Scripts*/
  function runScripts()
        {
      //  hoverall();
        stripe('price');
        }

function openw(wid, hei, pname, pfile){

nwin = open ('', '_req_info', 'height=' + hei + ', resizable=yes, scrollbars=yes, width='+ wid);

nwin.document.write('<html><head><title>' + pname + '</title><style>p{font-size: 10pt; font-weight: bold; font-family: tahoma;}</style></head><body><table width="100%" border="0" cellpadding="0" cellspacing="0">');
nwin.document.write('<tr><td align="center"><img src="' + pfile + '" border="0"></td></tr>');
nwin.document.write('<tr><td><br><p align="center">' + pname + '</p></td></tr>');
nwin.document.write('<tr><td><br><p align="center"><a href="javascript:window.close()" style="font-size: 10pt; font-weight: bold; font-family: tahoma;">Закрыть окно</a></p></td></tr>');
nwin.document.write('</table></body>');
nwin.document.close();

}
function findObj2(id) {
        if(document.all)
                return document.all[id];
        else
                return document.getElementById(id);
}

function thpr(){
 a=findObj2('forprint');
 if(!a) { b1=''; } else { b1=a.innerHTML; }
 a=findObj2('forprint2');
 if(!a) { b2=''; } else { b2=a.innerHTML; }
 nwin=open('', '_print', 'height=600, resizable=yes, scrollbars=yes, width=600')
 nwin.document.write('<html>');
 nwin.document.write('<head><link rel=stylesheet type=text/css href="/templates/rest/images/style.css"></head>');
 nwin.document.write('<body>');
 nwin.document.write('<h1>Расписание группы '+b2+'</h1>');
 nwin.document.write(b1);
 nwin.document.write('</body>');
 nwin.document.write('</html>');
 nwin.document.close();
 nwin.print();
}

function printit(){
 a=findObj2('body');
 if(!a) return false;
 b1=a.innerHTML;
 nwin=open('', '_print', 'height=600, resizable=yes, scrollbars=yes, width=800')
 nwin.document.write('<html>');
 nwin.document.write('<head><style>body {font-size: 12px;} table {font-size: 12px;} blockquote {padding: 0; margin: 0;}</style></head>');
 nwin.document.write('<body style="background: #FFF">');
 nwin.document.write(b1);
 nwin.document.write('</body>');
 nwin.document.write('</html>');
 nwin.document.close();
 nwin.print();
}

window.onload = runScripts;
