﻿function obtenerContenido() {
    var pnlContenido = document.getElementById('leftcontent');
    var hfContenido = document.getElementById('<%=hfContenido.ClientID%>');
    hfContenido.value = pnlContenido.innerHTML;
    //alert( hfContenido.value);
}
function printPreviewDiv(elementId) {
    //Creating new page
    var pp = window.open('', '', 'left=20,top=0,width=800,height=700,toolbar=0,scrollbars=1, status=0');
    //Adding HTML opening tag with <HEAD> … </HEAD> portion 
    pp.document.writeln('<HTML><HEAD>');
    pp.document.writeln('<LINK href=../CSS/ccc-style.css  type="text/css" rel="stylesheet">')
    //Adding style sheet to hide print and close buttons
    pp.document.writeln('<LINK href="/../CSS/ccc-PrintStyle.css"  type="text/css" rel="stylesheet" media="print"><base target="_self"></HEAD>')
    //Adding Body Tag
    pp.document.writeln('<body MS_POSITIONING="GridLayout" bottomMargin="0" leftMargin="0" topMargin="0" rightMargin="0">');
    //Adding form Taghg6y

    pp.document.writeln('<form style="background-color:#f2f3e8"><TABLE ><TR><TD height="10"></TD></TR></Table>');
    //Writing print area of the calling page
    pp.document.writeln(document.getElementById(elementId).innerHTML);
    //Creating two buttons Print and Close within a table
    pp.document.writeln('<TABLE width=80% ><TR><TD></TD></TR><TR><TD align=center><Input  ID ="PRINT" type="image" src="/images/print.gif" onclick="window.print();">&nbsp;&nbsp;&nbsp;<INPUT ID="CLOSE" type="image" src="/images/close_btn.gif" onclick="window.close();"></TD></TR><TR><TD></TD></TR></TABLE>');
    //	pp.document.writeln('<TABLE width=80% ><TR><TD></TD></TR><TR><TD align=center><Input  ID ="PRINT" type="image" src="/images/print.gif" onclick="javascript:location.reload(true);window.location.reload(true);window.print();">&nbsp;&nbsp;&nbsp;<INPUT ID="CLOSE" type="image" src="/images/close_btn.gif" onclick="window.close();"></TD></TR><TR><TD></TD></TR></TABLE>');

    //Ending Tag of </form>, </body> and </HTML>
    pp.document.writeln('</form></body></HTML>');
    pp.document.close();
}		

