﻿/*
    COPYRIGHT 2009 BY Max Meyercordt & Steffen Hoppe

*/

function checkEmails(eMail1, eMail2) {

    var e1 = document.getElementById(eMail1);
    var e2 = document.getElementById(eMail2);

    return eMail1 == eMail2;
}

function printPartOfPage(elementId) 
{
    var printContent = document.getElementById(elementId);
    var windowUrl = 'about:blank';
    var uniqueName = new Date();
    var windowName = 'Print' + uniqueName.getTime();
    var printWindow = window.open(windowUrl, windowName, 'left=50000,top=50000,width=0,height=0');

    printWindow.document.write(printContent.innerHTML);
    printWindow.document.close();
    printWindow.focus();
    printWindow.print();
    printWindow.close();
}

function checkCheckBoxes(Name, Checked) {
    var doc = window.document;
    var elements = doc.getElementsByTagName('input');

    for (var counter = 0; counter < elements.length; counter++) {
        if (elements[counter].type == 'checkbox' && elements[counter].name.indexOf(Name) != -1) {
            elements[counter].checked = Checked;
        }
    }
}

function closeWindow() {
    window.close();
}

function redirectWindow(url) {
    window.location.href = url;
}



/* MAXO - RIGHT AND LEFT DECORATION */
function TDim(pX, pY)
{
    this.X = pX;
    this.Y = pY;
}
    
function getWindowDims()
{
    var dims = new TDim(10000, 10000);
    if (self.innerHeight) // all except Explorer
    {
	    dims.X = self.innerWidth;
  	    dims.Y = self.innerHeight;
    }
    if (document.documentElement && document.documentElement.clientHeight)
	// Explorer 6 Strict Mode
    {
	    if (document.documentElement.clientWidth < dims.X)
	    {
	        dims.X = document.documentElement.clientWidth;
  	        dims.Y = document.documentElement.clientHeight;
  	    } 
    }
    if (document.body) // other Explorers
    {
	    if (document.body.clientWidth < dims.X)
	    {               
            dims.X = document.body.clientWidth;
            dims.Y = document.body.clientHeight;
        }
    }
    if (screen.availWidth) // other Explorers
    {
	    if (screen.availWidth < dims.X)
	    {               
            dims.X = screen.availWidth;
            dims.Y = screen.availHeight;
        }
    }           
    return dims;
}
         
function SetDecoration()
{  
    if (getWindowDims().X < 1200)
    {
        document.getElementById("master-wrapper-page").className = "master-wrapper-page2";
    }
    else
    {
        document.getElementById("master-wrapper-page").className = "master-wrapper-page";
    }
}
/* MAXO END - RIGHT AND LEFT DECORATION */
