tcse_win_mar_top_re =0;
tcse_win_mar_left_re=0;
tcse_h_resizable = '';
tcse_w_resizable = '';
tcse_scrl = 0;
footer_height = '';
title_height = 30;
function tcse_restore()
{
	if(tcse_win_mar_top_re==0)
	{
		$("#tcse_show").resizable('destroy');
		var s_t = $('#tcse_show').css('top');
		var s_l = $('#tcse_show').css('left');
		var s_h = $('#tcse_show').css('height');
		var s_w = $('#tcse_show').css('width');
		var heights = $(window).height()-7;	
		
		if($.browser.msie && $.browser.version.substr(0,1)<7)
		{
			var tops = get_scroll('y');
		  
		}
		else
		tops = '0%';
		var widths = $(window).width()-8;	
		tcse_win_mar_top_re=s_t + '#' + s_h ;
		tcse_win_mar_left_re=s_l + '#' + s_w ;
	
		$('#tcse_show').animate({
			
			left: '0%',
			top: tops,
			height: heights + 'px',
			width: widths + 'px'			
			},function(){
		
          $('#tcse_maxi_img').hide();
		   $('#tcse_restore_img').show();
tcse_c_resize();
		
			
				});
			


	}
	else
	{

		var s_t = tcse_win_mar_top_re.split('#');
		var s_w = tcse_win_mar_left_re.split('#');
	
		$('#tcse_show').animate({
			
			left: s_w[0],
			top: s_t[0],
			height: s_t[1],
			width: s_w[1]
			},function(){
				$( "#tcse_show" ).resizable({
		minHeight: tcse_h_resizable,
			minWidth: tcse_w_resizable,
			stop: function() { tcse_c_resize(); }
		});
	$( "#tcse_show" ).draggable({ containment: "window", scroll: false,handle: "#tcse_show_top" });
		$('#tcse_restore_img').hide();
          $('#tcse_maxi_img').show();
		 
				tcse_win_mar_top_re=0;
				tcse_win_mar_left_re=0;
				tcse_c_resize();
				});
				
						

			
	}
	
}
	

function tcse_popupt(url,title,title_icon,bottom_url,b_height,form_name,form_method)
{
	

if(!title_icon)		
title_icon = $('#tcse_title_icon').attr('src');	

footer_height = b_height;
		
		
		
		
		
													if(footer_height)
	{
		var uu = bottom_url.split('');
		var ut = bottom_url.split('http://');
		var ut1 = bottom_url.split('https://');
		var ut2 = bottom_url.split('www.');
		
		if(uu[0]=='/' || ut[0]=='' || ut[1]=='' || ut[2]=='')
	{
	var b_contt = 'ss';
	}
	else
	{
var b_contt = document.getElementById(bottom_url).innerHTML;
	}
	}
			
	
		
		
		
		
		
		
		
var icon = '<img src="'+ title_icon +'" id="tcse_title_icon" class="tcse_title_icon" />';
			$('#tcse_show_content').fadeOut(function(){									
								

         if(title=='')
		 {
			 title = $('#tcse_win_top_tit').text();
		 }

var resiz_m_w = title.length*8+150;
var resiz_m_h = 150;
$("#tcse_show").resizable('destroy');
$( "#tcse_show" ).resizable({
		minHeight: resiz_m_h,
			minWidth: resiz_m_w,
			stop: function() { tcse_c_resize(); }

		});
		tcse_w_resizable = resiz_m_w;
		tcse_h_resizable = resiz_m_h;
				p_height = $( "#tcse_show" ).css('height').split('px');
	p_s_height = p_height[0]-title_height-20-footer_height;
		$('#tcse_show_content').css('height',p_s_height+'px');
		$('#tcse_show_content_inner').css('height',p_s_height+'px');
		$('#tcse_show_bottom_load').hide();
		$('#tcse_show_bottom').hide();
		if(footer_height)
	{
	$('#tcse_show_bottom').css('height',footer_height+'px');
	$('#tcse_show_bottom').css('margin-top',(p_s_height + 10 )+'px');
	$('#tcse_show_bottom_load').css('height',(footer_height-10)+'px');
	$('#tcse_show_bottom_load').css('margin-top',(p_s_height + 10 )+'px');
	$('#tcse_show_bottom_load').fadeIn();

			
	}

		

																			


															 if(title!='')
										 {
								 document.getElementById('tcse_win_top_tit').innerHTML= icon + '<strong style="margin-left:10px;">' + title + '</strong>';
						
										 }
												var uu = url.split('');
		var ut = url.split('http://');
		var ut1 = url.split('https://');
		var ut2 = url.split('www.');
		
		if(uu[0]=='/' || ut[0]=='' || ut[1]=='' || ut[2]=='')
										{
											
				ajax(url+'&p_title=none','tcse_show_content',form_name,form_method,'tcse_show_bg()');

										}
										else 
										{
											
					document.getElementById('tcse_show_content').innerHTML=document.getElementById(url).innerHTML;
			

tcse_show_bg();

										}
																	if(footer_height)
	{
		
		if(b_contt=='ss')
	{
	ajax(bottom_url+'&p_title=none', 'tcse_show_bottom',form_name,form_method,'tcse_show_b_bg()');
	}
	else
	{
document.getElementById('tcse_show_bottom').innerHTML=b_contt;
	
tcse_show_b_bg();
	}
	}
									
															   });

}

function tcse_popup(url,title,title_icon,p_width,p_height,bottom_url,b_height,form_name,form_method)
{
	setc('load_mouse_hide','true');
$('#confirm_bg').show();
	if(!title_icon)
title_icon = tcse_real_path +'start.png';
	footer_height = b_height;
		
													if(footer_height)
	{
		var uu = bottom_url.split('');
		var ut = bottom_url.split('http://');
		var ut1 = bottom_url.split('https://');
		var ut2 = bottom_url.split('www.');
		
		if(uu[0]=='/' || ut[0]=='' || ut[1]=='' || ut[2]=='')
	{
	var b_contt = 'ss';
	}
	else
	{
var b_contt = document.getElementById(bottom_url).innerHTML;
	}
	}
var icon = '<img src="'+ title_icon +'" id="tcse_title_icon" class="tcse_title_icon" />';			
	
if(form_name!='')
url1 = url + tcse_get_form_data(form_name);
else
url1 = url;


 						 if(title=='')
						 title='UNTITLE ';
					var resiz_m_w = title.length*8+150;
					var resiz_m_h = 150;
					title = icon + '<strong style="margin-left:10px;">'+ title +'</strong>';
					$('#tcse_win_top_tit').html(title);
var sh_h = $("#tcse_show").css('height').split('%');
if(sh_h.length==2)
sh_h = ($(window).height()/100)*sh_h[0];
else
sh_h = sh_h[0];


		tcse_win_mar_top_re=0;
		tcse_win_mar_left_re=0;
		
		
		if(resiz_m_w>p_width && p_width)
		p_width = resiz_m_w;
		
		if(resiz_m_h>p_height && p_height)
		p_height = resiz_m_h;
		
		
		if(!p_width)
		p_width = ($(window).width()/100)*90;			
	
		if(!p_height)
		p_height = ($(window).height()/100)*90.5;	
	
		p_s_height = p_height-title_height-20-footer_height;
		

	$('#tcse_show_content').css('height',p_s_height+'px');
	$('#tcse_show_content_inner').css('height',p_s_height+'px');
	if(footer_height)
	{
	$('#tcse_show_bottom').css('height',footer_height+'px');
	$('#tcse_show_bottom').css('margin-top',(p_s_height + 10 )+'px');
	$('#tcse_show_bottom_load').css('height',(footer_height-10)+'px');
	$('#tcse_show_bottom_load').css('margin-top',(p_s_height + 10 )+'px');
	$('#tcse_show_bottom_load').fadeIn();
	}
	
			$('#tcse_show').css('width',p_width+'px');
			$('#tcse_show').css('height',p_height+'px');
			
		var hgt_p = p_height;
		

		
		var hgt_p = ($(window).height()-hgt_p)/2;
		
		
		
		
					if($.browser.msie && $.browser.version.substr(0,1)<7)
	{
		
		
		  $('html').css('overflow','hidden');	
		  hgt_p = hgt_p + get_scroll('y');	

	}
				
		$( "#tcse_show" ).css('top',hgt_p + 'px');
		
			if(p_width)
		var wt_p = p_width;
		else
		var wt_p = ($(window).width()/100)*90;
		
		var wt_p = ($(window).width()-wt_p)/2;
		$( "#tcse_show" ).css('left',wt_p + 'px');
		


		$('#tcse_restore_img').hide();
		$('#tcse_show_bottom').hide();
		$('#tcse_maxi_img').show();
		
		$('#tcse_show').fadeIn(function(){
				$( "#tcse_show" ).resizable({
		minHeight: resiz_m_h,
			minWidth: resiz_m_w,
			stop: function() { tcse_c_resize(); }

		});
		tcse_w_resizable = resiz_m_w;
		tcse_h_resizable = resiz_m_h;
			$('.tcse_show_content_inner').css('background-image','url(' + tcse_real_path + 'loading.gif)');
			});
	
			var uu = url.split('');
		var ut = url.split('http://');
		var ut1 = url.split('https://');
		var ut2 = url.split('www.');
		
		if(uu[0]=='/' || ut[0]=='' || ut[1]=='' || ut[2]=='')
	{
	ajax(url+'&p_title=none', 'tcse_show_content',form_name,form_method,'tcse_show_bg()');
	}
	else
	{
	document.getElementById('tcse_show_content').innerHTML=document.getElementById(url).innerHTML;
tcse_show_bg();

	}
	if(footer_height)
	{
		if(b_contt=='ss')
	{
	ajax(bottom_url+'&p_title=none', 'tcse_show_bottom',form_name,form_method,'tcse_show_b_bg()');
	}
	else
	{
document.getElementById('tcse_show_bottom').innerHTML=b_contt;
	
tcse_show_b_bg();
	}
	
	}
	
	
}

function get_scroll(val)
{
	var scrollX, scrollY;
	      if (document.all)
      {
         if (!document.documentElement.scrollLeft)
            scrollX = document.body.scrollLeft;
         else
            scrollX = document.documentElement.scrollLeft;
               
         if (!document.documentElement.scrollTop)
            scrollY = document.body.scrollTop;
         else
            scrollY = document.documentElement.scrollTop;
      }   
      else
      {
         scrollX = window.pageXOffset;
         scrollY = window.pageYOffset;
      }
	  if(val=='x')
	  return scrollX;
	   if(val=='y')
	  return scrollY;
}
function tcse_show_b_bg()
{

		$('#tcse_show_bottom').fadeIn(function(){
			$('#tcse_show_bottom_load').hide();
			if($.browser.msie && $.browser.version.substr(0,1)<7)
	{
			ie_png_fix();
	}
			});
	
}
function tcse_show_bg()
	{		
		$('#tcse_show_content').fadeIn(function(){
						if($.browser.msie && $.browser.version.substr(0,1)<7)
	{
			ie_png_fix();
	}
			});		
	}
	function tcse_pop_close()
	{

	
		$('#tcse_show').fadeOut(function(){
			$("#tcse_show").resizable('destroy');
			setc('load_mouse_hide','');
								if($.browser.msie && $.browser.version.substr(0,1)<7)
		{
	 $('html').css('overflow','auto');
	 $('html').css('overflow-x','hidden');
		}
			
			
			});
		$('#tcse_show_content').html('');	
		$('#tcse_show_content').hide();
		$('#confirm_bg').hide();
		
	}

		function tcse_b_over(id,img,acc)
	{
		if(acc==0)
		{
		$('#' + id ).attr('src',tcse_real_path + img + '.gif');
		$('#' + id ).removeClass(id);
		}
		else
		{
		$('#' + id ).attr('src', tcse_real_path + img + '1.gif');
		$('#' + id ).addClass(id);
		}
	}
	function tcse_c_resize()
	{
		
			if($.browser.msie && $.browser.version.substr(0,1)<7)
	{
	}
		else
		{
		if($( "#tcse_show" ).css('position')!='fixed')
		{
		$( "#tcse_show" ).css('position','fixed');
var top_p = $( "#tcse_show" ).css('top').split('px');
top_p = top_p[0] - get_scroll('y');
$( "#tcse_show" ).css('top',top_p + 'px');
		}
		}
		p_height = $( "#tcse_show" ).css('height').split('px');
	p_s_height = p_height[0]-title_height-20-footer_height;
	
	if(footer_height)
	{
	$('#tcse_show_bottom').css('margin-top',(p_s_height + 10 )+'px');
	$('#tcse_show_bottom').css('height',footer_height+'px');	
	$('#tcse_show_bottom_load').css('height',footer_height+'px');
	$('#tcse_show_bottom_load').css('margin-top',(p_s_height + 10 )+'px');
	
	}
	$('#tcse_show_content').css('height',p_s_height+'px');
	$('#tcse_show_content_inner').css('height',p_s_height+'px');
	}
$(document).ready(function(){
	if($.browser.msie && $.browser.version.substr(0,1)<7)
	{
    var sty=' style="position:absolute" ';
	}
	else
	{
	var sty ='';
	}
	$('body').append('<div  ' + sty +  ' class="confirm_bg" id="confirm_bg" ></div><div style="z-index:100002"  ' + sty +  ' class="confirm_bg" id="confirm_bg1" ></div><div class="tcse_confirm" ' + sty +  'id="confirm_body"><div class="tcse_show_inner_bg"></div><div class="tcse_confirm_top"><div class="tcse_confirm_title" id="tcse_confirm_title"></div><a href="javascript:void(0);"><img src="'+ tcse_real_path +'close.gif" onmouseover="this.src=\''+ tcse_real_path +'close1.gif\'" onmouseout="this.src=\''+ tcse_real_path +'close.gif\'"  align="right" style="margin-top:-17px;" onclick="confirm_hid();" title="Close"></a></div><div class="tcse_confirm_body"><img src="' +tcse_real_path +'attention.jpg" style="margin-left:5px; margin-top:3px;" /><div class="tcse_confirm_font"  id="tcse_confirm_msg"></div><div class="c_b_tcse"><div id="tcse_confirm_s"></div><div id="tcse_confirm_n" ></div></div></div><div id="tcse_confirm_result"></div></div><div id="tcse_show" class="tcse_show" ' + sty +  '><div class="tcse_show_inner_bg"></div><div  align="right" class="tcse_title_bar" style="height:'+ title_height +'px" id="tcse_show_top"><div class="tcse_top_title" id="tcse_win_top_tit" align="left" ></div><a href="javascript:void(0);"><img src="'+ tcse_real_path +'close.gif" onmouseover="tcse_b_over(\'tcse_close_b\',\'close\',1);" onmouseout="tcse_b_over(\'tcse_close_b\',\'close\',0);"  id="tcse_close_b"  align="right" onclick="tcse_pop_close();" title="Close"></a><a href="javascript:void(0);" id="tcse_maxi_img"  title="Maximize"><img  style="margin-left:-25px;position:absolute;"  align="right" onclick="tcse_restore();" src="'+ tcse_real_path +'maximize.gif" onmouseover="tcse_b_over(\'tcse_maxi_b\',\'maximize\',1);" onmouseout="tcse_b_over(\'tcse_maxi_b\',\'maximize\',0);"  id="tcse_maxi_b"></a><a href="javascript:void(0);" style="display:none;" id="tcse_restore_img"  title="Restore"><img  style="margin-left:-25px;position:absolute;"  align="right" onclick="tcse_restore();" src="'+ tcse_real_path +'restore.gif" onmouseover="tcse_b_over(\'tcse_restore_b\',\'restore\',1);" onmouseout="tcse_b_over(\'tcse_restore_b\',\'restore\',0);"  id="tcse_restore_b"></a></div><div id="tcse_show_content" class="tcse_show_content"></div><div class="tcse_show_content_inner" id="tcse_show_content_inner"></div><div id="tcse_show_bottom" class="tcse_show_bottom"></div><div id="tcse_show_bottom_load" class="tcse_show_bottom_load" align="center" ><img src="'+ tcse_real_path +'facebook.gif"  ><div></div>');
	

	$( "#tcse_show" ).draggable({ containment: "window", scroll: false,handle: "#tcse_show_top" });

	});

