// JavaScript Document 

var sender='';

var maxx;
var maxy;

function go(gostr){
	window.location=gostr;
}

function goform(gostr){
	parent.form.location=gostr;
}

function kerdes_dialog(kerdesstr,gostr)
{
 var where_to= confirm(kerdesstr);
 if (where_to==true)
 {
   window.location=gostr;
 }
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function error_msg(msg){
	alert(msg);
}

function chg_obj_class(obj_id,classn){
	document.getElementById(obj_id).className=classn;
}


function set_elem_val(obj_id,nval){
	document.getElementById(obj_id).value=nval;
}

function get_elem_val(obj_id){
	return document.getElementById(obj_id).value;
}

function show_editor(sender_id,editor_id){
	chg_obj_class('editor','objdisp');
	txt=get_elem_val(sender_id);
	tinyMCE.execInstanceCommand('elm1', 'mceSetContent',false,txt);
	//tinyMCE.setContent(txt);
	sender=sender_id;
}

function save_editor(){
	txt=get_elem_val('elm1');
	set_elem_val(sender,tinyMCE.getContent('elm1'));
	//alert(sender);
	sender='';
	chg_obj_class('editor','objhide');
}

function on_row(obj){
	obj.className='selrow';	
}

function off_row(obj){
	obj.className='notselrow';	
}

function chg_class(objid,nclass){
	objid.className=nclass;
}

function chg_class_mnu(objid,nclass,src){
	objid.className=nclass;
	objid.style.background='url('+site+'design/'+src+')';
}


function fill_field(fieldid,idv,namev){
	document.getElementById(fieldid).value=idv;
	document.getElementById(fieldid+'_name').value=namev;
	
}

function load_php(div,www){
	var url=www+'&ext=noframe';
	
	var pars='';
	var target=div;
	var myAjax=new Ajax.Updater(
								target,
								url,
								{
									method: 'get', 
									parameters: pars
									
								}
								);
}

function submit_divform(wwwstr,formid,divid){
	
	var url=wwwstr+'noframe/';
	var pars=Form.serialize(formid);
	Form.reset(formid);
	//alert(pars);
	var target=divid;
	var myAjax=new Ajax.Updater(
								target,
								url,
								{
									method: 'post', 
									parameters: pars
									
								}
								);
}

function openclose_dir(did,level){
	sel_level=level+1;
	obj=document.getElementById('d'+did+'_'+sel_level);
	iobj=document.getElementById('i'+did+'_'+level);
	if (obj.className=='showdir'){
			obj.className='hidedir';
			iobj.src='design/tree_plussz.jpg';
			
	}else {
		obj.className='showdir';
		iobj.src='design/tree_min.jpg';
		}		

}

function alertSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    maxx = window.innerWidth;
    maxy = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    maxx = document.documentElement.clientWidth;
    maxy = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    maxx = document.body.clientWidth;
    maxy = document.body.clientHeight;
  }
  //window.alert( 'Width = ' + maxx );
  //window.alert( 'Height = ' + maxy );
}

function show_bigpic(i){
	
	if (document.getElementById('bigimg_'+i).style.width=='130px') document.getElementById('bigimg_'+i).style.width='300px';
	 else document.getElementById('bigimg_'+i).style.width='130px'
	
}



