
function openPreview(contentId){

	PreviewWin=window.open('preview.aspx?ContentId=' + contentId, 'PreviewWindow','scrollbars=yes,resizable=yes,toolbar=no,height=330,width=450,left=10,top=10');
	if(window.focus)
	{
		PreviewWin.focus();
	}
	if(PreviewWin.opener == null) 
	{
		PreviewWin.opener = window;
		PreviewWin.opener.name = "newPUMain";
	}
}

function openPdfPreview(url){

	PreviewWin=window.open(url, 'PreviewWindow','scrollbars=no,resizable=yes,toolbar=no,height=330,width=450,left=10,top=10');
	if(window.focus)
	{
		PreviewWin.focus();
	}
	if(PreviewWin.opener == null) 
	{
		PreviewWin.opener = window;
		PreviewWin.opener.name = "newPUMain";
	}
}

function openPrinterDetail(printerID){

	DetailWindow=window.open('PrinterDetail.aspx?PrinterID=' + printerID, 'DetailWindow','scrollbars=1,resizable=yes,toolbar=no,height=400,width=550,left=10,top=10');
	if(window.focus)
	{
		DetailWindow.focus();
	}
	if(DetailWindow.opener == null) 
	{
		DetailWindow.opener = window;
		DetailWindow.opener.name = "newPUMain";
	}
}


function openSupport(url){

	SupportWin=window.open(url, 'SupportWindow','scrollbars=1,resizable=yes,toolbar=no,height=550,width=770,left=10,top=10');
	if(window.focus)
	{
		SupportWin.focus();
	}
	if(SupportWin.opener == null) 
	{
		SupportWin.opener = window;
		SupportWin.opener.name = "newPUMain";
	}
}

function openNotes(url){

	NotesWindow=window.open(url, 'NotesWindow','scrollbars=1,resizable=yes,toolbar=no,height=400,width=400,left=10,top=10');
	if(window.focus)
	{
		NotesWindow.focus();
	}
	if(NotesWindow.opener == null) 
	{
		NotesWindow.opener = window;
		NotesWindow.opener.name = "newPUMain";
	}
}

function openEmailPreview(url){

	NotesWindow=window.open(url, 'PreviewWindow','scrollbars=1,resizable=yes,toolbar=no,height=500,width=650,left=10,top=10');
	if(window.focus)
	{
		NotesWindow.focus();
	}
	if(NotesWindow.opener == null) 
	{
		NotesWindow.opener = window;
		NotesWindow.opener.name = "newPUMain";
	}
}

function aspectRatio(type){
	var imgX = getBrowserObject("lblWidth");
	var imgY = getBrowserObject("lblHeight");
	var widthObj = getBrowserObject("txtWidth");
	var heightObj = getBrowserObject("txtHeight");
	if ( type == 'X') {
		heightObj.value = Math.round( widthObj.value / ( imgX / imgY));
		return true;
	} else {
		widthObj.value = Math.round( heightObj.value * ( imgX / imgY));
		return true;
	}
}	

function getBrowserObject( element) {
	if ( !document.all && document.getElementById) {
		// NN6+
		return eval( "document.getElementById('" + element + "')");
	} else if ( document.all) {
		// IE5.x+
		return eval( "document.all." + element);
	}	
}

function getDate() {
	var today = new Date();
	var month = ((today.getMonth() + 1) < 10 ? "0" : "") + (today.getMonth() + 1);
	var day = ((today.getDate()) < 10 ? "0" : "") + (today.getDate());
	var year = today.getFullYear();
	return (month + "/" + day + "/" + year);
}


function DisplayPrinters(chkList, div) {
    if (document.getElementById(chkList).checked == true)
        document.getElementById(div).style.display = "block";
    else
        document.getElementById(div).style.display = "none";
        
    return true;
}
