// JavaScript Document

function DisplayImage(picURL,picWidth,picHeight){
var lw = screen.availWidth/2 - picWidth/2;
var lh = screen.availHeight/2 - picHeight/2;
newWindow=window.open(picURL,'newWin','left='+lw+',top='+lh+',toolbar=no,width='+picWidth+',height='+picHeight)
newWindow.document.write('<html><head><\/head><body background="'+picURL+'" style="background-repeat: no-repeat; background-position: center; width: 821px; height: 664px;"><\/body><\/html>')

newWindow.resizeBy(picWidth-newWindow.document.body.clientWidth,picHeight-newWindow.document.body.clientHeight)
newWindow.focus()
}

// Display Flash
function DisplayFlash(flaURL,flaWidth,flaHeight) {
  var lw = screen.width/2 - flaWidth/2;
  var lh = screen.height/2 - flaHeight/2;
  newWindow = window.open(flaURL,'newWin','left='+lw+',top='+lh+',toolbar=no,resizable,width='+flaWidth+',height='+flaHeight);
  newWindow.focus();
}

function items(obj) {
	if (document.getElementById) {   
	    if (document.getElementById(obj)) {
		    return document.getElementById(obj);
		} else {
		    return false;
		}
	}
	else if (document.all) {
		return eval('document.all.' + obj);
	}
	else if (document.layers) {
		return eval('document.layers[' + obj+']');
	}
	else {
		return false;
	}
}


function showForm() {
	var obj = items('vid');
	if (obj) {
		var n = obj.options[obj.selectedIndex].value;
		switch(n) {
			case '1':
				hide('ofset');
				show('flekso');
				hide('cifro');
				show('sparams');
			break;
			
			case '2':
				show('ofset');
				hide('flekso');
				hide('cifro');
				hide('sparams');
			break;

			case '3':
				hide('ofset');
				hide('flekso');
				show('cifro');
				show('sparams');
			break;

			default:
				hide('ofset');
				hide('flekso');
				hide('cifro');
				hide('sparams');
			break;
		}
	}
}

function showParams() {
	var obj = items('params');
	if (obj) {
		var n = obj.options[obj.selectedIndex].value;
		switch(n) {
			case '1':
				show('pform');
			break;
			case '0':
				hide('pform');
			break;
		}
	}
}

function show(src) {
	obj = items(src);
	if (obj) {
		obj.style.display = '';
	}
}

function hide(src) {
	obj = items(src);
	if (obj) {
		obj.style.display = 'none';
	}
}

function toggleDisplay(me){
	if(document.getElementById(me).style.display == "none") {
		document.getElementById(me).style.display = "block";
	} else {
		document.getElementById(me).style.display = "none";
	}
	return false;
}
