// IC WCMS JavaSricpt Functions Library
// IruCom WebCMS Version 4.0 
// IruCom WebCMS Release Date : 04.03.08  - RV2
// Copyright Pragash Irudayam ( IruCom systems )
// Licence only for one Domain. No changes or addons are allowed without prior permisssion from Pragash Irudayam (IruCom systems)

// German Language Strings
var str_month_array = new Array('Januar','Februar','März','April','Mai','Juni','Juli','August','September','Oktober','November','Dezember');
var str_week_array = new Array('So','Mo','Di','Mi','Do','Fr','Sa');
var str_no_date	= "kein Datum";

function IC_JS_Browser_Standard()
{
	if((document.all) && (navigator.appName.indexOf("Microsoft") != -1))
	{
		return false;
	}
	return true;
}

function IC_JS_Preload_Images()
{
	num_images = arguments.length;
	ic_preload_images = new Array();
	for(i=0; i<num_images; i++ )
	{	
		ic_preload_images[i] = new Image();
		ic_preload_images[i].src = arguments[i];
	}		
}
function IC_JS_Show_Tab(display_tab_id, hide_tab_id)
{
	if (typeof(document.getElementById) != 'undefined') 
	{
        dtb = document.getElementById(display_tab_id);
		htb = document.getElementById(hide_tab_id);
		
		htb.style.display = 'none';		
		dtb.style.display = 'block';				
				
    	return true;
	}
	else 
	{
	 	return false;
	}	
}
function IC_JS_Show_Dialog_Box(blockid, icon_id, icon_open, icon_close)
{
	if (typeof(document.getElementById) != 'undefined') 
	{
        x = document.getElementById(blockid);
		icon = document.getElementById(icon_id);
	}    
    else 
	{
        return false;		
    }
	// Check for Inline Style 
	// If null check for stylesheet values
	var display_style = x.style.display;	
	if( (display_style == 'undefined') || (display_style == null)|| (display_style == '') )
	{
		if((document.all) && (navigator.appName.indexOf("Microsoft") != -1))
		{
			// MSIE
			var display_style  = x.currentStyle.display;						
		}
		else
		{
			// DOM
			var display_style  = window.getComputedStyle(x, null).display;					
		}		
	}
	// alert(display_style);
	if(display_style == 'block')
	{
		x.style.display = 'none';
		icon.src = "ic_wcms_image/" + icon_open;		
	}
	else
	{
		x.style.display = 'block';
		icon.src = "ic_wcms_image/" + icon_close;			
	}	
    return true;		
}

function IC_JS_Window_Open(URLStr, Winname)
{ 
  if( ((URLStr.indexOf('http://')) == -1) && ((URLStr.indexOf('www')) != -1) )
  {
  	URLStr = "http://" + URLStr;
  } 
  nwin = window.open(URLStr, Winname);
}

function IC_JS_Window_Close()
{
	window.close();
}

// Used to Confirm 
function IC_JS_Confirm(msg)
{
	return confirm(msg);

}
function IC_JS_Show_Message(message)
{	
	return alert(message);		
}

function IC_JS_F_Submit_Form(form_id)
{
	if (typeof(document.getElementById) != 'undefined') 
	{
        form = document.getElementById(form_id);
		form.submit();
		return true;
	}    
    else 
	{
        return false;		
    }
}

function IC_JS_Delete_ChildNodes(id)
{
	if (typeof(document.getElementById) != 'undefined') 
	{
		var display_box = document.getElementById(id);		   	
    }    
    else 
	{
        return false;
		
    }
	// Delete all Child Nodes if available
	// Changes to the Nodlist changese the Index
	// Get initial number of Child nodes for the for Loop - and decrement
	var kids = display_box.childNodes;
	var num_kids = kids.length;
	if(num_kids != 0)
	{
		for(var i = num_kids-1; i >=0; i--)
		{
			display_box.removeChild(kids[i]);
		}
	}
	return true;
}

function IC_JS_Create_Info_Block(info_box_id, hint_msg_id)
{

	if(IC_JS_Delete_ChildNodes(info_box_id))
	{		
		if(hint_msg_id != 0 )
		{
			if (typeof(document.getElementById) != 'undefined') 
			{
				var info_box = document.getElementById(info_box_id);
				var hint_xml = document.getElementById(hint_msg_id);
				var hint_msg = hint_xml.cloneNode(true);				
				info_box.appendChild(hint_msg);		
			}    
			else 
			{
				return false;		
			}
		}
		return true;	
	}
	else
	{
		return false;
	}	
}


function IC_JS_Info_Block(info_box_id , theAction, hint_msg_id, event)
{
	// Default action	
	var showhide = 'visible';
	var x_margin = 35;
	var y_margin = 35;
	var x_toset = 0;
	var y_toset = 0; 
	
	if (typeof(document.getElementById) != 'undefined') 
	{
        x = document.getElementById(info_box_id);				
	}    
    else 
	{
        return false;		
    } 
	
	if (theAction == 'hide') 
	{           
		x.style.visibility = 'hidden' ;
		 return true;				
    }
	else
	{
		IC_JS_Create_Info_Block(info_box_id, hint_msg_id);
		
		/*var mouse_now_x = event.clientX;
		var mouse_now_y = event.clientY;
		
		if((document.all) && (navigator.appName.indexOf("Microsoft") != -1))
		{
			// MSIE
			var box_size_width  = parseInt(x.currentStyle.width.slice(0,-2));
			var box_size_height =  parseInt(x.currentStyle.height.slice(0,-2));
			var scroll_x = document.documentElement.scrollLeft;
			var scroll_y = document.documentElement.scrollTop;
			// MSIE <= 6
			//var scroll_x = document.body.scrollLeft;
			//var scroll_y = document.body.scrollTop;		
			
		}
		else
		{
			var box_size_width  = parseInt(window.getComputedStyle(x, null).width.slice(0,-2));
			var box_size_height =  parseInt(window.getComputedStyle(x, null).height.slice(0,-2));			
			var scroll_x = self.pageXOffset;
			var scroll_y = self.pageYOffset;		
		}
		
		if((box_size_width + x_margin )> mouse_now_x)
		{
			// on the rightside of the mouse 
			x_toset = mouse_now_x + x_margin;
		}
		else
		{
			x_toset = mouse_now_x - (x_margin + box_size_width) ;
		}
		if((box_size_height + y_margin )> mouse_now_y)
		{
			// on the topside of the mouse 
			y_toset = mouse_now_y + y_margin;			
		}
		else
		{
			y_toset = mouse_now_y - (y_margin + box_size_height) ;
		}
		var n_x = parseInt(scroll_x + x_toset)  + "px";
		var n_y = parseInt(scroll_y + y_toset)  + "px";
		
		//x.style.setProperty("left", n_x,'');
		//x.style.setProperty("top", n_y, '');
		
		x.style.left = n_x;
		x.style.top = n_y;*/
		
		
		x.style.visibility = 'visible';
		//IC_JS_Fade(x, 12);
		return true;			
	}
			
    return false;
		
}
/* Used to show short messages to the user eg. Help infos */
function IC_JS_Message_Block(blockid , theAction)
{
	// Default action	
	var showhide = 'block';	
	if (typeof(document.getElementById) != 'undefined') 
	{
        x = document.getElementById(blockid);
    }    
    else 
	{
        return false;		
    }
    
	if (theAction == 'hide') 
	{           
		showhide    = 'none' ;				
    }		
	x.style.display = showhide;	
    return true;
		
}

function IC_JS_Fade(elm, fps)
{		
	var opac = 10;
	var i = 1;
	var opac_incre = parseInt(100/fps);
	function IC_JS_Set_Opac(elm)
	{
		opac = opac + opac_incre;		
		if( i < fps ) 
		{
			if(IC_JS_Browser_Standard())
			{
				sopac = opac / 100;
				elm.style.opacity = sopac;				
			}
			else
			{
				elm.filters['DXImageTransform.Microsoft.Alpha'].Opacity = opac;
				/*win_curtain.filters['DXImageTransform.Microsoft.Fade'].apply();
				win_curtain.style.filter = "progid:DXImageTransform.Microsoft.Fade(duration=1.5)";
				win_curtain.filters['DXImageTransform.Microsoft.Fade'].play();*/
			}			
		}
		else
		{
			clearInterval(my_time_id);
		}
		i++;	
	}	
			
	var set_opac = function() {IC_JS_Set_Opac(elm)}
	var my_time_id = setInterval(set_opac, 50);
	
	return true;
}

/* icgui_webcms_window should be transparent*/
function IC_JS_Logout(msg)
{	
	var icgui_webcms_window = document.getElementById('icwcms_curtain_id_box');
	var win_curtain = document.createElement("div");
	if(IC_JS_Browser_Standard())
	{
		win_curtain.setAttribute("id", "icwcms_curtain_id");
		win_curtain.setAttribute("class", "icgui_webcms_window_curtain");		
	}
	else
	{
		win_curtain.setAttribute("id", "icwcms_curtain_id");
		win_curtain.setAttribute("className", "icgui_webcms_window_curtain");
	}
	
	win_curtain.style.width = "99.9%";
	win_curtain.style.height = "99.5%";
	win_curtain.style.zIndex = "310"; 
	win_curtain.style.position = "absolute";
	win_curtain.style.top = "1px";
	win_curtain.style.left = "1px";
	//alert(window.width);
	win_curtain.style.backgroundColor = '#FFFFFF';	
	icgui_webcms_window.appendChild(win_curtain);
	
	IC_JS_Fade(win_curtain, 19);
	if(IC_JS_Confirm(msg))
	{
		
		return true;	
	}
	else
	{
		IC_JS_Delete_ChildNodes('icwcms_curtain_id_box');
		return false;
	}	
}


function IC_JS_Change_Image(image_id, image_src)
{
	if (typeof(document.getElementById) != 'undefined') 
	{
		x = document.getElementById(image_id);
		x.src = image_src
		return true;
	}
	else
	{
		return false;
	}	
}

function IC_JS_Highlight_Row(theRow, theRowNum, theAction, Highlightcolor)
{
    var theCells = null;
    var newcolor    = Highlightcolor;
		   
    // Get the current row 
    if (typeof(document.getElementsByTagName) != 'undefined') 
	{
        theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') 
	{
        theCells = theRow.cells;
    }
    else 
	{
        return false;
    }
    
    var num_cell_rows  = theCells.length;   
    
	if (theAction == 'out') 
	{           
		newcolor    = '' ;		
    }
	// Sets the new color...	
	for (i = 0; i < num_cell_rows; i++) 
	{
		theCells[i].style.backgroundColor = newcolor;
	}
	
    return true;
} 

function IC_JS_Change_Value(ValueID, ToChangeID, Highlightcolor)
{
    var x = null;
   	var y = null; 
	var n_value = null; 
    if (typeof(document.getElementById) != 'undefined') 
	{
        x = document.getElementById(ValueID);
		n_value = x.value ;
		y = document.getElementById(ToChangeID);
		y.value = n_value;
		// Change the Border Color 
		IC_JS_Highlight_Textfield(ToChangeID, Highlightcolor);
		return true;
    }    
    else 
	{
        return false;
    }    
}




function IC_JS_Highlight_Textfield(fieldID, Highlightcolor)
{
    var x = null;
    var newcolor    = Highlightcolor;
	if (typeof(document.getElementById) != 'undefined') 
	{
        x = document.getElementById(fieldID);
    }    
    else 
	{
        return false;
	}    
	// Sets the new color...	
	//x.style.backgroundColor = newcolor;
	x.style.color = newcolor;	
    return true;
} 

function IC_JS_Highlight_Btn(btn_id, theAction, Highlightcolor)
{
    var x = null;
    var newcolor    = Highlightcolor;
	
    if (typeof(document.getElementById) != 'undefined') 
	{
        x = document.getElementById(btn_id);
    }    
    else 
	{
        return false;
	}   
        
	if (theAction == 'out') 
	{           
		newcolor    = 'transparent' ;				
    }
	// Sets the new color...	
	x.style.backgroundColor = newcolor;
	
    return true;
}

function IC_JS_Delete_Calender(display_box_id)
{
	if (typeof(document.getElementById) != 'undefined') 
	{
		var display_box = document.getElementById(display_box_id);		   	
    }    
    else 
	{
        return false;
		
    }
	// Delete all Child Nodes if available
	// Changes to the Nodlist changese the Index
	// Get initial number of Child nodes for the for Loop - and decrement
	var kids = display_box.childNodes;
	var num_kids = kids.length;
	if(num_kids != 0)
	{
		for(var i = num_kids-1; i >=0; i--)
		{
			display_box.removeChild(kids[i]);
		}
	}
	return true;
}

function IC_JS_Show_Calender(display_box_id, inputfield_id, displayfield_id, no_date_value_flag)
{
	if (typeof(document.getElementById) != 'undefined') 
	{
		var display_box = document.getElementById(display_box_id);
		if(display_box.style.display == "block")
		{
			// if Calender is displayed then hide displaybox and delete Calender
			display_box.style.display = "none";
			return (IC_JS_Delete_Calender(display_box_id));			
		}
		else
		{		
			//display displaybox and show Calender
			display_box.style.display = "block";
			IC_JS_Calender(display_box_id, inputfield_id, displayfield_id, no_date_value_flag);
		}		   	
    }    
    else 
	{
        return false;		
    }
}

function IC_JS_Insert_Calender_Value(display_box_id, insert_id, displayfield_id, value, user_display_value)
{
    var y = null; 
	if (typeof(document.getElementById) != 'undefined') 
	{
		y = document.getElementById(insert_id);
		y.value = value;
		
		x = document.getElementById(displayfield_id);
		x.value = user_display_value;
		/*
		var user_el = document.createElement("div");
		user_el.setAttribute("class", "icgui_calender_heading");
		user_el.appendChild(document.createTextNode(user_display_value));
		// put in front of display box
		var p_el_display_box = y.parentNode;
		p_el_display_box.appendChild(user_el);*/
		
		// Call Show function to decide to close'Delete' the Calender 
		IC_JS_Show_Calender(display_box_id, insert_id);
		return true;
    }    
    else 
	{
        return false;
    }    
} 
// Function to Build a Calender 
function IC_JS_Build_Calender(display_box_id, inputfield_id, displayfield_id, no_date_value_flag, selected_month, selected_year)
{
	if (typeof(document.getElementById) != 'undefined') 
	{
		var display_box = document.getElementById(display_box_id);		   	
    }    
    else 
	{
        return false;		
    }
	
	if(typeof(selected_month) == 'undefined') 
	{
		var dat = new Date();
		selected_month = dat.getMonth();
	}
	if(typeof(selected_year) == 'undefined')
	{
		var dat = new Date();
		selected_year = dat.getFullYear();
	}
	
	
	function IC_JS_Function_For_Calender_Date(display_box_id, inputfield_id, displayfield_id, db_value, label, user_display_value)
	{
		// ************** Important ...............
		var insert_f_name = "IC_JS_Insert_Calender_Value('"+display_box_id+ "','"+ inputfield_id+ "','"+displayfield_id + "','" + db_value+"','" +user_display_value+"');";
		//alert(user_display_value);
		var c_insertvalue = document.createElement("a");
		c_insertvalue.setAttribute("href", "#");
		c_insertvalue.setAttribute("onclick", insert_f_name);
		c_insertvalue.appendChild(document.createTextNode(label));
		// ************** Important ..............
		return c_insertvalue;
	}
	
	var days_in_month_array = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
	var f_name = "IC_JS_Calender(" + "'" + display_box_id + "','" + inputfield_id +"','"+displayfield_id + "','" + no_date_value_flag+"','icwcms_month_id' , 'icwcms_year_id' );";
	
	var c_month_year_box = document.createElement("div");
	c_month_year_box.setAttribute("class", "icgui_calender_heading");
	var c_form = document.createElement("form");
		var c_form_select = document.createElement("select");
		c_form_select.setAttribute("id", "icwcms_month_id");
		c_form_select.setAttribute("class", "icgui_calender_formfieldbold");
		// onchange btn is too fast
		c_form_select.setAttribute('onchange', f_name);
		for(var m_i = 0; m_i <= 11; m_i++)
		{
			var c_form_select_option = document.createElement("option");
			c_form_select_option.setAttribute("value", m_i);
			if(selected_month == m_i)
			{
				c_form_select_option.setAttribute("selected", "selected");
			}
			// put to Text Node 
			c_form_select_option.appendChild(document.createTextNode(str_month_array[m_i]));
			//put it to select Node
			c_form_select.appendChild(c_form_select_option);
		}
	c_form.appendChild(c_form_select);
	
		var c_form_select = document.createElement("select");
		c_form_select.setAttribute("id", "icwcms_year_id");
		c_form_select.setAttribute("class", "icgui_calender_formfieldbold");
		// onchange btn is too fast		
		c_form_select.setAttribute('onchange', f_name);
		for(var y_i = 0; y_i < 5; y_i++)
		{
			var c_form_select_option = document.createElement("option");			
			var dat  = new Date();			
			var next_year = dat.getFullYear() + y_i;
			c_form_select_option.setAttribute("value", next_year);
			if(selected_year == next_year)
			{
				c_form_select_option.setAttribute("selected", "selected");
			}
			// put to Text Node 
			c_form_select_option.appendChild(document.createTextNode(next_year));
			//put it to select Node
			c_form_select.appendChild(c_form_select_option);
		}		
	c_form.appendChild(c_form_select);
	
		var c_form_btn = document.createElement("button");
		c_form_btn.setAttribute('type', 'button');
		c_form_btn.setAttribute('title', 'select');
		c_form_btn.setAttribute("class", "icgui_calender_formbutton");
		c_form_btn.setAttribute('onclick', f_name);
		c_form_btn.appendChild(document.createTextNode('__'));		
	c_form.appendChild(c_form_btn);
		
	c_month_year_box.appendChild(c_form);
	
	// ###########################
	// Delete all Child Nodes if available
	// Changes to the Nodlist changese the Index
	// Get initial number of Child nodes for the for Loop - and decrement
	var kids = display_box.childNodes;
	var num_kids = kids.length;
	if(num_kids != 0)
	{
		for(var i = num_kids-1; i >=0; i--)
		{
			display_box.removeChild(kids[i]);
		}
	}
	// Put New Node to Display box
	display_box.appendChild(c_month_year_box);
	
	// ###########################	
	
	// Create table
	var c_tbl = document.createElement("table");
	c_tbl.setAttribute("class", "icgui_calender_tbl");
	// create table heading and put it to table
	var c_tbl_thead = document.createElement("thead");
	c_tbl.appendChild(c_tbl_thead);
		
	var c_tr = document.createElement("tr");
	for(var th_i = 0; th_i <= 6; th_i++)
	{
		var c_th = document.createElement("th");
		c_th.setAttribute("class", "icgui_calender_tbl_th");
		c_th.appendChild(document.createTextNode(str_week_array[th_i]));
		// put to row
		c_tr.appendChild(c_th);		
	}
	// put Row to Table head
	c_tbl_thead.appendChild(c_tr);	
	
	// *******************************
	// create table body and put it to table
	var c_tbl_tbody = document.createElement("tbody");
	c_tbl.appendChild(c_tbl_tbody);
		
	var days_in_month = days_in_month_array[selected_month];	
	// Check leapyear
	// Check if selected month is February 'index 1'
	if (((0 == (selected_year%4)) && ( (0 != (selected_year%100)) || (0 == (selected_year%400)))) && selected_month == 1)
	{
		days_in_month = 29;
	}
	var tr_closed = 0;
	for(var day_counter = 1; day_counter <= days_in_month;  day_counter ++ )
	{		
		var now_date = new Date(selected_year, selected_month, day_counter,0,0,0,0);
		var db_value  = now_date.getFullYear()+"-" + (parseInt(now_date.getMonth() +1) ) +"-" + now_date.getDate();
		var user_display_value = now_date.toLocaleString();
		if(tr_closed == 0)
		{
			var c_tr = document.createElement("tr");
			tr_closed = 1;
		}
		if(day_counter == 1)
		{
			var colsbefore = now_date.getDay() ;								
			for(var ci =1; ci <= colsbefore; ci++ )
			{				 
				 var c_td = document.createElement("td");
				 c_td.setAttribute("class", "icgui_calender_tbl_td_empty");
				 c_td.appendChild(document.createTextNode(" * "));
				// put empty cells to row
				c_tr.appendChild(c_td);				 
			}
		}		
		
		var c_td = document.createElement("td");
		// make Sunday and Saturday BG Grey (different CSS)
		// Default
		var icgui_calender_tbl_td_css = "icgui_calender_tbl_td";
		if( (now_date.getDay()== 0) || (now_date.getDay()== 6)) 
		{
			icgui_calender_tbl_td_css = "icgui_calender_tbl_td_weekend";
		}
		
		c_td.setAttribute("class", icgui_calender_tbl_td_css);
			// ************** Important ...............
			var f_for_date = IC_JS_Function_For_Calender_Date(display_box_id, inputfield_id, displayfield_id, db_value, day_counter, user_display_value);
			// ************** Important ..............
		c_td.appendChild(f_for_date);
		c_tr.appendChild(c_td);
		
		// Emty cells at the end
		if(day_counter == days_in_month)
		{
			var colsafter = 6 - now_date.getDay();
			for(var ci =1; ci <= colsafter; ci++ )
			{				 
				 var c_td = document.createElement("td");
				 c_td.setAttribute("class", "icgui_calender_tbl_td_empty");
				 c_td.appendChild(document.createTextNode(" * "));
				 // put empty cells to row
				 c_tr.appendChild(c_td);				 
			}
		}
				
		if( ( now_date.getDay() == 6) || (day_counter == days_in_month) )
		{			
			// put the row to table body
			// set flag to start a new row  
			c_tbl_tbody.appendChild(c_tr);
			tr_closed = 0;			
		}			
	}
	// *******************************
	// put the Table Element to the calender box
	display_box.appendChild(c_tbl);
	
	// ********************
	// Check for No Date Input required
	
	if(no_date_value_flag == "yes")
	{
		var c_no_date = document.createElement("div");
		c_no_date.setAttribute("class", "icgui_calender_no_date");
		var f_for_date = IC_JS_Function_For_Calender_Date(display_box_id, inputfield_id, displayfield_id, '0000-00-00', str_no_date, '00.00.0000');
		// ************** Important ..............
		c_no_date.appendChild(f_for_date);
		// put the Element to the calender box
		display_box.appendChild(c_no_date);			 
	}
	// ********************	
} 

// Function to display a Calender
function IC_JS_Calender(display_box_id, inputfield_id, displayfield_id, no_date_value_flag, month_id, year_id)
{
	
	if(typeof(month_id) == 'undefined') 
	{
		var dat = new Date();
		selected_month = dat.getMonth();
	}
	else
	{
		x = document.getElementById(month_id);
		selected_month = x.value;
	}
	if(typeof(year_id) == 'undefined')
	{
		var dat = new Date();
		selected_year = dat.getFullYear();
	}
	else
	{
		y = document.getElementById(year_id);
		selected_year = y.value;
	}
	// call Calender Builder
	// Check for MSIE 
	if((document.all) && (navigator.appName.indexOf("Microsoft") != -1))
	{
		IC_JS_MSIE_Build_Calender(display_box_id, inputfield_id, displayfield_id, no_date_value_flag, selected_month, selected_year);
	}
	else
	{
		IC_JS_Build_Calender(display_box_id, inputfield_id, displayfield_id, no_date_value_flag, selected_month, selected_year);
	}
}

function IC_JS_Image_Gallery_Selected_Image(img_id, img_src, info_display_box, info_from_box)
{
	if(!IC_JS_Change_Image(img_id, img_src))
	{
		return false;
	}
	if(IC_JS_Delete_ChildNodes(info_display_box))
	{
		return(IC_JS_Replace_Child(info_display_box, info_from_box));
	}
	else
	{
		return false;
	}   	

}

function IC_JS_Equalize_boxheight(box_to_id, box_from_id)
{

	if (typeof(document.getElementById) != 'undefined') 
	{
        x = document.getElementById(box_to_id);
		y = document.getElementById(box_from_id);		
	}    
    else 
	{
        return false;		
    } 
	
	if((document.all) && (navigator.appName.indexOf("Microsoft") != -1))
	{
		// MSIE
		var to_box_size_height =  parseInt(x.currentStyle.height.slice(0,-2));
		var box_size_height =  parseInt(y.currentStyle.height.slice(0,-2));
						
	}
	else
	{
		var to_box_size_height =  parseInt(window.getComputedStyle(x, null).height.slice(0,-2));
		var box_size_height =  parseInt(window.getComputedStyle(y, null).height.slice(0,-2));				
	}
	//alert(box_size_height );
	// set the height 
	if(to_box_size_height < box_size_height)
	{
		x.style.height = box_size_height + "px";
	}
		
}


function IC_JS_Flowchart_Explorer(info_box_id , theAction, hint_msg_id, image_id, image_src)
{
	// Default action	
	var showhide = 'visible';
	
	
	if (typeof(document.getElementById) != 'undefined') 
	{
        x = document.getElementById(info_box_id);				
	}    
    else 
	{
        return false;		
    }
	
	IC_JS_Change_Image(image_id, image_src);
	
	if (theAction == 'hide') 
	{           
		x.style.visibility = 'hidden' ;
		 return true;				
    }
	else
	{
		IC_JS_Create_Info_Block(info_box_id, hint_msg_id);
		
		x.style.visibility = 'visible';
		//IC_JS_Fade(x, 12);
		return true;			
	}
	
	
			
    return false;
		
}

function IC_JS_Hide_Element(box_id, theAction)
{
	// Default action	
	var showhide = 'visible';
	
	
	if (typeof(document.getElementById) != 'undefined') 
	{
        x = document.getElementById(box_id);				
	}    
    else 
	{
        return false;		
    }
	
	
	
	if (theAction == 'hide') 
	{           
		x.style.visibility = 'hidden' ;
		 return true;				
    }
	else
	{
				
		x.style.visibility = 'visible';
		//IC_JS_Fade(x, 12);
		return true;			
	}	
			
    return false;
		
}


