// JavaScript Document
//===============  COMMON ========================

function check_style(element)
{
		if(window.event.type=='mouseover')
		{
			element.oClassName=element.className;
			element.className=element.className+'_hover';
		}
		else if(window.event.type=='mouseout')
		{
					element.className=element.oClassName;
		}
}

//=========================================================
	
function submit_form(form_id)
{
		try{
			//alert('a');
			document.getElementById(form_id).submit();	
		}catch(e){}	
}


//=========================================================

function go_to_caption_editor(caption,lang)
{
	
	var w;
	var o=null;
	try{
		w=window.open('/?wp=7&lg='+lang+'#'+caption,'w_admin'); 
		w.focus();
		o=w.document.getElementById(caption);
		if(!o){
				//o=w.document.getElementById('goto_site_title');
				w.window.document.location.hash='goto_site_title';		
		}
 		else o.select();

 		
	try{
	
		window.top.show_my_tabNo('1');
	}
	catch(ex){}
 		
 		
 		
 		
	}catch(e){}
	
	
	
}


//===============  ADDITIONAL ========================

//=========================================================

function mark_main_menu_unit(e)
{
	try
	{
		e.style.backgroundColor='#2F3766';
	}
	catch(ex){}
}

//=========================================================

function unmark_main_menu_unit(e)
{
	try
	{
		e.style.backgroundColor='transparent';
	}
	catch(ex){}
}


/**** FOR INTRO PAGE *****************/
function mark_add_menu_unit(id)
{
	try{
		/*document.getElementById('smu_'+id).style.backgroundColor='#FBD6D6';*/
		
		document.getElementById('smuimg_'+id).src='/img/intro_pointerhover.gif';
	}
	catch(e){}	
	
}

//=========================================================

function unmark_add_menu_unit(id)
{
	try{
		/*document.getElementById('smu_'+id).style.backgroundColor='#FFFFFF';*/
		document.getElementById('smuimg_'+id).src='/img/intro_pointer.gif';
	}
	catch(e){}	
	
}

//=========================================================

function resizeImgWin(im)
{
	var imH=im.height;
	var imW=im.width;
	
	//var w=window.document.offsetX;
	//alert(window.document.body.offsetWidth);
	
	
	//alert(imH);
	
	if(imH>600)imH=500;
	
	window.resizeTo(window.document.body.offsetWidth,imH+100);
}




//===================================
function disable_w_layer(){
	
	var obj=document.getElementById('w_output');
	var lockobj=document.getElementById('lock_frm');
	lockobj.style.height=obj.offsetHeight;
	lockobj.style.display="block";
	
	//document.body.style.overflow="hidden";
	
	
}	


//=========================================================

function show_loading(){
	var o=document.getElementById('loading_frm');
	o.style.display="block";
}	

//=========================================================

function hide_loading(){
	var o=document.getElementById('loading_frm');
	o.style.display="none";
}	



var waitToShowFrm=0;

//=========================================================

function frm_ready_to_show(obj)
{
	if(waitToShowFrm>0)
	{
		//alert(0);
		hide_loading();
		obj.style.display='block';
		waitToShowFrm--;
		
	}
}

//=========================================================

function scroll_output_frm()
{
	
		
		
		window.setTimeout('moveElements()',10);
		
}	

//=========================================================

function moveElements()
{
	try{

		var obj=document.getElementById('system_menu');
		obj.style.top=document.body.scrollTop +0+"px";
	}
	catch(ex){alert(ex.toString)}
}
	




