function printPage() {
window.print();
window.close();
}

function SendSearch(etsi, dbname, cate, np) { 
if (etsi.value.length<1) {
return false;
}
else {
window.location= dbname.value + "/SearchResults?SearchDomain&Query=(%5BDbCategories%5D%20CONTAINS%20(%22" + cate.value + "%22))%20AND%20(("+ etsi.value + ")%20AND%20(DSOKX38A47))&SearchEntry=DetailedResultEntry&SearchOrder=1&Start=1&Count=20&np="+ np.value ;
return false; }
}

function Trim(TRIM_VALUE){
if(TRIM_VALUE.length < 1){
return"";
}
TRIM_VALUE = RTrim(TRIM_VALUE);
TRIM_VALUE = LTrim(TRIM_VALUE);
if(TRIM_VALUE==""){
return "";
}
else{
return TRIM_VALUE;
}
} //End Function

function RTrim(VALUE){
var w_space = String.fromCharCode(32);
var v_length = VALUE.length;
var strTemp = "";
if(v_length < 0){ return""; }
var iTemp = v_length -1;
while(iTemp > -1){
if(VALUE.charAt(iTemp) == w_space){
}
else{
strTemp = VALUE.substring(0,iTemp +1);
break;
}
iTemp = iTemp-1;
} //End While
return strTemp;
} //End Function

function LTrim(VALUE){
var w_space = String.fromCharCode(32);
if(v_length < 1){ return""; }
var v_length = VALUE.length;
var strTemp = "";
var iTemp = 0;
while(iTemp < v_length){
if(VALUE.charAt(iTemp) == w_space){
}
else{
strTemp = VALUE.substring(iTemp,v_length);
break;
}
iTemp = iTemp + 1;
} //End While
return strTemp;
} //End Function

function getRadioValue(rb) {
	i = 0;
	do {
		i ++; }
	while (!rb[i-1].checked);
	arvo = frm.oper1[i-1].value;
	return arvo;
}


function isDefined(property) {
return (typeof property != 'undefined');
}


var flashVersion = 0;

function getFlashVersion() {
var latestFlashVersion = 8;
var agent = navigator.userAgent.toLowerCase();

// NS3 needs flashVersion to be a local variable
if (agent.indexOf("mozilla/3") != -1 && agent.indexOf("msie") == -1)
{
flashVersion = 0;
}
// NS3+, Opera3+, IE5+ Mac (support plugin array):  check for Flash plugin in plugin array
if (navigator.plugins != null && navigator.plugins.length > 0) {
var flashPlugin = navigator.plugins['Shockwave Flash'];
if (typeof flashPlugin == 'object') {
for (var i = latestFlashVersion; i >= 3; i--) {
if (flashPlugin.description.indexOf(i + '.') != -1) {
flashVersion = i;
break;
}
}
}
}
// IE4+Win32:  attempt to create an ActiveX object using VBScript
else if (agent.indexOf("msie") != -1 && parseInt(navigator.appVersion) >= 4 && agent.indexOf("win")!=-1 && agent.indexOf("16bit")==-1) {
var doc = '<scr' + 'ipt language="VBScript"\> \n';
doc += 'On Error Resume Next \n';
doc += 'Dim obFlash \n';
doc += 'For i = ' + latestFlashVersion + ' To 3 Step-1 \n';
doc += '   Set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash." & i) \n';
doc += '   If IsObject(obFlash) Then \n';
doc += '      flashVersion = i \n';
doc += '      Exit For \n';
doc += '   End If \n';
doc += 'Next \n';
doc += '</scr' + 'ipt\> \n';
document.write(doc);
}

// WebTV 2.5 supports flash 3
else if (agent.indexOf("webtv/2.5") != -1) flashVersion = 3;
// older WebTV supports flash 2
else if (agent.indexOf("webtv") != -1) flashVersion = 2;
// Can't detect in all other cases
else {
flashVersion = flashVersion_DONTKNOW;
}
return flashVersion;
}

flashVersion_DONTKNOW = -1;
flashVersion = getFlashVersion();

/**
*  Javascript Flash-plugin detector and a class to generate HTML for Flash movies 
*
*  @author Toni Suokas <toni@apaja.com>
*  @version 0.7
*  @copyright (c)2004-2006 Apaja Creative Solutions Oy
*/

var nflashInstalled = 0;
var nflashVersion = 0;
MSDetect = 'false';

if (navigator.plugins && navigator.plugins.length) {
	x = navigator.plugins["Shockwave Flash"];
	y = navigator.plugins["Shockwave Flash (CrossOver - NPSWF32.dll)"];

	if (x) {
		nflashInstalled = 2;
		if (x.description) {
			z = x.description;
			nflashVersion = z.charAt(z.indexOf('.')-1);
		}
	} else if( y) {
		nflashInstalled = 2;
		if (y.description) {
			z = y.description;
			nflashVersion = z.charAt(z.indexOf('.')-1);
		}
	} else {
		nflashInstalled = 1;
	}

	if (navigator.plugins["Shockwave Flash 2.0"]) {
		nflashInstalled = 2;
		nflashVersion = 2;
	}
} else if (navigator.mimeTypes && navigator.mimeTypes.length) {
	x = navigator.mimeTypes['application/x-shockwave-flash'];
	if (x && x.enabledPlugin)
		nflashInstalled = 2;
	else
		nflashInstalled = 1;
} else {
        MSDetect = "true";
}

if (MSDetect == "true") {
	document.write('<scr' + 'ipt language="VBScript">\n');
	document.write('on error resume next\n');
	document.write('For i = 2 to 6\n');
	document.write('        If Not(IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & i))) Then\n');
	document.write('        Else\n');
	document.write('                nflashInstalled = 2\n');
	document.write('                nflashVersion = i\n');
	document.write('        End If\n');
	document.write('Next\n');
	document.write('If nflashInstalled = 0 Then\n');
	document.write('        nflashInstalled = 1\n');
	document.write('End If\n');
	document.write('</scr' + 'ipt>\n');
}

function Flash(flashFile) {
	this.flashFile = flashFile
	this.width = 0;
	this.height = 0;
	this.bgColor = '';
	this.minVersion = 6;
	this.backupImage = '';
	this.alternateContent = '';
	this.objectId = '';
	this.parameters = new Array();
	this.setWidth = Flash.setWidth;
	this.setHeight = Flash.setHeight;
	this.setBgColor = Flash.setBgColor;
	this.setMinVersion = Flash.setMinVersion;
	this.setBackupImage = Flash.setBackupImage;
	this.setAlternateContent = Flash.setAlternateContent;
	this.addParameter = Flash.addParameter;
	this.setId = Flash.setId;
	this.output = Flash.output;
}

Flash.addParameter = function (myKey, myValue, myEscape){
	if(myEscape == true){
		parameter = myKey + '=' + escape(myValue);
	}else{
		parameter = myKey + '=' + myValue;
	}
	arrayPush(this.parameters, parameter);
}

Flash.setWidth = function (myWidth) {
	this.width = myWidth;
}
Flash.setHeight = function (myHeight) {
	this.height = myHeight;
}
Flash.setBgColor = function (myColor) {
	this.bgColor = myColor;
}
Flash.setMinVersion = function (myVersion) {
	this.minVersion = myVersion;    
}
Flash.setBackupImage = function (myImage) {
	this.backupImage = myImage;
}
Flash.setAlternateContent = function (myContent) {
	this.alternateContent = myContent;
}

Flash.setId = function (myId){
	this.objectId = myId;
}

Flash.output = function() {

	if(this.parameters.length > 0){
		this.flashFile += '?' + this.parameters[0];
		for(i = 1; i < this.parameters.length; i++){
			this.flashFile += '&' + this.parameters[i];
		}
	}

	if (nflashInstalled == 2 && nflashVersion >= this.minVersion) {
		document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
		if (this.objectId != '') {
			document.write(' id="'+ this.objectId +'"');
		}
		document.write(' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"');
		document.write(' width="' + this.width + '" height="' + this.height + '">\n');
		document.write('<param name="movie" value="' + this.flashFile + '" />\n');
		document.write('<param name="quality" value="high" />\n');
		document.write('<param name="menu" value="false" />\n');
		document.write('<param name="bgcolor" value="' + this.bgColor + '" />\n');
		document.write('<embed src="' + this.flashFile + '"');
		document.write(' quality="high" bgcolor="' + this.bgColor + '" width="' + this.width + '" height="' + this.height + '"');
		document.write(' type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
		document.write('</object>');
        } else if (this.alternateContent != '') {
		document.write(this.alternateContent);
	} else if (this.backupImage != '') {
		document.write('<img src="' + this.backupImage + '" width="' + this.width + '" height="' + this.height + '" alt="" border="0">');
	}
}

// Replacement for arrayname.length property
function getArrayLength(myArray) {
	for (i = 0; i < myArray.length; i++) {
		if ((myArray[i] == "undefined") || (myArray[i] == "") || (myArray[i] == null)){
			return i;
		}
	}
	return myArray.length;
}

function arrayPush(myArray, value) {
	myArray[ getArrayLength(myArray) ] = value;
}
function arrayPop(myArray) {
	myArraySize = getArraySize(myArray);
	retval = myArray[myArraySize - 1];
	delete myAarray[myArraySize - 1];
	return retval;
}

