// JavaScript Document
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>';
}
