// JavaScript Functions
function test(){
	alert("test");
}

function change_lang(id)
{
	window.location="index.php?lang="+id;
}

//get object
function getObject(id) { 
	return document.getElementById(id); }
	
//expandable menus
function toggle(link, divId) {
	var lText = link.innerHTML;
	var d = getObject(divId);
	
	if (d.style.display == 'block') d.style.display = 'none';
	else d.style.display = 'block';
//	if (lText == '+') { link.innerHTML = '-'; d.style.display = 'block'; }	
//	else { link.innerHTML = '+'; d.style.display = 'none'; }
}

//general ajax, used for updating status, others
function doAction(actionid,addendum){ 
	var tmp_var;
	tmp_var=actionid;
	document.getElementById("show").innerHTML="<img src='site_images/core/ajax_loading.gif'>";
	$.post("inlinefunctions.php?actionid="+actionid+addendum, {val: document.getElementById("inputText").value},
	function(data){
	document.getElementById("show").innerHTML=data;
	document.getElementById("show2").innerHTML="&nbsp;<img src=site_images/core/action_done.gif width=20 height=20>";;
	});
}

//same but for iframes
function iframe_doAction(actionid,addendum){ 
	document.getElementById("show").innerHTML="<br><img src='../../site_images/core/ajax_loading.gif'>";
	$.post("inlinefunctions.php?actionid="+actionid+addendum, {val: document.getElementById("inputText").value},
	function(data){
	document.getElementById("show").innerHTML=data;
	document.getElementById("show2").innerHTML="&nbsp;<img src=site_images/core/action_done.gif width=20 height=20>";;
	});
}

function iframe_ScodeAction(actionid,addendum){ 
	document.getElementById("show").innerHTML="<br><img src='../../site_images/core/ajax_loading.gif'>";
	$.post("inlinefunctions.php?actionid="+actionid+addendum, {val: ""},
	function(data){
	document.getElementById("show").innerHTML=data;
	document.getElementById("show2").innerHTML="&nbsp;<img src=site_images/core/action_done.gif width=20 height=20>";;
	});
}

//toggling color for form objects (when on focus)
function toggleColor(objElement)
{
  if (objElement.className=='form_inputs_generic')
    objElement.className='form_inputs_generic_over';
  else
    objElement.className='form_inputs_generic';
}
function toggleColor2(objElement)
{
  if (objElement.className=='form_textarea_generic')
    objElement.className='form_textarea_generic_over';
  else
    objElement.className='form_textarea_generic';
}

function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,locationbar=0,scrollbars=0,statusbar=0,menubar=0,resizable=0,width=700,height=100,left=290,top=350');");
}