
/* Optimization of a html code */
window.onload = function(){
	if (!document.getElementsByTagName) return;
	var anchors = document.getElementsByTagName('a');
	for (var i=0; i < anchors.length; i++){
		if (anchors[i].getAttribute('href') && anchors[i].getAttribute('target') == '_blank'){
			anchors[i].rel = 'external';
		}
	}
	var imghors = document.getElementsByTagName('img');
	for (var i=0; i < imghors.length; i++){
		if (imghors[i].getAttribute('alt')){
			imghors[i].title = imghors[i].alt;
		}
	}
}


var wl = window.onload ? window.onload : function(){};
window.onload = function(){
 wl();
 if (!document.getElementsByTagName) return;
 var spanhors = document.getElementsByTagName('div');
 for (var i=0; i < spanhors.length; i++){
  if (spanhors[i].className == 'jsDisplayNone'){
   spanhors[i].style.display = 'none';
  }
 }
 var spanhors = document.getElementsByTagName('span');
 for (var i=0; i < spanhors.length; i++){
  if (spanhors[i].className == 'jsDisplayNone'){
   spanhors[i].style.display = 'none';
  }
 }
 var field_l = document.getElementById('field_left');
 var field_r = document.getElementById('field_right');
 var area = document.getElementById('work_area');
 var work = document.getElementById('work');
 var docHeight = (document.documentElement.clientHeight||document.body.clientHeight||window.innerHeight)-4;
 var fieldHeight = (field_r.innerHeight||field_r.clientHeight);
 docHeight = (docHeight>=fieldHeight) ? docHeight : fieldHeight;
 area.style.minHeight = (docHeight-363)+'px';
 field_l.style.minHeight = docHeight+'px';
 field_r.style.minHeight = docHeight+'px';
// alert(field_r);
}


function timestart(){
	var myDate = new Date();
	var mili = myDate.getMilliseconds();
	document.getElementById('new').value=mili;
}
function timeend(){
	var myDate = new Date();
	var mili=myDate.getMilliseconds();
	alert((mili-document.getElementById('new').value)/1000);
}


function read_more(id,button,title1,title2){
	var eliment = document.getElementById(id);
	if (eliment.style.display == ''){
		eliment.style.display = 'none';
		button.value = title1;
		button.title = title1;
	} else {
		eliment.style.display = '';
		button.value = title2;
		button.title = title2;
	}
}



