<?php

/* osCommerce, Open Source E-Commerce Solutions 
http://www.oscommerce.com 

Copyright (c) 2003 osCommerce 

osCommRes, Services Oline 
http://www.oscommres.com 
Copyright (c) 2005 osCommRes 

Freeway eCommerce 
http://www.zac-ware.com/freeway 
Copyright (c) 2007 ZacWare

Released under the GNU General Public License
*/
// Set flag that this is a parent file
	define( '_FEXEC', 1 );
require('includes/application_top.php');  
  tep_get_last_access_file();
 // $gID=isset($HTTP_GET_VARS['gID'])?$HTTP_GET_VARS['gID']:0;
  $gID=empty($HTTP_GET_VARS['gID'])? 0 : (int)$HTTP_GET_VARS['gID'];
  if ($gID<=0){
  		//echo "SELECT configuration_group_id,configuration_group_title from " . TABLE_NEWSDESK_CONFIGURATION_GROUP . " where lower(configuration_access_key)='" . strtolower($CONFIG_ACCESS_KEY) . "'"; 
		$config_group_query=tep_db_query("SELECT configuration_group_id,configuration_group_title from " . TABLE_NEWSDESK_CONFIGURATION_GROUP) ; //" where lower(configuration_access_key)='" . strtolower($CONFIG_ACCESS_KEY) . "'");
		if (tep_db_num_rows($config_group_query)>0){
			$config_group_result=tep_db_fetch_array($config_group_query);
			$gID=$config_group_result['configuration_group_id'];
			define('HEADING_TITLE',$config_group_result['configuration_group_title']);
		} else { 
			$gID=1;
		}
  }

  $action=isset($HTTP_GET_VARS['action'])?tep_db_prepare_input($HTTP_GET_VARS['action']):0;
  $g_title="";   
  $server_date = getServerDate(true);
  if($gID) 
  $g_query=tep_db_query("select configuration_group_title from ".TABLE_NEWSDESK_CONFIGURATION_GROUP." where configuration_group_id='".(int)$gID."'");
  if(tep_db_num_rows($g_query)>0){
  	$g_result=$g_query=tep_db_fetch_array($g_query);
   	$g_title=$g_result['configuration_group_title'];
	define('HEADING_TITLE',$g_result['configuration_group_title']);
  } 
  $cId=(int)isset($HTTP_GET_VARS['id'])?(int)$HTTP_GET_VARS['id']:0;
  if($action=='file_uploads' && $HTTP_GET_VARS['id']){  	             	
	     $upload_fs_dir = DIR_FS_TEMPLATES.DEFAULT_TEMPLATE.'/'.DIR_WS_IMAGES;
	     $configuration=$HTTP_POST_FILES['configuration_file_value'];
	     $HTTP_POST_FILES['configuration']['name']=$configuration['name'];	    		  	  
	     $HTTP_POST_FILES['configuration']['type']=$configuration['type'];
	     $HTTP_POST_FILES['configuration']['tmp_name']=$configuration['tmp_name'];
	     $HTTP_POST_FILES['configuration']['size']=$configuration['size'];	     
         $up_load = new upload('configuration', $upload_fs_dir);         
         $file_name = $up_load->filename;                           			         
         $error=false;
         $file_upload="file_upload";                            
         if($file_name != "freeway.png"){
			if(file_exists($upload_fs_dir."freeway.png") && !@unlink($upload_fs_dir."freeway.png")){								
				$error=true;
				$error_txt=sprintf(DELETE_ERROR,$upload_fs_dir."freeway.png");
				$error_result='<span alt="'.$error_txt.'" title="'.$error_txt.'"><font color="red">'.((strlen($error_txt)>30)?substr($error_txt,0,30):$error_txt).'</font></span><br>';
			}	
			if(!$error && !@rename($upload_fs_dir.$file_name, $upload_fs_dir."freeway.png")){					
				$error=true;
				$error_txt=sprintf(RENAME_ERROR,$upload_fs_dir."freeway.png");				
				$error_result='<span alt="'.$error_txt.'" title="'.$error_txt.'"><font color="red">'.((strlen($error_txt)>30)?substr($error_txt,0,30):$error_txt).'</font></span><br>';				
			}													
		  }
	 if(strlen($file_name)>30) $file_name=substr($file_name,0,30).'...';	  		  	 	 
	 if(!$error) tep_db_query("update " . TABLE_NEWSDESK_CONFIGURATION . " set configuration_value = 'freeway.png', last_modified = '" . $server_date . "' where configuration_id = '" . (int)$cId . "'");	 	 
	 echo '{'.$cId.'open}'.$error_result.'<a href="javascript:do_expand('.$cId.',\'get_details\',\''.$file_upload.'\');">'.((!$file_name)?'...':'freeway.png').'</a>'; 	 	  	   	  		 	 
  }
  if($action){  	  
  	  if($action=='get_details'){  		
  		$config_qry=tep_db_query("select configuration_value,set_function from ".TABLE_NEWSDESK_CONFIGURATION ." where configuration_id='". (int)$cId."'");
  		$value_field="";
  		if(tep_db_num_rows($config_qry)>0){
	  		$config=tep_db_fetch_array($config_qry);
	  		if ($config['set_function']) 	        	
	        	eval('$value_field .= ' . $config['set_function'] . '"' . html_entity_decode($config['configuration_value']) . '");');	        						        	      
	  		else{ 
	            $width_percnt=round(100/2);
	        	$value_field = tep_draw_input_field('configuration_value', html_entity_decode($config['configuration_value']),'size='.$width_percnt.' onkeypress="javascript:if(key(event)) do_expand('.(int)$cId.',\'save\');"');
	  		}	        
			 if(strpos($value_field,'name="configuration_value')) $value_field=str_replace('name="configuration_value','name="configuration_value['.$cId.']',$value_field);
			 if(strpos($value_field,'name="check_configuration_value')) $value_field=str_replace('name="check_configuration_value','name="configuration_value['.$cId.']',$value_field);			   	        
	        echo '{'.$cId.'}'.$value_field;
  		}      	
  	}else if($action=='save') {  		  	
  			$params=tep_db_prepare_input($HTTP_GET_VARS['params']);
  			$configuration_value=tep_db_prepare_input($HTTP_POST_VARS['configuration_val']);
			$configuration_qry = tep_db_query("select configuration_key from " . TABLE_NEWSDESK_CONFIGURATION . " where configuration_id = '" . (int)$cId . "'");
			if(tep_db_num_rows($configuration_qry)>0) $configuration_res=tep_db_fetch_array($configuration_qry);
			//if($configuration_res['configuration_key']=='SHOP_SELL_ITEMS') $configuration_value=str_replace(",","",$configuration_value);    			  		  		  		  		  		  		  		  		  		  		  		  	      	      	      	     	  	     	
  	     	tep_db_query("update " . TABLE_NEWSDESK_CONFIGURATION . " set configuration_value = '" . html_entity_decode(tep_db_prepare_input($configuration_value)) . "', last_modified = '" . $server_date . "' where configuration_id = '" . (int)$cId . "'");   	    	 
  	    	$configuration_query = tep_db_query("select configuration_id, configuration_title, configuration_value, use_function,configuration_group_id,configuration_description,set_function from " . TABLE_NEWSDESK_CONFIGURATION . " where configuration_id = '" . (int)$cId . "'");        
			$total_count= tep_db_num_rows($configuration_query);
			if($total_count){
				$configuration=tep_db_fetch_array($configuration_query);  	    			
  	    		if (tep_not_null($configuration['use_function'])) {
      			$use_function = $configuration['use_function'];
			      if (ereg('->', $use_function)) {
			        $class_method = explode('->', $use_function);
			        if (!is_object(${$class_method[0]})) {
			          include(DIR_WS_CLASSES . $class_method[0] . '.php');
			          ${$class_method[0]} = new $class_method[0]();
			        }
			        $cfgValue = tep_call_function($class_method[1], $configuration['configuration_value'], ${$class_method[0]});
			      } else {
			        $cfgValue = tep_call_function($use_function, $configuration['configuration_value']);		
			      }
		   		} else 
			    	 $cfgValue = $configuration['configuration_value'];
			    $file_upload="";			    
			    if(strlen($cfgValue)>30) $cfgValue=substr($cfgValue,0,30).'...';
			    if($configuration['set_function']=='file_upload') $file_upload='file_upload';   			    
			    if($cfgValue=='') $cfgValue="...."; 	 
				echo '{'.$cId.'open}<a href="javascript:do_expand('.$cId.',\'get_details\',\''.$file_upload.'\');">'.htmlentities($cfgValue).'</a>';
			}   	    		   	    		  		
  	}
  	exit;
  }        
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<style type="text/css">
	#pup {position:absolute; visibility:hidden; z-index:200; width:130; }
</style>
<script language="javascript" src="includes/menu.js"></script>
<script language="javascript" src="includes/general.js"></script>
<script language="javascript" src="includes/http.js"></script>
<script language="javascript">	
 function key(e){		
		var KeyID = (window.event) ? event.keyCode : e.keyCode;			
		if(KeyID==13) return true;
		else return false;
 }
//Js Upload Start
  AIM = {

	frame : function(c) {
		var n = 'f' + Math.floor(Math.random() * 99999);
		var d = document.createElement('DIV');
		d.innerHTML = '<iframe style="display:none" src="about:blank" id="'+n+'" name="'+n+'" onload="AIM.loaded(\''+n+'\')"></iframe>';
		document.body.appendChild(d);

		var i = document.getElementById(n);
		if (c && typeof(c.onComplete) == 'function') {
			i.onComplete = c.onComplete;
		}

		return n;
	},

	form : function(f, name) {
		f.setAttribute('target', name);
	},

	submit : function(f, c) {
		AIM.form(f, AIM.frame(c));
		if (c && typeof(c.onStart) == 'function') {
		
			return c.onStart();
		} else {
		
			return true;
		}
	},

	loaded : function(id) {
		var i = document.getElementById(id);
		if (i.contentDocument) {
			var d = i.contentDocument;
		} else if (i.contentWindow) {
			var d = i.contentWindow.document;
		} else {
			var d = window.frames[id].document;
		}
		if (d.location.href == "about:blank") {
			return;
		}

		if (typeof(i.onComplete) == 'function') {
			i.onComplete(d.body.innerHTML); 
		}
	}

}
  function startCallback() {
			// make something useful before submit (onStart)
		if(document.config_upload.configuration_file_value && document.config_upload.configuration_file_value.value==""){
			alert("Please Select the upload image");
			return false;
		}						
		else return true;
  }

  function completeCallback(response) {
	 do_result(response);			
  }
//Js Upload End

function check_selected_values(configcheckbox,controlname,countrycontrol,key){				
		return;		
	}
 var desc_array=new Array();
function do_expand(id,action,params){
	var qry="";
	if(id) {
		qry="?id="+id;
		var config_value=document.getElementById("config_value_"+id);
		var config_data=document.getElementById("config_data_"+id);
		var action_save=document.getElementById("action_save_"+id);			
		var action_close=document.getElementById("action_close_"+id);
		var img_load=document.getElementById("img_load_"+id);			
		if(img_load && action!='close') img_load.style.display="";
		var desc_div=document.getElementById("desc_"+id);
		var hidd_val=document.config.open_val.value;
		if(hidd_val){		
			var config_value_hidden=document.getElementById("config_value_"+hidd_val);
			var config_data_hidden=document.getElementById("config_data_"+hidd_val);
			var action_save_hidden=document.getElementById("action_save_"+hidd_val);
			var action_close_hidden=document.getElementById("action_close_"+hidd_val);
			var desc_div_hidden=document.getElementById("desc_"+hidd_val);
			config_data_hidden.style.display="";
			config_value_hidden.style.display="none";									
			action_save_hidden.style.display=action_close_hidden.style.display="none";																 
			if(desc_div_hidden) desc_div_hidden.className='config_title_line';	
			document.getElementsByName("configuration_file_value")[0].style.display="none";
			document.getElementById("desc_"+hidd_val).edit=false;
		}				
		document.config.open_val.value=id;	 					
	} 		
	if(action) qry+="&action="+action;	
	if(action=='get_details' && params=='file_upload' && action_save && action_close && config_data && img_load) {
	   	  action_save.style.display=action_close.style.display="";
	   	  config_data.style.display=img_load.style.display="none";
	   	  if(document.getElementsByName("configuration_file_value")) document.getElementsByName("configuration_file_value")[0].style.display="";
	   	  if(desc_div) desc_div.className='config_box';
	      document.getElementById("desc_"+id).edit=true;
		  kill();
		  prev_id="";
		  cEvent=false;
	} else if(action=='save' || action=='get_details'){	  	   
	   if(action=='save'){	     
	      var config="configuration_value["+id+"]";		  
	      var vals="";			 		  
		  var obj=document.getElementsByName(config);		   		    		   		   		  		  		  		  		  		  	
		  if(obj){	   				   				   				   				   				   				   				   			
	   		  i=0;
	   		  var chk_box=false;
	   		  while(true){		   			
	   			if(!obj[i]) break;	   			
	   			if(obj[i].type=='radio'){ 	   					   					   					   				
	   				if(obj[i].checked) vals=obj[i].value;	   						   			
	   			}else if(obj[i].type=='select-one' && obj[i].selectedIndex!=0){ 	
	   				vals+=obj[i].options[obj[i].selectedIndex].value+',';				   					   			
	   				chk_box=true;
	   			}else if(obj[i].type=='checkbox' && obj[i].checked){
	   				 chk_box=true;
	   				 vals+=obj[i].value+',';	   			
	   			}else if(obj[i].type!='checkbox' && obj[i].type!='hidden') 
	   				vals=obj[i].value;
	   			i++;		   			
	   		  } 	   		  
	   		  if(chk_box){ 
			  	if(vals.substr((vals.length-1),1)==','){ 
					vals=vals.substr(0,vals.length-1);}
				}
	   	  }	  
	   	  var configuration_value=document.config.configuration_val;	   	  
	   	  if(configuration_value && id){
		  	
		  	 configuration_value.value=vals;	   	 	   	  	    	   
			 }
	   }	   
	   if(params) qry+="&params="+params;
	   command="<?php echo tep_href_link(FILENAME_NEWSDESK_CONFIGURATION);?>"+qry;	   	   	  	
	   if(action=='get_details' && document.getElementById("config_value_"+id).innerHTML==""){
	      document.getElementById("desc_"+id).edit=true;
		  kill();
		  prev_id="";
		  cEvent=false;
	   	  do_get_command(command);
	   }else if(action=='get_details' && document.getElementById("config_value_"+id).innerHTML!="" && config_value){	   	  
	      document.getElementById("desc_"+id).edit=true;
		  kill();
		  prev_id="";
		  cEvent=false;
	   	  config_value.style.display=''; 
	   	  config_data.style.display=img_load.style.display='none';
	   	  var desc_div=document.getElementById("desc_"+id);if(desc_div) desc_div.className='config_box';
	   	  var action_save=document.getElementById("action_save_"+id);			
		  var action_close=document.getElementById("action_close_"+id);
		  if(action_save && action_close) action_save.style.display=action_close.style.display='';
	   }	   	   
	   if(action=='save') {
        document.getElementById("desc_"+id).edit=false;
	   	do_post_command('config',command);
	   }
	}else if(action=='close' && id){		   
	   var config_data=document.getElementById("config_data_"+id);
	   var config_value=document.getElementById("config_value_"+id);	   		
	   if(config_data && config_value) {		
		if(document.getElementsByName("configuration_file_value")) document.getElementsByName("configuration_file_value")[0].style.display=config_value.style.display="none";
	   	config_data.style.display='';
	   }	   
	   document.getElementById("desc_"+id).edit=false;
	   var  desc_div=document.getElementById("desc_"+id);
	   if(action_save && action_close) action_save.style.display=action_close.style.display='none';
	   if(desc_div) desc_div.className='config_title_line'; 
	}	 
 }
 function do_result(result){			
	if(result){
		id=result.substr(1,result.indexOf("}")-1);
		type="";
		var config_data=document.getElementById("config_data_"+id);
		var config_value=document.getElementById("config_value_"+id);
		if(id.indexOf('open')>0) {
			id=id.substr(0,id.length-4);		
			var config_data=document.getElementById("config_data_"+id);
			var config_value=document.getElementById("config_value_"+id);
			var img_load=document.getElementById("img_load_"+id);			
			if(config_data) config_data.innerHTML=result.substr(id.length+6);						  														
			if(config_value) config_value.innerHTML="";					
			if(img_load && document.getElementsByName("configuration_file_value")) document.getElementsByName("configuration_file_value")[0].style.display=img_load.style.display="none";
		 	do_expand(id,'close');
			return; 
		} 
		if(id){
			var desc_div=document.getElementById("desc_"+id); 			
			var action_save=document.getElementById("action_save_"+id);			
			var action_close=document.getElementById("action_close_"+id);
			var img_load=document.getElementById("img_load_"+id);
		}		
		if(desc_div) desc_div.className='config_box';				
		if(result.substr(result.indexOf("}")+1) && config_data && config_value){
			if(action_save && action_close) action_save.style.display=action_close.style.display='';					
			if(img_load) img_load.style.display="none";
			result=result.substr(result.indexOf("}")+1);
			config_value.style.display='';
			config_data.style.display='none';				
			config_value.innerHTML=result;			
		} 		
	}	
 }
 function do_action(id,action){ 	
	 var desc_div=document.getElementById("desc_"+id);
 	 if(desc_div.className!='config_box_over' && action=='open' && desc_div.className!='config_box'){
 	 	desc_div.className='config_box_over';
 	 }else if(action=='close' && desc_div.className!='config_box'){
 	 	desc_div.className='config_title_line';
 	 }
 }
  var prevID;
  var timerID;
  var cEvent;
  function pop_config(e,row,id){
	if (row.edit) return;
	prevID=id;
	cEvent=e;
	row.pop_on=true;
	show_description(id);
  }
  function close_config(row,id){
  	if (!row.pop_on || row.edit) return;
	prevID=false;
  	kill();
  }
</script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onLoad="SetFocus();" >
<script language="javascript" src="includes/popup.js" ></script>

<!-- header //-->
<?php 
require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2" onMouseOut="javascript:clearTimeout(1)" >
  <tr >
<!-- body_text //-->
    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
      <tr>
        <td>        
        <table border="0" width="100%" cellspacing="0" cellpadding="0">		 
          <tr>
            <td valign="top"><table style="cursor:pointer;"  border="0" width="100%" cellspacing="0" cellpadding="2" >              
  <?php
    $configuration_query = tep_db_query("select configuration_id, configuration_title, configuration_value, use_function,configuration_group_id,configuration_description,set_function from " .  TABLE_NEWSDESK_CONFIGURATION . " where configuration_group_id = '" . (int)$gID . "' order by sort_order");        
	$total_count= tep_db_num_rows($configuration_query);
	$icnt=0;    
	while ($configuration = tep_db_fetch_array($configuration_query)) {
    $gID=$configuration['configuration_group_id'];
    if($configuration['configuration_description'])
    	echo '<script language="javascript">desc_array['.$configuration["configuration_id"].']="'.addslashes($configuration["configuration_description"]).(($configuration['set_function']=='file_upload' && $configuration['configuration_value']=='freeway.png')?'<br><img alt=\'freeway.png\' width=200 height=200 title=\'freeway.png\' src=\'../templates/'.DEFAULT_TEMPLATE.'/images/freeway.png\'>':'').'";</script>';
    if (tep_not_null($configuration['use_function'])) {
      $use_function = $configuration['use_function'];
      if (ereg('->', $use_function)) {
        $class_method = explode('->', $use_function);
        if (!is_object(${$class_method[0]})) {
          include(DIR_WS_CLASSES . $class_method[0] . '.php');
          ${$class_method[0]} = new $class_method[0]();
        }
        $cfgValue = tep_call_function($class_method[1], $configuration['configuration_value'], ${$class_method[0]});
      } else {
        $cfgValue = tep_call_function($use_function, $configuration['configuration_value']);		
      }
    } else 
       $cfgValue = $configuration['configuration_value'];

    $file_upload="";
    if($configuration['set_function']=='file_upload') $file_upload='file_upload';   
    $print_cfgValue=$cfgValue;     
    if(strlen($print_cfgValue)>30) $print_cfgValue=substr($print_cfgValue,0,30).'...';
    if($print_cfgValue=='') $print_cfgValue="....";
	$config_row=2;
	$config_cols_width=round(100/2).'%';
	$save_href='<a href=javascript:do_expand('.$configuration["configuration_id"].',\'save\');><img src="images/template/img_save.gif" border="0" alt="save" title="save"></a>';	
	if($icnt%$config_row==0) echo "<tr style='height:70;width:50'>";		
	if($file_upload=='file_upload') { 
		$save_href="<input type='image' src='images/template/img_save.gif' alt='save' title='save'>";
		echo '<form name="config_upload" enctype="multipart/form-data" action="'.tep_href_link(FILENAME_NEWSDESK_CONFIGURATION,'action=file_uploads&id='.$configuration['configuration_id']).'" method="post" onsubmit="return AIM.submit(this, {\'onStart\' : startCallback, \'onComplete\' : completeCallback})">';		
 	}
    ?>	
	
		<td onMouseOver="javascript:pop_config(event,this,'<?php echo $configuration["configuration_id"]; ?>');" onMouseOut="javascript:close_config(this,'<?php echo $configuration["configuration_id"]; ?>');" onClick="javascript:do_expand(<?php echo $configuration['configuration_id'];?>,'get_details','<?php echo $file_upload;?>');" <?php echo 'width="'.$config_cols_width.'" id="desc_'.$configuration["configuration_id"].'"';?> class='config_title_line'>
		 
		 <table border="0" width="100%" cellspacing="0" cellpadding="2">			    
			 <tr class='config_title'>
				<td align="left"  ><?php echo $configuration['configuration_title'];?></td>
				<td align="right" id="action_save_<?php echo $configuration["configuration_id"];?>" style="display:none"><?php echo $save_href;?>&nbsp;&nbsp;</td>			    	                 	                	                      
			 </tr>			    			    
			 <tr class='config_title'>			     	 
				<td class='config_title'><span id="config_value_<?php echo $configuration["configuration_id"];?>" style="display:none"></span><input style="display:none" class="inputNormal" type="file" name="<?php echo 'configuration_file_value';?>"><span id="config_data_<?php echo $configuration["configuration_id"];?>"><a <?php echo ((strlen($cfgValue)>30)?"alt='".$cfgValue."' title='".$cfgValue."'":"");?>><?php echo htmlspecialchars($print_cfgValue);?></a></span>&nbsp;&nbsp;<span id="img_load_<?php echo $configuration["configuration_id"];?>" style="display:none"><img alt='Loading...' title='Loading...' src='images/24-1.gif'></span></td>                  	                	
				<td valign="top" align="right" id="action_close_<?php echo $configuration["configuration_id"];?>" style="display:none"><a href="javascript:do_expand(<?php echo $configuration['configuration_id'];?>,'close')"><img src="images/template/img_close.gif" alt="close" title="close" border="0"></a>&nbsp;&nbsp;</td>	     
			 </tr> 		     
		   </table>		
		 </td>
			
<?php	 	 
  if($file_upload=='file_upload') echo '</form>';
	$icnt++;
  }  
	  
	if($icnt%$config_row==0) echo "</tr >";		?>

 	</table> 	   
 		 	 
   		</td>         
		 <td class="smallText"></td> </tr>		 
        </table>
        <form  name="config" id="config" action="<?php echo FILENAME_NEWSDESK_CONFIGURATION;?>" method="post">        	         	
         	<input type="hidden" name="configuration_val"> 
			<input type="hidden" name="open_val"> 
        </form>
        </td>
      </tr>
    </table></td>
<!-- body_text_eof //-->
  </tr>
</table>
<!-- body_eof //-->
<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
<script language="javascript">	
	var baby=new Array();
	baby[1]="";
	content_value=""; 
	function show_description(code){
		content_value = desc_array[code];		
		content='<table border="0" cellspacing="0" cellpadding="4" class="tableArea" width="100%" ><tr><td class="main"><font size="1" face="arial">';
		content+=content_value;
		content+='</font></td></tr></table>';
		popwidth=150;						
			baby[1]=content; 				
			if (baby[1]!=""){			
			popup("1","#D6F0F9");					
				//setTimeout('popup("1","#D6F0F9")',2500);
				//clearTimeout();										
			}							
    }
</script>
