function __gohome(){
	top.location.href = __get_application_path();
}
		
function __search(searchId){
	self.location.href = __get_page_file() + '.asp?pageid='+searchId
}
		
function __print(pageId,template){
	window.open('print.asp?pageId='+pageId+'&template='+template,'printwin','loaction=0,status=0');
}
		
function __get_page_file(){
	tmpURL = document.location.toString();
	var myArray = tmpURL.split('/');
	fileName = myArray[myArray.length-1]
	it = fileName.indexOf('.')
	return fileName.substring(0,it)
}
		
function __get_application_path(){
	completePath = document.location.toString();
	var myPathArray = completePath.split('/');
	applicationPath = '';
	for(i = 0; i < myPathArray.length-1; i++){
		applicationPath += myPathArray[i] + '/';
	}
			
	return applicationPath
}

function __image_hover(node){
	if(node.getAttribute('srcOver') != null){
		node.setAttribute('src',node.getAttribute('srcOver'));
	}
}

function __image_dehover(node){
	if(node.getAttribute('srcOut') != null){
		node.setAttribute('src',node.getAttribute('srcOut'));
	}
}

/* OBJECT EXTENSIONS */
Array.prototype.exists = function (value, objectProperty_1, objectProperty_2){ // kaldes theArray.exists(value)
	for(var intLoop = 0; intLoop < this.length; intLoop++){

		var compareVal_1
		var compareVal_2

		if ( typeof(this[intLoop]) == 'object' ){
			compareVal_1 = (objectProperty_1) ? eval('this[intLoop].'+objectProperty_1) : this[intLoop]
		} else {
			compareVal_1 = this[intLoop]
		}

		if ( typeof(value) == 'object' ){
			compareVal_2 = (objectProperty_2) ? eval('value.'+objectProperty_2) : value
		} else {
			compareVal_2 = arguments[0]
		}

		//alert(compareVal_1 +'=='+ compareVal_2)
		if( compareVal_1 == compareVal_2 ){
			//this.onExist(intLoop);
			return true;
		}
	}
	return false;
}

Array.prototype.onExist = function (){}

Array.prototype.add = function (){
	this[this.length] = arguments[0]//; return this[this.length-1]
}

Array.prototype.remove = function (value){
	for (var ii = 0; ii < this.length; ii++){
		if(this[ii] == value){
			val = this[ii]
			this.splice(ii,1);
			return val
		}
	}
}
