// JavaScript Document
var ie=document.all;
var ns6=document.getElementById && !document.all;
var caobox = {	
		html : null,
		box  : null,
		show_popup:function( boxId){	
		this.box = boxId;
			if(TNCom_getDocumentSize(1 ) > TNCom_getDocumentSize(3))
				 var pageHeight=TNCom_getDocumentSize(1)-130;
			else var pageHeight=TNCom_getDocumentSize(3)-130;
			if(TNCom_getDocumentSize(0) < 974)
				 jQuery('#id_caobox2').css({width:974 + "px"});
			else jQuery('#id_caobox2').css({width:TNCom_getDocumentSize(0)-20 + "px"});			
			this.html = $('#' + boxId).html();
			$('#' + boxId).empty();
			$('#id_caobox1').html(this.html);			
		    caobox.show_layer();			  
		   	$('#id_caobox1').css({left: Math.round((TNCom_getDocumentSize(2) - jQuery('#id_caobox1').width()) / 2)+"px"});
		  	$('#id_caobox1').css({top:Math.round(TNCom_getDocumentSize(4) + (TNCom_getDocumentSize(3) - jQuery('#id_caobox1').height()) / 2)+"px"});
		  	$('#id_caobox1').show();
			
		},
		close_popup:function(){
			$('#' + this.box).html(this.html);
			$('#id_caobox1').hide().empty();
			$('#id_caobox2').hide();
		},
		show_layer : function(){	
			if(TNCom_getDocumentSize(0)<974) 
				$('#id_caobox2').css({width:"974px"});
			else 
				$('#id_caobox2').css({width:TNCom_getDocumentSize(0)+"px"});									
		    $('#id_caobox2').css({height:TNCom_getDocumentSize(1) - 100 +'px'});	
		    $('#id_caobox2').css({display:'block'}); 
	    },		
		init:function()
		{		
			jQuery(document).ready(function()
			{						
			    $('body').append('<div id="id_caobox1"></div><div id="id_caobox2"></div>');			    				
				jQuery('#id_caobox1, #id_caobox2').css({'display':'none', 'position':'absolute'});
				jQuery('#id_caobox1').css({'zIndex':'10002','height':'auto','overflow':'hidden'});
				jQuery('#id_caobox2').css({'zIndex':'10001','backgroundColor':'#000','opacity':'0.7','filter':'alpha(opacity="70")','left':0,'top':0});//.click( function(){ caobox.close_popup(html); });				
			});		
		}		
	}

caobox.init();
