//---------------------------------------------------
 /* Program Name            : Dextor.php
    Description             : Created by Piyush Dixit 
    Call                	: On top of every page
    Functionality           : Common javascript functions 
    Author                  : Piyush Dixit < Email : mystery1984@gmail.com > <Mob : +91.9891549233)
    Creation Date           : 24-October-09
    Modification History    : None
	Note					: Don't modify before informing Author*/
//---------------------------------------------------

function ob(id)
{
	var obj
	if(obj = document.getElementById(id))	
		return obj;
	else
		return false;
}

function getRound(obj)
{
	return Math.round(obj*100)/100;
}

function selectAll(form_object,element_caption)
{
	var postr='';
	var element=form_object.elements;
	for(var i=0;i<element.length;i++)
	{
		if(element[i].name.indexOf(element_caption)!=-1)
		{
			element[i].checked='checked';		
		}
	}
}

function deselectAll(form_object,element_caption)
{
	var postr='';
	var element=form_object.elements;
	for(var i=0;i<element.length;i++)
	{
		if(element[i].name.indexOf(element_caption)!=-1)
		{
			element[i].checked=false;		
		}
	}
}


function browserH() 

{

  var myWidth = 0, myHeight = 0;

  if( typeof( window.innerWidth ) == 'number' ) 

  {

    //Non-IE

    myWidth = window.innerWidth;

    myHeight = window.innerHeight;

  } 

  else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) 

  {

    //IE 6+ in 'standards compliant mode'

    myWidth = document.documentElement.clientWidth;

    myHeight = document.documentElement.clientHeight;

  } 

  else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) 
  {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;

  }
  return myHeight;
}



function printSelection(node,width,height){

 
  var content=node.innerHTML
  var pwin=window.open('','print_content','width='+width+',height='+height+' scrollbars=yes');
  pwin.document.open();
  pwin.document.write('<html><body onload="window.print()">'+content+'</body></html>');
  pwin.document.close();
  setTimeout(function(){pwin.close();},1000);

}




function browserH() 
{
	var myWidth = 0, myHeight = 0;
	if( typeof( window.innerWidth ) == 'number' ) 
	{
		//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	} 
	else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) 
	{
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	} 
	else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) 
	{
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	}
	return myHeight;
}


