function K2Tinit_window(mainW,dragD,contentW,cookName) {

	window_main    = document.getElementById( mainW );
	window_drag    = document.getElementById( dragD );
	window_content = document.getElementById( contentW );

  	window_main.style.position = 'absolute';
	window_main.style.display  = 'block';
	window_main.style.zIndex   = 99;

	Drag.cookiename = cookName;
	Drag.init( window_drag, window_main );

        window_loaded = 0;

	if ( ! window_loaded )
	{
		//----------------------------------
		// Figure width and height
		//----------------------------------
		
		var my_width  = 0;
		var my_height = 0;
		
		if ( typeof( window.innerWidth ) == 'number' )
		{
			//----------------------------------
			// Non IE
			//----------------------------------
		  
			my_width  = window.innerWidth;
			my_height = window.innerHeight;
		}
		else if ( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
		{
			//----------------------------------
			// IE 6+
			//----------------------------------
			
			my_width  = document.documentElement.clientWidth;
			my_height = document.documentElement.clientHeight;
		}
		else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
		{
			//----------------------------------
			// Old IE
			//----------------------------------
			
			my_width  = document.body.clientWidth;
			my_height = document.body.clientHeight;
		}
		
		//----------------------------------
		// Get div height && width
		//----------------------------------
		
		var divheight = parseInt( window_main.style.Height );
		var divwidth  = parseInt( window_main.style.Width );
		
		divheight = divheight ? divheight : 400;
		divwidth  = divwidth  ? divwidth  : 400;

		window_main.style.left = my_width  / 2  - (divwidth / 2)  + 'px';
		window_main.style.top  = my_height / 2 - (divheight / 2 ) + 'px';

 		ipbwrapper2	= document.getElementById( 'ipbwrapper' );
		ipbwrapper2.style.filter = 'alpha(opacity=30)';
		window_main.style.filter = 'progid:DXImageTransform.Microsoft.shadow (direction=120, strength=7, color=black)';

	}

	window_loaded = 1;

}


function K2TpopUpWindow (mainW,dragD,contentW,cookName,ref) {

        var use_js = 1;

	if ( use_js )
	{
		try
		{
			K2Tinit_window(mainW,dragD,contentW,cookName);
			not_loaded_yet = 1;
		}
		catch( e )
		{
			//alert(e);
			not_loaded_yet = 0;
		}
	}
	
	if ( ! not_loaded_yet )
	{
		window.open( ref,'BrowserBuddy','width=250,height=500,resizable=yes,scrollbars=yes');
	}

}