// JavaScript Document
(
	function(){
		var UA=navigator.userAgent;
		is_ie=/msie/i.test(UA)&&!(/opera/i.test(UA))&&!(/mac_powerpc/i.test(UA));
		is_khtml=/Konqueror|Safari|KHTML/i.test(UA);
		is_gecko=/gecko/i.test(UA)&&!is_khtml;
	}
)();

function roll(a) {
	a.style.cursor='pointer';
	if (a.className.substr((a.className.length-1),1) == 'n') {b='o';}
	else {b='n';}
	a.className=a.className.substr(0,(a.className.length-1))+b;
}

function rollo(a){
	if(bubble_start_working) {
		if (a.className.substr((a.className.length-2),2) == '_o')
			a.className=a.className.substr(0,(a.className.length-2));
		else
			a.className=a.className+'_o';
	}
}

function rollId(a) {
	if(bubble_start_working) {
		if (a.id.substr((a.id.length-1),1) == 'n') {b='o';}
		else {b='n';}
		a.id = a.id.substr(0,(a.id.length-1))+b;
	}
}

function check_numbers_input(a) {
	b = '';
	for (i=0;i<a.value.length;i++) {
		if ( (!isNaN(a.value.substr(i,1)) && a.value.substr(i,1) != ' ') || (a.value.substr(i,1) == '.' && a.value.indexOf('.')==i) || (a.value.substr(i,1) == '-' && i==0) ) {
			b += a.value.substr(i,1);
		}
	}
	if(a.value != b)
		a.value = b;
}

function rollimg(a) {
	if(bubble_start_working) {
		a.style.cursor = 'pointer';
		ext = a.src.substr((a.src.length-4),4);
		state = a.src.substr((a.src.length-6),2);
		if (state == '_o')
			a.src = a.src.substr(0,(a.src.length-6))+ext;
		else
			a.src = a.src.substr(0,(a.src.length-4))+'_o'+ext;
	}
}

function showHide( obj ) {
	if(document.getElementById(obj).style.display == 'none') {
		document.getElementById(obj).style.display='block';
		document.getElementById('ico_'+obj).src='images/ico_minus.jpg';
	}
	else {
		document.getElementById(obj).style.display='none';
		document.getElementById('ico_'+obj).src='images/ico_plus.jpg';
	}
}

function insert_flash (){
	parameters = '';
	file = '';
	id = '';
	width = '';
	height = '';
	bgcolor = '#ffffff';
	wmode = 'transparent';
	scale = 'showAll';
	
	for(var i=0; i<arguments.length; i++){
	    arg = arguments[i].split('=');
	  	if (arg[0] == 'file'){file = arg[1]}
		else if (arg[0] == 'id'){id = arg[1]}
		else if (arg[0] == 'width'){width = arg[1]}
		else if (arg[0] == 'height'){height = arg[1]}
		else if (arg[0] == 'bgcolor'){bgcolor = arg[1]}
		else if (arg[0] == 'wmode'){wmode = arg[1]}
		else if (arg[0] == 'scale'){scale = arg[1]}
		else {parameters += arguments[i] + '&'}
	}
	//alert(file + '\n' + HTMLobj + '\n' + width + '\n' +height + '\n' +bgcolor + '\n' +wmode + '\n' +parameters);
	document.getElementById(id).innerHTML = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+width+'" height="'+height+'" id="temp" align="middle">'+
	'<param name="allowScriptAccess" value="sameDomain" />'+
	'<param name="movie" value="'+file+'" />'+
	'<param name="quality" value="high" />'+
	'<param name="bgcolor" value="'+bgcolor+'" />'+
	'<param name="wmode" value="'+wmode+'" />'+
	'<param name="scale" value="'+scale+'" />'+
	'<param name="FlashVars" value="'+parameters+'">'+
	'<embed src="'+file+'" FlashVars="'+parameters+'" quality="high" wmode="'+wmode+'" scale="'+scale+'" bgcolor="'+bgcolor+'" width="'+width+'" height="'+height+'" name="temp" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'+
	'</object>';
}

/*--------[ bubble help ]-------------*/
var Xoffset = -80;
var Yoffset = 20;
var timedelay, skn, b_height, b_width; 
var bubble_start_working = false;

function bubble_set() {
 //document.body.innerHTML += '<div id="bubble" style="visibility:hidden; display:none; left:400px; top:200px; position:absolute; z-index:1;"></div>';
 document.onmousemove = bubble_move;
 skn = document.getElementById("bubble").style;
 skn.visibility="visible";
 skn.display="none";
 bubble_start_working = true;
}

function bubble(msg,width,height) {
 if(bubble_start_working) {
  var content = msg;
  b_width = width;
  b_height = height;
  document.getElementById("bubble").innerHTML=content;
  skn.display='';
  //b_height = document.getElementById("bubble").offsetHeight;
  //b_width = document.getElementById("bubble").offsetWidth;
  document.getElementById("bubble").style.width = b_width+'px';
  document.getElementById("bubble").style.height = b_height+'px';
 }
}

function bubble_move(e) {
 if(bubble_start_working) {
  if(is_ie)
   e=event;
  
  b_height = document.getElementById("bubble").offsetHeight;
  b_width = document.getElementById("bubble").offsetWidth;
  var xScroll = (document.all) ? (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) : window.pageXOffset;
  var yScroll = (document.all) ? (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) : window.pageYOffset;
  
  var x = e.clientX + xScroll;
  var y = e.clientY + yScroll;

  var xBorder = document.body.clientWidth + xScroll;
  var yBorder = document.body.clientHeight + yScroll;

  var temp_x = x + Xoffset;
  if(temp_x < 1)
   temp_x = 1;
  if( (temp_x+b_width) > xBorder )
   temp_x = document.body.clientWidth - b_width;
  skn.left = temp_x + 'px';
  var temp_y = y + Yoffset;
  if( (temp_y+b_height) > yBorder )
   temp_y = y - b_height - 10;
  skn.top = temp_y + 'px';
 }
}

function bubble_kill() {
 if(bubble_start_working) {
  clearTimeout(timedelay);
  skn.display="none"
 }
}
/*--------[ bubble help end ]-------------*/

function text_bubble( text ) {
 content = '<div style="background-color:#f7f9ff; padding:5px; font-family:Verdana, Arial, Helvetica, sans-serif; border:solid 1px #e4e2ee; color:#311e79; font-size:11px;">'+text+'</div>';
 bubble(content,500,110);
}
