//---------------------------------------------------
 /* 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*/
//---------------------------------------------------

//------------------------------------------------
//Open popu fadescreen window
//------------------------------------------------
function popup(background,content_area)
{
	if(content_area)
	{
		var body_obj				=ob(content_area);
	}
	else
	{
		var body_obj				=document.getElementsByTagName('body')
		var body_obj				=body_obj[0];
	}
	this.content_body			=false;
	
	if(!background)background="#000000";
	
	//Animation variable
	this._tmp_size_w			=0;
	this._tmp_size_h			=0;
	this.inc_h					=40;
	this.inc_w					=0;
	this.current_h				=1;
	this.current_w				=1;
	this.delay					=1;
	this.opened					=false;
	this.vscroll = (document.all ? document.scrollTop : window.pageYOffset);
	this.content = 'dextor_popup_content';
		
	
	
	if(!document.getElementById('dextor_popup'))
	{
		var popup=  '<div id="dextor_popup_bg" style="position:absolute;left:0px;top:0px;z-index:1000;width:100%;background:'+background+';filter:alpha(opacity=70);-moz-opacity:.70;opacity:.70;">&nbsp;' +
					 '</div>' +
					 '<div style="position:absolute;left:0px;top:0px;z-index:2000;width:100%;" class="dextor_popup_content">' +
						'<center>'+
						'<table cellpadding="0" cellspacing="0" border="0" width="100%">' +
						 '<tr>' +
							'<td align="center" valign="middle" id="dextor_popup_content">' +
								
							'</td>' +
						 '</tr>' +
						'</table>' +
						'</center>'+
					'</div>';
		
		var fade_screen=document.createElement('div');
		body_obj.insertBefore(fade_screen,body_obj.firstChild);
		fade_screen.setAttribute("id",'dextor_popup');
		fade_screen.style.position='absolute';
		fade_screen.style.display='none';
		fade_screen.style.zIndex='2000';
		fade_screen.style.width=body_obj.offsetWidth+'px';
		fade_screen.style.marginLeft='0px';
		fade_screen.style.marginTop='0px';
		fade_screen.innerHTML=popup;
		
		document.getElementById('dextor_popup_bg').style.height=browserH()+'px';
		document.getElementById('dextor_popup_content').style.height=browserH()+'px';
		
		
	}
	else
	{
		document.getElementById('dextor_popup_content').innerHTML="";
	}
	
	this.show=function()
	{
		//alert('show');
                this.opened=true;
		window.scrollTo(0,0);
		body_obj.style.overflow		='hidden';
		document.getElementById('dextor_popup').style.display='block';
		document.getElementById('dextor_popup').style.width=body_obj.offsetWidth+'px';
	}
	this.close=function()
	{
		this.opened=false;
		document.getElementById('dextor_popup').style.display		='none';
		document.getElementById('dextor_popup_content').innerHTML	='';
		body_obj.style.overflow										='auto';
		window.scrollTo(0,this.vscroll);
	}
	return this;
}

