var ns4 = (document.layers) ? true : false;  // browser sniffer
var ie4 = (document.all) ? true : false;
var ns6 = (document.getElementById&&!document.all) ? true : false;


function popw(loc,nam,wid,hei,othe) {
if (window.screen)
{
x = (screen.availWidth - wid) * 0.5;
y = (screen.availHeight- hei) * 0.5;
}
else
{
x = 50;
y = 50;
}
if (othe=='') {popupw=window.open(loc,nam,'width='+wid+',height='+hei)
 } else {popupw=window.open(loc,nam,'width='+wid+',height='+hei+','+othe)
}
popupw.moveTo(x,y);
l=popupw.focus();
return popupw 
}

function popprint(l) {
popw(l,'PrintWindow',380,400,'status=yes,resizable=yes,menubar=yes,scrollbars=yes')
}

function popprintclassic(f) {
popw('','PrintWindow',780,400,'status=yes,resizable=yes,menubar=yes,scrollbars=yes')
f.submit();
}

function popprintclassicjournal(f) {
popw('','PrintWindow',800,400,'status=yes,resizable=yes,menubar=yes,scrollbars=yes')
f.submit();
}

function superJournal() {
popw('index.aspx?Scroll=0','superJournal',800,600,'status=yes,resizable=yes,menubar=yes,scrollbars=yes')
}


function superHJournal(c) {
popw('index.aspx?Scroll=0&Element=HeadFrames&ClassID=' + c,'superJournal',800,600,'status=yes,resizable=yes,menubar=yes,scrollbars=yes')
}


function popNewLesson(f) {
l=popw('index.aspx?ShowFrames=True&Element=ESchoolLesson&Action=FormNew','smallWindow',350,350,'status=yes,resizable=yes,menubar=yes,scrollbars=yes')
}

function popLesson(L) {
l=popw('index.aspx?ShowFrames=True&Element=ESchoolLesson&LessonID='+L,'smallWindow',350,350,'status=yes,resizable=yes,menubar=yes,scrollbars=yes')
}

function popMarks(L,S){
l=popw('index.aspx?ShowFrames=True&Element=ESchoolMark&LessonID='+L + '&Student_2_show='+S,'smallWindow',350,350,'status=yes,resizable=yes,menubar=yes,scrollbars=yes')
}
function popMarksH(MID){
//alert(MID)
l=popw('index.aspx?ShowFrames=True&Element=ESchoolMarkHistory&MarkParentID='+MID,'smallWindow',350,350,'status=yes,resizable=yes,menubar=yes,scrollbars=yes')
}

function popMBook(SID){
var DateObj = new Date()
popw('default.aspx?Element=ESchoolMarks&PrintElement=True&Action=2&StudentID=' + SID + '&SYear=' + DateObj.getFullYear() + '&SMonth=' + (DateObj.getMonth()+1)  + '&SDay=1&IsMark=4','PrintWindow',780,400,'status=yes,resizable=yes,menubar=yes,scrollbars=yes');
}

function popTrim(SID,CID,SbID){
l=popw('index.aspx?ShowFrames=True&Element=ESchoolTrims&Student_2_show='+SID+'&SubjectID='+SbID+'&ClassID='+CID ,'smallWindow',450,650,'status=yes,resizable=yes,menubar=yes,scrollbars=yes')
}
