//<![CDATA[

// Print web page
function printpage() {
	window.print(); 
}

// Open print page using _print extension.
function showPrint() {
	var strPage = window.location.pathname;
	
	strPage = strPage.substring(0, strPage.indexOf("_1.aspx"));
	if(strPage.indexOf("document") == 1) 
	{
		strPage = "document";
	}
	else if(strPage.indexOf("catalogue") == 1) {		
		strPage = "catalogue";		
	}
	else if(strPage.indexOf("news") == 1) {
		strPage = "news";	
	}
	else if(strPage.indexOf("search") == 1) {
		strPage = "search";	
	}
	else {
		// set document as default
		strPage = "document";	
	}
	/*window.location = strPage + "_print_1.aspx" + window.location.search;*/
	window.open(strPage + "_print_1.aspx" + window.location.search);
	
}

// Site search
function checkSearchFields(objForm)
{	
		if((Trim(objForm.keywords.value) == "") || (objForm.keywords.value == "Search this site") || (objForm.keywords.value == "Buscar en la web")) {
			alert("Please enter your keyword(s)");
			objForm.keywords.focus();
			return false;
		}
		else {
			return true;
		}
}



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


// Show / Hide Script

var catorgid = '1:29654';

function catshow(obj) {
	if(document.getElementById("img" + obj)) {
		show("img" + obj);
		hide("img" + catorgid);
	}
	if(document.getElementById("txt" + obj)) {
		show("txt" + obj);
		hide("txt" + catorgid);
	}
}

function cathide(obj) {
	hide("img" + obj);
	hide("txt" + obj);
	show("img" + catorgid);
	show("txt" + catorgid);
}

function show(c) {
	if (document.getElementById && document.getElementById(c)!= null) 
		node = document.getElementById(c).style.display='block'; 
	else if (document.layers && document.layers[c]!= null) 
		document.layers[c].display = 'block'; 
	else if (document.all && document.all(c)!= null) 
		document.all[c].style.display = 'block';
} 

function hide(c) {	
	if (document.getElementById && document.getElementById(c)!= null)
		node = document.getElementById(c).style.display='none';
	else if (document.layers && document.layers[c]!= null) 
		document.layers[c].display = 'none';
	else if (document.all && document.all(c)!= null) 
		document.all[c].style.display = 'none';
}


//]]>
